Skip to content

Commit 7490dbf

Browse files
committed
bug: prevent double proof association
1 parent 182067e commit 7490dbf

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/SignatureChecker.sol

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ contract SignatureChecker is Ownable {
1212
/// valid digests for a given address
1313
mapping(address => bytes32) public digests;
1414

15-
uint256 public constant BN254_MODULUS =
16-
21888242871839275222246405745257275088548364400416034343698204186575808495617;
17-
1815
/// @notice Error for invalid signatures
1916
error InvalidSignature();
2017
/// @notice Error for invalid notary addresses
@@ -23,6 +20,8 @@ contract SignatureChecker is Ownable {
2320
error InvalidDigest();
2421
/// @notice Error for invalid signature length
2522
error InvalidSignatureLength();
23+
/// @notice Error for duplicate proof, meaning the proofs is already associated with another address
24+
error DuplicateProof();
2625

2726
/// @notice Constructor configures the notary address
2827
/// @param _notaryAddress The address of the notary to add
@@ -81,6 +80,10 @@ contract SignatureChecker is Ownable {
8180
if (recoveredSigner != signer) {
8281
revert InvalidSignature();
8382
}
83+
if (digests[msg.sender] == digest) {
84+
revert DuplicateProof();
85+
}
86+
8487
digests[msg.sender] = digest;
8588
return true;
8689
}

0 commit comments

Comments
 (0)