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

Add support for OKLink verification #7724

Closed
CodeSandwich opened this issue Apr 19, 2024 · 3 comments · Fixed by #7915
Closed

Add support for OKLink verification #7724

CodeSandwich opened this issue Apr 19, 2024 · 3 comments · Fixed by #7915
Labels
T-feature Type: feature

Comments

@CodeSandwich
Copy link
Contributor

Component

Other (please describe)

Describe the feature you would like

Polygon endorses polygonscan.com for their mainnet and https://www.oklink.com/amoy for their Amoy testnet as the block explorers. It would be great if they were supported by cast verify-contract and other tools like cast src.

There are so many block explorers, do they share the APIs? If yes then maybe generic support could be added where foundry commands would accept the URL of the explorer? It would be great because nowadays there are dozens of L2s and alt chains, and each of them has at least 1 scanner plus a scanner for their testnet.

Additional context

No response

@CodeSandwich CodeSandwich added the T-feature Type: feature label Apr 19, 2024
@DaniPopes
Copy link
Member

Polygon is already supported, OKLink is not yet supported, see #7586

@DaniPopes DaniPopes changed the title Add support for Polygon block explorers Add support for OKLink verification Apr 22, 2024
@klkvr
Copy link
Member

klkvr commented Apr 22, 2024

@CodeSandwich You can already use OKLink for Amoy testnet by passing --verifier-url 'https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/AMOY_TESTNET'

@CodeSandwich
Copy link
Contributor Author

CodeSandwich commented May 6, 2024

Ohh, thank you and sorry for the noise, I somehow missed the --verifier-url parameter!

For my own reference the default etherscan-like explorers' URLs are here: https://github.com/alloy-rs/chains/blob/351451bd14386ddfd6b43c6fff72fcf5820a0aef/src/named.rs#L767. Now it contains all Polygon flavors, including Amoy with OKLink. It's fairly difficult information to find, it could be useful to have it somehow documented in Foundry itself, but I'm not sure how. Maybe a new cast command that would list all the known chains, their names, IDs and default explorers? I think that it may be also helpful for the users to document that setting --verifier etherscan only selects the verifier API flavor, which does affect the default URL, but does not necessarily set it to etherscan.io.

I'm fine with closing this issue, but I see that it's linked to the PR now, so I'll close it manually only in case the PR is rejected as unneeded.

mattsse pushed a commit to alloy-rs/chains that referenced this issue May 14, 2024
Use `amoy.polygonscan.com` as both explorer and verification endpoint

ref foundry-rs/foundry#7922
ref foundry-rs/foundry#7724
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
None yet
3 participants