DISCLAIMER: THIS IS A POC UNDER DEVELOPMENT, DO NOT USE IT IN PRODUCTION ENVIRONMENTS
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
$ source .env
- Base sepolia
forge script --chain-id 84532 script/Deploy.s.sol:CommunityHubDeployScript --rpc-url ${BASE_SEPOLIA_RPC_URL} --broadcast --slow --verify --verifier-url ${BASESCAN_SEPOLIA_URL} --etherscan-api-key ${BASESCAN_SEPOLIA_API_KEY} --optimize --optimizer-runs 20000 -- --vvvv
- Base
forge script --chain-id 8453 script/Deploy.s.sol:CommunityHubDeployScript --rpc-url ${BASE_RPC_URL} --broadcast --slow --verify --verifier-url ${BASESCAN_URL} --etherscan-api-key ${BASESCAN_API_KEY} --optimize --optimizer-runs 20000 -- --vvvv
For production deployments do not use a public RPC. Use a dedicated one or things like the node mempool can cause the script to fail.
$ anvil
- Update your .env file with a private key given to you by Anvil.
forge script script/Deploy.s.sol:MyScript --fork-url http://localhost:8545 --broadcast
forge verify-contract --chain-id 8453 --num-of-optimizations 20000 --watch --verifier-url ${BASESCAN_URL} --etherscan-api-key ${BASESCAN_API_KEY} --compiler-version v0.8.25+commit.b61c2a9 src/.sol:
$ cast <subcommand>
$ forge --help
$ anvil --help
$ cast --help
npx hardhat --network base run ./script/migratev2.ts