Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error HH210: Redefinition of task verify failed. Unsupported operation adding positional param definitions in an overridden task. #5058

Closed
bingozwb opened this issue Apr 2, 2024 · 1 comment
Assignees

Comments

@bingozwb
Copy link

bingozwb commented Apr 2, 2024

Version of Hardhat

2.22.2

What happened?

I got error

Error HH210: Redefinition of task verify failed. Unsupported operation adding positional param definitions in an overridden task.

when runnig npx hardhat verify ... or other task behind adding require('@nomicfoundation/hardhat-verify') to hardhat.config.js.

This is my hardhat.config.js

require('@nomiclabs/hardhat-waffle')

// hardhat upgrade plugins
require('@nomiclabs/hardhat-ethers')
require('@openzeppelin/hardhat-upgrades')
// hardhat etherscan plugins
// require('@nomiclabs/hardhat-etherscan')
require('@nomicfoundation/hardhat-verify')

// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task('accounts', 'Prints the list of accounts', async () => {
  const accounts = await ethers.getSigners()

  for (const account of accounts) {
    console.log(account.address)
  }
})

// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more

/**
 * @type import('hardhat/config').HardhatUserConfig
 */
module.exports = {
  solidity: {...},
  networks: {...},
  etherscan: { // https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan#hardhat-etherscan
    // Your API key for Etherscan
    // Obtain one at https://etherscan.com/
    apiKey: {
      mainnet: '',
      sepolia: '',
      bsc: '',
      bscTestnet: ''
    }
  },
}

This is the error

Error HH210: Redefinition of task verify failed. Unsupported operation adding positional param definitions in an overridden task.

HardhatError: HH210: Redefinition of task verify failed. Unsupported operation adding positional param definitions in an overridden task.
    at OverriddenTaskDefinition._throwNoParamsOverrideError (/Users/bingo/workspace/contract/xxx-contract/node_modules/_hardhat@2.22.2@hardhat/src/internal/core/tasks/task-definitions.ts:758:11)
    at OverriddenTaskDefinition.addOptionalPositionalParam (/Users/bingo/workspace/contract/xxx-contract/node_modules/_hardhat@2.22.2@hardhat/src/internal/core/tasks/task-definitions.ts:713:17)
    at Object.<anonymous> (/Users/bingo/workspace/contract/xxx-contract/node_modules/_@nomicfoundation_hardhat-verify@2.0.5@@nomicfoundation/hardhat-verify/src/index.ts:93:4)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/bingo/workspace/contract/xxx-contract/hardhat.config.js:8:1)

hardhat version:
2.22.2
@nomicfoundation/hardhat-verify version:
2.0.5

Minimal reproduction steps

  1. adding require('@nomicfoundation/hardhat-verify') to hardhat.config.js.
  2. run npx hardhat verify --list-networks

Search terms

No response

@bingozwb
Copy link
Author

bingozwb commented Apr 2, 2024

I got it!
The plugin @openzeppelin/hardhat-upgrades contains hardhat-verify already. So when i removed require('@nomicfoundation/hardhat-verify') from hardhat.config.js and run npx hardhat verify ..., it works.
I think this issue can be notice onto doc hardhat-verify | Ethereum development environment for professionals by Nomic Foundation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants