Skip to content

fix: allow colon in EIP-712 type names in encodeType parser#289

Merged
ckorchane-ledger merged 1 commit intomainfrom
fix/allow-colon-in-eip712-type-names
Mar 26, 2026
Merged

fix: allow colon in EIP-712 type names in encodeType parser#289
ckorchane-ledger merged 1 commit intomainfrom
fix/allow-colon-in-eip712-type-names

Conversation

@lcastillo-ledger
Copy link
Copy Markdown
Collaborator

Summary

  • Widen _ENCODE_TYPE_RE regex in common/abi.py from (\w+) to ([\w:]+) so that EIP-712 type names containing colons (e.g. HyperliquidTransaction:Withdraw) are correctly parsed instead of being truncated at the colon.

Context

Hyperliquid uses colon-separated primaryType names like HyperliquidTransaction:Withdraw in their EIP-712 signing scheme. While : is technically not part of the EIP-712 spec's "valid identifier" definition, it is used in production by Hyperliquid and accepted by all major wallet implementations (MetaMask, eth_account, etc).

The parse_encode_type function is used by the v2-to-legacy-EIP-712 converter. Without this fix, converting a v2 descriptor with HyperliquidTransaction:Withdraw(string hyperliquidChain,...) as format key produces a schema with Withdraw instead of HyperliquidTransaction:Withdraw.

Test plan

  • Verified erc7730 convert erc7730-to-eip712 on a Hyperliquid withdraw v2 descriptor now produces the correct HyperliquidTransaction:Withdraw key in the output schema

Made with Cursor

Hyperliquid uses colon-separated type names (e.g.
"HyperliquidTransaction:Withdraw") in their EIP-712 primaryType.
The encodeType regex only accepted \w (letters, digits, underscore),
causing the parser to truncate the type name at the colon.

Widen the regex to [\w:] so that colon-containing type names are
correctly captured.

Made-with: Cursor
@ckorchane-ledger ckorchane-ledger merged commit 0f5088b into main Mar 26, 2026
10 checks passed
@ckorchane-ledger ckorchane-ledger deleted the fix/allow-colon-in-eip712-type-names branch March 26, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants