Assertions

Git Source

This library contains assertions for common requirement checks

Functions

assertGt

Asserts that _x is greater than _y and returns _x

function assertGt(uint256 _x, uint256 _y) internal pure returns (uint256 __x);

assertGt

Asserts that _x is greater than _y and returns _x

function assertGt(int256 _x, int256 _y) internal pure returns (int256 __x);

assertGtEq

Asserts that _x is greater than or equal to _y and returns _x

function assertGtEq(uint256 _x, uint256 _y) internal pure returns (uint256 __x);

assertGtEq

Asserts that _x is greater than or equal to _y and returns _x

function assertGtEq(int256 _x, int256 _y) internal pure returns (int256 __x);

assertLt

Asserts that _x is lesser than _y and returns _x

function assertLt(uint256 _x, uint256 _y) internal pure returns (uint256 __x);

assertLt

Asserts that _x is lesser than _y and returns _x

function assertLt(int256 _x, int256 _y) internal pure returns (int256 __x);

assertLtEq

Asserts that _x is lesser than or equal to _y and returns _x

function assertLtEq(uint256 _x, uint256 _y) internal pure returns (uint256 __x);

assertLtEq

Asserts that _x is lesser than or equal to _y and returns _x

function assertLtEq(int256 _x, int256 _y) internal pure returns (int256 __x);

assertNonNull

Asserts that _x is not null and returns _x

function assertNonNull(uint256 _x) internal pure returns (uint256 __x);

assertNonNull

Asserts that _address is not null and returns _address

function assertNonNull(address _address) internal pure returns (address __address);

assertHasCode

Asserts that _address contains code and returns _address

function assertHasCode(address _address) internal view returns (address __address);

Errors

NotGreaterThan

Throws if _x is not greater than _y

error NotGreaterThan(uint256 _x, uint256 _y);

NotLesserThan

Throws if _x is not lesser than _y

error NotLesserThan(uint256 _x, uint256 _y);

NotGreaterOrEqualThan

Throws if _x is not greater than or equal to _y

error NotGreaterOrEqualThan(uint256 _x, uint256 _y);

NotLesserOrEqualThan

Throws if _x is not lesser than or equal to _y

error NotLesserOrEqualThan(uint256 _x, uint256 _y);

IntNotGreaterThan

Throws if _x is not greater than _y

error IntNotGreaterThan(int256 _x, int256 _y);

IntNotLesserThan

Throws if _x is not lesser than _y

error IntNotLesserThan(int256 _x, int256 _y);

IntNotGreaterOrEqualThan

Throws if _x is not greater than or equal to _y

error IntNotGreaterOrEqualThan(int256 _x, int256 _y);

IntNotLesserOrEqualThan

Throws if _x is not lesser than or equal to _y

error IntNotLesserOrEqualThan(int256 _x, int256 _y);

NullAmount

Throws if checked amount is null

error NullAmount();

NullAddress

Throws if checked address is null

error NullAddress();

NoCode

Throws if checked address contains no code

error NoCode(address _contract);