Hardhat Verification Plugin
Hardhat is a full-featured development environment for contract compilation, deployment and verification. The Hardhat Etherscan plugin 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
npm install --save-dev hardhat
yarn instructions
yarn add --dev hardhat
npm
npm install --save-dev @nomiclabs/hardhat-etherscan
yarn
yarn add --dev @nomiclabs/hardhat-etherscan
Add the following statement to your
hardhat.config.js
.require("@nomiclabs/hardhat-etherscan");
If using TypeScript, add this to your
hardhat.config.ts.
More info on using typescript with hardhat available here.import "@nomiclabs/hardhat-etherscan";
Your basic Hardhat config file (
hardhat.config.js
or hardhat.config.ts
) will be setup to support the network you are working on. In this example we use the Sokol 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. More info.
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-etherscan");
require('hardhat-deploy');