Skip to content

Commit

Permalink
chore: restrict verify proof interface to view
Browse files Browse the repository at this point in the history
  • Loading branch information
0xOsiris committed Dec 30, 2024
1 parent 5835348 commit 1e04673
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/interfaces/IWorldID.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ interface IWorldID is IBaseWorldID {
uint256 nullifierHash,
uint256 externalNullifierHash,
uint256[8] calldata proof
) external;
) external view;
}
9 changes: 3 additions & 6 deletions src/test/mock/SimpleStateBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ contract SimpleStateBridge is IBridge, IWorldID {
emit SetRootHistoryExpiry(expiryTime);
}

event ProofVerified(uint256 indexed root);

error ProofNotVerified();

function verifyProof(uint256 root, uint256, uint256, uint256, uint256[8] calldata proof)
function verifyProof(uint256, uint256, uint256, uint256, uint256[8] calldata proof)
external
pure
{
if (proof[0] % 2 == 0) {
emit ProofVerified(root);
} else {
if (proof[0] % 2 != 0) {
revert ProofNotVerified();
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/test/router/WorldIDRouterStateBridge.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ contract WorldIDRouterStateBridge is WorldIDRouterTest {
bool shouldSucceed = proof[0] % 2 == 0;

bytes memory errorData = new bytes(0);
if (shouldSucceed) {
vm.expectEmit(true, true, true, true);
emit ProofVerified(root);
} else {
if (!shouldSucceed) {
errorData = abi.encodeWithSelector(SimpleStateBridge.ProofNotVerified.selector);
}

Expand Down

0 comments on commit 1e04673

Please sign in to comment.