Skip to main content

PredicateHelper

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

Functions#

or#

function or(  address[] targets,  bytes[] data) external returns (bool)

Calls every target with corresponding data

Parameters:#

NameTypeDescription
targetsaddress[]
databytes[]

Return Values:#

NameTypeDescription
ResultboolTrue if call to any target returned True. Otherwise, false

and#

function and(  address[] targets,  bytes[] data) external returns (bool)

Calls every target with corresponding data

Parameters:#

NameTypeDescription
targetsaddress[]
databytes[]

Return Values:#

NameTypeDescription
ResultboolTrue if calls to all targets returned True. Otherwise, false

eq#

function eq(  uint256 value,  address target,  bytes data) external returns (bool)

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

Parameters:#

NameTypeDescription
valueuint256Value to test
targetaddress
databytes

Return Values:#

NameTypeDescription
ResultboolTrue if call to target returns the same value as value. Otherwise, false

lt#

function lt(  uint256 value,  address target,  bytes data) external returns (bool)

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

Parameters:#

NameTypeDescription
valueuint256Value to test
targetaddress
databytes

Return Values:#

NameTypeDescription
ResultboolTrue if call to target returns value which is lower than value. Otherwise, false

gt#

function gt(  uint256 value,  address target,  bytes data) external returns (bool)

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

Parameters:#

NameTypeDescription
valueuint256Value to test
targetaddress
databytes

Return Values:#

NameTypeDescription
ResultboolTrue if call to target returns value which is bigger than value. Otherwise, false

timestampBelow#

function timestampBelow(  uint256 time) external returns (bool)

Checks passed time against block timestamp

Parameters:#

NameTypeDescription
timeuint256

Return Values:#

NameTypeDescription
ResultboolTrue if current block timestamp is lower than time. Otherwise, false