Skip to content

With the updated version of etherscan V1 -> V2 the chainId is missing #1165

Open
@kharchafiabdallah

Description

@kharchafiabdallah

When I verify a transparent upgradeable contract and after upgrading to version 2 of Etherscan https://docs.etherscan.io/etherscan-v2, you need to inject the chain id into the query parameters, otherwise you get the following error:

Etherscan returned with message: NOTOK, reason: Missing chainid parameter (required for v2 api), please see https://api.etherscan.io/v2/chainlist for the list of supported chainids

I think modifying line 17 of packages/plugin-hardhat/src/utils/etherscan-api.ts to
const parameters = { ...params, chainid: etherscan.chainId, apikey: etherscan.apiKey };
should fix the problem.

So i don't know if you already have a fix somewhere or we have missed something in the configuration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions