hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

hardhat-etherscan: error `unknown UID` when verifying deployed contracts

Open CJ42 opened this issue 2 years ago • 2 comments

I often encounter a problem with hardhat-etherscan when trying to verify deployed contracts.

Sometimes, the verification works without any problem, other times I get back the following error:

Error in plugin @nomiclabs/hardhat-etherscan: The API responded with an unexpected message.
Contract verification may have succeeded and should be checked manually.
Message: Unknown UID

image

My hardhat config https://github.com/lukso-network/lsp-smart-contracts/blob/6b237254f55eda45233abf681d3064c42651b2f2/hardhat.config.ts#L51-L73

etherscan: {
    // no API is required to verify contracts
    // via the Blockscout instance of L14 or L16 network
    apiKey: "no-api-key-needed",
    customChains: [
      {
        network: "luksoL14",
        chainId: 22,
        urls: {
          apiURL: "https://blockscout.com/lukso/l14/api",
          browserURL: "https://blockscout.com/lukso/l14",
        },
      },
      {
        network: "luksoL16",
        chainId: 2828,
        urls: {
          apiURL: "https://explorer.execution.l16.lukso.network/api",
          browserURL: "https://explorer.execution.l16.lukso.network/",
        },
      },
    ],
  },

The script I am running to verify the contract:

npx hardhat verify <contract-address> <address-passed-in-constructor> --network luksoL16

CJ42 avatar Sep 13 '22 07:09 CJ42

This issue is also being tracked on Linear.

We use Linear to manage our development process, but we keep the conversations on Github.

LINEAR-ID: e9740706-27d3-4314-8e66-f61e7d71389e

github-actions[bot] avatar Sep 13 '22 07:09 github-actions[bot]

Hey,

Thanks for submitting this issue. Can you please report it to those explorers and keep us updated?

alcuadrado avatar Sep 16 '22 13:09 alcuadrado

I have the same problem while verifying contract in Kava network with this guide. https://docs.kava.io/docs/ethereum/contract_verification

grGred avatar Oct 17 '22 12:10 grGred

Closing this because, as far as I understand, there's not much we can do on our side.

fvictorio avatar Oct 28 '22 13:10 fvictorio

On kava network the problem might be in old microservices of Kava scanner. Issue link: https://github.com/blockscout/blockscout/issues/6275#issuecomment-1291692298

grGred avatar Oct 28 '22 13:10 grGred