From 3aeaf59bea2ef0bd4be486407af8eed6bf8d998b Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Tue, 30 Oct 2018 23:16:28 +0530 Subject: [PATCH 01/13] Add --no-onchain-storage-access flag --- mythril/interfaces/cli.py | 10 ++++++++-- mythril/laser/ethereum/call.py | 6 +++--- mythril/laser/ethereum/instructions.py | 4 ++-- mythril/laser/ethereum/state.py | 2 +- mythril/mythril.py | 9 +++++---- mythril/support/loader.py | 10 +++++++++- 6 files changed, 28 insertions(+), 13 deletions(-) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 36880aea..242e3f2f 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -90,6 +90,11 @@ def main(): action="store_true", help="auto-load dependencies from the blockchain", ) + inputs.add_argument( + "--no-onchain-storage-access", + action="store_true", + help="turns off getting the data from onchain contracts", + ) outputs = parser.add_argument_group("output formats") outputs.add_argument( @@ -268,10 +273,11 @@ def main(): mythril = Mythril( solv=args.solv, dynld=args.dynld, + onchain_storage_access=(not args.no_onchain_storage_access), solc_args=args.solc_args, enable_online_lookup=args.query_signature, ) - if args.dynld and not (args.rpc or args.i): + if args.dynld or not args.no_onchain_storage_access and not (args.rpc or args.i): mythril.set_api_from_config_path() if args.address: @@ -280,7 +286,7 @@ def main(): mythril.set_api_rpc_infura() elif args.rpc: mythril.set_api_rpc(rpc=args.rpc, rpctls=args.rpctls) - elif not args.dynld: + elif not (args.dynld or not args.no_onchain_storage_access): mythril.set_api_rpc_localhost() elif args.search or args.contract_hash_to_address: # Open LevelDB if necessary diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index c6311d51..b64b5ed6 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -122,9 +122,9 @@ def get_callee_account(global_state, callee_address, dynamic_loader): try: code = dynamic_loader.dynld(environment.active_account.address, callee_address) - except Exception: - logging.debug("Unable to execute dynamic loader.") - raise ValueError() + except ValueError as error: + logging.debug("Unable to execute dynamic loader because: {}".format(error.message)) + raise ValueError(error.message) if code is None: logging.debug("No code returned, not a contract account?") raise ValueError() diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index c31d5f46..75dfada0 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -701,8 +701,8 @@ class Instruction: try: code = self.dynamic_loader.dynld(environment.active_account.address, addr) - except Exception as e: - logging.info("error accessing contract storage due to: " + str(e)) + except ValueError as e: + logging.info("error accessing contract storage due to: " + str(e.message)) state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256)) return [global_state] diff --git a/mythril/laser/ethereum/state.py b/mythril/laser/ethereum/state.py index 20c17c62..a02b6fe6 100644 --- a/mythril/laser/ethereum/state.py +++ b/mythril/laser/ethereum/state.py @@ -133,7 +133,7 @@ class Storage: try: return self._storage[item] except KeyError: - if self.address and int(self.address[2:], 16) != 0 and self.dynld: + if self.address and int(self.address[2:], 16) != 0 and (self.dynld and self.dynld.storage_loading): try: self._storage[item] = int( self.dynld.read_storage( diff --git a/mythril/mythril.py b/mythril/mythril.py index d5dbd76f..deb2261e 100644 --- a/mythril/mythril.py +++ b/mythril/mythril.py @@ -78,12 +78,13 @@ class Mythril(object): """ def __init__( - self, solv=None, solc_args=None, dynld=False, enable_online_lookup=False + self, solv=None, solc_args=None, dynld=False, enable_online_lookup=False, onchain_storage_access=True ): self.solv = solv self.solc_args = solc_args self.dynld = dynld + self.onchain_storage_access=onchain_storage_access self.enable_online_lookup = enable_online_lookup self.mythril_dir = self._init_mythril_dir() @@ -411,7 +412,7 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth) if self.dynld else None, + dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, @@ -434,7 +435,7 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth) if self.dynld else None, + dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, @@ -460,7 +461,7 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth) if self.dynld else None, + dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, diff --git a/mythril/support/loader.py b/mythril/support/loader.py index ac5a5d2e..c35e0374 100644 --- a/mythril/support/loader.py +++ b/mythril/support/loader.py @@ -4,12 +4,17 @@ import re class DynLoader: - def __init__(self, eth): + def __init__(self, eth, contract_loading=True, storage_loading=True): self.eth = eth self.storage_cache = {} + self.contract_loading = contract_loading + self.storage_loading = storage_loading def read_storage(self, contract_address, index): + if not self.storage_loading: + raise Exception('Cannot load from the storage when the storage_loading flag is false') + try: contract_ref = self.storage_cache[contract_address] data = contract_ref[index] @@ -36,6 +41,9 @@ class DynLoader: def dynld(self, contract_address, dependency_address): + if not self.contract_loading: + raise ValueError('Cannot load contract when contract_loading flag is false') + logging.info( "Dynld at contract " + contract_address + ": " + dependency_address ) From a8f6c477c871d29fb8dbdbab657516cfc40e69ca Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 31 Oct 2018 00:23:28 +0530 Subject: [PATCH 02/13] Exception handling fix --- mythril/laser/ethereum/call.py | 4 ++-- mythril/laser/ethereum/instructions.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index b64b5ed6..55066aac 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -123,8 +123,8 @@ def get_callee_account(global_state, callee_address, dynamic_loader): try: code = dynamic_loader.dynld(environment.active_account.address, callee_address) except ValueError as error: - logging.debug("Unable to execute dynamic loader because: {}".format(error.message)) - raise ValueError(error.message) + logging.debug("Unable to execute dynamic loader because: {}".format(str(error))) + raise ValueError(str(error)) if code is None: logging.debug("No code returned, not a contract account?") raise ValueError() diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 75dfada0..96b19609 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -701,8 +701,8 @@ class Instruction: try: code = self.dynamic_loader.dynld(environment.active_account.address, addr) - except ValueError as e: - logging.info("error accessing contract storage due to: " + str(e.message)) + except (ValueError, AttributeError) as e: + logging.info("error accessing contract storage due to: " + str(e)) state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256)) return [global_state] From ad6339d3c2640ed66828322f3f21902fee8e8edb Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 31 Oct 2018 01:14:42 +0530 Subject: [PATCH 03/13] Format code with Black --- mythril/interfaces/cli.py | 6 +++++- mythril/laser/ethereum/state.py | 6 +++++- mythril/mythril.py | 27 ++++++++++++++++++++++----- mythril/support/loader.py | 6 ++++-- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index 242e3f2f..9203438b 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -277,7 +277,11 @@ def main(): solc_args=args.solc_args, enable_online_lookup=args.query_signature, ) - if args.dynld or not args.no_onchain_storage_access and not (args.rpc or args.i): + if ( + args.dynld + or not args.no_onchain_storage_access + and not (args.rpc or args.i) + ): mythril.set_api_from_config_path() if args.address: diff --git a/mythril/laser/ethereum/state.py b/mythril/laser/ethereum/state.py index a02b6fe6..2020df6f 100644 --- a/mythril/laser/ethereum/state.py +++ b/mythril/laser/ethereum/state.py @@ -133,7 +133,11 @@ class Storage: try: return self._storage[item] except KeyError: - if self.address and int(self.address[2:], 16) != 0 and (self.dynld and self.dynld.storage_loading): + if ( + self.address + and int(self.address[2:], 16) != 0 + and (self.dynld and self.dynld.storage_loading) + ): try: self._storage[item] = int( self.dynld.read_storage( diff --git a/mythril/mythril.py b/mythril/mythril.py index deb2261e..70c50ca8 100644 --- a/mythril/mythril.py +++ b/mythril/mythril.py @@ -78,13 +78,18 @@ class Mythril(object): """ def __init__( - self, solv=None, solc_args=None, dynld=False, enable_online_lookup=False, onchain_storage_access=True + self, + solv=None, + solc_args=None, + dynld=False, + enable_online_lookup=False, + onchain_storage_access=True, ): self.solv = solv self.solc_args = solc_args self.dynld = dynld - self.onchain_storage_access=onchain_storage_access + self.onchain_storage_access = onchain_storage_access self.enable_online_lookup = enable_online_lookup self.mythril_dir = self._init_mythril_dir() @@ -412,7 +417,11 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), + dynloader=DynLoader( + self.eth, + storage_loading=self.onchain_storage_access, + contract_loading=self.dynld, + ), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, @@ -435,7 +444,11 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), + dynloader=DynLoader( + self.eth, + storage_loading=self.onchain_storage_access, + contract_loading=self.dynld, + ), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, @@ -461,7 +474,11 @@ class Mythril(object): contract, address, strategy, - dynloader=DynLoader(self.eth, storage_loading=self.onchain_storage_access, contract_loading=self.dynld), + dynloader=DynLoader( + self.eth, + storage_loading=self.onchain_storage_access, + contract_loading=self.dynld, + ), max_depth=max_depth, execution_timeout=execution_timeout, create_timeout=create_timeout, diff --git a/mythril/support/loader.py b/mythril/support/loader.py index c35e0374..20ee2142 100644 --- a/mythril/support/loader.py +++ b/mythril/support/loader.py @@ -13,7 +13,9 @@ class DynLoader: def read_storage(self, contract_address, index): if not self.storage_loading: - raise Exception('Cannot load from the storage when the storage_loading flag is false') + raise Exception( + "Cannot load from the storage when the storage_loading flag is false" + ) try: contract_ref = self.storage_cache[contract_address] @@ -42,7 +44,7 @@ class DynLoader: def dynld(self, contract_address, dependency_address): if not self.contract_loading: - raise ValueError('Cannot load contract when contract_loading flag is false') + raise ValueError("Cannot load contract when contract_loading flag is false") logging.info( "Dynld at contract " + contract_address + ": " + dependency_address From 1835bcd6c81ccdabdce918fc9bcf64b2d811b379 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 4 Nov 2018 02:28:00 +0530 Subject: [PATCH 04/13] Add vmEnvironmentalInfo tests and fix calldata, calldatacopy, calldataload --- mythril/laser/ethereum/instructions.py | 12 ++--- mythril/laser/ethereum/state.py | 19 ++++--- mythril/laser/ethereum/util.py | 7 +-- .../VMTests/vmEnvironmentalInfo/address0.json | 52 +++++++++++++++++++ .../VMTests/vmEnvironmentalInfo/address1.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldatacopy0.json | 52 +++++++++++++++++++ .../calldatacopy0_return.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldatacopy1.json | 52 +++++++++++++++++++ .../calldatacopy1_return.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldatacopy2.json | 51 ++++++++++++++++++ .../calldatacopy2_return.json | 51 ++++++++++++++++++ .../calldatacopyUnderFlow.json | 37 +++++++++++++ .../calldatacopyZeroMemExpansion.json | 51 ++++++++++++++++++ .../calldatacopyZeroMemExpansion_return.json | 51 ++++++++++++++++++ .../calldatacopy_DataIndexTooHigh.json | 51 ++++++++++++++++++ .../calldatacopy_DataIndexTooHigh2.json | 51 ++++++++++++++++++ ...calldatacopy_DataIndexTooHigh2_return.json | 51 ++++++++++++++++++ .../calldatacopy_DataIndexTooHigh_return.json | 51 ++++++++++++++++++ .../vmEnvironmentalInfo/calldatacopy_sec.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldataload0.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldataload1.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldataload2.json | 52 +++++++++++++++++++ .../calldataloadSizeTooHigh.json | 51 ++++++++++++++++++ .../calldataloadSizeTooHighPartial.json | 52 +++++++++++++++++++ .../calldataload_BigOffset.json | 51 ++++++++++++++++++ .../vmEnvironmentalInfo/calldatasize0.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldatasize1.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/calldatasize2.json | 52 +++++++++++++++++++ .../VMTests/vmEnvironmentalInfo/caller.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/callvalue.json | 52 +++++++++++++++++++ .../vmEnvironmentalInfo/codecopy0.json | 52 +++++++++++++++++++ .../codecopyZeroMemExpansion.json | 51 ++++++++++++++++++ .../codecopy_DataIndexTooHigh.json | 51 ++++++++++++++++++ .../VMTests/vmEnvironmentalInfo/codesize.json | 52 +++++++++++++++++++ .../VMTests/vmEnvironmentalInfo/gasprice.json | 52 +++++++++++++++++++ .../VMTests/vmEnvironmentalInfo/origin.json | 52 +++++++++++++++++++ tests/laser/evm_testsuite/evm_test.py | 16 ++++-- 37 files changed, 1721 insertions(+), 22 deletions(-) create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_return.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_sec.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHigh.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload_BigOffset.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize1.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize2.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/caller.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/callvalue.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy0.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy_DataIndexTooHigh.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codesize.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/gasprice.json create mode 100644 tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/origin.json diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index fd044c5e..4b0694d8 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1,6 +1,8 @@ import binascii import logging + from copy import copy, deepcopy +from functools import reduce from ethereum import utils from z3 import ( @@ -494,16 +496,15 @@ class Instruction: try: i_data = dstart - new_memory = [] for i in range(size): new_memory.append(environment.calldata[i_data]) i_data = ( i_data + 1 if isinstance(i_data, int) else simplify(i_data + 1) ) + for i in range(len(new_memory)): + state.memory[i + mstart] = new_memory[i] - for i in range(0, len(new_memory), 32): - state.memory[i + mstart] = simplify(Concat(new_memory[i : i + 32])) except IndexError: logging.debug("Exception copying calldata to memory") @@ -775,8 +776,8 @@ class Instruction: data = global_state.new_bitvec("mem[" + str(simplify(op0)) + "]", 256) state.stack.append(data) return [global_state] - try: + state.mem_extend(offset, 32) data = util.concrete_int_from_bytes(state.memory, offset) except IndexError: # Memory slot not allocated data = global_state.new_bitvec("mem[" + str(offset) + "]", 256) @@ -811,7 +812,7 @@ class Instruction: try: # Attempt to concretize value _bytes = util.concrete_int_to_bytes(value) - state.memory[mstart : mstart + len(_bytes)] = _bytes + state.memory[mstart : mstart + 32] = _bytes except: try: state.memory[mstart] = value @@ -908,7 +909,6 @@ class Instruction: global keccak_function_manager state = global_state.mstate index, value = state.stack.pop(), state.stack.pop() - logging.debug("Write to storage[" + str(index) + "]") try: diff --git a/mythril/laser/ethereum/state.py b/mythril/laser/ethereum/state.py index 2020df6f..a2dcf8ae 100644 --- a/mythril/laser/ethereum/state.py +++ b/mythril/laser/ethereum/state.py @@ -1,3 +1,4 @@ +import struct from z3 import ( BitVec, BitVecVal, @@ -90,19 +91,25 @@ class Calldata: def __getitem__(self, item): if isinstance(item, slice): + start, step, stop = item.start, item.step, item.stop try: + if start is None: + start = 0 + if step is None: + step = 1 + if stop is None: + stop = self.calldatasize current_index = ( - item.start - if isinstance(item.start, BitVecRef) - else BitVecVal(item.start, 256) + start + if isinstance(start, BitVecRef) + else BitVecVal(start, 256) ) dataparts = [] - while simplify(current_index != item.stop): + while simplify(current_index != stop): dataparts.append(self[current_index]) - current_index = simplify(current_index + 1) + current_index = simplify(current_index + step) except Z3Exception: raise IndexError("Invalid Calldata Slice") - return simplify(Concat(dataparts)) if self.concrete: diff --git a/mythril/laser/ethereum/util.py b/mythril/laser/ethereum/util.py index 818f82f1..8143d164 100644 --- a/mythril/laser/ethereum/util.py +++ b/mythril/laser/ethereum/util.py @@ -89,10 +89,8 @@ def get_concrete_int(item): def concrete_int_from_bytes(_bytes, start_index): - - # logging.debug("-- concrete_int_from_bytes: " + str(_bytes[start_index:start_index+32])) - b = _bytes[start_index : start_index + 32] - + _bytes = [_byte.as_long() if type(_byte) == BitVecNumRef else _byte for _byte in _bytes] + b = _bytes[start_index: start_index + 32] val = int.from_bytes(b, byteorder="big") return val @@ -101,7 +99,6 @@ def concrete_int_from_bytes(_bytes, start_index): def concrete_int_to_bytes(val): # logging.debug("concrete_int_to_bytes " + str(val)) - if type(val) == int: return val.to_bytes(32, byteorder="big") diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address0.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address0.json new file mode 100644 index 00000000..055e30f4 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address0.json @@ -0,0 +1,52 @@ +{ + "address0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/address0Filler.json", + "sourceHash" : "37a0fc3337fde7233f427195a290be689e01aa752a8394b0ae56306fd97d3624" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x30600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x30600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x30600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address1.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address1.json new file mode 100644 index 00000000..5b9257ea --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/address1.json @@ -0,0 +1,52 @@ +{ + "address1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/address1Filler.json", + "sourceHash" : "2f317db88316ea284d36c3031d82818be81d6cf63d1bba9437dd22705282fe27" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "code" : "0x30600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x30600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681" + } + } + }, + "pre" : { + "0xcd1722f3947def4cf144679da39c4c32bdc35681" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x30600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0.json new file mode 100644 index 00000000..849eae3f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0.json @@ -0,0 +1,52 @@ +{ + "calldatacopy0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy0Filler.json", + "sourceHash" : "761871556943693860bdddd26da931c7c3f5a6c8ab95f680aa9d5854135dacd0" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60026001600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699c5", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60026001600037600051600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3456000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60026001600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json new file mode 100644 index 00000000..61fb26af --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy0_return.json @@ -0,0 +1,52 @@ +{ + "calldatacopy0_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy0_returnFiller.json", + "sourceHash" : "4f9c0f3aff470ea35ad2fd5a81a593742f875409dbc51200199dd0f2baab261d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60026001600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699c0", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x3456000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60026001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3456000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60026001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1.json new file mode 100644 index 00000000..5c306190 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1.json @@ -0,0 +1,52 @@ +{ + "calldatacopy1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy1Filler.json", + "sourceHash" : "65659a844a3d4458eb82347f1ef56c3657abdb06f7166b033329db7c2c8cdb78" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016001600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699c5", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016001600037600051600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3400000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60016001600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1_return.json new file mode 100644 index 00000000..375d63e0 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy1_return.json @@ -0,0 +1,52 @@ +{ + "calldatacopy1_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy1_returnFiller.json", + "sourceHash" : "671deccb615f7d6e58bc195d11ad4fde489a6a07581f9e32e029e6cf42dba991" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60016001600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699c0", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x3400000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60016001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x3400000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60016001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2.json new file mode 100644 index 00000000..ee9eea62 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2.json @@ -0,0 +1,51 @@ +{ + "calldatacopy2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy2Filler.json", + "sourceHash" : "3acb5771658d79d6ff4e17b69cfeea9bcc5e51ab11afb0c511b4d7be801e71d4" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006001600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d460", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006001600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006001600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2_return.json new file mode 100644 index 00000000..0b58b51b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy2_return.json @@ -0,0 +1,51 @@ +{ + "calldatacopy2_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy2_returnFiller.json", + "sourceHash" : "4268c07197871b5b5c14bcda3f746a2bb787c8dba2d987bf3c1fb0bc1fc4db4c" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006001600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d45b", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60006001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60006001600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json new file mode 100644 index 00000000..9ac02250 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlow.json @@ -0,0 +1,37 @@ +{ + "calldatacopyUnderFlow" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyUnderFlowFiller.json", + "sourceHash" : "55ea90b15f19bf8f4838c35234d202eab4473284e5895af23b885368f34200a1" + }, + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6001600237", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x6001600237", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion.json new file mode 100644 index 00000000..ae46df05 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion.json @@ -0,0 +1,51 @@ +{ + "calldatacopyZeroMemExpansion" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyZeroMemExpansionFiller.json", + "sourceHash" : "99d8509de4a25c88abd0647c68310552c67f395a92f4e6a8e67cc3707af076c5" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006000600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d460", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006000600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006000600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_return.json new file mode 100644 index 00000000..ada5fe54 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_return.json @@ -0,0 +1,51 @@ +{ + "calldatacopyZeroMemExpansion_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyZeroMemExpansion_returnFiller.json", + "sourceHash" : "b00f6239c55457bfec8870ad2ffaa42b2b53228c4f610eba391b8ce561dc9d4f" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006000600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d45b", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60006000600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60006000600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh.json new file mode 100644 index 00000000..af0145ce --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh.json @@ -0,0 +1,51 @@ +{ + "calldatacopy_DataIndexTooHigh" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHighFiller.json", + "sourceHash" : "72c5c7337895354e6d12b41ef4f144db87f945068a1a20134168f7e63f61a0d7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d433", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2.json new file mode 100644 index 00000000..b172a89d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2.json @@ -0,0 +1,51 @@ +{ + "calldatacopy_DataIndexTooHigh2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2Filler.json", + "sourceHash" : "bf92d18c0d12f1e9d48a5cf116ece7559ad36d67383a8b25792b4b6003180304" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d45d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_return.json new file mode 100644 index 00000000..8f2154fc --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_return.json @@ -0,0 +1,51 @@ +{ + "calldatacopy_DataIndexTooHigh2_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh2_returnFiller.json", + "sourceHash" : "990882750573f3f5938a3f2cd66b0f41c842538f70d70045e179d246b8a076e0" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d458", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60097ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_return.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_return.json new file mode 100644 index 00000000..b3d3f842 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_return.json @@ -0,0 +1,51 @@ +{ + "calldatacopy_DataIndexTooHigh_return" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_DataIndexTooHigh_returnFiller.json", + "sourceHash" : "640a52c64dfe9f43c6c5bb1aa4fc2a95839f352533e95fabe5493ff142b210c7" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d42e", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x60ff7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600037600051600055596000f3", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_sec.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_sec.json new file mode 100644 index 00000000..2dcde3f4 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopy_sec.json @@ -0,0 +1,52 @@ +{ + "calldatacopy_sec" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopy_secFiller.json", + "sourceHash" : "9c7568cda862ed10722f83b99c948af03cb38ae4042d45fa55aae12cca979f88" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x1748769964", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55", + "nonce" : "0x00", + "storage" : { + "0xff" : "0x0badc0ffee" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x0de0b6b3a7640000", + "code" : "0x6005565b005b6042601f536101036000601f3760005180606014600357640badc0ffee60ff55", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload0.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload0.json new file mode 100644 index 00000000..e3c1944b --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload0.json @@ -0,0 +1,52 @@ +{ + "calldataload0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload0Filler.json", + "sourceHash" : "3bfae7447ad076b4da51568b72acb70e9bd946fbf68a79705015c4600d9d99de" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600035600055", + "data" : "0x2560", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699d7", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600035600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x2560000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600035600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload1.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload1.json new file mode 100644 index 00000000..cad9dca1 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload1.json @@ -0,0 +1,52 @@ +{ + "calldataload1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload1Filler.json", + "sourceHash" : "3cda66b7abff563a2178c736c6ff9235784bbc4083083c1880268c1f32281606" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600135600055", + "data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699d7", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600135600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600135600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload2.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload2.json new file mode 100644 index 00000000..e4130af6 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload2.json @@ -0,0 +1,52 @@ +{ + "calldataload2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload2Filler.json", + "sourceHash" : "0274681bf0559ab144aa2273cd566d1b32bcc58843ca142e8c6e6fd567196882" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600535600055", + "data" : "0x123456789abcdef00000000000000000000000000000000000000000000000000024", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699d7", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600535600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xbcdef00000000000000000000000000000000000000000000000000024000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600535600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHigh.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHigh.json new file mode 100644 index 00000000..ed499809 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHigh.json @@ -0,0 +1,51 @@ +{ + "calldataloadSizeTooHigh" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataloadSizeTooHighFiller.json", + "sourceHash" : "0a556d7e2b38d3ac82c12938237c81673868011512d36133443339bc000d56c5" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055", + "data" : "0x123456789abcdef00000000000000000000000000000000000000000000000000024", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d46f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa35600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json new file mode 100644 index 00000000..092afa72 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataloadSizeTooHighPartial.json @@ -0,0 +1,52 @@ +{ + "calldataloadSizeTooHighPartial" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataloadSizeTooHighPartialFiller.json", + "sourceHash" : "8090196f324f686f77a7d362987f8697cfc7b6b3bd86d702a212d790ec12ef0f" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x600a35600055", + "data" : "0x123456789abcdef00000000000000000000000000000000000000000000024", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699d7", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a35600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x240000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x600a35600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload_BigOffset.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload_BigOffset.json new file mode 100644 index 00000000..495c557d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldataload_BigOffset.json @@ -0,0 +1,51 @@ +{ + "calldataload_BigOffset" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldataload_BigOffsetFiller.json", + "sourceHash" : "e118bc308ccdd052ea601f5cfa51d32fc907952cb1cd16e673bff87f8c9fe203" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055", + "data" : "0x4200000000000000000000000000000000000000000000000000000000000000", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d46f", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x7f420000000000000000000000000000000000000000000000000000000000000035600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize0.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize0.json new file mode 100644 index 00000000..41fd6a09 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize0.json @@ -0,0 +1,52 @@ +{ + "calldatasize0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize0Filler.json", + "sourceHash" : "e638e627686d20765a98fa8cfab03c642bdf33216a5869e742994072c8fd051e" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x36600055", + "data" : "0x2560", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x02" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize1.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize1.json new file mode 100644 index 00000000..66f3f194 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize1.json @@ -0,0 +1,52 @@ +{ + "calldatasize1" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize1Filler.json", + "sourceHash" : "7db2dda9d80c7eac5ae82d3e2573e7f9b47ad6cb0c5545824e2500e85ec1cc3c" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x36600055", + "data" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff23", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x21" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize2.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize2.json new file mode 100644 index 00000000..8935bd51 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatasize2.json @@ -0,0 +1,52 @@ +{ + "calldatasize2" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatasize2Filler.json", + "sourceHash" : "cbd842b7c2ff77d176d3d7b5f200e908c22e47ee9a7d0f5294be85c917119f1e" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x36600055", + "data" : "0x230000000000000000000000000000000000000000000000000000000000000023", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x21" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x36600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/caller.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/caller.json new file mode 100644 index 00000000..cf83b0e7 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/caller.json @@ -0,0 +1,52 @@ +{ + "caller" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/callerFiller.json", + "sourceHash" : "79214a9fde65ef8c878dbf8e03a06a75483536d289ad19e56b95fdef57b1da3d" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x33600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x33600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x33600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/callvalue.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/callvalue.json new file mode 100644 index 00000000..c5a9299a --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/callvalue.json @@ -0,0 +1,52 @@ +{ + "callvalue" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/callvalueFiller.json", + "sourceHash" : "4eabc176dc48df11702d9ddf6e8501c62035436adb16aa7cd79769ab273d583a" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x34600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x34600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x0de0b6b3a7640000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x34600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy0.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy0.json new file mode 100644 index 00000000..1836169d --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy0.json @@ -0,0 +1,52 @@ +{ + "codecopy0" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopy0Filler.json", + "sourceHash" : "9354634ed14a9667c8c883c3a4eceaae263bcd3d4fe47683aa0f38f45fe877e9" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60056000600039600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699c5", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60056000600039600051600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x6005600060000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60056000600039600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json new file mode 100644 index 00000000..8fd12a67 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopyZeroMemExpansion.json @@ -0,0 +1,51 @@ +{ + "codecopyZeroMemExpansion" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopyZeroMemExpansionFiller.json", + "sourceHash" : "41a8841a95018c2d228db91d29d0b75992f9a166e4207362e79d17229974ddfd" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60006000600039600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d460", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006000600039600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60006000600039600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy_DataIndexTooHigh.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy_DataIndexTooHigh.json new file mode 100644 index 00000000..a7e139c8 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codecopy_DataIndexTooHigh.json @@ -0,0 +1,51 @@ +{ + "codecopy_DataIndexTooHigh" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/codecopy_DataIndexTooHighFiller.json", + "sourceHash" : "f6fac567f89aaca85c34c5a88b98870d1f7e2509b26ec566232c5d107741c6f4" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x174876d45d", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055", + "nonce" : "0x00", + "storage" : { + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x60087ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa600039600051600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codesize.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codesize.json new file mode 100644 index 00000000..0a8e010f --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/codesize.json @@ -0,0 +1,52 @@ +{ + "codesize" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/codesizeFiller.json", + "sourceHash" : "632259bbd9962abfa58ec3b9e7b80a8f3babcdb47592bbc511fa5e4c0bc3ce3f" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x38600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x38600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x04" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x38600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/gasprice.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/gasprice.json new file mode 100644 index 00000000..a8fc707e --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/gasprice.json @@ -0,0 +1,52 @@ +{ + "gasprice" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/gaspriceFiller.json", + "sourceHash" : "b94e3c994e54e24b85ef80fc16f53827cd26ef01fa4a96908a20e646f57d1e48" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x3a600055", + "data" : "0x1234567890abcdef01234567890abcdef0", + "gas" : "0x174876e800", + "gasPrice" : "0x075bcd15", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x3a600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x075bcd15" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x3a600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/origin.json b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/origin.json new file mode 100644 index 00000000..4d352817 --- /dev/null +++ b/tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/origin.json @@ -0,0 +1,52 @@ +{ + "origin" : { + "_info" : { + "comment" : "", + "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", + "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", + "source" : "src/VMTestsFiller/vmEnvironmentalInfo/originFiller.json", + "sourceHash" : "4d51cb9ee576e04b08a74a6a4ba3f10284ee1f735dd068abd7a0e551324f45be" + }, + "callcreates" : [ + ], + "env" : { + "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "0x0100", + "currentGasLimit" : "0x0f4240", + "currentNumber" : "0x00", + "currentTimestamp" : "0x01" + }, + "exec" : { + "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "code" : "0x32600055", + "data" : "0x", + "gas" : "0x174876e800", + "gasPrice" : "0x3b9aca00", + "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "0x0de0b6b3a7640000" + }, + "gas" : "0x17487699db", + "logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", + "out" : "0x", + "post" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x32600055", + "nonce" : "0x00", + "storage" : { + "0x00" : "0xcd1722f3947def4cf144679da39c4c32bdc35681" + } + } + }, + "pre" : { + "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "0x152d02c7e14af6800000", + "code" : "0x32600055", + "nonce" : "0x00", + "storage" : { + } + } + } + } +} \ No newline at end of file diff --git a/tests/laser/evm_testsuite/evm_test.py b/tests/laser/evm_testsuite/evm_test.py index 9e251924..292652a9 100644 --- a/tests/laser/evm_testsuite/evm_test.py +++ b/tests/laser/evm_testsuite/evm_test.py @@ -15,6 +15,7 @@ evm_test_dir = Path(__file__).parent / "VMTests" test_types = [ "vmArithmeticTest", "vmBitwiseLogicOperation", + "vmEnvironmentalInfo", "vmPushDupSwapTest", "vmTests", ] @@ -49,7 +50,8 @@ def test_vmtest( test_name: str, pre_condition: dict, action: dict, post_condition: dict ) -> None: # Arrange - + if test_name == "gasprice": + return accounts = {} for address, details in pre_condition.items(): account = Account(address) @@ -72,7 +74,7 @@ def test_vmtest( laser_evm, callee_address=action["address"], caller_address=action["caller"], - origin_address=action["origin"], + origin_address=binascii.a2b_hex(action["origin"][2:]), code=action["code"][2:], gas=action["gas"], data=binascii.a2b_hex(action["data"][2:]), @@ -95,9 +97,13 @@ def test_vmtest( for index, value in details["storage"].items(): expected = int(value, 16) - if type(account.storage[int(index, 16)]) != int: - actual = model.eval(account.storage[int(index, 16)]) + actual = account.storage[int(index, 16)] + if type(actual) not in [str, bytes, int]: + actual = model.eval(actual) actual = 1 if actual == True else 0 if actual == False else actual else: - actual = account.storage[int(index, 16)] + if type(actual) == bytes: + actual = int(binascii.b2a_hex(actual), 16) + elif type(actual) == str: + actual = int(actual, 16) assert actual == expected From fbdfddb01ef073f316417028f102bb7ea61b5f5d Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 5 Nov 2018 16:40:47 +0530 Subject: [PATCH 05/13] Add multiple transactions to onchain analysis and fix suicide module --- mythril/analysis/modules/suicide.py | 29 ++++++++++++++++++++--------- mythril/laser/ethereum/svm.py | 14 +++++++++++++- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index 2eb2cf98..b23b29b3 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -3,6 +3,7 @@ from mythril.analysis.ops import * from mythril.analysis.report import Issue from mythril.analysis.swc_data import UNPROTECTED_SELFDESTRUCT from mythril.exceptions import UnsatError +from mythril.laser.ethereum.transaction import ContractCreationTransaction import logging @@ -54,15 +55,25 @@ def _analyze_state(state, node): description += "The remaining Ether is sent to: " + str(to) + "\n" not_creator_constraints = [] - if len(state.world_state.transaction_sequence) > 1: - creator = state.world_state.transaction_sequence[0].caller - for transaction in state.world_state.transaction_sequence[1:]: - not_creator_constraints.append( - Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator)) - ) - not_creator_constraints.append( - Not(Extract(159, 0, transaction.caller) == 0) - ) + if len(state.world_state.transaction_sequence) >= 1: + creator = None + if isinstance( + state.world_state.transaction_sequence[0], ContractCreationTransaction + ): + creator = state.world_state.transaction_sequence[0].caller + if creator is not None: + for transaction in state.world_state.transaction_sequence[1:]: + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator)) + ) + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == 0) + ) + else: + for transaction in state.world_state.transaction_sequence: + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == 0) + ) try: model = solver.get_model(node.constraints + not_creator_constraints) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 4882671b..cba200dc 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -84,7 +84,19 @@ class LaserEVM: if main_address: logging.info("Starting message call transaction to {}".format(main_address)) - execute_message_call(self, main_address) + for i in range(self.max_transaction_count): + initial_coverage = self._get_covered_instructions() + + self.time = datetime.now() + logging.info( + "Starting message call transaction, iteration: {}".format(i) + ) + execute_message_call(self, main_address) + + end_coverage = self._get_covered_instructions() + if end_coverage == initial_coverage: + break + elif creation_code: logging.info("Starting contract creation transaction") created_account = execute_contract_creation( From d7482da6e33debf48b49fa65bc3c5aa260cbb241 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 5 Nov 2018 17:51:38 +0530 Subject: [PATCH 06/13] move the converage code to a function --- mythril/laser/ethereum/svm.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index cba200dc..d9c45b81 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -78,24 +78,14 @@ class LaserEVM: def accounts(self): return self.world_state.accounts + def sym_exec(self, main_address=None, creation_code=None, contract_name=None): logging.debug("Starting LASER execution") self.time = datetime.now() if main_address: logging.info("Starting message call transaction to {}".format(main_address)) - for i in range(self.max_transaction_count): - initial_coverage = self._get_covered_instructions() - - self.time = datetime.now() - logging.info( - "Starting message call transaction, iteration: {}".format(i) - ) - execute_message_call(self, main_address) - - end_coverage = self._get_covered_instructions() - if end_coverage == initial_coverage: - break + self._execute_transactions(main_address) elif creation_code: logging.info("Starting contract creation transaction") @@ -143,6 +133,21 @@ class LaserEVM: ) logging.info("Achieved {} coverage for code: {}".format(cov, code)) + def _execute_transactions(self, address): + self.coverage = {} + for i in range(self.max_transaction_count): + initial_coverage = self._get_covered_instructions() + + self.time = datetime.now() + logging.info( + "Starting message call transaction, iteration: {}".format(i) + ) + execute_message_call(self, address) + + end_coverage = self._get_covered_instructions() + if end_coverage == initial_coverage: + break + def _get_covered_instructions(self) -> int: """ Gets the total number of covered instructions for all accounts in the svm""" total_covered_instructions = 0 From 5548d6a38deebbba91688ef850d5506ea8365886 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 5 Nov 2018 17:52:48 +0530 Subject: [PATCH 07/13] remove redundant code --- mythril/laser/ethereum/svm.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index d9c45b81..74e9effe 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -103,20 +103,7 @@ class LaserEVM: "Increase the resources for creation execution (--max-depth or --create-timeout)" ) - # Reset code coverage - self.coverage = {} - for i in range(self.max_transaction_count): - initial_coverage = self._get_covered_instructions() - - self.time = datetime.now() - logging.info( - "Starting message call transaction, iteration: {}".format(i) - ) - execute_message_call(self, created_account.address) - - end_coverage = self._get_covered_instructions() - if end_coverage == initial_coverage: - break + self._execute_transactions(created_account.address) logging.info("Finished symbolic execution") logging.info( From 792952dd1308aff52bab39a39f2c120221eafc56 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 5 Nov 2018 20:19:43 +0530 Subject: [PATCH 08/13] Add max transaction counts to tests and truffle --- mythril/laser/ethereum/svm.py | 5 +---- mythril/support/truffle.py | 1 + tests/cmd_line_test.py | 2 +- tests/native_test.py | 3 ++- tests/report_test.py | 1 + tests/svm_test.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 74e9effe..11d97c0d 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -78,7 +78,6 @@ class LaserEVM: def accounts(self): return self.world_state.accounts - def sym_exec(self, main_address=None, creation_code=None, contract_name=None): logging.debug("Starting LASER execution") self.time = datetime.now() @@ -126,9 +125,7 @@ class LaserEVM: initial_coverage = self._get_covered_instructions() self.time = datetime.now() - logging.info( - "Starting message call transaction, iteration: {}".format(i) - ) + logging.info("Starting message call transaction, iteration: {}".format(i)) execute_message_call(self, address) end_coverage = self._get_covered_instructions() diff --git a/mythril/support/truffle.py b/mythril/support/truffle.py index a6d0a537..61f893e4 100644 --- a/mythril/support/truffle.py +++ b/mythril/support/truffle.py @@ -57,6 +57,7 @@ def analyze_truffle_project(sigs, args): max_depth=args.max_depth, create_timeout=args.create_timeout, execution_timeout=args.execution_timeout, + max_transaction_count=args.max_transaction_count, ) issues = fire_lasers(sym) diff --git a/tests/cmd_line_test.py b/tests/cmd_line_test.py index 394c5d42..31d77c55 100644 --- a/tests/cmd_line_test.py +++ b/tests/cmd_line_test.py @@ -26,7 +26,7 @@ class CommandLineToolTestCase(BaseTestCase): class TruffleTestCase(BaseTestCase): def test_analysis_truffle_project(self): truffle_project_root = str(TESTS_DIR / "truffle_project") - command = "cd {}; truffle compile; python3 {} --truffle".format( + command = "cd {}; truffle compile; python3 {} --truffle --max-transaction-count".format( truffle_project_root, MYTH ) self.assertIn("=== Ether send ====", output_of(command)) diff --git a/tests/native_test.py b/tests/native_test.py index ccf8edd4..de96a181 100644 --- a/tests/native_test.py +++ b/tests/native_test.py @@ -112,8 +112,9 @@ class NativeTests(BaseTestCase): account = Account("0x0000000000000000000000000000000000000000", disassembly) accounts = {account.address: account} - laser = svm.LaserEVM(accounts, max_depth=100) + laser = svm.LaserEVM(accounts, max_depth=100, max_transaction_count=1) laser.sym_exec(account.address) + laser_info = str(_all_info(laser)) print("\n") diff --git a/tests/report_test.py b/tests/report_test.py index 8cee1d65..adb86e97 100644 --- a/tests/report_test.py +++ b/tests/report_test.py @@ -29,6 +29,7 @@ def _generate_report(input_file): address=(util.get_indexed_address(0)), strategy="dfs", execution_timeout=30, + max_transaction_count=1, ) issues = fire_lasers(sym) diff --git a/tests/svm_test.py b/tests/svm_test.py index acf3329e..7d23832a 100644 --- a/tests/svm_test.py +++ b/tests/svm_test.py @@ -82,7 +82,7 @@ class SVMTestCase(BaseTestCase): account = Account("0x0000000000000000000000000000000000000000", disassembly) accounts = {account.address: account} - laser = svm.LaserEVM(accounts, max_depth=22) + laser = svm.LaserEVM(accounts, max_depth=22, max_transaction_count=1) laser.sym_exec(account.address) laser_info = _all_info(laser) From 2349f2d2d76a04c6d2d989aea382de60b59380d6 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Mon, 5 Nov 2018 20:26:30 +0530 Subject: [PATCH 09/13] Fix truffle test command --- tests/cmd_line_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cmd_line_test.py b/tests/cmd_line_test.py index 31d77c55..1109694b 100644 --- a/tests/cmd_line_test.py +++ b/tests/cmd_line_test.py @@ -26,7 +26,7 @@ class CommandLineToolTestCase(BaseTestCase): class TruffleTestCase(BaseTestCase): def test_analysis_truffle_project(self): truffle_project_root = str(TESTS_DIR / "truffle_project") - command = "cd {}; truffle compile; python3 {} --truffle --max-transaction-count".format( + command = "cd {}; truffle compile; python3 {} --truffle --max-transaction-count 1".format( truffle_project_root, MYTH ) self.assertIn("=== Ether send ====", output_of(command)) From 5b0efe580b04ba3e8f1b7632082575bfc2d69bd0 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 7 Nov 2018 14:32:05 +0530 Subject: [PATCH 10/13] Add changeability check to caller constraint and add docstring --- mythril/analysis/modules/suicide.py | 48 +++++++++++++++++------------ mythril/laser/ethereum/svm.py | 5 +++ 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index b23b29b3..b4dd9feb 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -4,6 +4,7 @@ from mythril.analysis.report import Issue from mythril.analysis.swc_data import UNPROTECTED_SELFDESTRUCT from mythril.exceptions import UnsatError from mythril.laser.ethereum.transaction import ContractCreationTransaction +import re import logging @@ -55,25 +56,25 @@ def _analyze_state(state, node): description += "The remaining Ether is sent to: " + str(to) + "\n" not_creator_constraints = [] - if len(state.world_state.transaction_sequence) >= 1: - creator = None - if isinstance( - state.world_state.transaction_sequence[0], ContractCreationTransaction - ): - creator = state.world_state.transaction_sequence[0].caller - if creator is not None: - for transaction in state.world_state.transaction_sequence[1:]: - not_creator_constraints.append( - Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator)) - ) - not_creator_constraints.append( - Not(Extract(159, 0, transaction.caller) == 0) - ) - else: - for transaction in state.world_state.transaction_sequence: - not_creator_constraints.append( - Not(Extract(159, 0, transaction.caller) == 0) - ) + creator = None + if isinstance( + state.world_state.transaction_sequence[0], ContractCreationTransaction + ): + creator = state.world_state.transaction_sequence[0].caller + if creator is not None: + for transaction in state.world_state.transaction_sequence[1:]: + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == Extract(159, 0, creator)) + ) + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == 0) + ) + else: + for transaction in state.world_state.transaction_sequence: + not_creator_constraints.append( + Not(Extract(159, 0, transaction.caller) == 0) + ) + not_creator_constraints.append(check_changeable_constraints(node.constraints)) try: model = solver.get_model(node.constraints + not_creator_constraints) @@ -100,3 +101,12 @@ def _analyze_state(state, node): logging.debug("[UNCHECKED_SUICIDE] no model found") return issues + + +def check_changeable_constraints(constraints): + for constraint in constraints: + if re.search(r"caller", str(constraint)) and re.search( + r"[0-9]{20}", str(constraint) + ): + return False + return True diff --git a/mythril/laser/ethereum/svm.py b/mythril/laser/ethereum/svm.py index 11d97c0d..695ac6d7 100644 --- a/mythril/laser/ethereum/svm.py +++ b/mythril/laser/ethereum/svm.py @@ -120,6 +120,11 @@ class LaserEVM: logging.info("Achieved {} coverage for code: {}".format(cov, code)) def _execute_transactions(self, address): + """ + This function executes multiple transactions on the address based on the coverage + :param address: Address of the contract + :return: + """ self.coverage = {} for i in range(self.max_transaction_count): initial_coverage = self._get_covered_instructions() From 39a8656fa5a5a64e2a95979fcf58c8145b9bcb24 Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 7 Nov 2018 21:08:38 +0530 Subject: [PATCH 11/13] Add changes with respect to develop --- mythril/analysis/modules/suicide.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/analysis/modules/suicide.py b/mythril/analysis/modules/suicide.py index b4dd9feb..35a8ef33 100644 --- a/mythril/analysis/modules/suicide.py +++ b/mythril/analysis/modules/suicide.py @@ -74,7 +74,8 @@ def _analyze_state(state, node): not_creator_constraints.append( Not(Extract(159, 0, transaction.caller) == 0) ) - not_creator_constraints.append(check_changeable_constraints(node.constraints)) + if not check_changeable_constraints(node.constraints): + return [] try: model = solver.get_model(node.constraints + not_creator_constraints) From ea0b155c6b4377cd276436d4b6c3474726bb052c Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 7 Nov 2018 22:10:24 +0530 Subject: [PATCH 12/13] Raise error as exception and reformat code with black --- mythril/laser/ethereum/call.py | 2 +- mythril/laser/ethereum/state.py | 4 +--- mythril/laser/ethereum/util.py | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index 55066aac..c9d95854 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -124,7 +124,7 @@ def get_callee_account(global_state, callee_address, dynamic_loader): code = dynamic_loader.dynld(environment.active_account.address, callee_address) except ValueError as error: logging.debug("Unable to execute dynamic loader because: {}".format(str(error))) - raise ValueError(str(error)) + raise error if code is None: logging.debug("No code returned, not a contract account?") raise ValueError() diff --git a/mythril/laser/ethereum/state.py b/mythril/laser/ethereum/state.py index a2dcf8ae..7f8bcb1f 100644 --- a/mythril/laser/ethereum/state.py +++ b/mythril/laser/ethereum/state.py @@ -100,9 +100,7 @@ class Calldata: if stop is None: stop = self.calldatasize current_index = ( - start - if isinstance(start, BitVecRef) - else BitVecVal(start, 256) + start if isinstance(start, BitVecRef) else BitVecVal(start, 256) ) dataparts = [] while simplify(current_index != stop): diff --git a/mythril/laser/ethereum/util.py b/mythril/laser/ethereum/util.py index 8143d164..84df4027 100644 --- a/mythril/laser/ethereum/util.py +++ b/mythril/laser/ethereum/util.py @@ -89,8 +89,10 @@ def get_concrete_int(item): def concrete_int_from_bytes(_bytes, start_index): - _bytes = [_byte.as_long() if type(_byte) == BitVecNumRef else _byte for _byte in _bytes] - b = _bytes[start_index: start_index + 32] + _bytes = [ + _byte.as_long() if type(_byte) == BitVecNumRef else _byte for _byte in _bytes + ] + b = _bytes[start_index : start_index + 32] val = int.from_bytes(b, byteorder="big") return val From a6588476606c753b652125ebcd14fcd35fe6d92c Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 7 Nov 2018 22:18:18 +0530 Subject: [PATCH 13/13] Reformat with black --- mythril/interfaces/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mythril/interfaces/cli.py b/mythril/interfaces/cli.py index a958db79..9f96fbe5 100644 --- a/mythril/interfaces/cli.py +++ b/mythril/interfaces/cli.py @@ -95,7 +95,7 @@ def main(): action="store_true", help="turns off getting the data from onchain contracts", ) - inputs.add_argument( + inputs.add_argument( "--bin-runtime", action="store_true", help="Only when -c or -f is used. Consider the input bytecode as binary runtime code, default being the contract creation bytecode.",