- Create .secrets.json in the root of the project
- Create an account on Infura grab the PROJECT ID
- Create an account using Metamask
- Copy the account Private Key and Infura PROJECT ID to .secrets.json file
{
"TESTNET_PRIVATE_KEY": "Your account private key",
"MAINNET_PRIVATE_KEY": "Your account private key",
"INFURA_PROJECT_ID": "Infura Project Id"
}
ABOVE STEPS SEEMS TOO MUCH, COMMENT OUT THE CONTENTS OF networks field FROM hardhat.config.js
-
Lint contracts using solhint
npm run lint-contracts
-
Compile contracts
npm run compile
-
Test contracts
npm run test
-
Code coverage
npm run coverage
-
Deploy contracts
-
To deploy contracts on the local blockchain first run
npm run hhn
in a terminal then open another tab in the terminal andnpm run deploy-local
-
To deploy on either
Testnet
orMainnet
before executing the deploy script ensure to add account private key & infura project ID in.secrets.json
file else the deploy-* scripts will fail -
Available deployment scripts are
-
deploy-local
-
deploy-mainnet
-
deploy-ropsten
-
deploy-rinkeby
-
deploy-goerli
-
deploy-kovan
-
-
npx hardhat node --fork https://mainnet.infura.io/v3/<INFURA_PROJECT_ID>