Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot verify proxy contracts on Base Sepolia #1019

Closed
rsimonton opened this issue Apr 24, 2024 · 2 comments
Closed

Cannot verify proxy contracts on Base Sepolia #1019

rsimonton opened this issue Apr 24, 2024 · 2 comments

Comments

@rsimonton
Copy link

rsimonton commented Apr 24, 2024

I have a deployment script that I've been using for the past six months or so to deploy and verify contracts on Polygon. Recently I've begun deploying on Base Sepolia, and the verification process is failing without any changes on my end to the project dependencies. I'm using:

  "devDependencies": {
    "@nomicfoundation/hardhat-toolbox": "^4.0.0",
    "@nomicfoundation/hardhat-verify": "^2.0.2",
    "@openzeppelin/contracts": "^5.0.0",
    "@openzeppelin/contracts-upgradeable": "^5.0.0",
    "@openzeppelin/hardhat-upgrades": "^3.0.0",

Here's how I'm kicking off verification:

    await hre.run("verify:verify", {
      address: proxy.target,
      constructorArguments: [trustedForwarder],
    })

Pretty straightforward. The console output is quite confusing though:

Verifying implementation: 0x5361353EB7195fd782A017cF5Ad27a0ae81a402E
The contract 0x5361353EB7195fd782A017cF5Ad27a0ae81a402E has already been verified on Etherscan.
https://sepolia.basescan.org/address/0x5361353EB7195fd782A017cF5Ad27a0ae81a402E#code
Verifying proxy: 0xCe4A2F1FaAab75551728c3c49332350E69111770
Contract at 0xCe4A2F1FaAab75551728c3c49332350E69111770 already verified.
Linking proxy 0xCe4A2F1FaAab75551728c3c49332350E69111770 with implementation.
Failed to link proxy 0xCe4A2F1FaAab75551728c3c49332350E69111770 with its implementation. Reason: The implementation contract at 0x5361353eb7195fd782a017cf5ad27a0ae81a402e does not seem to be verified. Please verify and publish the contract source before proceeding with this proxy verification.

The "already been verified" messages make sense as this contract's source exactly matches a previously deployed contract. But the final error message contradicts the earlier output. Any insights here would be greatly appreciated. I have not yet confirmed whether or not this is an issue on mainnet. I have confirmed that the error message is coming back from the Basescan API itself.

I've also confirmed that I can manually link the proxy in Basescan UI by the whole "Is this a proxy?" process, further confusing me as to why it isn't working programmatically.

@ericglau
Copy link
Member

This looks like a Basescan/Etherscan issue where the "Similar Match Source Code" status leads to the first "already been verified" message, but since it is not an exact match, the proxy linking fails.

I don't think there is anything that we can do from the Hardhat plugin to avoid this. For mainnets, you could contact Basescan/Etherscan to re-verify to promote your contract to Full Match (see https://info.etherscan.com/update-on-similar-match-contract-verification/). For testnets, if you can link it in the Basescan UI, is that sufficient?

@ericglau
Copy link
Member

Closing since this is a block explorer issue as described above.

@ericglau ericglau closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants