Skip to content

Conversation

@klkvr
Copy link
Member

@klkvr klkvr commented Jul 30, 2024

Closes #8555

Instead of relying on Config to determine whether we need to strip metadata, we now just look at the end of the bytecode and try decoding it into CBOR as suggested by @mds1 in #8555 (comment). If decoding succeeds, we strip the suffix

I've also added tests and a helper to add them. Tests are simply running cast etherscan-source --flatten and then try to verify compiled downloaded source against on-chain bytecode.

}

#[cfg(test)]
mod tests {
Copy link
Member

Choose a reason for hiding this comment

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

pls move to tests directory

Copy link
Contributor

@yash-atreya yash-atreya left a comment

Choose a reason for hiding this comment

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

lgtm!

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.

metadata 👍

@mattsse mattsse merged commit bb4b2a3 into master Jul 30, 2024
@mattsse mattsse deleted the klkvr/fix-has-metadata-vb branch July 30, 2024 09:47
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(forge verify-bytecode) - range end index 18446744073709516997 out of range for slice of length 10855

5 participants