Skip to main content
@tevm/voltaire
@tevm/voltaire / evm / Arithmetic

Arithmetic

Functions

add()

add(frame): EvmError | null
Defined in: src/evm/arithmetic/0x01_ADD.js:7 ADD opcode (0x01) - Addition with overflow wrapping

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

addmod()

addmod(frame): EvmError | null
Defined in: src/evm/arithmetic/0x08_ADDMOD.js:7 ADDMOD opcode (0x08) - Addition modulo n (mod by zero returns 0)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

div()

div(frame): EvmError | null
Defined in: src/evm/arithmetic/0x04_DIV.js:7 DIV opcode (0x04) - Integer division (division by zero returns 0)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

exp()

exp(frame): EvmError | null
Defined in: src/evm/arithmetic/0x0a_EXP.js:7 EXP opcode (0x0a) - Exponential operation

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

mod()

mod(frame): EvmError | null
Defined in: src/evm/arithmetic/0x06_MOD.js:7 MOD opcode (0x06) - Modulo operation (mod by zero returns 0)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

mul()

mul(frame): EvmError | null
Defined in: src/evm/arithmetic/0x02_MUL.js:7 MUL opcode (0x02) - Multiplication with overflow wrapping

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

mulmod()

mulmod(frame): EvmError | null
Defined in: src/evm/arithmetic/0x09_MULMOD.js:7 MULMOD opcode (0x09) - Multiplication modulo n (mod by zero returns 0)

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

sdiv()

sdiv(frame): EvmError | null
Defined in: src/evm/arithmetic/0x05_SDIV.js:7 SDIV opcode (0x05) - Signed integer division

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

signextend()

signextend(frame): EvmError | null
Defined in: src/evm/arithmetic/0x0b_SIGNEXTEND.js:7 SIGNEXTEND opcode (0x0b) - Sign extension

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

smod()

smod(frame): EvmError | null
Defined in: src/evm/arithmetic/0x07_SMOD.js:7 SMOD opcode (0x07) - Signed modulo operation

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any

sub()

sub(frame): EvmError | null
Defined in: src/evm/arithmetic/0x03_SUB.js:7 SUB opcode (0x03) - Subtraction with underflow wrapping

Parameters

frame
BrandedFrame Frame instance

Returns

EvmError | null Error if any