Skip to content

fix(syn-solidity): strip namespaces from custom types in EIP-712 formatting - #1146

Merged
DaniPopes merged 4 commits into
alloy-rs:mainfrom
Ysh204:fix/sol-macro-eip712-namespace-stripping
Jul 16, 2026
Merged

DaniPopes merged 4 commits into
alloy-rs:mainfrom
Ysh204:fix/sol-macro-eip712-namespace-stripping

Conversation

@Ysh204

@Ysh204 Ysh204 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Motivation

EIP-712 type signatures should use the bare name of referenced custom types.

While direct custom types were formatted correctly, custom types nested inside
arrays retained their fully qualified paths (e.g. A.StructB[]), resulting in
incorrect EIP-712 type signatures and hashes.

Solution

Add a private recursive helper for EIP-712 type formatting that strips
namespaces from custom types while recursively formatting array element types.

Also adds regression tests covering:

  • Direct custom types
  • Dynamic arrays
  • Fixed-size arrays
  • Nested arrays

to ensure custom type names are formatted correctly in all supported array
configurations.

Comment thread tests/core-sol/src/lib.rs Resolved
@Ysh204
Ysh204 force-pushed the fix/sol-macro-eip712-namespace-stripping branch from ea8315d to 5ee1326 Compare July 13, 2026 15:21
@DaniPopes
DaniPopes enabled auto-merge (squash) July 13, 2026 18:42
@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Jul 13, 2026
@DaniPopes
DaniPopes disabled auto-merge July 16, 2026 14:15
@DaniPopes
DaniPopes merged commit 3203fa6 into alloy-rs:main Jul 16, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Jul 16, 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