1

I am trying to verify a contract in Polygonscan.

I flatten my contract, remove the constructors, compile in REMIX IDE without erros with Petesburg EVM version using enabling optimization (200). The deployment from REMIX is correct to.

Then I select all the same in the PolygonScan form however, PolygonScan return the next when I tried to verify my single contract file:

"Error! Unable to generate Contract ByteCode and ABI"

But we were unable to locate a matching bytecode (err_code_2)

ByteCode (what we are looking for)

vs what we got

We tried looking for a match from the list of compiled contract bytecode outputs (as listed below), but was unable to find an exact match.

Any ideas? I'm frustrated because I don't know what else to do Thanks

enter image description here

2 Answers 2

1

Without having full access to your computer, it is not possible to tell what you are doing wrong.

If you use a smart contract development framework like Brownie or Hardhat to develop your smart contract, the framework automates this error-prone process and you are likely to have fewer problems in the future.

1
  • 1
    Thank you. I was trying to deploy and verify with Hardhat and was correct Aug 15, 2022 at 19:41
0

As Mikko suggested I used HardHat to deploy and verify my contract and was correct.

I follow the next Polygon reference:

https://docs.polygon.technology/docs/develop/hardhat/

The last step was the effective to verify it without the "ByteCode and ABI" problems of PolygonScan:

npm install --save-dev @nomiclabs/hardhat-etherscan

npx hardhat verify --network matic 0x0000YourContractAddress

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.