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

feat(forge script): add flag to output --standard-json-input somewhere #1350

Open
bxmmm1 opened this issue Sep 2, 2024 · 7 comments
Open

Comments

@bxmmm1
Copy link

bxmmm1 commented Sep 2, 2024

Component

Forge

Describe the feature you would like

When a script deoloys contracts to 2 different chains (Mainnet, Base) Etherscan & BaseScan don't use the same API key, so the contract verification fails with --verify

It would be convenient, to store the standard json output somewhere for all deployed contracts. That way, it is easy to manually drag & drop it on Etherscan,Basescan to verify the contracts.

Additional context

No response

@mattsse
Copy link
Member

mattsse commented Sep 2, 2024

we have

  --show-standard-json-input
      Prints the standard json compiler input.
      The standard json compiler input can be used to manually submit contract verification in the browser.

on verify-contract, so we should be able to also include this in the script command easily

@bxmmm1
Copy link
Author

bxmmm1 commented Sep 2, 2024

we have

  --show-standard-json-input
      Prints the standard json compiler input.
      The standard json compiler input can be used to manually submit contract verification in the browser.

on verify-contract, so we should be able to also include this in the script command easily

Yes, but that only works with forge create, right?

@zerosnacks zerosnacks changed the title Store standard-json-input somewhere. feat(forge script): add flag to output --standard-json-input somewhere Sep 3, 2024
@CodeSandwich
Copy link
Contributor

CodeSandwich commented Sep 18, 2024

Yes, but that only works with forge create, right?

It seems that no, I was able to run forge verify-contract --show-standard-json-input $(cast address-zero) MyContract and it did nothing but printing the standard input JSON. It didn't even complain that the Etherscan API key wasn't provided, it was like running a completely different command that only prints the standard input JSON. I wish that it actually was a separate command or a forge inspect output, I would have never guessed to look at one of forge verify-contract flags if it wasn't mentioned it in this issue. Thanks!

@grandizzy
Copy link
Collaborator

@CodeSandwich we're going to add better documentation for the flag.

@zerosnacks zerosnacks transferred this issue from foundry-rs/foundry Nov 7, 2024
@CodeSandwich
Copy link
Contributor

Awesome! IMO making it a separate command or a feature of a more obvious command like forge inspect or forge build would be the actual low discoverability solution, but having one more place where it's documented is certainly a good step 👍

@bxmmm1
Copy link
Author

bxmmm1 commented Nov 7, 2024

Update: Etherscan V2 started using the same API Key for everything 🥇

https://docs.etherscan.io/etherscan-v2#single-api-key

@grandizzy
Copy link
Collaborator

Update: Etherscan V2 started using the same API Key for everything 🥇

Yep, tracking impl in foundry-rs/foundry#9196

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: No status
Development

No branches or pull requests

4 participants