/hardhat-foundry-playground

Foundry + Hardhat = ❤️

Primary LanguageSolidityApache License 2.0Apache-2.0

Hardhat x Foundry Playground

Test

Getting Started

  • Use Foundry:
forge install
forge test
  • Use Hardhat:
yarn install
yarn test

Features

  • Write / run tests with either Hardhat or Foundry:
forge test
# or
yarn test
  • Use Hardhat's task framework
yarn hardhat example
  • Install libraries with Hardhat.
yarn add @openzeppelin/contracts
  • Install libraries with Foundry which work with Hardhat.
forge install rari-capital/solmate # Already in this repo, just an example

Notes

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.