Skip to content

vile/eth-bonds

Repository files navigation

ETH Bonds

solidity - v0.8.25 Foundry - Latest Conventional Commits

About

A simple ownable contract that allows for on-chain keeping of "bonds," denominated in Ether. The usage of bonds is not specific, but, for example, can be used to whitelist wallets to interact with dApps (e.g., LayerZero Sybil Reporting).

Getting Started

Requirements

  1. Git - Install Git
    1. Check if you have Git installed with git --version
  2. Foundry - Install Foundry
    1. Check if you have Foundry installed with forge --version

Optional

  1. Python - Install Python (see pyenv)
    1. Check if you have Python installed with python --version
    2. Required for Slither
  2. Slither - Install Slither (preferably with pipx)
    1. Check if you have Slither installed with slither --version
  3. Rust - Install Rust
    1. Check if you have Rust installed with rustc --version
    2. Required for Aderyn
  4. Aderyn - Install Aderyn
    1. Check if you have Aderyn installed with aderyn --version
  5. 4naly3er - Install 4naly3er
    1. This is an external tool, ensure to export a scope file, make scopefile, before use

Development

  1. Act - Install Act
    1. Check if you have Act installed with act --version
    2. Refer to this project's Makefile (sudo-act) for usage
  2. Markdownlint - Install Markdownlint

Installation

git clone https://github.com/vile/eth-bonds.git
cd eth-bonds
make

Usage

Testing

make test
make test-ext # Includes coverage report, slither, & aderyn

Run individual tests with:

forge test --mt test_name -vvvvv

Deploying

Keystore

Ensure you have your intended deployment wallet imported as a keystore for Foundry. If not, create a new wallet using cast, and import it as a keystore.

cast wallet list
cast wallet new
cast wallet import [your_new_wallet]
cast wallet address --account [your_new_wallet]

Environment Variables

Then, input your keystore name and wallet address in .env. In addition to this, include your RPC URL and Etherscan API key.

mv .env.example .env

Futhermore in .env, include deployment parameters. If you are unsure what the deployment parameters mean (or intend to do), refer to the .env comments and the NatSpec of Bond's constructor.

Deploy Script

Finally, push a live deployment (or dryrun):

make script-deploy-live # OR
make script-deploy-dry

About

A simple ownable contract that allows for on-chain keeping of "bonds," denominated in Ether.

Topics

Resources

License

Stars

Watchers

Forks

Contributors