Skip to content

Commit

Permalink
Add evaluation of 'Verify' output
Browse files Browse the repository at this point in the history
  • Loading branch information
storojs72 committed Jul 19, 2024
1 parent 29f0ef7 commit 57b8995
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/src/SphinxVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {PlonkVerifier} from "./PlonkVerifier.sol";
/// @title Sphinx Verifier
/// @notice This contracts implements a solidity verifier for Sphinx.
contract SphinxVerifier is PlonkVerifier {
error InvalidProof();

function VERSION() external pure returns (string memory) {
return "TODO";
}
Expand All @@ -26,6 +28,9 @@ contract SphinxVerifier is PlonkVerifier {
uint256[] memory inputs = new uint256[](2);
inputs[0] = uint256(vkey);
inputs[1] = uint256(publicValuesDigest);
this.Verify(proofBytes, inputs);
bool success = this.Verify(proofBytes, inputs);
if (!success) {
revert InvalidProof();
}
}
}

0 comments on commit 57b8995

Please sign in to comment.