Arcus Sigma
Arcus Sigma

Reputation: 11

Hardhat verify command not present

I've installed estherscan from npm, but the verify command is still not present. When I try to verify a contract I get the error that the verify task does not exist.

This is my hardhat.config.js file,

`/**
* @type import('hardhat/config').HardhatUserConfig
*/

require('dotenv').config();
require("@nomiclabs/hardhat-ethers");

const { API_URL, PRIVATE_KEY, ETHERSCAN } = process.env;

module.exports = {
   solidity: "0.8.9",
   defaultNetwork: "polygon_mumbai",
   networks: {
      hardhat: {},
      polygon_mumbai: {
         url: API_URL,
         accounts: [`0x${PRIVATE_KEY}`]
      }
   },
   etherscan: {
    apiKey: ETHERSCAN
   }
}`

When I try to verify I get the error "Error HH303: Unrecognized task verify"

When I run the command npx hardhat I don't see any verify task on the menu

I've tried installing the etherscan verify plugin for hardhat using npm install --save-dev @nomiclabs/hardhat-etherscan

Upvotes: 0

Views: 406

Answers (1)

Arcus Sigma
Arcus Sigma

Reputation: 11

I forgot to import the plugin into hardhat.config.js,

solution is to import it before running the command.

require("@nomiclabs/hardhat-etherscan");

Upvotes: 1

Related Questions