Common workflow
- Build contracts
forge build- Run tests (unit and fuzz)
forge test
# Add -vv for verbose, or --gas-report for gas usage
forge test -vv --gas-report- Format contracts
forge fmt- Capture gas snapshots (for regression/CI)
forge snapshot- Start a local node (Anvil)
anvil
# By default exposes local JSON-RPC at http://127.0.0.1:8545- Use Cast to call node or interact with contracts
cast <subcommand> [args]
# Examples:
# cast send --from <address> --private-key <key> --to <to> --value <wei>
# cast call <contract> "balanceOf(address)(uint256)" <address> --rpc-url <url>