Skip to content

Commit ae53de1

Browse files
authored
Merge pull request #325 from tmigone/tmigone/fix-eip712-domain
fix: use GraphTally as EIP712 domain for TAP v2
2 parents 3512369 + 8d168a2 commit ae53de1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tap_core/src/lib.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,23 @@ impl TapVersion {
5656
}
5757

5858
/// The domain separator is defined as:
59-
/// - `name`: "TAP"
60-
/// - `version`: "1" or "2" depending on protocol version
59+
/// - `name`: "TAP" for V1, "GraphTally" for V2 - This could be a fn argument but we don't want to change the function signature.
60+
/// - `version`: always set to "1", what changes is the domain name.
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.
6363
pub fn tap_eip712_domain(
6464
chain_id: u64,
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",
70-
version: version.as_str(),
74+
name: name,
75+
version: "1",
7176
chain_id: chain_id,
7277
verifying_contract: verifying_contract_address,
7378
}

0 commit comments

Comments
 (0)