Skip to main content

SafeMath256

Table of contents

Constructors

Methods

Constructors

constructor

new SafeMath256(): SafeMath256

Returns

SafeMath256

Methods

add

add(a, b): u256

Parameters

NameType
au256
bu256

Returns

u256

Returns the addition of two unsigned integers, reverting on overflow.

Defined in

assembly/libraries/SafeMath.ts:115


div

div(a, b): u256

Parameters

NameType
au256
bu256

Returns

u256

Returns the integer division of two unsigned integers. Reverts on division by zero. The result is rounded towards zero.

Defined in

assembly/libraries/SafeMath.ts:161


mod

mod(a, b): u256

Parameters

NameType
au256
bu256

Returns

u256

Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), Reverts with custom message when dividing by zero.

Defined in

assembly/libraries/SafeMath.ts:175


mul

mul(a, b): u256

Parameters

NameType
au256
bu256

Returns

u256

Returns the multiplication of two unsigned integers, reverting on overflow.

Defined in

assembly/libraries/SafeMath.ts:143


sub

sub(a, b): u256

Parameters

NameType
au256
bu256

Returns

u256

Returns the integer division of two unsigned integers. Reverts with custom message on division by zero. The result is rounded towards zero.

Defined in

assembly/libraries/SafeMath.ts:129