Template to kickstart a Foundry project.
The easiest way to get started is by clicking the Use this template button at the top right of this page.
If you prefer to go the CLI way:
forge init my-project --template https://github.com/pooltogether/foundry-template
You may have to install the following tools to use this repository:
- Foundry to compile and test contracts
- direnv to handle environment variables
- lcov to generate the code coverage report
Install dependencies:
npm i
Copy .envrc.example
and write down the env variables needed to run this project.
cp .envrc.example .envrc
Once your env variables are setup, load them with:
direnv allow
Run the following command to compile the contracts:
npm run compile
First setup npm:
nvm use
npm i
Start anvil:
anvil
In another terminal window, run the following command: npm run deploy:local
Use one of the following commands to deploy on the testnet of your choice.
npm run deploy:arbitrumSepolia
npm run deploy:optimismSepolia
To generate the local contract list, run the following command: npm run gen:deployments