Template repository for getting started quickly with Foundry in one project
This project uses Foundry. See the book for instructions on how to install and use Foundry.
- Use Foundry:
forge install
forge test
- Compile contracts:
npm run build
- Run tests:
npm run test
- Run and serve coverage:
npm run coverage
- Generate and serve docs (http://localhost:4000):
npm run doc
npm run doc-serve
- Install libraries with Foundry which work with Hardhat.
forge install rari-capital/solmate # Already in this repo, just an example
- Use this template to create a new project
forge init --template https://github.com/gperezalba/forge-template dir_name
git remote set-url origin https://github.com/org/project-name.git
Whenever you install new libraries using Foundry, make sure to update your remappings.txt
file by running forge remappings > remappings.txt
. This is required because we use hardhat-preprocessor
and the remappings.txt
file to allow Hardhat to resolve libraries you install with Foundry.