Skip to content
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

fix(dyn-abi): correctly parse empty lists of bytes #548

Merged
merged 4 commits into from
Feb 29, 2024

Conversation

DaniPopes
Copy link
Member

Two bugs in here:

  • the element parser was getting called on an empty list like "[]" with "]", which should be special cased to just return the empty list without calling the element parser IMO
  • an empty string was getting incorrectly parsed as an empty byte hex string like "0x", but we shouldn't allow this

Fixes foundry-rs/foundry#7280

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.

nice

@DaniPopes DaniPopes merged commit 7e39882 into main Feb 29, 2024
21 checks passed
@DaniPopes DaniPopes deleted the dani/empty-bytes-arrays branch February 29, 2024 17:04
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.

Cast encodes incorrect calldata when given empty bytes arrays
2 participants