Skip to main content

PredicateHelper

A helper contract for executing boolean functions on arbitrary target call results

Functions

or

function or(
uint256 offsets,
bytes calldata data
) public view returns(bool)

Calls every target with corresponding data

Parameters:

NameTypeDescription
offsetsuint256
databytes

Return values

TypeDescription
boolTrue if call to any target returned True. Otherwise, false

and

function and(
uint256 offsets,
bytes calldata data
) public view returns(bool)

Checks if a given flag is set for the provided address

Parameters:

NameTypeDescription
offsetsuint256
databytes

Return values

TypeDescription
boolTrue if calls to all targets returned True. Otherwise, false

not

function not(
bytes calldata data
) public view returns(bool)

Calls target with specified data and tests if it's equal to 0

Parameters:

NameTypeDescription
databytes

Return values

TypeDescription
boolTrue if call to target returns 0. Otherwise, false

eq

function eq(
uint256 value,
bytes calldata data
) public view returns(bool)

Calls target with specified data and tests if it's equal to the value

Parameters:

NameTypeDescription
valueuint256Value to test
databytes

Return values

TypeDescription
boolTrue if call to target returns the same value as value. Otherwise, false

lt

function lt(
uint256 value,
bytes calldata data
) public view returns(bool)

Calls target with specified data and tests if it's lower than value

Parameters:

NameTypeDescription
valueuint256Value to test
databytes

Return values

TypeDescription
boolTrue if call to target returns value which is lower than value. Otherwise, false

gt

function gt(
uint256 value,
bytes calldata data
) public view returns(bool)

Calls target with specified data and tests if it's bigger than value

Parameters:

NameTypeDescription
valueuint256Value to test
databytes

Return values

TypeDescription
boolTrue if call to target returns value which is bigger than value. Otherwise, false

arbitraryStaticCall

function arbitraryStaticCall(
address target,
bytes calldata data
) public view returns(uint256)

Performs an arbitrary call to target with data

Parameters:

NameTypeDescription
targetaddressValue to test
databytes

Return values

TypeDescription
uint256Bytes transmuted to uint256