Skip to content

fix(dyn-abi): validate EIP-712 fixed bytes length - #1135

Merged
DaniPopes merged 2 commits into
alloy-rs:mainfrom
0xalpharush:bug/a1-eip712-fixed-bytes
Jun 30, 2026
Merged

DaniPopes merged 2 commits into
alloy-rs:mainfrom
0xalpharush:bug/a1-eip712-fixed-bytes

Conversation

@0xalpharush

@0xalpharush 0xalpharush commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Reject EIP-712 JSON hex values for bytesN unless the decoded byte length is exactly N.
  • Preserve existing fixed-byte word construction for correctly sized values.

Regression

  • Added fixed_bytes_rejects_oversized_hex, which failed before the fix because bytes2 accepted 0x123456 and truncated it.

Test Plan

  • cargo test -p alloy-dyn-abi --features eip712 fixed_bytes_rejects_oversized_hex

@0xalpharush
0xalpharush marked this pull request as ready for review June 30, 2026 18:04
@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Jun 30, 2026
@DaniPopes
DaniPopes merged commit 1914e9d into alloy-rs:main Jun 30, 2026
31 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants