- We are going to have a contract controlled by a DAO
- Every transaction that the DAO wants to send has to be voted on Please note: ERC20 based voting is not always recommended, and I encourage you to explore other forms of governance like reputation based or "skin-in-the-game" based. Plutocracy is bad! Don't default to ERC20 token voting!!
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
git clone https://github.com/Riiz0/foundry-dao-f24.git
cd foundry-defi-stablecoin-f23
forge build
forge test
I did not write deploy scripts for this project, you can if you'd like!
This will default to your local node. You need to have it running in another terminal in order for it to deploy.
make deploy
We talk about 4 test tiers in the video.
- Unit
- Integration
- Forked
- Staging
forge test
forge coverage
and for coverage based testing:
forge coverage --report debug
You can estimate how much gas things cost by running:
forge snapshot
And you'll see and output file called .gas-snapshot
To run code formatting:
forge fmt
Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry consists of:
- Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
- Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
- Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
- Chisel: Fast, utilitarian, and verbose solidity REPL.
$ forge build
$ forge test
$ forge fmt
$ forge snapshot
$ anvil
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
$ cast <subcommand>
$ forge --help
$ anvil --help
$ cast --help