This is my personal hardhat boilerplate, that does what I basically want for every project setup:
- Add the open zeppelin contracts
- Add the hardhat verification plugin
- Use
dotenv
- A sensible
.gitignore
- A
scripts
andcontracts
directory - A
tests
directory for testing - Just kidding I don't write tests
- A Makefile, so I don't have to remember the hardhat commands
I know I should probably just use a yarn
script in package.json
,
but I like Makefiles, so I added a Makefile
.
You need to add a .env
file at the root, with the following info:
API_URL="https://eth-rinkeby.alchemyapi.io/v2/..."
: Your API for calling the blockchainPRIVATE_KEY="0x3...32"
: The private key of the account deploying the contractETHERSCAN_KEY="..."
: You Etherscan API key, for verifying the contract. You can grab this from the etherscan website and signing in.
If waiting 60 seconds for the etherscan verification is annoying, you can make a separate script to deploy without verifying, and use that for testing.