fix: allow colon in EIP-712 type names in encodeType parser#289
Merged
ckorchane-ledger merged 1 commit intomainfrom Mar 26, 2026
Merged
fix: allow colon in EIP-712 type names in encodeType parser#289ckorchane-ledger merged 1 commit intomainfrom
ckorchane-ledger merged 1 commit intomainfrom
Conversation
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
3 tasks
ckorchane-ledger
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_ENCODE_TYPE_REregex incommon/abi.pyfrom(\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:Withdrawin 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_typefunction is used by the v2-to-legacy-EIP-712 converter. Without this fix, converting a v2 descriptor withHyperliquidTransaction:Withdraw(string hyperliquidChain,...)as format key produces a schema withWithdrawinstead ofHyperliquidTransaction:Withdraw.Test plan
erc7730 convert erc7730-to-eip712on a Hyperliquid withdraw v2 descriptor now produces the correctHyperliquidTransaction:Withdrawkey in the output schemaMade with Cursor