From 98aaf57cb32097b54fb901e611c7c7cd50735784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Tue, 19 Aug 2025 12:32:52 -0300 Subject: [PATCH 1/2] fix: use GraphTally as EIP712 domain for TAP v2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tap_core/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tap_core/src/lib.rs b/tap_core/src/lib.rs index 217aa6a..a505a4b 100644 --- a/tap_core/src/lib.rs +++ b/tap_core/src/lib.rs @@ -56,7 +56,7 @@ impl TapVersion { } /// The domain separator is defined as: -/// - `name`: "TAP" +/// - `name`: "TAP" for V1, "GraphTally" for V2 - This could be a fn argument but we don't want to change the function signature /// - `version`: "1" or "2" depending on protocol version /// - `chain_id`: The chain ID of the chain where the domain separator is deployed. /// - `verifying_contract`: The address of the contract that is verifying the signature. @@ -65,8 +65,13 @@ pub fn tap_eip712_domain( verifying_contract_address: Address, version: TapVersion, ) -> Eip712Domain { + let name = match version { + TapVersion::V1 => "TAP", + TapVersion::V2 => "GraphTally", + }; + eip712_domain! { - name: "TAP", + name: name, version: version.as_str(), chain_id: chain_id, verifying_contract: verifying_contract_address, From 8d168a287a384b4548e83f6558d9604b8ad796bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Migone?= Date: Tue, 19 Aug 2025 13:48:16 -0300 Subject: [PATCH 2/2] fix: apply proper version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás Migone --- tap_core/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tap_core/src/lib.rs b/tap_core/src/lib.rs index a505a4b..72d768d 100644 --- a/tap_core/src/lib.rs +++ b/tap_core/src/lib.rs @@ -56,8 +56,8 @@ impl TapVersion { } /// The domain separator is defined as: -/// - `name`: "TAP" for V1, "GraphTally" for V2 - This could be a fn argument but we don't want to change the function signature -/// - `version`: "1" or "2" depending on protocol version +/// - `name`: "TAP" for V1, "GraphTally" for V2 - This could be a fn argument but we don't want to change the function signature. +/// - `version`: always set to "1", what changes is the domain name. /// - `chain_id`: The chain ID of the chain where the domain separator is deployed. /// - `verifying_contract`: The address of the contract that is verifying the signature. pub fn tap_eip712_domain( @@ -72,7 +72,7 @@ pub fn tap_eip712_domain( eip712_domain! { name: name, - version: version.as_str(), + version: "1", chain_id: chain_id, verifying_contract: verifying_contract_address, }