Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 1.71 KB

README.md

File metadata and controls

79 lines (56 loc) · 1.71 KB

Hardhat x Foundry Template

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

Github Actions

Install

yarn i

Build

yarn build

Test

forge test

yarn test -vvvv

forge fork test

source envs/eth.env

yarn test -vvvv --fork-url $PROVIDER

hardhat test

yarn testh

hardhat coverage test

yarn testc

Env

source envs/eth.env
source envs/bsc.env
source envs/pol.env

PRIVATE_KEY=
SCAN_API_KEY=
PROVIDER=
NETWORK_ID=
ENV_FILE=envs/eth.env

Deploy

yarn run env-cmd -f $ENV_FILE yarn run hardhat contract:deploy --name Token --gas-price 3 --args '[]' --network $NETWORK_ID

yarn run env-cmd -f $ENV_FILE yarn run hardhat upgradeableContract:deploy --name TokenUpgradeable --gas-price 3 --args '[]' --network $NETWORK_ID

Upgrade

yarn run env-cmd -f $ENV_FILE yarn run hardhat upgradeableContract:upgrade --proxy-name TokenUpgradeable --impl-name TokenUpgradeable --gas-price 3 --network $NETWORK_ID

Verfiy

yarn run env-cmd -f $ENV_FILE yarn run hardhat contract:verify --name Token --args '[]' --network $NETWORK_ID

yarn run env-cmd -f $ENV_FILE yarn run hardhat upgradeableContract:verify --name TokenUpgradeable --args '[]' --network $NETWORK_ID

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.