| 1 | ## Foundry |
| 2 | |
| 3 | **Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** |
| 4 | |
| 5 | Foundry consists of: |
| 6 | |
| 7 | - **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). |
| 8 | - **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. |
| 9 | - **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. |
| 10 | - **Chisel**: Fast, utilitarian, and verbose solidity REPL. |
| 11 | |
| 12 | ## Documentation |
| 13 | |
| 14 | https://book.getfoundry.sh/ |
| 15 | |
| 16 | ## Usage |
| 17 | |
| 18 | ### Build |
| 19 | |
| 20 | ```shell |
| 21 | $ forge build |
| 22 | ``` |
| 23 | |
| 24 | ### Test |
| 25 | |
| 26 | ```shell |
| 27 | $ forge test |
| 28 | ``` |
| 29 | |
| 30 | ### Format |
| 31 | |
| 32 | ```shell |
| 33 | $ forge fmt |
| 34 | ``` |
| 35 | |
| 36 | ### Gas Snapshots |
| 37 | |
| 38 | ```shell |
| 39 | $ forge snapshot |
| 40 | ``` |
| 41 | |
| 42 | ### Anvil |
| 43 | |
| 44 | ```shell |
| 45 | $ anvil |
| 46 | ``` |
| 47 | |
| 48 | ### Deploy |
| 49 | |
| 50 | ```shell |
| 51 | $ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> |
| 52 | ``` |
| 53 | |
| 54 | ### Cast |
| 55 | |
| 56 | ```shell |
| 57 | $ cast <subcommand> |
| 58 | ``` |
| 59 | |
| 60 | ### Help |
| 61 | |
| 62 | ```shell |
| 63 | $ forge --help |
| 64 | $ anvil --help |
| 65 | $ cast --help |
| 66 | ``` |