Skip to content

A template for projects that want to use Hardhat for contract deployment but write tests in Solidity using Foundry.

License

Notifications You must be signed in to change notification settings

Bridgerz/hardhat-foundry-template

Repository files navigation

Hardhat Foundry Template

A template for projects that want to use Hardhat for contract deployment/interactions but write tests in Solidity using Foundry.


Get Started

Click the Use this template button at the top of the page to use this repository as a template for your own project.


🏄‍♂️ Quick Start

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.

Dependencies

  1. Install node dependencies
yarn install
  1. 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>

Compilation

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.

Testing

yarn test

Coverage

forge coverage

About

A template for projects that want to use Hardhat for contract deployment but write tests in Solidity using Foundry.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published