Contract Verification
Last updated
Last updated
is a full-featured development environment for contract compilation, deployment and verification. The supports contract verification on BlockScout.
If you are starting from scratch, create an npm project by going to an empty folder, running npm init
, and following the instructions. Recommend npm 7 or higher.
Once your project is ready:
npm instructions
yarn instructions
Run npx hardhat
in your project folder and follow the instructions to create ().
Install the (requires v3.0.0+).
npm
yarn
Add the following statement to your hardhat.config.js
.
Some chains are not supported by the plugin (to check run npx hardhat verify --list-networks
)
If your chain is not in the list, you can add a customChains
object to the config file. It includes:
chainID
- Network chain ID
apiURL
- Block explorer API URL
browserURL
- Block explorer URL
For example, if planq were not in the default list, this is how it would be added to the config file. Note the network name in customChains
must match the network name in the apiKey
object.
You can include constructor arguments with the verify task.
planq example (no constructors).
If using TypeScript, add this to your hardhat.config.ts.
.
Your basic (hardhat.config.js
or hardhat.config.ts
) will be setup to support the network you are working on. In this example we use the planq test network and a .js
file.
Here we add an RPC url without an API key, however some value is still required. You can use any arbitrary string. .
If you prefer, you can migrate to to use a plugin bundle.
Find an extensive list of ChainIDs at .
Learn more about plugin configs, troubleshooting etc. at