- Sample contracts
- Basic Greeter contract with an external interface.
- Foundry setup
- Foundry configuration with multiple custom profiles and remappings.
- Deployment scripts
- Sample scripts to deploy contracts on both mainnet and testnet.
- Sample e2e & unit tests
- Example tests showcasing mocking, assertions and configuration for mainnet forking. As well it includes everything needed in order to check code coverage.
- Linter
- Simple and fast solidity linting thanks to forge fmt.
- Github workflows CI
- Run all tests and see the coverage as you push your changes.
- Install Foundry by following the instructions from their repository.
- Copy the
.env.examplefile to.envand fill in the variables. - Install the dependencies by running:
yarn install. In case there is an error with the commands, runfoundryupand try them again.
The default way to build the code is suboptimal but fast, you can run it via:
yarn buildIn order to build a more optimized code (via IR), run:
yarn build:optimizedUnit tests should be isolated from any externalities, while E2E usually run in a fork of the blockchain. In this boilerplate you will find example of both.
In order to run both unit and E2E tests, run:
yarn testIn order to just run unit tests, run:
yarn test:unitIn order to run unit tests and run way more fuzzing than usual (5x), run:
yarn test:unit:deepIn order to just run e2e tests, run:
yarn test:e2eIn order to check your current code coverage, run:
yarn coverageConfigure the .env variables.
yarn deploy:goerliyarn deploy:mainnetThe deployments are stored in ./broadcast
See the Foundry Book for available options.
