#[repr(u8)]pub enum Opcode {
Show 144 variants
STOP = 0,
ADD = 1,
MUL = 2,
SUB = 3,
DIV = 4,
SDIV = 5,
MOD = 6,
SMOD = 7,
ADDMOD = 8,
MULMOD = 9,
EXP = 10,
SIGNEXTEND = 11,
LT = 16,
GT = 17,
SLT = 18,
SGT = 19,
EQ = 20,
ISZERO = 21,
AND = 22,
OR = 23,
XOR = 24,
NOT = 25,
BYTE = 26,
SHL = 27,
SHR = 28,
SAR = 29,
SHA3 = 32,
ADDRESS = 48,
BALANCE = 49,
ORIGIN = 50,
CALLER = 51,
CALLVALUE = 52,
CALLDATALOAD = 53,
CALLDATASIZE = 54,
CALLDATACOPY = 55,
CODESIZE = 56,
CODECOPY = 57,
GASPRICE = 58,
EXTCODESIZE = 59,
EXTCODECOPY = 60,
RETURNDATASIZE = 61,
RETURNDATACOPY = 62,
EXTCODEHASH = 63,
BLOCKHASH = 64,
COINBASE = 65,
TIMESTAMP = 66,
NUMBER = 67,
DIFFICULTY = 68,
GASLIMIT = 69,
CHAINID = 70,
SELFBALANCE = 71,
BASEFEE = 72,
POP = 80,
MLOAD = 81,
MSTORE = 82,
MSTORE8 = 83,
SLOAD = 84,
SSTORE = 85,
JUMP = 86,
JUMPI = 87,
PC = 88,
MSIZE = 89,
GAS = 90,
JUMPDEST = 91,
PUSH0 = 95,
PUSH1 = 96,
PUSH2 = 97,
PUSH3 = 98,
PUSH4 = 99,
PUSH5 = 100,
PUSH6 = 101,
PUSH7 = 102,
PUSH8 = 103,
PUSH9 = 104,
PUSH10 = 105,
PUSH11 = 106,
PUSH12 = 107,
PUSH13 = 108,
PUSH14 = 109,
PUSH15 = 110,
PUSH16 = 111,
PUSH17 = 112,
PUSH18 = 113,
PUSH19 = 114,
PUSH20 = 115,
PUSH21 = 116,
PUSH22 = 117,
PUSH23 = 118,
PUSH24 = 119,
PUSH25 = 120,
PUSH26 = 121,
PUSH27 = 122,
PUSH28 = 123,
PUSH29 = 124,
PUSH30 = 125,
PUSH31 = 126,
PUSH32 = 127,
DUP1 = 128,
DUP2 = 129,
DUP3 = 130,
DUP4 = 131,
DUP5 = 132,
DUP6 = 133,
DUP7 = 134,
DUP8 = 135,
DUP9 = 136,
DUP10 = 137,
DUP11 = 138,
DUP12 = 139,
DUP13 = 140,
DUP14 = 141,
DUP15 = 142,
DUP16 = 143,
SWAP1 = 144,
SWAP2 = 145,
SWAP3 = 146,
SWAP4 = 147,
SWAP5 = 148,
SWAP6 = 149,
SWAP7 = 150,
SWAP8 = 151,
SWAP9 = 152,
SWAP10 = 153,
SWAP11 = 154,
SWAP12 = 155,
SWAP13 = 156,
SWAP14 = 157,
SWAP15 = 158,
SWAP16 = 159,
LOG0 = 160,
LOG1 = 161,
LOG2 = 162,
LOG3 = 163,
LOG4 = 164,
CREATE = 240,
CALL = 241,
CALLCODE = 242,
RETURN = 243,
DELEGATECALL = 244,
CREATE2 = 245,
STATICCALL = 250,
REVERT = 253,
INVALID = 254,
SELFDESTRUCT = 255,
}
Expand description
An EVM Opcode.
Variants§
STOP = 0
Opcode 0x0 - Halts execution
ADD = 1
Opcode 0x1 - Addition operation
MUL = 2
Opcode 0x2 - Multiplication operation
SUB = 3
Opcode 0x3 - Subtraction operation
DIV = 4
Opcode 0x4 - Integer division operation
SDIV = 5
Opcode 0x5 - Signed integer division operation (truncated)
MOD = 6
Opcode 0x6 - Modulo remainder operation
SMOD = 7
Opcode 0x7 - Signed modulo remainder operation
ADDMOD = 8
Opcode 0x8 - Modulo addition operation
MULMOD = 9
Opcode 0x9 - Modulo multiplication operation
EXP = 10
Opcode 0xA - Exponential operation
SIGNEXTEND = 11
Opcode 0xB - Extend length of two’s complement signed integer
LT = 16
Opcode 0x10 - Less-than comparison
GT = 17
Opcode 0x11 - Greater-than comparison
SLT = 18
Opcode 0x12 - Signed less-than comparison
SGT = 19
Opcode 0x13 - Signed greater-than comparison
EQ = 20
Opcode 0x14 - Equality comparison
ISZERO = 21
Opcode 0x15 - Simple not operator
AND = 22
Opcode 0x16 - Bitwise AND operation
OR = 23
Opcode 0x17 - Bitwise OR operation
XOR = 24
Opcode 0x18 - Bitwise XOR operation
NOT = 25
Opcode 0x19 - Bitwise NOT operation
BYTE = 26
Opcode 0x1A - Retrieve single byte from word
SHL = 27
Opcode 0x1B - Left shift operation
SHR = 28
Opcode 0x1C - Logical right shift operation
SAR = 29
Opcode 0x1D - Arithmetic (signed) right shift operation
SHA3 = 32
Opcode 0x20 - Compute Keccak-256 hash
ADDRESS = 48
Opcode 0x30 - Get address of currently executing account
BALANCE = 49
Opcode 0x31 - Get address of currently executing account
ORIGIN = 50
Opcode 0x32 - Get execution origination address
CALLER = 51
Opcode 0x33 - Get caller address
CALLVALUE = 52
Opcode 0x34 - Get deposited value by the instruction/transaction responsible for this execution
CALLDATALOAD = 53
Opcode 0x35 - Get input data of current environment
CALLDATASIZE = 54
Opcode 0x36 - Get size of input data in current environment
CALLDATACOPY = 55
Opcode 0x37 - Copy input data in current environment to memory
CODESIZE = 56
Opcode 0x38 - Get size of code running in current environment
CODECOPY = 57
Opcode 0x39 - Copy code running in current environment to memory
GASPRICE = 58
Opcode 0x3A - Get price of gas in current environment
EXTCODESIZE = 59
Opcode 0x3B - Get size of an account’s code
EXTCODECOPY = 60
Opcode 0x3C - Copy an account’s code to memory
RETURNDATASIZE = 61
Opcode 0x3D - Get size of output data from the previous call from the current environment
RETURNDATACOPY = 62
Opcode 0x3E - Copy output data from the previous call to memory
EXTCODEHASH = 63
Opcode 0x3F - Get hash of an account’s code
BLOCKHASH = 64
Opcode 0x40 - Get the hash of one of the 256 most recent complete blocks
COINBASE = 65
Opcode 0x41 - Get the block’s beneficiary address
TIMESTAMP = 66
Opcode 0x42 - Get the block’s timestamp
NUMBER = 67
Opcode 0x43 - Get the block’s number
DIFFICULTY = 68
Opcode 0x44 - Get the block’s difficulty
GASLIMIT = 69
Opcode 0x45 - Get the block’s gas limit
CHAINID = 70
Opcode 0x46 - Get the chain ID
SELFBALANCE = 71
Opcode 0x47 - Get balance of currently executing account
BASEFEE = 72
Opcode 0x48 - Get the base fee
POP = 80
Opcode 0x50 - Remove item from stack
MLOAD = 81
Opcode 0x51 - Load word from memory
MSTORE = 82
Opcode 0x52 - Save word to memory
MSTORE8 = 83
Opcode 0x53 - Save byte to memory
SLOAD = 84
Opcode 0x54 - Load word from storage
SSTORE = 85
Opcode 0x55 - Save word to storage
JUMP = 86
Opcode 0x56 - Alter the program counter
JUMPI = 87
Opcode 0x57 - Conditionally alter the program counter
PC = 88
Opcode 0x58 - Get the value of the program counter prior to the increment corresponding to this instruction
MSIZE = 89
Opcode 0x59 - Get the size of active memory in bytes
GAS = 90
Opcode 0x5A - Get the amount of available gas, including the corresponding reduction for the cost of this instruction
JUMPDEST = 91
Opcode 0x5B - Mark a valid destination for jumps
PUSH0 = 95
Opcode 0x5F - Place the constant value 0 on stack
PUSH1 = 96
Opcode 0x60 - Place 1 byte item on stack
PUSH2 = 97
Opcode 0x61 - Place 2 byte item on stack
PUSH3 = 98
Opcode 0x62 - Place 3 byte item on stack
PUSH4 = 99
Opcode 0x63 - Place 4 byte item on stack
PUSH5 = 100
Opcode 0x64 - Place 5 byte item on stack
PUSH6 = 101
Opcode 0x65 - Place 6 byte item on stack
PUSH7 = 102
Opcode 0x66 - Place 7 byte item on stack
PUSH8 = 103
Opcode 0x67 - Place 8 byte item on stack
PUSH9 = 104
Opcode 0x68 - Place 9 byte item on stack
PUSH10 = 105
Opcode 0x69 - Place 10 byte item on stack
PUSH11 = 106
Opcode 0x6A - Place 11 byte item on stack
PUSH12 = 107
Opcode 0x6B - Place 12 byte item on stack
PUSH13 = 108
Opcode 0x6C - Place 13 byte item on stack
PUSH14 = 109
Opcode 0x6D - Place 14 byte item on stack
PUSH15 = 110
Opcode 0x6E - Place 15 byte item on stack
PUSH16 = 111
Opcode 0x6F - Place 16 byte item on stack
PUSH17 = 112
Opcode 0x70 - Place 17 byte item on stack
PUSH18 = 113
Opcode 0x71 - Place 18 byte item on stack
PUSH19 = 114
Opcode 0x72 - Place 19 byte item on stack
PUSH20 = 115
Opcode 0x73 - Place 20 byte item on stack
PUSH21 = 116
Opcode 0x74 - Place 21 byte item on stack
PUSH22 = 117
Opcode 0x75 - Place 22 byte item on stack
PUSH23 = 118
Opcode 0x76 - Place 23 byte item on stack
PUSH24 = 119
Opcode 0x77 - Place 24 byte item on stack
PUSH25 = 120
Opcode 0x78 - Place 25 byte item on stack
PUSH26 = 121
Opcode 0x79 - Place 26 byte item on stack
PUSH27 = 122
Opcode 0x7A - Place 27 byte item on stack
PUSH28 = 123
Opcode 0x7B - Place 28 byte item on stack
PUSH29 = 124
Opcode 0x7C - Place 29 byte item on stack
PUSH30 = 125
Opcode 0x7D - Place 30 byte item on stack
PUSH31 = 126
Opcode 0x7E - Place 31 byte item on stack
PUSH32 = 127
Opcode 0x7F - Place 32 byte item on stack
DUP1 = 128
Opcode 0x80 - Duplicate 1st stack item
DUP2 = 129
Opcode 0x81 - Duplicate 2nd stack item
DUP3 = 130
Opcode 0x82 - Duplicate 3rd stack item
DUP4 = 131
Opcode 0x83 - Duplicate 4th stack item
DUP5 = 132
Opcode 0x84 - Duplicate 5th stack item
DUP6 = 133
Opcode 0x85 - Duplicate 6th stack item
DUP7 = 134
Opcode 0x86 - Duplicate 7th stack item
DUP8 = 135
Opcode 0x87 - Duplicate 8th stack item
DUP9 = 136
Opcode 0x88 - Duplicate 9th stack item
DUP10 = 137
Opcode 0x89 - Duplicate 10th stack item
DUP11 = 138
Opcode 0x8A - Duplicate 11th stack item
DUP12 = 139
Opcode 0x8B - Duplicate 12th stack item
DUP13 = 140
Opcode 0x8C - Duplicate 13th stack item
DUP14 = 141
Opcode 0x8D - Duplicate 14th stack item
DUP15 = 142
Opcode 0x8E - Duplicate 15th stack item
DUP16 = 143
Opcode 0x8F - Duplicate 16th stack item
SWAP1 = 144
Opcode 0x90 - Exchange 1st and 2nd stack items
SWAP2 = 145
Opcode 0x91 - Exchange 1st and 3rd stack items
SWAP3 = 146
Opcode 0x92 - Exchange 1st and 4th stack items
SWAP4 = 147
Opcode 0x93 - Exchange 1st and 5th stack items
SWAP5 = 148
Opcode 0x94 - Exchange 1st and 6th stack items
SWAP6 = 149
Opcode 0x95 - Exchange 1st and 7th stack items
SWAP7 = 150
Opcode 0x96 - Exchange 1st and 8th stack items
SWAP8 = 151
Opcode 0x97 - Exchange 1st and 9th stack items
SWAP9 = 152
Opcode 0x98 - Exchange 1st and 10th stack items
SWAP10 = 153
Opcode 0x99 - Exchange 1st and 11th stack items
SWAP11 = 154
Opcode 0x9A - Exchange 1st and 12th stack items
SWAP12 = 155
Opcode 0x9B - Exchange 1st and 13th stack items
SWAP13 = 156
Opcode 0x9C - Exchange 1st and 14th stack items
SWAP14 = 157
Opcode 0x9D - Exchange 1st and 15th stack items
SWAP15 = 158
Opcode 0x9E - Exchange 1st and 16th stack items
SWAP16 = 159
Opcode 0x9F - Exchange 1st and 17th stack items
LOG0 = 160
Opcode 0xA0 - Append log record with one topic
LOG1 = 161
Opcode 0xA1 - Append log record with two topics
LOG2 = 162
Opcode 0xA2 - Append log record with three topics
LOG3 = 163
Opcode 0xA3 - Append log record with four topics
LOG4 = 164
Opcode 0xA4 - Append log record with five topics
CREATE = 240
Opcode 0xF0 - Create a new account with associated code
CALL = 241
Opcode 0xF1 - Message-call into an account
CALLCODE = 242
Opcode 0xF2 - Message-call into this account with alternative account’s code
RETURN = 243
Opcode 0xF3 - Halt execution returning output data
DELEGATECALL = 244
Opcode 0xF4 - Message-call into this account with an alternative account’s code, but persisting the current values for sender and value
CREATE2 = 245
Opcode 0xF5 - Create a new account with associated code at a predictable address
STATICCALL = 250
Opcode 0xFA - Static message-call into an account
REVERT = 253
Opcode 0xFD - Halt execution reverting state changes but returning data and remaining gas
INVALID = 254
Opcode 0xFE - Designated invalid instruction
SELFDESTRUCT = 255
Opcode 0xFF - Halt execution and register account for later deletion