Skip to content

yusufferdogan/hardhat-foundry-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat x Foundry Template

Template repository for getting started quickly with Hardhat and Foundry in one project

Github Actions

Getting Started

  • Prepare
yarn run prepare
  • Use Foundry:
forge install
forge test
  • Use Hardhat:
npm install
npx hardhat test

Features

  • Write / run tests with either Hardhat or Foundry:
forge test
# or
npx hardhat test
  • Foundry Coverage
forge coverage --report lcov
  • Foundry run single test
  forge test --match-path test/Foo721.t.sol
  • Foundry run script deploy
source .env
forge script script/deploy.s.sol --rpc-url $GOERLI_RPC_URL --verify --via-ir --broadcast
  • Use Hardhat's task framework
npx hardhat example
  • Install libraries with Foundry which work with Hardhat.
forge install foundry-rs/forge-std
forge install OpenZeppelin/openzeppelin-contracts

Myhtril

install ➡️

 pip3 install mythril
 PATH+=":$HOME/.local/bin/"

use ➡️

 myth analyze contracts/Foo721.sol --solc-json mythril.config.json

Slither

install ➡️

 pip3 install slither-analyzer
 PATH+=":$HOME/.local/bin/"

use ➡️

 slither contracts/Foo721.sol

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.

TODO

  • Fix hardhat coverage

image

About

Minimal template to get started with Foundry + Hardhat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 55.9%
  • Solidity 29.5%
  • JavaScript 14.6%