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

cast etherscan-source not respecting [etherscan] config #9494

Closed
2 tasks done
sakulstra opened this issue Dec 5, 2024 · 4 comments
Closed
2 tasks done

cast etherscan-source not respecting [etherscan] config #9494

sakulstra opened this issue Dec 5, 2024 · 4 comments
Labels
C-cast Command: cast T-bug Type: bug

Comments

@sakulstra
Copy link
Contributor

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (805d7ce 2024-12-04T00:23:29.410361000Z)

What command(s) is the bug in?

cast etherscan-source

Operating System

macOS (Apple Silicon)

Describe the bug

In my foundry.toml i have a setup like:

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY_MAINNET}", chain = 1 }
optimism = { key = "${ETHERSCAN_API_KEY_OPTIMISM}", chain = 10 }
avalanche = { key = "${ETHERSCAN_API_KEY_AVALANCHE}", chain = 43114 }
polygon = { key = "${ETHERSCAN_API_KEY_POLYGON}", chain = 137 }
arbitrum = { key = "${ETHERSCAN_API_KEY_ARBITRUM}", chain = 42161 }
fantom = { key = "${ETHERSCAN_API_KEY_FANTOM}", chain = 250 }

Which when running forge script ... --verify is recognized and works appropriately.


When I run cast etherscan-source --chain alias|id though, cast will always try to use the ETHERSCAN_API_KEY and does not consider the etherscan setup in the toml. Therefore cast always fails with invalid api key as it's trying to use the wrong api key. As a fix one can manually supply the correct one via --etherscan-api-key, but that obviously is suboptimal.

@sakulstra sakulstra added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Dec 5, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 5, 2024
@zerosnacks zerosnacks added C-cast Command: cast T-to-investigate Type: to investigate and removed T-needs-triage Type: this issue needs to be labelled labels Dec 5, 2024
@grandizzy
Copy link
Collaborator

grandizzy commented Dec 5, 2024

I think this should be part of #4776 resolution @zerosnacks wdyt? also mind that cast doesn't have configs to read from

@zerosnacks
Copy link
Member

I think so as well, it should be covered by #4776

As stated, it is currently not expected behavior for cast to read from the Foundry configuration file depending on where you run cast from as it is meant to be a standalone utility.

@zerosnacks zerosnacks removed the T-to-investigate Type: to investigate label Dec 5, 2024
@zerosnacks
Copy link
Member

Marking as won't fix / duplicate, given the above

Added a note to #4776:

Note: cast will always try to use the ETHERSCAN_API_KEY, when compatibility is added this should not be the case

@zerosnacks zerosnacks closed this as not planned Won't fix, can't repro, duplicate, stale Dec 5, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 5, 2024
@sakulstra
Copy link
Contributor Author

oh sorry i completely forgot i faced this before and didn't find on search :/
But yah, i guess also etherscan v2 support would help 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-bug Type: bug
Projects
Status: Done
Development

No branches or pull requests

3 participants