-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 verify-contract): --guess-constructor-args
#6724
Conversation
eb7c30e
to
1f5d910
Compare
2b7d0b7
to
e5e5e6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style nit,
I'll set the env vars in CI via secrets
made also did some more testing and it seems that in some cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! only one doc nit, pending vars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Motivation
Ref #6334
Solution
RpcOpts
toVerifyArgs
. If any valideth_rpc_url
is found in config and--chain
is not specified, we are using explorer for chain_id from RPC. This should make UX cleaner (ref comment)--guess-constructor-args
parameter 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-key
to--etherscan-api-key
for 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-args
work for any contract is by implementing some kind ofcast run
with 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.