diff --git a/learn_evm/evm_opcodes.md b/learn_evm/evm_opcodes.md index 9034ff76..5d77e421 100644 --- a/learn_evm/evm_opcodes.md +++ b/learn_evm/evm_opcodes.md @@ -10,150 +10,150 @@ The gas information is a work in progress. If an asterisk is in the Gas column, ## Table -| Opcode | Name | Description | Extra Info | Gas | -| ------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ----------- | -| [`0x00`](#stop) | STOP | Halts execution | - | 0 | -| [`0x01`](#add) | ADD | Addition operation | - | 3 | -| [`0x02`](#mul) | MUL | Multiplication operation | - | 5 | -| [`0x03`](#sub) | SUB | Subtraction operation | - | 3 | -| [`0x04`](#div) | DIV | Integer division operation | - | 5 | -| [`0x05`](#sdiv) | SDIV | Signed integer division operation (truncated) | - | 5 | -| [`0x06`](#mod) | MOD | Modulo remainder operation | - | 5 | -| [`0x07`](#smod) | SMOD | Signed modulo remainder operation | - | 5 | -| [`0x08`](#addmod) | ADDMOD | Modulo addition operation | - | 8 | -| [`0x09`](#mulmod) | MULMOD | Modulo multiplication operation | - | 8 | -| [`0x0a`](#exp) | EXP | Exponential operation | - | 10\* | -| [`0x0b`](#signextend) | SIGNEXTEND | Extend length of two's complement signed integer | - | 5 | +| Opcode | Name | Description | Extra Info | Gas | +| ------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ------------ | +| [`0x00`](#stop) | STOP | Halts execution | - | 0 | +| [`0x01`](#add) | ADD | Addition operation | - | 3 | +| [`0x02`](#mul) | MUL | Multiplication operation | - | 5 | +| [`0x03`](#sub) | SUB | Subtraction operation | - | 3 | +| [`0x04`](#div) | DIV | Integer division operation | - | 5 | +| [`0x05`](#sdiv) | SDIV | Signed integer division operation (truncated) | - | 5 | +| [`0x06`](#mod) | MOD | Modulo remainder operation | - | 5 | +| [`0x07`](#smod) | SMOD | Signed modulo remainder operation | - | 5 | +| [`0x08`](#addmod) | ADDMOD | Modulo addition operation | - | 8 | +| [`0x09`](#mulmod) | MULMOD | Modulo multiplication operation | - | 8 | +| [`0x0a`](#exp) | EXP | Exponential operation | - | 10\* | +| [`0x0b`](#signextend) | SIGNEXTEND | Extend length of two's complement signed integer | - | 5 | | `0x0c` - `0x0f` | Unused | Unused | - | -| [`0x10`](#lt) | LT | Less-than comparison | - | 3 | -| [`0x11`](#gt) | GT | Greater-than comparison | - | 3 | -| [`0x12`](#slt) | SLT | Signed less-than comparison | - | 3 | -| [`0x13`](#sgt) | SGT | Signed greater-than comparison | - | 3 | -| [`0x14`](#eq) | EQ | Equality comparison | - | 3 | -| [`0x15`](#iszero) | ISZERO | Simple not operator | - | 3 | -| [`0x16`](#and) | AND | Bitwise AND operation | - | 3 | -| [`0x17`](#or) | OR | Bitwise OR operation | - | 3 | -| [`0x18`](#xor) | XOR | Bitwise XOR operation | - | 3 | -| [`0x19`](#not) | NOT | Bitwise NOT operation | - | 3 | -| [`0x1a`](#byte) | BYTE | Retrieve single byte from word | - | 3 | -| [`0x1b`](#shl) | SHL | Shift Left | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | -| [`0x1c`](#shr) | SHR | Logical Shift Right | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | -| [`0x1d`](#sar) | SAR | Arithmetic Shift Right | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | -| [`0x20`](#keccak256) | KECCAK256 | Compute Keccak-256 hash | - | 30\* | +| [`0x10`](#lt) | LT | Less-than comparison | - | 3 | +| [`0x11`](#gt) | GT | Greater-than comparison | - | 3 | +| [`0x12`](#slt) | SLT | Signed less-than comparison | - | 3 | +| [`0x13`](#sgt) | SGT | Signed greater-than comparison | - | 3 | +| [`0x14`](#eq) | EQ | Equality comparison | - | 3 | +| [`0x15`](#iszero) | ISZERO | Simple not operator | - | 3 | +| [`0x16`](#and) | AND | Bitwise AND operation | - | 3 | +| [`0x17`](#or) | OR | Bitwise OR operation | - | 3 | +| [`0x18`](#xor) | XOR | Bitwise XOR operation | - | 3 | +| [`0x19`](#not) | NOT | Bitwise NOT operation | - | 3 | +| [`0x1a`](#byte) | BYTE | Retrieve single byte from word | - | 3 | +| [`0x1b`](#shl) | SHL | Shift Left | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | +| [`0x1c`](#shr) | SHR | Logical Shift Right | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | +| [`0x1d`](#sar) | SAR | Arithmetic Shift Right | [EIP145](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-145.md) | 3 | +| [`0x20`](#keccak256) | KECCAK256 | Compute Keccak-256 hash | - | 30\* | | `0x21` - `0x2f` | Unused | Unused | -| [`0x30`](#address) | ADDRESS | Get address of currently executing account | - | 2 | -| [`0x31`](#balance) | BALANCE | Get balance of the given account | - | 700 | -| [`0x32`](#origin) | ORIGIN | Get execution origination address | - | 2 | -| [`0x33`](#caller) | CALLER | Get caller address | - | 2 | -| [`0x34`](#callvalue) | CALLVALUE | Get deposited value by the instruction/transaction responsible for this execution | - | 2 | -| [`0x35`](#calldataload) | CALLDATALOAD | Get input data of current environment | - | 3 | -| [`0x36`](#calldatasize) | CALLDATASIZE | Get size of input data in current environment | - | 2\* | -| [`0x37`](#calldatacopy) | CALLDATACOPY | Copy input data in current environment to memory | - | 3 | -| [`0x38`](#codesize) | CODESIZE | Get size of code running in current environment | - | 2 | -| [`0x39`](#codecopy) | CODECOPY | Copy code running in current environment to memory | - | 3\* | -| [`0x3a`](#gasprice) | GASPRICE | Get price of gas in current environment | - | 2 | -| [`0x3b`](#extcodesize) | EXTCODESIZE | Get size of an account's code | - | 700 | -| [`0x3c`](#extcodecopy) | EXTCODECOPY | Copy an account's code to memory | - | 700\* | -| [`0x3d`](#returndatasize) | RETURNDATASIZE | Pushes the size of the return data buffer onto the stack | [EIP 211](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-211.md) | 2 | -| [`0x3e`](#returndatacopy) | RETURNDATACOPY | Copies data from the return data buffer to memory | [EIP 211](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-211.md) | 3 | -| [`0x3f`](#extcodehash) | EXTCODEHASH | Returns the keccak256 hash of a contract's code | [EIP 1052](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1052.md) | 700 | -| [`0x40`](#blockhash) | BLOCKHASH | Get the hash of one of the 256 most recent complete blocks | - | 20 | -| [`0x41`](#coinbase) | COINBASE | Get the block's beneficiary address | - | 2 | -| [`0x42`](#timestamp) | TIMESTAMP | Get the block's timestamp | - | 2 | -| [`0x43`](#number) | NUMBER | Get the block's number | - | 2 | -| [`0x44`](#difficulty) | DIFFICULTY | Get the block's difficulty | - | 2 | -| [`0x45`](#gaslimit) | GASLIMIT | Get the block's gas limit | - | 2 | -| [`0x46`](#chainid) | CHAINID | Returns the current chain’s EIP-155 unique identifier | [EIP 1344](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1344.md) | 2 | -| [`0x47`](#selfbalance) | SELFBALANCE | Returns the balance of the currently executing account | - | 5 | -| [`0x48`](#basefee) | BASEFEE | Returns the value of the base fee of the current block it is executing in. | [EIP 3198](https://eips.ethereum.org/EIPS/eip-3198) | 2 | -| [`0x49`](#blobhash) | BLOBHASH | Returns the transaction blob versioned hash at the given index, or `0` if the index is greater than the number of versioned hashes | [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) | 3 | -| [`0x4a`](#blobbasefee) | BLOBBASEFEE | Returns the value of the blob base fee of the current block it is executing in | [EIP-7516](https://eips.ethereum.org/EIPS/eip-7516) | 2 | +| [`0x30`](#address) | ADDRESS | Get address of currently executing account | - | 2 | +| [`0x31`](#balance) | BALANCE | Get balance of the given account | - | 700 | +| [`0x32`](#origin) | ORIGIN | Get execution origination address | - | 2 | +| [`0x33`](#caller) | CALLER | Get caller address | - | 2 | +| [`0x34`](#callvalue) | CALLVALUE | Get deposited value by the instruction/transaction responsible for this execution | - | 2 | +| [`0x35`](#calldataload) | CALLDATALOAD | Get input data of current environment | - | 3 | +| [`0x36`](#calldatasize) | CALLDATASIZE | Get size of input data in current environment | - | 2\* | +| [`0x37`](#calldatacopy) | CALLDATACOPY | Copy input data in current environment to memory | - | 3 | +| [`0x38`](#codesize) | CODESIZE | Get size of code running in current environment | - | 2 | +| [`0x39`](#codecopy) | CODECOPY | Copy code running in current environment to memory | - | 3\* | +| [`0x3a`](#gasprice) | GASPRICE | Get price of gas in current environment | - | 2 | +| [`0x3b`](#extcodesize) | EXTCODESIZE | Get size of an account's code | - | 700 | +| [`0x3c`](#extcodecopy) | EXTCODECOPY | Copy an account's code to memory | - | 700\* | +| [`0x3d`](#returndatasize) | RETURNDATASIZE | Pushes the size of the return data buffer onto the stack | [EIP 211](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-211.md) | 2 | +| [`0x3e`](#returndatacopy) | RETURNDATACOPY | Copies data from the return data buffer to memory | [EIP 211](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-211.md) | 3 | +| [`0x3f`](#extcodehash) | EXTCODEHASH | Returns the keccak256 hash of a contract's code | [EIP 1052](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1052.md) | 700 | +| [`0x40`](#blockhash) | BLOCKHASH | Get the hash of one of the 256 most recent complete blocks | - | 20 | +| [`0x41`](#coinbase) | COINBASE | Get the block's beneficiary address | - | 2 | +| [`0x42`](#timestamp) | TIMESTAMP | Get the block's timestamp | - | 2 | +| [`0x43`](#number) | NUMBER | Get the block's number | - | 2 | +| [`0x44`](#difficulty) | DIFFICULTY | Get the block's difficulty | - | 2 | +| [`0x45`](#gaslimit) | GASLIMIT | Get the block's gas limit | - | 2 | +| [`0x46`](#chainid) | CHAINID | Returns the current chain’s EIP-155 unique identifier | [EIP 1344](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1344.md) | 2 | +| [`0x47`](#selfbalance) | SELFBALANCE | Returns the balance of the currently executing account | - | 5 | +| [`0x48`](#basefee) | BASEFEE | Returns the value of the base fee of the current block it is executing in. | [EIP 3198](https://eips.ethereum.org/EIPS/eip-3198) | 2 | +| [`0x49`](#blobhash) | BLOBHASH | Returns the transaction blob versioned hash at the given index, or `0` if the index is greater than the number of versioned hashes | [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) | 3 | +| [`0x4a`](#blobbasefee) | BLOBBASEFEE | Returns the value of the blob base fee of the current block it is executing in | [EIP-7516](https://eips.ethereum.org/EIPS/eip-7516) | 2 | | `0x4b` - `0x4f` | Unused | - | -| [`0x50`](#pop) | POP | Remove word from stack | - | 2 | -| [`0x51`](#mload) | MLOAD | Load word from memory | - | 3\* | -| [`0x52`](#mstore) | MSTORE | Save word to memory | - | 3\* | -| [`0x53`](#mstore8) | MSTORE8 | Save byte to memory | - | 3 | -| [`0x54`](#sload) | SLOAD | Load word from storage | - | 800 | -| [`0x55`](#sstore) | SSTORE | Save word to storage | - | 20000\*\* | -| [`0x56`](#jump) | JUMP | Alter the program counter | - | 8 | -| [`0x57`](#jumpi) | JUMPI | Conditionally alter the program counter | - | 10 | -| [`0x58`](#pc) | PC | Get the value of the program counter prior to the increment | - | 2 | -| [`0x59`](#msize) | MSIZE | Get the size of active memory in bytes | - | 2 | -| [`0x5a`](#gas) | GAS | Get the amount of available gas, including the corresponding reduction for the cost of this instruction | - | 2 | -| [`0x5b`](#jumpdest) | JUMPDEST | Mark a valid destination for jumps | - | 1 | -| [`0x5c`](#tload) | TLOAD | Load word from transient storage | [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) | 100 | -| [`0x5d`](#tstore) | TSTORE | Save word to transient storage | [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) | 100 | -| [`0x5e`](#mcopy) | MCOPY | Copy memory from one area to another | [EIP-5656](https://eips.ethereum.org/EIPS/eip-5656) | 3+3\*words\*| -| [`0x5f`](#push0) | PUSH0 | Place the constant value 0 on stack | [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) | 2 | -| [`0x60`](#push1) | PUSH1 | Place 1 byte item on stack | - | 3 | -| [`0x61`](#push2) | PUSH2 | Place 2-byte item on stack | - | 3 | -| [`0x62`](#push3) | PUSH3 | Place 3-byte item on stack | - | 3 | -| [`0x63`](#push4) | PUSH4 | Place 4-byte item on stack | - | 3 | -| [`0x64`](#push5) | PUSH5 | Place 5-byte item on stack | - | 3 | -| [`0x65`](#push6) | PUSH6 | Place 6-byte item on stack | - | 3 | -| [`0x66`](#push7) | PUSH7 | Place 7-byte item on stack | - | 3 | -| [`0x67`](#push8) | PUSH8 | Place 8-byte item on stack | - | 3 | -| [`0x68`](#push9) | PUSH9 | Place 9-byte item on stack | - | 3 | -| [`0x69`](#push10) | PUSH10 | Place 10-byte item on stack | - | 3 | -| [`0x6a`](#push11) | PUSH11 | Place 11-byte item on stack | - | 3 | -| [`0x6b`](#push12) | PUSH12 | Place 12-byte item on stack | - | 3 | -| [`0x6c`](#push13) | PUSH13 | Place 13-byte item on stack | - | 3 | -| [`0x6d`](#push14) | PUSH14 | Place 14-byte item on stack | - | 3 | -| [`0x6e`](#push15) | PUSH15 | Place 15-byte item on stack | - | 3 | -| [`0x6f`](#push16) | PUSH16 | Place 16-byte item on stack | - | 3 | -| [`0x70`](#push17) | PUSH17 | Place 17-byte item on stack | - | 3 | -| [`0x71`](#push18) | PUSH18 | Place 18-byte item on stack | - | 3 | -| [`0x72`](#push19) | PUSH19 | Place 19-byte item on stack | - | 3 | -| [`0x73`](#push20) | PUSH20 | Place 20-byte item on stack | - | 3 | -| [`0x74`](#push21) | PUSH21 | Place 21-byte item on stack | - | 3 | -| [`0x75`](#push22) | PUSH22 | Place 22-byte item on stack | - | 3 | -| [`0x76`](#push23) | PUSH23 | Place 23-byte item on stack | - | 3 | -| [`0x77`](#push24) | PUSH24 | Place 24-byte item on stack | - | 3 | -| [`0x78`](#push25) | PUSH25 | Place 25-byte item on stack | - | 3 | -| [`0x79`](#push26) | PUSH26 | Place 26-byte item on stack | - | 3 | -| [`0x7a`](#push27) | PUSH27 | Place 27-byte item on stack | - | 3 | -| [`0x7b`](#push28) | PUSH28 | Place 28-byte item on stack | - | 3 | -| [`0x7c`](#push29) | PUSH29 | Place 29-byte item on stack | - | 3 | -| [`0x7d`](#push30) | PUSH30 | Place 30-byte item on stack | - | 3 | -| [`0x7e`](#push31) | PUSH31 | Place 31-byte item on stack | - | 3 | -| [`0x7f`](#push32) | PUSH32 | Place 32-byte (full word) item on stack | - | 3 | -| [`0x80`](#dup1) | DUP1 | Duplicate 1st stack item | - | 3 | -| [`0x81`](#dup2) | DUP2 | Duplicate 2nd stack item | - | 3 | -| [`0x82`](#dup3) | DUP3 | Duplicate 3rd stack item | - | 3 | -| [`0x83`](#dup4) | DUP4 | Duplicate 4th stack item | - | 3 | -| [`0x84`](#dup5) | DUP5 | Duplicate 5th stack item | - | 3 | -| [`0x85`](#dup6) | DUP6 | Duplicate 6th stack item | - | 3 | -| [`0x86`](#dup7) | DUP7 | Duplicate 7th stack item | - | 3 | -| [`0x87`](#dup8) | DUP8 | Duplicate 8th stack item | - | 3 | -| [`0x88`](#dup9) | DUP9 | Duplicate 9th stack item | - | 3 | -| [`0x89`](#dup10) | DUP10 | Duplicate 10th stack item | - | 3 | -| [`0x8a`](#dup11) | DUP11 | Duplicate 11th stack item | - | 3 | -| [`0x8b`](#dup12) | DUP12 | Duplicate 12th stack item | - | 3 | -| [`0x8c`](#dup13) | DUP13 | Duplicate 13th stack item | - | 3 | -| [`0x8d`](#dup14) | DUP14 | Duplicate 14th stack item | - | 3 | -| [`0x8e`](#dup15) | DUP15 | Duplicate 15th stack item | - | 3 | -| [`0x8f`](#dup16) | DUP16 | Duplicate 16th stack item | - | 3 | -| [`0x90`](#swap1) | SWAP1 | Exchange 1st and 2nd stack items | - | 3 | -| [`0x91`](#swap2) | SWAP2 | Exchange 1st and 3rd stack items | - | 3 | -| [`0x92`](#swap3) | SWAP3 | Exchange 1st and 4th stack items | - | 3 | -| [`0x93`](#swap4) | SWAP4 | Exchange 1st and 5th stack items | - | 3 | -| [`0x94`](#swap5) | SWAP5 | Exchange 1st and 6th stack items | - | 3 | -| [`0x95`](#swap6) | SWAP6 | Exchange 1st and 7th stack items | - | 3 | -| [`0x96`](#swap7) | SWAP7 | Exchange 1st and 8th stack items | - | 3 | -| [`0x97`](#swap8) | SWAP8 | Exchange 1st and 9th stack items | - | 3 | -| [`0x98`](#swap9) | SWAP9 | Exchange 1st and 10th stack items | - | 3 | -| [`0x99`](#swap10) | SWAP10 | Exchange 1st and 11th stack items | - | 3 | -| [`0x9a`](#swap11) | SWAP11 | Exchange 1st and 12th stack items | - | 3 | -| [`0x9b`](#swap12) | SWAP12 | Exchange 1st and 13th stack items | - | 3 | -| [`0x9c`](#swap13) | SWAP13 | Exchange 1st and 14th stack items | - | 3 | -| [`0x9d`](#swap14) | SWAP14 | Exchange 1st and 15th stack items | - | 3 | -| [`0x9e`](#swap15) | SWAP15 | Exchange 1st and 16th stack items | - | 3 | -| [`0x9f`](#swap16) | SWAP16 | Exchange 1st and 17th stack items | - | 3 | -| [`0xa0`](#log0) | LOG0 | Append log record with no topics | - | 375 | -| [`0xa1`](#log1) | LOG1 | Append log record with one topic | - | 750 | -| [`0xa2`](#log2) | LOG2 | Append log record with two topics | - | 1125 | -| [`0xa3`](#log3) | LOG3 | Append log record with three topics | - | 1500 | -| [`0xa4`](#log4) | LOG4 | Append log record with four topics | - | 1875 | +| [`0x50`](#pop) | POP | Remove word from stack | - | 2 | +| [`0x51`](#mload) | MLOAD | Load word from memory | - | 3\* | +| [`0x52`](#mstore) | MSTORE | Save word to memory | - | 3\* | +| [`0x53`](#mstore8) | MSTORE8 | Save byte to memory | - | 3 | +| [`0x54`](#sload) | SLOAD | Load word from storage | - | 800 | +| [`0x55`](#sstore) | SSTORE | Save word to storage | - | 20000\*\* | +| [`0x56`](#jump) | JUMP | Alter the program counter | - | 8 | +| [`0x57`](#jumpi) | JUMPI | Conditionally alter the program counter | - | 10 | +| [`0x58`](#pc) | PC | Get the value of the program counter prior to the increment | - | 2 | +| [`0x59`](#msize) | MSIZE | Get the size of active memory in bytes | - | 2 | +| [`0x5a`](#gas) | GAS | Get the amount of available gas, including the corresponding reduction for the cost of this instruction | - | 2 | +| [`0x5b`](#jumpdest) | JUMPDEST | Mark a valid destination for jumps | - | 1 | +| [`0x5c`](#tload) | TLOAD | Load word from transient storage | [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) | 100 | +| [`0x5d`](#tstore) | TSTORE | Save word to transient storage | [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153) | 100 | +| [`0x5e`](#mcopy) | MCOPY | Copy memory from one area to another | [EIP-5656](https://eips.ethereum.org/EIPS/eip-5656) | 3+3\*words\* | +| [`0x5f`](#push0) | PUSH0 | Place the constant value 0 on stack | [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) | 2 | +| [`0x60`](#push1) | PUSH1 | Place 1 byte item on stack | - | 3 | +| [`0x61`](#push2) | PUSH2 | Place 2-byte item on stack | - | 3 | +| [`0x62`](#push3) | PUSH3 | Place 3-byte item on stack | - | 3 | +| [`0x63`](#push4) | PUSH4 | Place 4-byte item on stack | - | 3 | +| [`0x64`](#push5) | PUSH5 | Place 5-byte item on stack | - | 3 | +| [`0x65`](#push6) | PUSH6 | Place 6-byte item on stack | - | 3 | +| [`0x66`](#push7) | PUSH7 | Place 7-byte item on stack | - | 3 | +| [`0x67`](#push8) | PUSH8 | Place 8-byte item on stack | - | 3 | +| [`0x68`](#push9) | PUSH9 | Place 9-byte item on stack | - | 3 | +| [`0x69`](#push10) | PUSH10 | Place 10-byte item on stack | - | 3 | +| [`0x6a`](#push11) | PUSH11 | Place 11-byte item on stack | - | 3 | +| [`0x6b`](#push12) | PUSH12 | Place 12-byte item on stack | - | 3 | +| [`0x6c`](#push13) | PUSH13 | Place 13-byte item on stack | - | 3 | +| [`0x6d`](#push14) | PUSH14 | Place 14-byte item on stack | - | 3 | +| [`0x6e`](#push15) | PUSH15 | Place 15-byte item on stack | - | 3 | +| [`0x6f`](#push16) | PUSH16 | Place 16-byte item on stack | - | 3 | +| [`0x70`](#push17) | PUSH17 | Place 17-byte item on stack | - | 3 | +| [`0x71`](#push18) | PUSH18 | Place 18-byte item on stack | - | 3 | +| [`0x72`](#push19) | PUSH19 | Place 19-byte item on stack | - | 3 | +| [`0x73`](#push20) | PUSH20 | Place 20-byte item on stack | - | 3 | +| [`0x74`](#push21) | PUSH21 | Place 21-byte item on stack | - | 3 | +| [`0x75`](#push22) | PUSH22 | Place 22-byte item on stack | - | 3 | +| [`0x76`](#push23) | PUSH23 | Place 23-byte item on stack | - | 3 | +| [`0x77`](#push24) | PUSH24 | Place 24-byte item on stack | - | 3 | +| [`0x78`](#push25) | PUSH25 | Place 25-byte item on stack | - | 3 | +| [`0x79`](#push26) | PUSH26 | Place 26-byte item on stack | - | 3 | +| [`0x7a`](#push27) | PUSH27 | Place 27-byte item on stack | - | 3 | +| [`0x7b`](#push28) | PUSH28 | Place 28-byte item on stack | - | 3 | +| [`0x7c`](#push29) | PUSH29 | Place 29-byte item on stack | - | 3 | +| [`0x7d`](#push30) | PUSH30 | Place 30-byte item on stack | - | 3 | +| [`0x7e`](#push31) | PUSH31 | Place 31-byte item on stack | - | 3 | +| [`0x7f`](#push32) | PUSH32 | Place 32-byte (full word) item on stack | - | 3 | +| [`0x80`](#dup1) | DUP1 | Duplicate 1st stack item | - | 3 | +| [`0x81`](#dup2) | DUP2 | Duplicate 2nd stack item | - | 3 | +| [`0x82`](#dup3) | DUP3 | Duplicate 3rd stack item | - | 3 | +| [`0x83`](#dup4) | DUP4 | Duplicate 4th stack item | - | 3 | +| [`0x84`](#dup5) | DUP5 | Duplicate 5th stack item | - | 3 | +| [`0x85`](#dup6) | DUP6 | Duplicate 6th stack item | - | 3 | +| [`0x86`](#dup7) | DUP7 | Duplicate 7th stack item | - | 3 | +| [`0x87`](#dup8) | DUP8 | Duplicate 8th stack item | - | 3 | +| [`0x88`](#dup9) | DUP9 | Duplicate 9th stack item | - | 3 | +| [`0x89`](#dup10) | DUP10 | Duplicate 10th stack item | - | 3 | +| [`0x8a`](#dup11) | DUP11 | Duplicate 11th stack item | - | 3 | +| [`0x8b`](#dup12) | DUP12 | Duplicate 12th stack item | - | 3 | +| [`0x8c`](#dup13) | DUP13 | Duplicate 13th stack item | - | 3 | +| [`0x8d`](#dup14) | DUP14 | Duplicate 14th stack item | - | 3 | +| [`0x8e`](#dup15) | DUP15 | Duplicate 15th stack item | - | 3 | +| [`0x8f`](#dup16) | DUP16 | Duplicate 16th stack item | - | 3 | +| [`0x90`](#swap1) | SWAP1 | Exchange 1st and 2nd stack items | - | 3 | +| [`0x91`](#swap2) | SWAP2 | Exchange 1st and 3rd stack items | - | 3 | +| [`0x92`](#swap3) | SWAP3 | Exchange 1st and 4th stack items | - | 3 | +| [`0x93`](#swap4) | SWAP4 | Exchange 1st and 5th stack items | - | 3 | +| [`0x94`](#swap5) | SWAP5 | Exchange 1st and 6th stack items | - | 3 | +| [`0x95`](#swap6) | SWAP6 | Exchange 1st and 7th stack items | - | 3 | +| [`0x96`](#swap7) | SWAP7 | Exchange 1st and 8th stack items | - | 3 | +| [`0x97`](#swap8) | SWAP8 | Exchange 1st and 9th stack items | - | 3 | +| [`0x98`](#swap9) | SWAP9 | Exchange 1st and 10th stack items | - | 3 | +| [`0x99`](#swap10) | SWAP10 | Exchange 1st and 11th stack items | - | 3 | +| [`0x9a`](#swap11) | SWAP11 | Exchange 1st and 12th stack items | - | 3 | +| [`0x9b`](#swap12) | SWAP12 | Exchange 1st and 13th stack items | - | 3 | +| [`0x9c`](#swap13) | SWAP13 | Exchange 1st and 14th stack items | - | 3 | +| [`0x9d`](#swap14) | SWAP14 | Exchange 1st and 15th stack items | - | 3 | +| [`0x9e`](#swap15) | SWAP15 | Exchange 1st and 16th stack items | - | 3 | +| [`0x9f`](#swap16) | SWAP16 | Exchange 1st and 17th stack items | - | 3 | +| [`0xa0`](#log0) | LOG0 | Append log record with no topics | - | 375 | +| [`0xa1`](#log1) | LOG1 | Append log record with one topic | - | 750 | +| [`0xa2`](#log2) | LOG2 | Append log record with two topics | - | 1125 | +| [`0xa3`](#log3) | LOG3 | Append log record with three topics | - | 1500 | +| [`0xa4`](#log4) | LOG4 | Append log record with four topics | - | 1875 | | `0xa5` - `0xaf` | Unused | - | | `0xb0` | JUMPTO | Tentative [libevmasm has different numbers](https://github.com/ethereum/solidity/blob/c61610302aa2bfa029715b534719d25fe3949059/libevmasm/Instruction.h#L176) | [EIP 615](https://github.com/ethereum/EIPs/blob/606405b5ab7aa28d8191958504e8aad4649666c9/EIPS/eip-615.md) | | `0xb1` | JUMPIF | Tentative | [EIP 615](https://github.com/ethereum/EIPs/blob/606405b5ab7aa28d8191958504e8aad4649666c9/EIPS/eip-615.md) | @@ -165,22 +165,22 @@ The gas information is a work in progress. If an asterisk is in the Gas column, | `0xb9` | PUTLOCAL | Tentative | [EIP 615](https://github.com/ethereum/EIPs/blob/606405b5ab7aa28d8191958504e8aad4649666c9/EIPS/eip-615.md) | | `0xba` | GETLOCAL | Tentative | [EIP 615](https://github.com/ethereum/EIPs/blob/606405b5ab7aa28d8191958504e8aad4649666c9/EIPS/eip-615.md) | | `0xbb` - `0xe0` | Unused | - | -| `0xe1` | SLOADBYTES | Only referenced in pyethereum | - | - | -| `0xe2` | SSTOREBYTES | Only referenced in pyethereum | - | - | -| `0xe3` | SSIZE | Only referenced in pyethereum | - | - | +| `0xe1` | SLOADBYTES | Only referenced in pyethereum | - | - | +| `0xe2` | SSTOREBYTES | Only referenced in pyethereum | - | - | +| `0xe3` | SSIZE | Only referenced in pyethereum | - | - | | `0xe4` - `0xef` | Unused | - | -| [`0xf0`](#create) | CREATE | Create a new account with associated code | - | 32000 | -| [`0xf1`](#call) | CALL | Message-call into an account | - | Complicated | -| [`0xf2`](#callcode) | CALLCODE | Message-call into this account with alternative account's code | - | Complicated | -| [`0xf3`](#return) | RETURN | Halt execution returning output data | - | 0 | -| [`0xf4`](#delegatecall) | DELEGATECALL | Message-call into this account with an alternative account's code, but persisting into this account with an alternative account's code | - | Complicated | +| [`0xf0`](#create) | CREATE | Create a new account with associated code | - | 32000 | +| [`0xf1`](#call) | CALL | Message-call into an account | - | Complicated | +| [`0xf2`](#callcode) | CALLCODE | Message-call into this account with alternative account's code | - | Complicated | +| [`0xf3`](#return) | RETURN | Halt execution returning output data | - | 0 | +| [`0xf4`](#delegatecall) | DELEGATECALL | Message-call into this account with an alternative account's code, but persisting into this account with an alternative account's code | - | Complicated | | [`0xf5`](#create2) | CREATE2 | Create a new account and set creation address to `sha3(sender + sha3(init code)) % 2**160` | - | | `0xf6` - `0xf9` | Unused | - | - | -| [`0xfa`](#staticcall) | STATICCALL | Similar to CALL, but does not modify state | - | 40 | +| [`0xfa`](#staticcall) | STATICCALL | Similar to CALL, but does not modify state | - | 40 | | `0xfb` | Unused | - | - | -| [`0xfd`](#revert) | REVERT | Stop execution and revert state changes, without consuming all provided gas and providing a reason | - | 0 | -| `0xfe` | INVALID | Designated invalid instruction | - | 0 | -| [`0xff`](#selfdestruct) | SELFDESTRUCT | Sends all ETH to the target. If executed in the same transaction a contract was created, register the account for later deletion | [EIP-6780](https://eips.ethereum.org/EIPS/eip-6780) | 5000\* | +| [`0xfd`](#revert) | REVERT | Stop execution and revert state changes, without consuming all provided gas and providing a reason | - | 0 | +| `0xfe` | INVALID | Designated invalid instruction | - | 0 | +| [`0xff`](#selfdestruct) | SELFDESTRUCT | Sends all ETH to the target. If executed in the same transaction a contract was created, register the account for later deletion | [EIP-6780](https://eips.ethereum.org/EIPS/eip-6780) | 5000\* | ## Instruction Details