Based on https://github.com/libevm/forge-example
with some minor modifications/additions to the solidity side such as BaseTest.sol
Building and testing
forge install
forge build
forge test
Other useful commands:
- forking from existing state
# -vvv = very very verbose
forge test -f http://127.0.0.1:8545 -vvv
- access the debugger
forge run --debug src/test/Contract.t.sol --sig "testExample()"
- run test on a single contract
forge test --match-contract Test3
Copy .env.example
to .env
and fill it out with correct details.
node --experimental-json-modules scripts/deploy.js
Check here https://github.com/libevm/forge-example#etherscan-verification