Skip to content

Commit

Permalink
feat: put impersonation commitment mapper pubkey as constant
Browse files Browse the repository at this point in the history
  • Loading branch information
yum0e committed Jul 12, 2023
1 parent 9ae561a commit 1ae4ebf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/verifiers/HydraS3Verifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ contract HydraS3Verifier is IHydraS3Verifier, IBaseVerifier, HydraS3SnarkVerifie
// Registry storing the Registry Tree Roots of the Attester's available ClaimData
IAvailableRootsRegistry public immutable AVAILABLE_ROOTS_REGISTRY;

// Impersonation Commitment Mapper EdDSA Public key
uint256 public constant impersonationCommitmentMapperPubKeyX =
0x1801b584700a740f9576cc7e83745895452edc518a9ce60b430e1272fc4eb93b;
uint256 public constant impersonationCommitmentMapperPubKeyY =
0x057cf80de4f8dd3e4c56f948f40c28c3acbeca71ef9f825597bf8cc059f1238b;

constructor(address commitmentMapperRegistry, address availableRootsRegistry) {
COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperRegistry);
AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistry);
Expand Down Expand Up @@ -134,10 +140,7 @@ contract HydraS3Verifier is IHydraS3Verifier, IBaseVerifier, HydraS3SnarkVerifie
// In impersonation mode, we use the EdDSA public key of the Impersonation Commitment Mapper
// otherwise we use the EdDSA public key of the Commitment Mapper Registry
uint256[2] memory commitmentMapperPubKey = isImpersonationMode
? [
0x1801b584700a740f9576cc7e83745895452edc518a9ce60b430e1272fc4eb93b,
0x057cf80de4f8dd3e4c56f948f40c28c3acbeca71ef9f825597bf8cc059f1238b
]
? [impersonationCommitmentMapperPubKeyX, impersonationCommitmentMapperPubKeyY]
: COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();

if (
Expand Down Expand Up @@ -206,10 +209,7 @@ contract HydraS3Verifier is IHydraS3Verifier, IBaseVerifier, HydraS3SnarkVerifie
}
// commitmentMapperPubKey
uint256[2] memory commitmentMapperPubKey = isImpersonationMode
? [
0x1801b584700a740f9576cc7e83745895452edc518a9ce60b430e1272fc4eb93b,
0x057cf80de4f8dd3e4c56f948f40c28c3acbeca71ef9f825597bf8cc059f1238b
]
? [impersonationCommitmentMapperPubKeyX, impersonationCommitmentMapperPubKeyY]
: COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();
if (
input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||
Expand Down

0 comments on commit 1ae4ebf

Please sign in to comment.