Skip to content

Commit 98aaf57

Browse files
committed
fix: use GraphTally as EIP712 domain for TAP v2
Signed-off-by: Tomás Migone <[email protected]>
1 parent 3512369 commit 98aaf57

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tap_core/src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl TapVersion {
5656
}
5757

5858
/// The domain separator is defined as:
59-
/// - `name`: "TAP"
59+
/// - `name`: "TAP" for V1, "GraphTally" for V2 - This could be a fn argument but we don't want to change the function signature
6060
/// - `version`: "1" or "2" depending on protocol version
6161
/// - `chain_id`: The chain ID of the chain where the domain separator is deployed.
6262
/// - `verifying_contract`: The address of the contract that is verifying the signature.
@@ -65,8 +65,13 @@ pub fn tap_eip712_domain(
6565
verifying_contract_address: Address,
6666
version: TapVersion,
6767
) -> Eip712Domain {
68+
let name = match version {
69+
TapVersion::V1 => "TAP",
70+
TapVersion::V2 => "GraphTally",
71+
};
72+
6873
eip712_domain! {
69-
name: "TAP",
74+
name: name,
7075
version: version.as_str(),
7176
chain_id: chain_id,
7277
verifying_contract: verifying_contract_address,

0 commit comments

Comments
 (0)