|
|
@ -82,10 +82,11 @@ const ( |
|
|
|
GASPRICE |
|
|
|
GASPRICE |
|
|
|
EXTCODESIZE |
|
|
|
EXTCODESIZE |
|
|
|
EXTCODECOPY |
|
|
|
EXTCODECOPY |
|
|
|
|
|
|
|
RETURNDATASIZE |
|
|
|
|
|
|
|
RETURNDATACOPY |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
|
|
|
|
|
|
|
|
|
// 0x40 range - block operations
|
|
|
|
// 0x40 range - block operations
|
|
|
|
BLOCKHASH OpCode = 0x40 + iota |
|
|
|
BLOCKHASH OpCode = 0x40 + iota |
|
|
|
COINBASE |
|
|
|
COINBASE |
|
|
@ -239,27 +240,29 @@ var opCodeToString = map[OpCode]string{ |
|
|
|
SHA3: "SHA3", |
|
|
|
SHA3: "SHA3", |
|
|
|
|
|
|
|
|
|
|
|
// 0x30 range - closure state
|
|
|
|
// 0x30 range - closure state
|
|
|
|
ADDRESS: "ADDRESS", |
|
|
|
ADDRESS: "ADDRESS", |
|
|
|
BALANCE: "BALANCE", |
|
|
|
BALANCE: "BALANCE", |
|
|
|
ORIGIN: "ORIGIN", |
|
|
|
ORIGIN: "ORIGIN", |
|
|
|
CALLER: "CALLER", |
|
|
|
CALLER: "CALLER", |
|
|
|
CALLVALUE: "CALLVALUE", |
|
|
|
CALLVALUE: "CALLVALUE", |
|
|
|
CALLDATALOAD: "CALLDATALOAD", |
|
|
|
CALLDATALOAD: "CALLDATALOAD", |
|
|
|
CALLDATASIZE: "CALLDATASIZE", |
|
|
|
CALLDATASIZE: "CALLDATASIZE", |
|
|
|
CALLDATACOPY: "CALLDATACOPY", |
|
|
|
CALLDATACOPY: "CALLDATACOPY", |
|
|
|
CODESIZE: "CODESIZE", |
|
|
|
CODESIZE: "CODESIZE", |
|
|
|
CODECOPY: "CODECOPY", |
|
|
|
CODECOPY: "CODECOPY", |
|
|
|
GASPRICE: "GASPRICE", |
|
|
|
GASPRICE: "GASPRICE", |
|
|
|
|
|
|
|
EXTCODESIZE: "EXTCODESIZE", |
|
|
|
|
|
|
|
EXTCODECOPY: "EXTCODECOPY", |
|
|
|
|
|
|
|
RETURNDATASIZE: "RETURNDATASIZE", |
|
|
|
|
|
|
|
RETURNDATACOPY: "RETURNDATACOPY", |
|
|
|
|
|
|
|
|
|
|
|
// 0x40 range - block operations
|
|
|
|
// 0x40 range - block operations
|
|
|
|
BLOCKHASH: "BLOCKHASH", |
|
|
|
BLOCKHASH: "BLOCKHASH", |
|
|
|
COINBASE: "COINBASE", |
|
|
|
COINBASE: "COINBASE", |
|
|
|
TIMESTAMP: "TIMESTAMP", |
|
|
|
TIMESTAMP: "TIMESTAMP", |
|
|
|
NUMBER: "NUMBER", |
|
|
|
NUMBER: "NUMBER", |
|
|
|
DIFFICULTY: "DIFFICULTY", |
|
|
|
DIFFICULTY: "DIFFICULTY", |
|
|
|
GASLIMIT: "GASLIMIT", |
|
|
|
GASLIMIT: "GASLIMIT", |
|
|
|
EXTCODESIZE: "EXTCODESIZE", |
|
|
|
|
|
|
|
EXTCODECOPY: "EXTCODECOPY", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 0x50 range - 'storage' and execution
|
|
|
|
// 0x50 range - 'storage' and execution
|
|
|
|
POP: "POP", |
|
|
|
POP: "POP", |
|
|
@ -374,137 +377,139 @@ func (o OpCode) String() string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var stringToOp = map[string]OpCode{ |
|
|
|
var stringToOp = map[string]OpCode{ |
|
|
|
"STOP": STOP, |
|
|
|
"STOP": STOP, |
|
|
|
"ADD": ADD, |
|
|
|
"ADD": ADD, |
|
|
|
"MUL": MUL, |
|
|
|
"MUL": MUL, |
|
|
|
"SUB": SUB, |
|
|
|
"SUB": SUB, |
|
|
|
"DIV": DIV, |
|
|
|
"DIV": DIV, |
|
|
|
"SDIV": SDIV, |
|
|
|
"SDIV": SDIV, |
|
|
|
"MOD": MOD, |
|
|
|
"MOD": MOD, |
|
|
|
"SMOD": SMOD, |
|
|
|
"SMOD": SMOD, |
|
|
|
"EXP": EXP, |
|
|
|
"EXP": EXP, |
|
|
|
"NOT": NOT, |
|
|
|
"NOT": NOT, |
|
|
|
"LT": LT, |
|
|
|
"LT": LT, |
|
|
|
"GT": GT, |
|
|
|
"GT": GT, |
|
|
|
"SLT": SLT, |
|
|
|
"SLT": SLT, |
|
|
|
"SGT": SGT, |
|
|
|
"SGT": SGT, |
|
|
|
"EQ": EQ, |
|
|
|
"EQ": EQ, |
|
|
|
"ISZERO": ISZERO, |
|
|
|
"ISZERO": ISZERO, |
|
|
|
"SIGNEXTEND": SIGNEXTEND, |
|
|
|
"SIGNEXTEND": SIGNEXTEND, |
|
|
|
"AND": AND, |
|
|
|
"AND": AND, |
|
|
|
"OR": OR, |
|
|
|
"OR": OR, |
|
|
|
"XOR": XOR, |
|
|
|
"XOR": XOR, |
|
|
|
"BYTE": BYTE, |
|
|
|
"BYTE": BYTE, |
|
|
|
"ADDMOD": ADDMOD, |
|
|
|
"ADDMOD": ADDMOD, |
|
|
|
"MULMOD": MULMOD, |
|
|
|
"MULMOD": MULMOD, |
|
|
|
"SHA3": SHA3, |
|
|
|
"SHA3": SHA3, |
|
|
|
"ADDRESS": ADDRESS, |
|
|
|
"ADDRESS": ADDRESS, |
|
|
|
"BALANCE": BALANCE, |
|
|
|
"BALANCE": BALANCE, |
|
|
|
"ORIGIN": ORIGIN, |
|
|
|
"ORIGIN": ORIGIN, |
|
|
|
"CALLER": CALLER, |
|
|
|
"CALLER": CALLER, |
|
|
|
"CALLVALUE": CALLVALUE, |
|
|
|
"CALLVALUE": CALLVALUE, |
|
|
|
"CALLDATALOAD": CALLDATALOAD, |
|
|
|
"CALLDATALOAD": CALLDATALOAD, |
|
|
|
"CALLDATASIZE": CALLDATASIZE, |
|
|
|
"CALLDATASIZE": CALLDATASIZE, |
|
|
|
"CALLDATACOPY": CALLDATACOPY, |
|
|
|
"CALLDATACOPY": CALLDATACOPY, |
|
|
|
"DELEGATECALL": DELEGATECALL, |
|
|
|
"DELEGATECALL": DELEGATECALL, |
|
|
|
"STATICCALL": STATICCALL, |
|
|
|
"STATICCALL": STATICCALL, |
|
|
|
"CODESIZE": CODESIZE, |
|
|
|
"CODESIZE": CODESIZE, |
|
|
|
"CODECOPY": CODECOPY, |
|
|
|
"CODECOPY": CODECOPY, |
|
|
|
"GASPRICE": GASPRICE, |
|
|
|
"GASPRICE": GASPRICE, |
|
|
|
"BLOCKHASH": BLOCKHASH, |
|
|
|
"EXTCODESIZE": EXTCODESIZE, |
|
|
|
"COINBASE": COINBASE, |
|
|
|
"EXTCODECOPY": EXTCODECOPY, |
|
|
|
"TIMESTAMP": TIMESTAMP, |
|
|
|
"RETURNDATASIZE": RETURNDATASIZE, |
|
|
|
"NUMBER": NUMBER, |
|
|
|
"RETURNDATACOPY": RETURNDATACOPY, |
|
|
|
"DIFFICULTY": DIFFICULTY, |
|
|
|
"BLOCKHASH": BLOCKHASH, |
|
|
|
"GASLIMIT": GASLIMIT, |
|
|
|
"COINBASE": COINBASE, |
|
|
|
"EXTCODESIZE": EXTCODESIZE, |
|
|
|
"TIMESTAMP": TIMESTAMP, |
|
|
|
"EXTCODECOPY": EXTCODECOPY, |
|
|
|
"NUMBER": NUMBER, |
|
|
|
"POP": POP, |
|
|
|
"DIFFICULTY": DIFFICULTY, |
|
|
|
"MLOAD": MLOAD, |
|
|
|
"GASLIMIT": GASLIMIT, |
|
|
|
"MSTORE": MSTORE, |
|
|
|
"POP": POP, |
|
|
|
"MSTORE8": MSTORE8, |
|
|
|
"MLOAD": MLOAD, |
|
|
|
"SLOAD": SLOAD, |
|
|
|
"MSTORE": MSTORE, |
|
|
|
"SSTORE": SSTORE, |
|
|
|
"MSTORE8": MSTORE8, |
|
|
|
"JUMP": JUMP, |
|
|
|
"SLOAD": SLOAD, |
|
|
|
"JUMPI": JUMPI, |
|
|
|
"SSTORE": SSTORE, |
|
|
|
"PC": PC, |
|
|
|
"JUMP": JUMP, |
|
|
|
"MSIZE": MSIZE, |
|
|
|
"JUMPI": JUMPI, |
|
|
|
"GAS": GAS, |
|
|
|
"PC": PC, |
|
|
|
"JUMPDEST": JUMPDEST, |
|
|
|
"MSIZE": MSIZE, |
|
|
|
"PUSH1": PUSH1, |
|
|
|
"GAS": GAS, |
|
|
|
"PUSH2": PUSH2, |
|
|
|
"JUMPDEST": JUMPDEST, |
|
|
|
"PUSH3": PUSH3, |
|
|
|
"PUSH1": PUSH1, |
|
|
|
"PUSH4": PUSH4, |
|
|
|
"PUSH2": PUSH2, |
|
|
|
"PUSH5": PUSH5, |
|
|
|
"PUSH3": PUSH3, |
|
|
|
"PUSH6": PUSH6, |
|
|
|
"PUSH4": PUSH4, |
|
|
|
"PUSH7": PUSH7, |
|
|
|
"PUSH5": PUSH5, |
|
|
|
"PUSH8": PUSH8, |
|
|
|
"PUSH6": PUSH6, |
|
|
|
"PUSH9": PUSH9, |
|
|
|
"PUSH7": PUSH7, |
|
|
|
"PUSH10": PUSH10, |
|
|
|
"PUSH8": PUSH8, |
|
|
|
"PUSH11": PUSH11, |
|
|
|
"PUSH9": PUSH9, |
|
|
|
"PUSH12": PUSH12, |
|
|
|
"PUSH10": PUSH10, |
|
|
|
"PUSH13": PUSH13, |
|
|
|
"PUSH11": PUSH11, |
|
|
|
"PUSH14": PUSH14, |
|
|
|
"PUSH12": PUSH12, |
|
|
|
"PUSH15": PUSH15, |
|
|
|
"PUSH13": PUSH13, |
|
|
|
"PUSH16": PUSH16, |
|
|
|
"PUSH14": PUSH14, |
|
|
|
"PUSH17": PUSH17, |
|
|
|
"PUSH15": PUSH15, |
|
|
|
"PUSH18": PUSH18, |
|
|
|
"PUSH16": PUSH16, |
|
|
|
"PUSH19": PUSH19, |
|
|
|
"PUSH17": PUSH17, |
|
|
|
"PUSH20": PUSH20, |
|
|
|
"PUSH18": PUSH18, |
|
|
|
"PUSH21": PUSH21, |
|
|
|
"PUSH19": PUSH19, |
|
|
|
"PUSH22": PUSH22, |
|
|
|
"PUSH20": PUSH20, |
|
|
|
"PUSH23": PUSH23, |
|
|
|
"PUSH21": PUSH21, |
|
|
|
"PUSH24": PUSH24, |
|
|
|
"PUSH22": PUSH22, |
|
|
|
"PUSH25": PUSH25, |
|
|
|
"PUSH23": PUSH23, |
|
|
|
"PUSH26": PUSH26, |
|
|
|
"PUSH24": PUSH24, |
|
|
|
"PUSH27": PUSH27, |
|
|
|
"PUSH25": PUSH25, |
|
|
|
"PUSH28": PUSH28, |
|
|
|
"PUSH26": PUSH26, |
|
|
|
"PUSH29": PUSH29, |
|
|
|
"PUSH27": PUSH27, |
|
|
|
"PUSH30": PUSH30, |
|
|
|
"PUSH28": PUSH28, |
|
|
|
"PUSH31": PUSH31, |
|
|
|
"PUSH29": PUSH29, |
|
|
|
"PUSH32": PUSH32, |
|
|
|
"PUSH30": PUSH30, |
|
|
|
"DUP1": DUP1, |
|
|
|
"PUSH31": PUSH31, |
|
|
|
"DUP2": DUP2, |
|
|
|
"PUSH32": PUSH32, |
|
|
|
"DUP3": DUP3, |
|
|
|
"DUP1": DUP1, |
|
|
|
"DUP4": DUP4, |
|
|
|
"DUP2": DUP2, |
|
|
|
"DUP5": DUP5, |
|
|
|
"DUP3": DUP3, |
|
|
|
"DUP6": DUP6, |
|
|
|
"DUP4": DUP4, |
|
|
|
"DUP7": DUP7, |
|
|
|
"DUP5": DUP5, |
|
|
|
"DUP8": DUP8, |
|
|
|
"DUP6": DUP6, |
|
|
|
"DUP9": DUP9, |
|
|
|
"DUP7": DUP7, |
|
|
|
"DUP10": DUP10, |
|
|
|
"DUP8": DUP8, |
|
|
|
"DUP11": DUP11, |
|
|
|
"DUP9": DUP9, |
|
|
|
"DUP12": DUP12, |
|
|
|
"DUP10": DUP10, |
|
|
|
"DUP13": DUP13, |
|
|
|
"DUP11": DUP11, |
|
|
|
"DUP14": DUP14, |
|
|
|
"DUP12": DUP12, |
|
|
|
"DUP15": DUP15, |
|
|
|
"DUP13": DUP13, |
|
|
|
"DUP16": DUP16, |
|
|
|
"DUP14": DUP14, |
|
|
|
"SWAP1": SWAP1, |
|
|
|
"DUP15": DUP15, |
|
|
|
"SWAP2": SWAP2, |
|
|
|
"DUP16": DUP16, |
|
|
|
"SWAP3": SWAP3, |
|
|
|
"SWAP1": SWAP1, |
|
|
|
"SWAP4": SWAP4, |
|
|
|
"SWAP2": SWAP2, |
|
|
|
"SWAP5": SWAP5, |
|
|
|
"SWAP3": SWAP3, |
|
|
|
"SWAP6": SWAP6, |
|
|
|
"SWAP4": SWAP4, |
|
|
|
"SWAP7": SWAP7, |
|
|
|
"SWAP5": SWAP5, |
|
|
|
"SWAP8": SWAP8, |
|
|
|
"SWAP6": SWAP6, |
|
|
|
"SWAP9": SWAP9, |
|
|
|
"SWAP7": SWAP7, |
|
|
|
"SWAP10": SWAP10, |
|
|
|
"SWAP8": SWAP8, |
|
|
|
"SWAP11": SWAP11, |
|
|
|
"SWAP9": SWAP9, |
|
|
|
"SWAP12": SWAP12, |
|
|
|
"SWAP10": SWAP10, |
|
|
|
"SWAP13": SWAP13, |
|
|
|
"SWAP11": SWAP11, |
|
|
|
"SWAP14": SWAP14, |
|
|
|
"SWAP12": SWAP12, |
|
|
|
"SWAP15": SWAP15, |
|
|
|
"SWAP13": SWAP13, |
|
|
|
"SWAP16": SWAP16, |
|
|
|
"SWAP14": SWAP14, |
|
|
|
"LOG0": LOG0, |
|
|
|
"SWAP15": SWAP15, |
|
|
|
"LOG1": LOG1, |
|
|
|
"SWAP16": SWAP16, |
|
|
|
"LOG2": LOG2, |
|
|
|
"LOG0": LOG0, |
|
|
|
"LOG3": LOG3, |
|
|
|
"LOG1": LOG1, |
|
|
|
"LOG4": LOG4, |
|
|
|
"LOG2": LOG2, |
|
|
|
"CREATE": CREATE, |
|
|
|
"LOG3": LOG3, |
|
|
|
"CALL": CALL, |
|
|
|
"LOG4": LOG4, |
|
|
|
"RETURN": RETURN, |
|
|
|
"CREATE": CREATE, |
|
|
|
"CALLCODE": CALLCODE, |
|
|
|
"CALL": CALL, |
|
|
|
"SELFDESTRUCT": SELFDESTRUCT, |
|
|
|
"RETURN": RETURN, |
|
|
|
|
|
|
|
"CALLCODE": CALLCODE, |
|
|
|
|
|
|
|
"SELFDESTRUCT": SELFDESTRUCT, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func StringToOp(str string) OpCode { |
|
|
|
func StringToOp(str string) OpCode { |
|
|
|