Last active
September 30, 2024 11:55
-
-
Save Lohann/f18257829761c00d52569c05f3b5fb99 to your computer and use it in GitHub Desktop.
Efficient EVM code interpreter written in EVM assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EVM Interpreter Written in pure EVM assembly | |
// | |
// The bytecode is provided in the calldata, the code is interpreted, not deployed as a smart-contract. | |
// | |
// Motivation: Deploying a smart-contract is expensive, what if you just want to execute a tiny piece of | |
// custom logic, but without having to deploy a smart-contract? Then you can use this interpreter with delegatecall. | |
// Tested on https://www.evm.codes/playground | |
// | |
// @author Lohann Paterno Coutinho Ferreira | |
JUMPDEST // STOP 0x00 | |
// Setup | |
// We use the memory size to know if this is a setup, or the STOP opcode being executed. | |
MSIZE | |
ISZERO | |
PUSH2 0x0e // JUMP to setup | |
JUMPI | |
CALLDATASIZE // calldatasize < pc | |
LT | |
PUSH2 0x1fc0 // JUMP to INVALID | |
JUMPI | |
STOP | |
JUMPDEST | |
// Set MSIZE to 32 | |
PUSH0 | |
PUSH0 | |
MSTORE | |
PUSH0 // PC | |
// Load next opcode | |
JUMPDEST | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH5 5 | |
SHL | |
JUMP | |
// ADD 0x01 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
ADD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MUL 0x02 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
MUL | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SUB 0x03 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SUB | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DIV 0x04 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
DIV | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SDIV 0x05 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
DIV | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MOD 0x06 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
MOD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SMOD 0x07 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SMOD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// ADDMOD 0x08 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
ADDMOD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MULLMOD 0x09 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
MULMOD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// EXP 0x0A | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
EXP | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SIGNEXTEND 0x0B | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SIGNEXTEND | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GAP | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
// LT 0x10 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
GT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GT 0x11 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
LT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SLT 0x12 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SGT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SGT 0x13 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SLT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// EQ 0x14 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
EQ | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// ISZERO 0x15 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
ISZERO | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// AND 0x16 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
AND | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// OR 0x17 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
OR | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// OR 0x18 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
XOR | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// NOT 0x19 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
NOT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BYTE 0x1A | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
BYTE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SHL 0x1B | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SHL | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SHR 0x1C | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SHR | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SHR 0x1D | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SAR | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// <Unknown> 0x1E | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x1F | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// KECCAK256 0x20 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
KECCAK256 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// <Unknown> 0x21 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x22 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x23 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x24 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x25 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x26 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x27 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x28 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x29 | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2a | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2b | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2c | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2d | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2e | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x2f | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// ADDRESS 0x30 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
ADDRESS | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BALANCE 0x31 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
BALANCE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// ORIGIN 0x32 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
ORIGIN | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLER 0x33 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
CALLER | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLVALUE 0x34 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
CALLVALUE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLDATALOAD 0x35 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
PUSH0 | |
SWAP2 | |
// CALLDATALOAD calldata is empty | |
POP | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLDATASIZE 0x36 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
PUSH0 | |
// CALLDATASIZE is empty | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLDATACOPY 0x37 | |
JUMPDEST | |
PUSH15 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
// Copy empty calldata | |
POP | |
CALLDATASIZE | |
SWAP1 | |
CALLDATACOPY | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CODESIZE 0x38 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
// CODESIZE | |
CALLDATASIZE // The code is the calldata | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CODECOPY 0x39 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
// CODECOPY | |
CALLDATACOPY // The code is in the calldata | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GASPRICE 0x3A | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
GASPRICE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// EXTCODESIZE 0x3B | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
EXTCODESIZE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// EXTCODECOPY 0x3C | |
JUMPDEST | |
PUSH16 1 | |
ADD | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
EXTCODECOPY | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// RETURNDATASIZE 0x3D | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
RETURNDATASIZE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// RETURNDATACOPY 0x3E | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
RETURNDATACOPY | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// EXTCODEHASH 0x3F | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
EXTCODEHASH | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BLOCKHASH 0x40 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
BLOCKHASH | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// COINBASE 0x41 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
COINBASE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// TIMESTAMP 0x42 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
TIMESTAMP | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// NUMBER 0x43 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
NUMBER | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PREVRANDAO 0x44 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
PREVRANDAO | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GASLIMIT 0x45 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
GASLIMIT | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CHAINID 0x46 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
CHAINID | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SELFBALANCE 0x47 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
SELFBALANCE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BASEFEE 0x48 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
BASEFEE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BLOBHASH 0x49 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
BLOBHASH | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// BLOBBASEFEE 0x4A | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
BLOBBASEFEE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// <Unknown> 0x4B | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x4C | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x4D | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x4E | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// <Unknown> 0x4F | |
JUMPDEST | |
INVALID | |
STOP | |
PUSH28 0 | |
// POP 0x50 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
SWAP1 | |
POP | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MLOAD 0x51 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
MLOAD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MSTORE 0x52 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
MSTORE | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MSTORE8 0x53 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
MSTORE8 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SLOAD 0x54 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SLOAD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SSTORE 0x55 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
SSTORE | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// JUMP 0x56 | |
JUMPDEST | |
POP | |
DUP1 | |
PUSH14 1 | |
ADD | |
SWAP1 | |
CALLDATALOAD | |
PUSH1 0xf0 | |
SHR | |
PUSH2 0x5b00 | |
XOR | |
PUSH1 0x05 | |
SHL | |
JUMP | |
// JUMPI 0x57 | |
JUMPDEST | |
SWAP1 | |
SWAP2 | |
PUSH14 0x0000000000000000000000000ac0 | |
JUMPI | |
SWAP1 | |
POP | |
PUSH1 0x01 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 0x05 | |
SHL | |
JUMP | |
// PC 0x58 | |
JUMPDEST | |
DUP1 | |
PUSH20 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MSIZE 0x59 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
MSIZE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GAS 0x5A | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
GAS | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// JUMPDEST 0x5B | |
JUMPDEST | |
PUSH21 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// TLOAD 0x5C | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
TLOAD | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// TSTORE 0x5D | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
TSTORE | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// MCOPY 0x5E | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
MCOPY | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH0 0x5F | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
PUSH0 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH1 0x60 | |
JUMPDEST | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH14 1 | |
BYTE | |
SWAP2 | |
PUSH1 2 | |
ADD | |
SWAP1 | |
PUSH1 2 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH2 0x61 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 240 | |
SHR | |
SWAP2 | |
PUSH1 2 | |
ADD | |
SWAP1 | |
PUSH1 2 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH3 0x62 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 232 | |
SHR | |
SWAP2 | |
PUSH1 3 | |
ADD | |
SWAP1 | |
PUSH1 3 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH4 0x63 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 224 | |
SHR | |
SWAP2 | |
PUSH1 4 | |
ADD | |
SWAP1 | |
PUSH1 4 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH5 0x64 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 216 | |
SHR | |
SWAP2 | |
PUSH1 5 | |
ADD | |
SWAP1 | |
PUSH1 5 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH6 0x65 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 208 | |
SHR | |
SWAP2 | |
PUSH1 6 | |
ADD | |
SWAP1 | |
PUSH1 6 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH7 0x66 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 200 | |
SHR | |
SWAP2 | |
PUSH1 7 | |
ADD | |
SWAP1 | |
PUSH1 7 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH8 0x67 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 192 | |
SHR | |
SWAP2 | |
PUSH1 8 | |
ADD | |
SWAP1 | |
PUSH1 8 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH9 0x68 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 184 | |
SHR | |
SWAP2 | |
PUSH1 9 | |
ADD | |
SWAP1 | |
PUSH1 9 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH10 0x69 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 176 | |
SHR | |
SWAP2 | |
PUSH1 10 | |
ADD | |
SWAP1 | |
PUSH1 10 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH11 0x6A | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 168 | |
SHR | |
SWAP2 | |
PUSH1 11 | |
ADD | |
SWAP1 | |
PUSH1 11 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH12 0x6B | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 160 | |
SHR | |
SWAP2 | |
PUSH1 12 | |
ADD | |
SWAP1 | |
PUSH1 12 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH13 0x6C | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 152 | |
SHR | |
SWAP2 | |
PUSH1 13 | |
ADD | |
SWAP1 | |
PUSH1 13 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH14 0x6D | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 144 | |
SHR | |
SWAP2 | |
PUSH1 14 | |
ADD | |
SWAP1 | |
PUSH1 14 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH15 0x6E | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 136 | |
SHR | |
SWAP2 | |
PUSH1 15 | |
ADD | |
SWAP1 | |
PUSH1 15 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH16 0x6F | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 128 | |
SHR | |
SWAP2 | |
PUSH1 16 | |
ADD | |
SWAP1 | |
PUSH1 16 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH17 0x70 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 120 | |
SHR | |
SWAP2 | |
PUSH1 17 | |
ADD | |
SWAP1 | |
PUSH1 17 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH18 0x71 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 112 | |
SHR | |
SWAP2 | |
PUSH1 18 | |
ADD | |
SWAP1 | |
PUSH1 18 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH19 0x72 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 104 | |
SHR | |
SWAP2 | |
PUSH1 19 | |
ADD | |
SWAP1 | |
PUSH1 19 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH20 0x73 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 96 | |
SHR | |
SWAP2 | |
PUSH1 20 | |
ADD | |
SWAP1 | |
PUSH1 20 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH21 0x74 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 88 | |
SHR | |
SWAP2 | |
PUSH1 21 | |
ADD | |
SWAP1 | |
PUSH1 21 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH22 0x75 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 80 | |
SHR | |
SWAP2 | |
PUSH1 22 | |
ADD | |
SWAP1 | |
PUSH1 22 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH23 0x76 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 72 | |
SHR | |
SWAP2 | |
PUSH1 23 | |
ADD | |
SWAP1 | |
PUSH1 23 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH24 0x77 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 64 | |
SHR | |
SWAP2 | |
PUSH1 24 | |
ADD | |
SWAP1 | |
PUSH1 24 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH25 0x78 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 56 | |
SHR | |
SWAP2 | |
PUSH1 25 | |
ADD | |
SWAP1 | |
PUSH1 25 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH26 0x79 | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 48 | |
SHR | |
SWAP2 | |
PUSH1 26 | |
ADD | |
SWAP1 | |
PUSH1 26 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH27 0x7A | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 40 | |
SHR | |
SWAP2 | |
PUSH1 27 | |
ADD | |
SWAP1 | |
PUSH1 27 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH28 0x7B | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 32 | |
SHR | |
SWAP2 | |
PUSH1 28 | |
ADD | |
SWAP1 | |
PUSH1 28 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH29 0x7C | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 24 | |
SHR | |
SWAP2 | |
PUSH1 29 | |
ADD | |
SWAP1 | |
PUSH1 29 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH30 0x7D | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 16 | |
SHR | |
SWAP2 | |
PUSH1 30 | |
ADD | |
SWAP1 | |
PUSH1 30 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH31 0x7E | |
JUMPDEST | |
PUSH11 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
DUP1 | |
PUSH1 8 | |
SHR | |
SWAP2 | |
PUSH1 31 | |
ADD | |
SWAP1 | |
PUSH1 31 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// PUSH32 0x7F | |
JUMPDEST | |
PUSH15 1 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
SWAP1 | |
PUSH1 32 | |
ADD | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP1 0x80 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP2 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP2 0x81 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP3 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP3 0x82 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP4 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP4 0x83 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP5 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP5 0x84 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP6 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP6 0x85 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP7 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP7 0x86 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP8 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP8 0x87 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP9 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP9 0x88 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP10 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP10 0x89 | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP11 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP11 0x8A | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP12 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP12 0x8B | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP13 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP13 0x8C | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP14 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP14 0x8D | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP15 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP15 0x8E | |
JUMPDEST | |
PUSH19 1 | |
ADD | |
DUP16 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// DUP16 0x8F | |
JUMPDEST | |
PUSH1 1 | |
ADD | |
PUSH1 32 | |
DUP1 | |
MSIZE | |
SUB | |
MLOAD | |
ISZERO | |
MUL | |
MSIZE | |
SUB | |
MSTORE // Store the pc in MSIZE or MSIZE - 20 | |
DUP16 | |
PUSH1 32 | |
MSIZE | |
SUB | |
DUP1 | |
MLOAD | |
SWAP1 | |
PUSH0 | |
SWAP1 | |
MSTORE | |
PUSH4 0x13 | |
JUMP | |
// SWAP1 0x90 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP2 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP2 0x91 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP3 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP3 0x92 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP4 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP4 0x93 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP5 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP5 0x94 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP6 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP6 0x95 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP7 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP7 0x96 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP8 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP8 0x97 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP9 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP9 0x98 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP10 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP10 0x99 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP11 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP11 0x9A | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP12 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP12 0x9B | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP13 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP13 0x9C | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP14 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP14 0x9D | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP15 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP15 0x9E | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP1 | |
SWAP16 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// SWAP16 0x9F | |
JUMPDEST | |
PUSH1 1 | |
ADD | |
PUSH1 32 | |
DUP1 | |
MSIZE | |
SUB | |
MLOAD | |
ISZERO | |
MUL | |
MSIZE | |
SUB | |
MSTORE // Store the pc in MSIZE or MSIZE - 20 | |
SWAP16 | |
PUSH1 32 | |
MSIZE | |
SUB | |
DUP1 | |
MLOAD | |
SWAP1 | |
PUSH0 | |
SWAP1 | |
MSTORE | |
PUSH4 0x13 | |
JUMP | |
// LOG0 0xA0 | |
JUMPDEST | |
PUSH18 1 | |
ADD | |
SWAP2 | |
SWAP1 | |
LOG0 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// LOG1 0xA1 | |
JUMPDEST | |
PUSH17 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
LOG1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// LOG2 0xA2 | |
JUMPDEST | |
PUSH16 1 | |
ADD | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
LOG2 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// LOG3 0xA3 | |
JUMPDEST | |
PUSH15 1 | |
ADD | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
LOG3 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// LOG4 0xA4 | |
JUMPDEST | |
PUSH14 1 | |
ADD | |
SWAP6 | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
LOG4 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GAP | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
// CREATE 0xF0 | |
JUMPDEST | |
PUSH16 1 | |
ADD | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
CREATE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALL 0xF1 | |
JUMPDEST | |
PUSH12 1 | |
ADD | |
SWAP7 | |
SWAP6 | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
CALL | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CALLCODE 0xF2 | |
JUMPDEST | |
PUSH12 1 | |
ADD | |
SWAP7 | |
SWAP6 | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
CALLCODE | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// RETURN 0xF3 | |
JUMPDEST | |
POP | |
RETURN | |
PUSH27 0 | |
INVALID | |
// DELEGATECALL 0xF4 | |
JUMPDEST | |
PUSH2 0x1e88 // return ptr | |
PUSH2 0x1fec // guard ptr | |
JUMP | |
JUMPDEST | |
PUSH5 1 | |
ADD | |
SWAP6 | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
DELEGATECALL | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// CREATE2 0xF5 | |
JUMPDEST | |
PUSH15 1 | |
ADD | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
CREATE2 | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GAP | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
PUSH31 0 | |
// STATICCALL 0xFA | |
JUMPDEST | |
PUSH13 1 | |
ADD | |
SWAP6 | |
SWAP5 | |
SWAP4 | |
SWAP3 | |
SWAP2 | |
SWAP1 | |
STATICCALL | |
SWAP1 | |
DUP1 | |
CALLDATALOAD | |
PUSH0 | |
BYTE | |
PUSH1 5 | |
SHL | |
JUMP | |
// GAP | |
PUSH31 0 | |
PUSH31 0 | |
// REVERT 0xFD | |
JUMPDEST | |
POP | |
REVERT | |
PUSH27 0 | |
INVALID | |
// INVALID 0xFE | |
JUMPDEST | |
INVALID | |
PUSH29 0 | |
// SELFDESTRUCT 0xFF | |
// OBS: Only allowed when using delegatecall | |
JUMPDEST | |
PUSH2 0x1fe8 // return ptr | |
PUSH2 0x1fec // guard ptr | |
JUMP | |
JUMPDEST | |
POP | |
SELFDESTRUCT | |
STOP | |
// Guard to prevent an instruction who can potentialy | |
// destroy this contract from being executed. | |
JUMPDEST | |
ADDRESS | |
// !REPLACE THIS BY THE ADDRESS OF THE CONTRACT! | |
PUSH20 0x0000000000000000000000000000000000000000 | |
EQ | |
PUSH2 0x2009 | |
JUMPI | |
JUMP | |
JUMPDEST | |
INVALID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
contract EvmInterpreter { | |
constructor() payable { | |
bytes memory runtime = INTERPRETER_BYTECODE; | |
assembly { | |
// Set the contract address, to prevent someone from destroy it. | |
let offset := add(runtime, 0x200f) | |
let chunk := and(mload(offset), 0xffffffffffffffffffffffff) | |
chunk := or(chunk, shl(0x60, address())) | |
mstore(offset, chunk) | |
// Return the interpreter bytecode | |
return(add(runtime, 32), mload(runtime)) | |
} | |
} | |
bytes constant private INTERPRETER_BYTECODE = hex"5b591561000e573610611fc057005b5f5f525f5b80355f1a6400000000051b565b710000000000000000000000000000000000010191019080355f1a60051b565b710000000000000000000000000000000000010191029080355f1a60051b565b700000000000000000000000000000000001019190039080355f1a60051b565b700000000000000000000000000000000001019190049080355f1a60051b565b700000000000000000000000000000000001019190049080355f1a60051b565b700000000000000000000000000000000001019190069080355f1a60051b565b700000000000000000000000000000000001019190079080355f1a60051b565b700000000000000000000000000000000001019291089080355f1a60051b565b700000000000000000000000000000000001019291099080355f1a60051b565b7000000000000000000000000000000000010191900a9080355f1a60051b565b7000000000000000000000000000000000010191900b9080355f1a60051b567e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000005b710000000000000000000000000000000000010191119080355f1a60051b565b710000000000000000000000000000000000010191109080355f1a60051b565b710000000000000000000000000000000000010191139080355f1a60051b565b710000000000000000000000000000000000010191129080355f1a60051b565b710000000000000000000000000000000000010191149080355f1a60051b565b710000000000000000000000000000000000010190159080355f1a60051b565b710000000000000000000000000000000000010191169080355f1a60051b565b710000000000000000000000000000000000010191179080355f1a60051b565b710000000000000000000000000000000000010191189080355f1a60051b565b710000000000000000000000000000000000010190199080355f1a60051b565b7000000000000000000000000000000000010191901a9080355f1a60051b565b7000000000000000000000000000000000010191901b9080355f1a60051b565b7000000000000000000000000000000000010191901c9080355f1a60051b565b7000000000000000000000000000000000010191901d9080355f1a60051b565bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005b700000000000000000000000000000000001019190209080355f1a60051b565bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005b720000000000000000000000000000000000000101309080355f1a60051b565b710000000000000000000000000000000000010190319080355f1a60051b565b720000000000000000000000000000000000000101329080355f1a60051b565b720000000000000000000000000000000000000101339080355f1a60051b565b720000000000000000000000000000000000000101349080355f1a60051b565b71000000000000000000000000000000000001015f915080355f1a60051b565b7200000000000000000000000000000000000001015f9080355f1a60051b565b6e0000000000000000000000000000010192915036903780355f1a60051b565b720000000000000000000000000000000000000101369080355f1a60051b565b700000000000000000000000000000000001019291903780355f1a60051b565b7200000000000000000000000000000000000001013a9080355f1a60051b565b7100000000000000000000000000000000000101903b9080355f1a60051b565b6f0000000000000000000000000000000101939291903c80355f1a60051b565b7200000000000000000000000000000000000001013d9080355f1a60051b565b700000000000000000000000000000000001019291903e80355f1a60051b565b7100000000000000000000000000000000000101903f9080355f1a60051b565b710000000000000000000000000000000000010190409080355f1a60051b565b720000000000000000000000000000000000000101419080355f1a60051b565b720000000000000000000000000000000000000101429080355f1a60051b565b720000000000000000000000000000000000000101439080355f1a60051b565b720000000000000000000000000000000000000101449080355f1a60051b565b720000000000000000000000000000000000000101459080355f1a60051b565b720000000000000000000000000000000000000101469080355f1a60051b565b720000000000000000000000000000000000000101479080355f1a60051b565b720000000000000000000000000000000000000101489080355f1a60051b565b710000000000000000000000000000000000010190499080355f1a60051b565b7200000000000000000000000000000000000001014a9080355f1a60051b565bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005bfe007b000000000000000000000000000000000000000000000000000000005b720000000000000000000000000000000000000101905080355f1a60051b565b710000000000000000000000000000000000010190519080355f1a60051b565b710000000000000000000000000000000000010191905280355f1a60051b565b710000000000000000000000000000000000010191905380355f1a60051b565b710000000000000000000000000000000000010190549080355f1a60051b565b710000000000000000000000000000000000010191905580355f1a60051b565b50806d000000000000000000000000000101903560f01c615b001860051b565b90916d0000000000000000000000000ac057905060010180355f1a60051b565b807300000000000000000000000000000000000000010180355f1a60051b565b720000000000000000000000000000000000000101599080355f1a60051b565b7200000000000000000000000000000000000001015a9080355f1a60051b565b740000000000000000000000000000000000000000010180355f1a60051b565b7100000000000000000000000000000000000101905c9080355f1a60051b565b710000000000000000000000000000000000010191905d80355f1a60051b565b700000000000000000000000000000000001019291905e80355f1a60051b565b7200000000000000000000000000000000000001015f9080355f1a60051b565b8035806d00000000000000000000000000011a916002019060021a60051b565b6a00000000000000000000010180358060f01c916002019060021a60051b565b6a00000000000000000000010180358060e81c916003019060031a60051b565b6a00000000000000000000010180358060e01c916004019060041a60051b565b6a00000000000000000000010180358060d81c916005019060051a60051b565b6a00000000000000000000010180358060d01c916006019060061a60051b565b6a00000000000000000000010180358060c81c916007019060071a60051b565b6a00000000000000000000010180358060c01c916008019060081a60051b565b6a00000000000000000000010180358060b81c916009019060091a60051b565b6a00000000000000000000010180358060b01c91600a0190600a1a60051b565b6a00000000000000000000010180358060a81c91600b0190600b1a60051b565b6a00000000000000000000010180358060a01c91600c0190600c1a60051b565b6a00000000000000000000010180358060981c91600d0190600d1a60051b565b6a00000000000000000000010180358060901c91600e0190600e1a60051b565b6a00000000000000000000010180358060881c91600f0190600f1a60051b565b6a00000000000000000000010180358060801c916010019060101a60051b565b6a00000000000000000000010180358060781c916011019060111a60051b565b6a00000000000000000000010180358060701c916012019060121a60051b565b6a00000000000000000000010180358060681c916013019060131a60051b565b6a00000000000000000000010180358060601c916014019060141a60051b565b6a00000000000000000000010180358060581c916015019060151a60051b565b6a00000000000000000000010180358060501c916016019060161a60051b565b6a00000000000000000000010180358060481c916017019060171a60051b565b6a00000000000000000000010180358060401c916018019060181a60051b565b6a00000000000000000000010180358060381c916019019060191a60051b565b6a00000000000000000000010180358060301c91601a0190601a1a60051b565b6a00000000000000000000010180358060281c91601b0190601b1a60051b565b6a00000000000000000000010180358060201c91601c0190601c1a60051b565b6a00000000000000000000010180358060181c91601d0190601d1a60051b565b6a00000000000000000000010180358060101c91601e0190601e1a60051b565b6a00000000000000000000010180358060081c91601f0190601f1a60051b565b6e0000000000000000000000000000010180359060200180355f1a60051b565b720000000000000000000000000000000000000101819080355f1a60051b565b720000000000000000000000000000000000000101829080355f1a60051b565b720000000000000000000000000000000000000101839080355f1a60051b565b720000000000000000000000000000000000000101849080355f1a60051b565b720000000000000000000000000000000000000101859080355f1a60051b565b720000000000000000000000000000000000000101869080355f1a60051b565b720000000000000000000000000000000000000101879080355f1a60051b565b720000000000000000000000000000000000000101889080355f1a60051b565b720000000000000000000000000000000000000101899080355f1a60051b565b7200000000000000000000000000000000000001018a9080355f1a60051b565b7200000000000000000000000000000000000001018b9080355f1a60051b565b7200000000000000000000000000000000000001018c9080355f1a60051b565b7200000000000000000000000000000000000001018d9080355f1a60051b565b7200000000000000000000000000000000000001018e9080355f1a60051b565b7200000000000000000000000000000000000001018f9080355f1a60051b565b60010160208059035115025903528f602059038051905f90526300000013565b710000000000000000000000000000000000010190919080355f1a60051b565b710000000000000000000000000000000000010190929080355f1a60051b565b710000000000000000000000000000000000010190939080355f1a60051b565b710000000000000000000000000000000000010190949080355f1a60051b565b710000000000000000000000000000000000010190959080355f1a60051b565b710000000000000000000000000000000000010190969080355f1a60051b565b710000000000000000000000000000000000010190979080355f1a60051b565b710000000000000000000000000000000000010190989080355f1a60051b565b710000000000000000000000000000000000010190999080355f1a60051b565b7100000000000000000000000000000000000101909a9080355f1a60051b565b7100000000000000000000000000000000000101909b9080355f1a60051b565b7100000000000000000000000000000000000101909c9080355f1a60051b565b7100000000000000000000000000000000000101909d9080355f1a60051b565b7100000000000000000000000000000000000101909e9080355f1a60051b565b7100000000000000000000000000000000000101909f9080355f1a60051b565b60010160208059035115025903529f602059038051905f90526300000013565b71000000000000000000000000000000000001019190a080355f1a60051b565b70000000000000000000000000000000000101929190a180355f1a60051b565b6f000000000000000000000000000000010193929190a280355f1a60051b565b6e000000000000000000000000000001019493929190a380355f1a60051b565b6d000000000000000000000000000101959493929190a480355f1a60051b567e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000005b6f0000000000000000000000000000000101929190f09080355f1a60051b565b6b0000000000000000000000010196959493929190f19080355f1a60051b565b6b0000000000000000000000010196959493929190f29080355f1a60051b565b50f37a000000000000000000000000000000000000000000000000000000fe5b611e88611fec565b64000000000101959493929190f49080355f1a60051b565b6e0000000000000000000000000000010193929190f59080355f1a60051b567e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000005b6c0000000000000000000000000101959493929190fa9080355f1a60051b567e000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000005b50fd7a000000000000000000000000000000000000000000000000000000fe5bfe7c00000000000000000000000000000000000000000000000000000000005b611fe8611fec565b50ff005b307300000000000000000000000000000000000000001461200957565bfe"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment