File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ contract SignatureChecker is Ownable {
1010 mapping (address => bool ) public isNotary;
1111
1212 /// valid digests for a given address
13- mapping (address => bytes32 ) public digests;
13+ mapping (bytes32 => address ) public digests;
1414
1515 /// @notice Error for invalid signatures
1616 error InvalidSignature ();
@@ -80,11 +80,13 @@ contract SignatureChecker is Ownable {
8080 if (recoveredSigner != signer) {
8181 revert InvalidSignature ();
8282 }
83- if (digests[msg .sender ] == digest) {
83+
84+ // TODO(WJ 2025-02-20): Should check for any sender.
85+ if (digests[digest] == msg .sender ) {
8486 revert DuplicateProof ();
8587 }
8688
87- digests[msg . sender ] = digest ;
89+ digests[digest ] = msg . sender ;
8890 return true ;
8991 }
9092}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ contract SignatureCheckerTest is Test {
1111 signatureChecker = new SignatureChecker (0xfdf07A5dCfa7b74f4c28DAb23eaD8B1c43Be801F );
1212 }
1313
14- function test_isValidSignatureNow () public {
14+ function test_isValidSignature () public {
1515 // TEST vector from web-prover @ githash 2dc768e818d6f9fef575a88a2ceb80c0ed11974f
1616 address signer = 0xfdf07A5dCfa7b74f4c28DAb23eaD8B1c43Be801F ;
1717 bytes32 digest = bytes32 (0xe45537be7b5cd288c9c46b7e027b4f5a66202146012f792c1b1cabb65828994b );
You can’t perform that action at this time.
0 commit comments