Expand description
EVM opcode definitions and utilities.
Modules§
Structs§
- OpCode
- An EVM opcode.
- OpCode
Error - An error indicating that an opcode is invalid.
- OpCode
Info - Information about opcode, such as name, and stack inputs and outputs.
Enums§
- Instruction
Tables - Either a plain, static instruction table, or a boxed, dynamic instruction table.
Constants§
- ADD
- The
0x01
(“ADD”) opcode. - ADDMOD
- The
0x08
(“ADDMOD”) opcode. - ADDRESS
- The
0x30
(“ADDRESS”) opcode. - AND
- The
0x16
(“AND”) opcode. - BALANCE
- The
0x31
(“BALANCE”) opcode. - BASEFEE
- The
0x48
(“BASEFEE”) opcode. - BLOBBASEFEE
- The
0x4A
(“BLOBBASEFEE”) opcode. - BLOBHASH
- The
0x49
(“BLOBHASH”) opcode. - BLOCKHASH
- The
0x40
(“BLOCKHASH”) opcode. - BYTE
- The
0x1A
(“BYTE”) opcode. - CALL
- The
0xF1
(“CALL”) opcode. - CALLCODE
- The
0xF2
(“CALLCODE”) opcode. - CALLDATACOPY
- The
0x37
(“CALLDATACOPY”) opcode. - CALLDATALOAD
- The
0x35
(“CALLDATALOAD”) opcode. - CALLDATASIZE
- The
0x36
(“CALLDATASIZE”) opcode. - CALLER
- The
0x33
(“CALLER”) opcode. - CALLF
- The
0xE3
(“CALLF”) opcode. - CALLVALUE
- The
0x34
(“CALLVALUE”) opcode. - CHAINID
- The
0x46
(“CHAINID”) opcode. - CODECOPY
- The
0x39
(“CODECOPY”) opcode. - CODESIZE
- The
0x38
(“CODESIZE”) opcode. - COINBASE
- The
0x41
(“COINBASE”) opcode. - CREATE
- The
0xF0
(“CREATE”) opcode. - CREATE2
- The
0xF5
(“CREATE2”) opcode. - DATACOPY
- The
0xD3
(“DATACOPY”) opcode. - DATALOAD
- The
0xD0
(“DATALOAD”) opcode. - DATALOADN
- The
0xD1
(“DATALOADN”) opcode. - DATASIZE
- The
0xD2
(“DATASIZE”) opcode. - DELEGATECALL
- The
0xF4
(“DELEGATECALL”) opcode. - DIFFICULTY
- The
0x44
(“DIFFICULTY”) opcode. - DIV
- The
0x04
(“DIV”) opcode. - DUP1
- The
0x80
(“DUP1”) opcode. - DUP2
- The
0x81
(“DUP2”) opcode. - DUP3
- The
0x82
(“DUP3”) opcode. - DUP4
- The
0x83
(“DUP4”) opcode. - DUP5
- The
0x84
(“DUP5”) opcode. - DUP6
- The
0x85
(“DUP6”) opcode. - DUP7
- The
0x86
(“DUP7”) opcode. - DUP8
- The
0x87
(“DUP8”) opcode. - DUP9
- The
0x88
(“DUP9”) opcode. - DUP10
- The
0x89
(“DUP10”) opcode. - DUP11
- The
0x8A
(“DUP11”) opcode. - DUP12
- The
0x8B
(“DUP12”) opcode. - DUP13
- The
0x8C
(“DUP13”) opcode. - DUP14
- The
0x8D
(“DUP14”) opcode. - DUP15
- The
0x8E
(“DUP15”) opcode. - DUP16
- The
0x8F
(“DUP16”) opcode. - DUPN
- The
0xE6
(“DUPN”) opcode. - EOFCREATE
- The
0xEC
(“EOFCREATE”) opcode. - EQ
- The
0x14
(“EQ”) opcode. - EXCHANGE
- The
0xE8
(“EXCHANGE”) opcode. - EXP
- The
0x0A
(“EXP”) opcode. - EXTCALL
- The
0xF8
(“EXTCALL”) opcode. - EXTCODECOPY
- The
0x3C
(“EXTCODECOPY”) opcode. - EXTCODEHASH
- The
0x3F
(“EXTCODEHASH”) opcode. - EXTCODESIZE
- The
0x3B
(“EXTCODESIZE”) opcode. - EXTDELEGATECALL
- The
0xF9
(“EXTDELEGATECALL”) opcode. - EXTSTATICCALL
- The
0xFB
(“EXTSTATICCALL”) opcode. - GAS
- The
0x5A
(“GAS”) opcode. - GASLIMIT
- The
0x45
(“GASLIMIT”) opcode. - GASPRICE
- The
0x3A
(“GASPRICE”) opcode. - GT
- The
0x11
(“GT”) opcode. - INVALID
- The
0xFE
(“INVALID”) opcode. - ISZERO
- The
0x15
(“ISZERO”) opcode. - JUMP
- The
0x56
(“JUMP”) opcode. - JUMPDEST
- The
0x5B
(“JUMPDEST”) opcode. - JUMPF
- The
0xE5
(“JUMPF”) opcode. - JUMPI
- The
0x57
(“JUMPI”) opcode. - KECCA
K256 - The
0x20
(“KECCAK256”) opcode. - LOG0
- The
0xA0
(“LOG0”) opcode. - LOG1
- The
0xA1
(“LOG1”) opcode. - LOG2
- The
0xA2
(“LOG2”) opcode. - LOG3
- The
0xA3
(“LOG3”) opcode. - LOG4
- The
0xA4
(“LOG4”) opcode. - LT
- The
0x10
(“LT”) opcode. - MCOPY
- The
0x5E
(“MCOPY”) opcode. - MLOAD
- The
0x51
(“MLOAD”) opcode. - MOD
- The
0x06
(“MOD”) opcode. - MSIZE
- The
0x59
(“MSIZE”) opcode. - MSTORE
- The
0x52
(“MSTORE”) opcode. - MSTORE8
- The
0x53
(“MSTORE8”) opcode. - MUL
- The
0x02
(“MUL”) opcode. - MULMOD
- The
0x09
(“MULMOD”) opcode. - NOP
- Alias for the
JUMPDEST
opcode. - NOT
- The
0x19
(“NOT”) opcode. - NUMBER
- The
0x43
(“NUMBER”) opcode. - OPCODE_
INFO_ JUMPTABLE - Maps each opcode to its info.
- OR
- The
0x17
(“OR”) opcode. - ORIGIN
- The
0x32
(“ORIGIN”) opcode. - PC
- The
0x58
(“PC”) opcode. - POP
- The
0x50
(“POP”) opcode. - PUSH0
- The
0x5F
(“PUSH0”) opcode. - PUSH1
- The
0x60
(“PUSH1”) opcode. - PUSH2
- The
0x61
(“PUSH2”) opcode. - PUSH3
- The
0x62
(“PUSH3”) opcode. - PUSH4
- The
0x63
(“PUSH4”) opcode. - PUSH5
- The
0x64
(“PUSH5”) opcode. - PUSH6
- The
0x65
(“PUSH6”) opcode. - PUSH7
- The
0x66
(“PUSH7”) opcode. - PUSH8
- The
0x67
(“PUSH8”) opcode. - PUSH9
- The
0x68
(“PUSH9”) opcode. - PUSH10
- The
0x69
(“PUSH10”) opcode. - PUSH11
- The
0x6A
(“PUSH11”) opcode. - PUSH12
- The
0x6B
(“PUSH12”) opcode. - PUSH13
- The
0x6C
(“PUSH13”) opcode. - PUSH14
- The
0x6D
(“PUSH14”) opcode. - PUSH15
- The
0x6E
(“PUSH15”) opcode. - PUSH16
- The
0x6F
(“PUSH16”) opcode. - PUSH17
- The
0x70
(“PUSH17”) opcode. - PUSH18
- The
0x71
(“PUSH18”) opcode. - PUSH19
- The
0x72
(“PUSH19”) opcode. - PUSH20
- The
0x73
(“PUSH20”) opcode. - PUSH21
- The
0x74
(“PUSH21”) opcode. - PUSH22
- The
0x75
(“PUSH22”) opcode. - PUSH23
- The
0x76
(“PUSH23”) opcode. - PUSH24
- The
0x77
(“PUSH24”) opcode. - PUSH25
- The
0x78
(“PUSH25”) opcode. - PUSH26
- The
0x79
(“PUSH26”) opcode. - PUSH27
- The
0x7A
(“PUSH27”) opcode. - PUSH28
- The
0x7B
(“PUSH28”) opcode. - PUSH29
- The
0x7C
(“PUSH29”) opcode. - PUSH30
- The
0x7D
(“PUSH30”) opcode. - PUSH31
- The
0x7E
(“PUSH31”) opcode. - PUSH32
- The
0x7F
(“PUSH32”) opcode. - RETF
- The
0xE4
(“RETF”) opcode. - RETURN
- The
0xF3
(“RETURN”) opcode. - RETURNCONTRACT
- The
0xEE
(“RETURNCONTRACT”) opcode. - RETURNDATACOPY
- The
0x3E
(“RETURNDATACOPY”) opcode. - RETURNDATALOAD
- The
0xF7
(“RETURNDATALOAD”) opcode. - RETURNDATASIZE
- The
0x3D
(“RETURNDATASIZE”) opcode. - REVERT
- The
0xFD
(“REVERT”) opcode. - RJUMP
- The
0xE0
(“RJUMP”) opcode. - RJUMPI
- The
0xE1
(“RJUMPI”) opcode. - RJUMPV
- The
0xE2
(“RJUMPV”) opcode. - SAR
- The
0x1D
(“SAR”) opcode. - SDIV
- The
0x05
(“SDIV”) opcode. - SELFBALANCE
- The
0x47
(“SELFBALANCE”) opcode. - SELFDESTRUCT
- The
0xFF
(“SELFDESTRUCT”) opcode. - SGT
- The
0x13
(“SGT”) opcode. - SHL
- The
0x1B
(“SHL”) opcode. - SHR
- The
0x1C
(“SHR”) opcode. - SIGNEXTEND
- The
0x0B
(“SIGNEXTEND”) opcode. - SLOAD
- The
0x54
(“SLOAD”) opcode. - SLT
- The
0x12
(“SLT”) opcode. - SMOD
- The
0x07
(“SMOD”) opcode. - SSTORE
- The
0x55
(“SSTORE”) opcode. - STATICCALL
- The
0xFA
(“STATICCALL”) opcode. - STOP
- The
0x00
(“STOP”) opcode. - SUB
- The
0x03
(“SUB”) opcode. - SWAP1
- The
0x90
(“SWAP1”) opcode. - SWAP2
- The
0x91
(“SWAP2”) opcode. - SWAP3
- The
0x92
(“SWAP3”) opcode. - SWAP4
- The
0x93
(“SWAP4”) opcode. - SWAP5
- The
0x94
(“SWAP5”) opcode. - SWAP6
- The
0x95
(“SWAP6”) opcode. - SWAP7
- The
0x96
(“SWAP7”) opcode. - SWAP8
- The
0x97
(“SWAP8”) opcode. - SWAP9
- The
0x98
(“SWAP9”) opcode. - SWAP10
- The
0x99
(“SWAP10”) opcode. - SWAP11
- The
0x9A
(“SWAP11”) opcode. - SWAP12
- The
0x9B
(“SWAP12”) opcode. - SWAP13
- The
0x9C
(“SWAP13”) opcode. - SWAP14
- The
0x9D
(“SWAP14”) opcode. - SWAP15
- The
0x9E
(“SWAP15”) opcode. - SWAP16
- The
0x9F
(“SWAP16”) opcode. - SWAPN
- The
0xE7
(“SWAPN”) opcode. - TIMESTAMP
- The
0x42
(“TIMESTAMP”) opcode. - TLOAD
- The
0x5C
(“TLOAD”) opcode. - TSTORE
- The
0x5D
(“TSTORE”) opcode. - XOR
- The
0x18
(“XOR”) opcode.
Functions§
- immediate_
size - Sets the immediate bytes number.
- instruction
- Returns the instruction function for the given opcode and spec.
- make_
boxed_ instruction_ table - Make boxed instruction table that calls
f
closure for every instruction. - make_
instruction_ table - Make instruction table.
- not_eof
- Sets the EOF flag to false.
- stack_
io - Sets the number of stack inputs and outputs.
- terminating
- Sets the terminating flag to true.
- update_
boxed_ instruction - Updates a boxed instruction with a new one.
Type Aliases§
- Boxed
Instruction - EVM boxed dynamic opcode function signature.
- Boxed
Instruction Table - A table of boxed instructions.
- DynInstruction
- EVM dynamic opcode function signature.
- Instruction
- EVM opcode function signature.
- Instruction
Table - Instruction table is list of instruction function pointers mapped to 256 EVM opcodes.