Skip to main content
Arithmetic (@tevm/voltaire/evm) implements the 11 EVM integer arithmetic opcodes (0x01-0x0b). All values are 256-bit unsigned bigints; ADD, MUL, and SUB wrap modulo 2^256, while DIV, SDIV, MOD, SMOD, ADDMOD, and MULMOD return 0n when the divisor or modulus is 0n.

Opcode Table

Usage

Each handler takes frame: BrandedFrame, mutates stack, gasRemaining, and pc, and returns EvmError | null. The same 11 operations are also bound directly as methods on frame (frame.add(), frame.mul(), etc.).