LibOpConditionsNP

Git Source

Opcode to return the first nonzero item on the stack up to the inputs limit.

Functions

integrity

function integrity(IntegrityCheckStateNP memory, Operand operand) internal pure returns (uint256, uint256);

run

conditions Pairwise list of conditions and values. The first nonzero condition evaluated puts its corresponding value on the stack. conditions is eagerly evaluated. If no condition is nonzero, the expression will revert. The number of inputs must be even. The number of outputs is 1. If an author wants to provide some default value, they can set the last condition to some nonzero constant value such as 1.

function run(InterpreterStateNP memory, Operand operand, Pointer stackTop) internal pure returns (Pointer);

referenceFn

Gas intensive reference implementation of condition for testing.

function referenceFn(InterpreterStateNP memory, Operand operand, uint256[] memory inputs) internal pure returns (uint256[] memory outputs);