ZkVerifier

Git Source

Inherits: Ownable, IZkVerifier

State Variables

verifier

IRiscZeroVerifier public verifier;

imageId

bytes32 public imageId;

Functions

constructor

constructor(address _owner, bytes32 _imageId, address _verifier) Ownable(_owner);

setVerifier

Sets the _risc0Verifier address

Admin check is needed on the external method

function setVerifier(address _risc0Verifier) external onlyOwner;

Parameters

NameTypeDescription
_risc0Verifieraddressthe new IRiscZeroVerifier address

setImageId

Sets the image id

Admin check is needed on the external method

function setImageId(bytes32 _imageId) external onlyOwner;

Parameters

NameTypeDescription
_imageIdbytes32the new image id

verifyInput

Verifies an input

function verifyInput(bytes calldata journalEntry, bytes calldata seal) external view;

Parameters

NameTypeDescription
journalEntrybytesthe risc0 journal entry
sealbytesthe risc0 seal

_checkAddresses

function _checkAddresses() private view;

__verify

function __verify(bytes calldata journalEntry, bytes calldata seal) private view;

Events

ImageSet

event ImageSet(bytes32 _imageId);

VerifierSet

event VerifierSet(address indexed oldVerifier, address indexed newVerifier);

Errors

ZkVerifier_ImageNotValid

error ZkVerifier_ImageNotValid();

ZkVerifier_InputNotValid

error ZkVerifier_InputNotValid();

ZkVerifier_VerifierNotSet

error ZkVerifier_VerifierNotSet();