From 8984bfd59e203dba93ed0445046a1fde70277f68 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Fri, 11 Oct 2024 14:35:50 +0200 Subject: [PATCH] fix: fix edge case for referencing verifyingContract --- src/erc7730/convert/convert_erc7730_to_eip712.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/erc7730/convert/convert_erc7730_to_eip712.py b/src/erc7730/convert/convert_erc7730_to_eip712.py index 128e030..d1fd666 100644 --- a/src/erc7730/convert/convert_erc7730_to_eip712.py +++ b/src/erc7730/convert/convert_erc7730_to_eip712.py @@ -138,6 +138,11 @@ def convert_field_description(cls, field: ResolvedFieldDescription, prefix: str case FieldFormat.TOKEN_AMOUNT: if field.params is not None and isinstance(field.params, TokenAmountParameters): asset_path = field.params.tokenPath if prefix is None else f"{prefix}.{field.params.tokenPath}" + + # FIXME edge case for referencing verifyingContract, this will be handled cleanly in #65 + if asset_path == "@.to": + asset_path = None + field_format = LegacyEIP712Format.AMOUNT case FieldFormat.AMOUNT: field_format = LegacyEIP712Format.AMOUNT