Skip to main content
Version: 2.1.x

BaseVerifierHelper.sol

This is a basic verifier helper contract. It contains signals and error codes used across verifier helper contracts.

chainid

Get the current chain ID.

EpochKeySignals

Signals inside a epoch key proof and epoch key lite proof.

caution

stateTreeRoot will be 0 in an epoch key lite proof.

struct EpochKeySignals {
uint256 epochKey;
uint256 stateTreeRoot;
uint256 data;
uint160 attesterId;
uint48 epoch;
uint48 chainId;
uint8 nonce;
bool revealNonce;
}

ReputationSignals

Signals inside a reputation proof.

struct ReputationSignals {
uint256 epochKey;
uint256 stateTreeRoot;
uint256 minRep;
uint256 maxRep;
uint256 graffiti;
uint256 data;
uint160 attesterId;
uint48 epoch;
uint48 chainId;
uint8 nonce;
bool revealNonce;
bool proveMinRep;
bool proveMaxRep;
bool proveZeroRep;
bool proveGraffiti;
}

decodeEpochKeyControl

Decode an epoch key related control from epoch key lite proof, epoch key proof, and reputation proof into named variables.

function decodeEpochKeyControl(uint256 control)
public
pure
returns (
uint8 nonce,
uint48 epoch,
uint160 attesterId,
bool revealNonce,
uint48 chainId
)

shift

Get data in certain range of bits.

data
Variable bitsShift bits

It will return a variable from data within variable bits.

function shiftAndParse(
uint256 data,
uint8 shiftBits,
uint8 variableBits
) public pure returns (uint256)