From 1ae4ebf3bcdc118118e88d939b5fc201ed3a7ff1 Mon Sep 17 00:00:00 2001 From: bigq Date: Wed, 12 Jul 2023 10:24:29 +0200 Subject: [PATCH] feat: put impersonation commitment mapper pubkey as constant --- src/verifiers/HydraS3Verifier.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/verifiers/HydraS3Verifier.sol b/src/verifiers/HydraS3Verifier.sol index 65d2075..7f527a4 100644 --- a/src/verifiers/HydraS3Verifier.sol +++ b/src/verifiers/HydraS3Verifier.sol @@ -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); @@ -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 ( @@ -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] ||