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.
- reuse the deploying code between sript and test module.
- create Helper to handle the price feed that deployed on different rpc urls.
- be aware the difference between msg.sender and address(this)
- usage of cheat code in foundry to mock some specific objects. Like the address sending transaction.
- using prank to use the mock user in next transaction
- using deal to give an mock user some ehters
- using hoax to do the above two things
$ 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