Skip to content

fix: some verify-bytecode fixes #8513

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

Merged
merged 6 commits into from
Jul 24, 2024
Merged

fix: some verify-bytecode fixes #8513

merged 6 commits into from
Jul 24, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jul 24, 2024

Cleans up code a bit, removing redundant Result and preferring checking match_type.is_none() instead of keeping a separate bool.

Also removes --verification-type flag as it doesn't make much sense because user'd expect us to determine match type during comparison.

Closes #8505. The cause is etherscan bug - it returns invalid constructor arguments for mentioned contract.

I've updated logic to not rely on etherscan constructor args if --constructor-args are passed.

Also updated --constructor-args to expect multiple values and abi-encode them similarly to forge create as this seems to be the expected UX at least by the author of #8505. I've kept an option for abi-encoded args as --encoded-constructor-args

@maurelian
Copy link

Also updated --constructor-args to expect multiple values and abi-encode them similarly to forge create as this seems to be the expected UX at least by the author of #8505. I've kept an option for abi-encoded args as --encoded-constructor-args

Thanks I'm a fan of this approach.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mattsse mattsse enabled auto-merge (squash) July 24, 2024 20:50
@mattsse mattsse merged commit 0ad127a into master Jul 24, 2024
21 checks passed
@mattsse mattsse deleted the klkvr/fix-verify-bytecode branch July 24, 2024 21:06
zerosnacks added a commit that referenced this pull request Jul 25, 2024
@blmalone
Copy link

@klkvr There was a breaking change in this PR. The --json used to return a matched boolean but that's gone.

[
    {"bytecode_type":"creation","match_type":"partial"},
    {"bytecode_type":"runtime","match_type":null,"message":"Runtime code did not match - this may be due to varying compiler settings"}
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(verify-bytecode) fails to verify deployed code due to way constructor arguments are applied
4 participants