# install Foundryup
curl -L https://foundry.paradigm.xyz | bash
foundryup
# install dependencies
forge soldeer install
# compile contracts
forge build# all forge tests
forge test
# all tests of a test contract
forge test --mc <contract_name>
# specific test function
forge test --mt <test_name>
# generate coverage report
yarn coverage-forgeThe default behavior for forge test is to only display a summary of passing and failing tests. To show more information change the verbosity level with the -v flag:
-vv: displays logs emitted during tests, including assertion errors (e.g., expected vs. actual values);-vvv: shows execution traces for failing tests, in addition to logs;-vvvv: displays execution traces for all tests and setup traces for failing tests;-vvvvv: provides the most detailed output, showing execution and setup traces for all tests, including storage changes.
- Install dependencies:
yarn
- Create a
.envfile in the project root with:See .env.template for an example environment file.<NETWORK>_RPC_URL= DEPLOYER_PRIVATE_KEY=0x...
- Ensure chain config (
deployment/chain-config/<network>.json) is set up as needed.
Run the following command to deploy contracts:
yarn deploy_contracts_<network>This will:
- Load environment variables from
.env - Use Forge to deploy contracts with parameters from your config files
Set COSTON2_RPC_URL and DEPLOYER_PRIVATE_KEY in your .env file.
Check and if needed update config file deployment/chain-config/coston2.json.
Run
yarn deploy_contracts_coston2To verify (on Blockscout explorer) all deployed contracts on a supported network run:
yarn verify_contracts_<network>
For example, to verify on coston2:
yarn verify_contracts_coston2
This will automatically verify all contracts listed in the deployment JSON for the selected network.