This is a list of the most frequently needed commands.
Build the contracts:
$ forge buildDelete the build artifacts and cache directories:
$ forge cleanCompile the contracts:
$ forge buildGet a test coverage report:
$ forge coverageDeploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545For this script to work, you need to have a MNEMONIC environment variable set to a valid
BIP39 mnemonic.
For instructions on how to deploy to a testnet or mainnet, check out the Solidity Scripting tutorial.
Format the contracts:
$ forge fmtGet a gas report:
$ forge test --gas-reportLint the contracts:
$ bun run lintRun the tests:
$ forge testGenerate test coverage and output result to the terminal:
$ bun run test:coverageGenerate test coverage with lcov report (you'll have to open the ./coverage/index.html file in your browser, to do so
simply copy paste the path):
$ bun run test:coverage:report- abigger87/femplate
- cleanunicorn/ethereum-smartcontract-template
- foundry-rs/forge-template
- FrankieIsLost/forge-template
This project is licensed under BUSL 1.1.
Follow instructions to install solstat locally and run. Currently, named parameters in mappings causes solstat to panic and is unable to produce the solstat_report.md (issue).