hardhat
hardhat copied to clipboard
hardhat-etherscan: error `unknown UID` when verifying deployed contracts
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
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
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
Hey,
Thanks for submitting this issue. Can you please report it to those explorers and keep us updated?
I have the same problem while verifying contract in Kava network with this guide. https://docs.kava.io/docs/ethereum/contract_verification
Closing this because, as far as I understand, there's not much we can do on our side.
On kava network the problem might be in old microservices of Kava scanner. Issue link: https://github.com/blockscout/blockscout/issues/6275#issuecomment-1291692298