Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(verify-bytecode): extract constructor arguments from creation code #8547

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Jul 28, 2024

Motivation

Closes #8545

Solution

If Etherescan returned incorrect constructor arguments, replace them with latest bytes of on-chain creation code, based on the length of local creation code. This should work well as long as metadata settings are same for both local and on-chain contracts (either both contain metadata, or both don't contain).

@klkvr klkvr changed the title fix verify-bytecode: extract constructor arguments from creation code fix(verify-bytecode): extract constructor arguments from creation code Jul 28, 2024
@mattsse mattsse merged commit 108b8d1 into master Jul 29, 2024
20 checks passed
@mattsse mattsse deleted the klkvr/fix-verify-bytecode branch July 29, 2024 09:34
zerosnacks added a commit that referenced this pull request Jul 29, 2024
benwjhack pushed a commit to CompassLabs/foundry-test that referenced this pull request Sep 11, 2024
…ode (foundry-rs#8547)

fix verify-bytecode: extract constructor arguments from creation code
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(verify-bytecode) - Incorrect constructor args being returned from Etherscan's Get Source Code Endpoint
2 participants