0

I am trying to deploy a contract on Matic network, I have an API key set up and the proper private key for metamask in my env. ( I have deployed many contracts and verified them this way many times. However I cannot get my contract to verify on matic network, I run the exact script in the same way on Mumbai and it works fine.

I run the following script after deploying it successfully

npx hardhat verify --network matic 0x488a79ca15b51d4deb7a2c45a25f32650cbaeb15

The error I receive is the following:

Error in plugin @nomiclabs/hardhat-etherscan: Failed to send contract verification request.
Endpoint URL: https://api.polygonscan.com/api
Reason: The Etherscan API responded that the address 0x488a79ca15b51d4deb7a2c45a25f32650cbaeb15 does not have bytecode.
This can happen if the contract was recently deployed and this fact hasn't propagated to the backend yet.
Try waiting for a minute before verifying your contract. If you are invoking this from a script,
try to wait for five confirmations of your contract deployment transaction before running the verification subtask.

I am quite frustrated I know there is a way to verify through remix but this hardhat command is what I have used in the past and has always worked.

Does anyone know why this would be happening?

0

1 Answer 1

0

While it seems you solved it, I suspected it is just that you need to wait up to a few minutes for polygonscan to index the deployment data before the contract verification.

3
  • Thanks for the recommendation!!! The weird thing is I had waited a few hours for this one and it still wouldn't verify, but then I tried again today and the contract went through without a hitch! This was the correct answer above however it is still very odd. Commented Jun 14, 2022 at 18:48
  • I see. That's really weird. I generally solved this error if I waited a few minutes for Etherscan. Probably something's wrong with the polygonscan.
    – turboza
    Commented Jun 14, 2022 at 19:03
  • Yea it was really weird because the contract had also had a lot of confirmations there...only thing I can think is maybe the gas fees were high on polygon at the time and was preventing polygonscan from catching up? Either way thanks for the help! Commented Jun 14, 2022 at 20:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.