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

Unable to verify contracts on Polygon Amoy #7733

Closed
2 tasks done
lucianogreiner opened this issue Apr 20, 2024 · 5 comments
Closed
2 tasks done

Unable to verify contracts on Polygon Amoy #7733

lucianogreiner opened this issue Apr 20, 2024 · 5 comments
Labels
T-bug Type: bug

Comments

@lucianogreiner
Copy link

lucianogreiner commented Apr 20, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (844caa8 2024-04-20T00:16:40.844544000Z)

What command(s) is the bug in?

forge verify-contract --chain polygon-amoy 0xbc4fa1a123ab3afcc803a87e7321f200db7e4ca8 src/MyContract.sol:MyContract

Operating System

macOS (Apple Silicon)

Describe the bug

I am struggling to verify my contracts with etherscan (polygonscan) for amoy contracts I've deployed.

As I execute the verify-contract command, I get a HTML output like this:

2024-04-20T01:16:29.863704Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="
<!DOCTYPE html><html lang=\"en-US\"><head><title>Just a moment...</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\"><meta name=\"robots\" content=\"noindex,nofollow\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><style>*{box-. ... A LOT MORE ... ogU);}}document.getElementsByTagName('head')[0].appendChild(cpo);}());</script></body></html>

Searching for similar issues here from last year, I found something saying we should add a question mark to the end of API URL. I tried this, but no luck.

My foundry.toml has:
polygon-amoy = {key = "XXXX73KYHBHRN6WTWQ844P97TM9MJKSZ6B" }

Thoughts?

@lucianogreiner lucianogreiner added the T-bug Type: bug label Apr 20, 2024
@lucianogreiner lucianogreiner changed the title Unable to verify contracts on Polygon Anoy Unable to verify contracts on Polygon Amoy Apr 20, 2024
@DaniPopes
Copy link
Member

The first link is incorrect here https://github.com/alloy-rs/chains/blob/14af647606c6945f433252ed96cd47397771e6ba/src/named.rs#L783

I don't know what the API endpoint should be for OKLink, and also I don't think it will work until #7586

@DaniPopes
Copy link
Member

Closing in favor of #7724

@DaniPopes DaniPopes closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
@bixia
Copy link
Contributor

bixia commented Apr 23, 2024

currently, the amoy testnet is hosted by OKLINK, so the API url is different.

@bixia
Copy link
Contributor

bixia commented Apr 23, 2024

you may refer to the doc: https://www.oklink.com/docs/zh/#explorer-rpc-api-contract-verifysourcecode

@bixia
Copy link
Contributor

bixia commented Apr 23, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants