A template for projects that want to use Hardhat for contract deployment/interactions but write tests in Solidity using Foundry.
- Hardhat: compile, run and test smart contracts
- Foundry: Contract tests written in Solidity and linting
- Typechain: generate types for compiled contracts
- Ethers: EVM chain interactions
- Prettier Plugin Solidity: code formatter
Click the Use this template
button at the top of the page to use this repository as a template for your own project.
This project uses Foundry for the development framework and Hardhat for the deployment framework.
Note This project enables upgradeability via the OpenZeppelin Hardhat Upgrades method. More info on upgradable contracts can be found here. For details on ownership and upgrading, follow this tutorial.
- Install node dependencies
yarn install
- Next, duplicate the
.env.example
file and rename it to.env
. Register for an Infura account and add your api key to the.env
file along with the other example values:
INFURA_API_KEY=<YOUR_API_KEY>
To compile your contracts, run:
yarn compile
Note After compilation, the hardhat TypeChain extension automatically generates TypeScript bindings for each contract. These bindings can be found in the
/types
directory.
yarn test
forge coverage