hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

`hardhat-verify` support for L2 testnets

Open michalinacienciala opened this issue 1 year ago • 4 comments
trafficstars

Describe the feature

As Goerli testnet deprecates with the end of the year, a lot of L2 networks change their testnets from Goerli-based to Sepolia-based. Along with those changes, the scan websites also add the support for Sepolia-based L2 testnets. But so far hardhat-verify does not include those new chains in https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-verify/src/internal/chain-config.ts, which I think means that hardhat-verify will not work for them. Here are some L2 testnets I would like to see supported:

  • Arbitrum Sepolia (id 421614) - https://sepolia.arbiscan.io/ (already tracked in https://github.com/NomicFoundation/hardhat/issues/4582)
  • Base Sepolia (id 84532) - ArbiScan does not support it yet, but I got a following info from them about the support: 'At this point, Base Sepolia is already in the pipeline but there is no estimation when can we push the site to live. Stay tuned for more info and make sure to follow BaseScan's Twitter to yourself updated when it is already live.'
  • Optimism Sepolia (id 11155420) - https://sepolia-optimism.etherscan.io/

Search terms

hardhard-verify sepolia arbitrumSepolia baseSepolia optimisticSepolia

michalinacienciala avatar Nov 21 '23 15:11 michalinacienciala

Btw, the Mumbai testnet is also planned to be deprecated and replaced by the Amoy testnet (name: amoy, chain id: 80002). Not sure when will that happen and when will the polygonscan support it. Read more: https://github.com/maticnetwork/heimdall/issues/1096 https://github.com/maticnetwork/bor/pull/1072

michalinacienciala avatar Nov 29 '23 11:11 michalinacienciala

It would be cool if Base Sepolia were supported.

jacek0x avatar Feb 05 '24 14:02 jacek0x

Btw, until these networks are added to the chain list, you can still verify contracts by adding them to your hardhat config as custom chains, for example:

etherscan: {
  apiKey: {
    optimismSepolia: "<optimism-sepolia-api-key>"
  },
  customChains: [
    {
      network: "optimismSepolia",
      chainId: 11155420,
      urls: {
        apiURL: "https://api-sepolia-optimistic.etherscan.io/api",
        browserURL: "https://sepolia-optimism.etherscan.io/"
      }
    }
  ]
}

You can read more here.

schaable avatar Feb 05 '24 15:02 schaable

@schaable Awesome, thanks! That worked.

jacek0x avatar Feb 05 '24 22:02 jacek0x

Btw, the Mumbai testnet is also planned to be deprecated and replaced by the Amoy testnet (name: amoy, chain id: 80002). Not sure when will that happen and when will the polygonscan support it. Read more: maticnetwork/heimdall#1096 maticnetwork/bor#1072

It seems that amoy block explorer won't be polygonscan but oklink as refered here: https://polygon.technology/blog/introducing-the-amoy-testnet-for-polygon-pos Is there a plan for this plugin to support oklink block explorer as a source verifier api to target ? (the same way sourcify was added)... I found this project if it is helping: https://github.com/enjinstarter/hardhat-oklink-verify/tree/main/src but I would be more confident in using an hardhat supported plugin inside my production environment...

tazous avatar Mar 08 '24 09:03 tazous

Goerli is down and https://amoy.polygonscan.com/ is up. Any eta on this?

iPaulPro avatar Apr 19 '24 21:04 iPaulPro

Amoy has been added to the chain list in hardhat-verify and will be available on the next release of the plugin: https://github.com/NomicFoundation/hardhat/pull/5163

schaable avatar May 06 '24 21:05 schaable