feat(forge verify-contract): --guess-constructor-args#6724
Merged
Conversation
eb7c30e to
1f5d910
Compare
2b7d0b7 to
e5e5e6d
Compare
mattsse
approved these changes
Feb 26, 2024
mattsse
left a comment
Member
There was a problem hiding this comment.
style nit,
I'll set the env vars in CI via secrets
Member
Author
|
made also did some more testing and it seems that in some cases |
Evalir
approved these changes
Feb 26, 2024
Evalir
left a comment
Contributor
There was a problem hiding this comment.
nice! only one doc nit, pending vars
This was referenced Apr 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Ref #6334
Solution
RpcOptstoVerifyArgs. If any valideth_rpc_urlis found in config and--chainis not specified, we are using explorer for chain_id from RPC. This should make UX cleaner (ref comment)--guess-constructor-argsparameter which uses Etherscan API and RPC provider to fetch creation code of contracts created directly with create transaction or directly with default CREATE2 deployer.--guess-constructor-args. I wasn't able to run existing verification tests without some small updates to them (renaming--etherscan-keyto--etherscan-api-keyfor example). Is there a chance that required env vars are not set in CI which leads to tests silently passing or I got something wrong?The only way I can see to make
--guess-constructor-argswork for any contract is by implementing some kind ofcast runwith custom inspector which will be pretty long-running thing (somecast run's are taking several minutes on my machine). So not sure if such UX is really a best way to do it. Would be happy to get some ideas on how creation code for arbitrary contract could be fetched faster.