Skip to content

Commit 0f5088b

Browse files
fix: allow colon in EIP-712 type names in encodeType parser (#289)
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
1 parent 7dcf3bf commit 0f5088b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/erc7730/common/abi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def get_functions(abis: list[ABI], *, include_read_only: bool = False) -> Functi
152152
return functions
153153

154154

155-
_ENCODE_TYPE_RE = re.compile(r"(\w+)\(([^)]*)\)")
155+
_ENCODE_TYPE_RE = re.compile(r"([\w:]+)\(([^)]*)\)")
156156

157157

158158
def parse_encode_type(encode_type: str) -> tuple[str, dict[str, list[tuple[str, str]]]]:

0 commit comments

Comments
 (0)