arnaucube
arnaucube/sonobePublic Self-hosted repository
sonobe/solidity-verifiers/templates/nova_cyclefold_decider.askama.sol
solidity-verifiers/templates/nova_cyclefold_decider.askama.solRaw
 1{{ groth16_verifier }}
 2
 3{{ kzg10_verifier }}
 4
 5/**
 6 * @author  PSE & 0xPARC
 7 * @title   NovaDecider contract, for verifying zk-snarks Nova IVC proofs.
 8 * @dev     This is an askama template. It will feature a snarkjs groth16 and a kzg10 verifier, from which this contract inherits.
 9 *          WARNING: This contract is not complete nor finished. It lacks checks to ensure that no soundness issues can happen.
10 *          Indeed, we know some of the checks that are missing. And we're working on the solution
11 *          but for now, it's good enough for testing and benchmarking.
12 */
13contract NovaDecider is Groth16Verifier, KZG10Verifier {
14    function verifyProof(uint[2] calldata _pA, uint[2][2] calldata _pB, uint[2] calldata _pC, uint[1] calldata _pubSignals, uint256[2] calldata c, uint256[2] calldata pi, uint256 x, uint256 y) public view returns (bool) {
15        bool success_kzg = super.check(c, pi, x, y);
16        require(success_kzg == true, "KZG  Failed");
17        
18        // for now, we do not relate the Groth16 and KZG10 proofs
19        bool success_g16 =  super.verifyProof(_pA, _pB, _pC, _pubSignals);
20        require(success_g16 == true, "G16 Failed");
21
22        return(true);
23    }   
24}