From aab48a8e6381466d3baaeecb020771b0b753b657 Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 29 Mar 2019 12:55:21 +0100 Subject: [PATCH 1/2] remove unnecessary variable from dynamic loading function --- mythril/laser/ethereum/call.py | 2 +- mythril/laser/ethereum/instructions.py | 2 +- mythril/support/loader.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index 27df993e..bb86b7a8 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -136,7 +136,7 @@ def get_callee_account( log.debug("Attempting to load dependency") try: - code = dynamic_loader.dynld(environment.active_account.address, callee_address) + code = dynamic_loader.dynld(callee_address) except ValueError as error: log.debug("Unable to execute dynamic loader because: {}".format(str(error))) raise error diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 09152f80..b6bb61cd 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -1097,7 +1097,7 @@ class Instruction: return [global_state] try: - code = self.dynamic_loader.dynld(environment.active_account.address, addr) + code = self.dynamic_loader.dynld(addr) except (ValueError, AttributeError) as e: log.debug("error accessing contract storage due to: " + str(e)) state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256)) diff --git a/mythril/support/loader.py b/mythril/support/loader.py index 6e434439..7efa1e75 100644 --- a/mythril/support/loader.py +++ b/mythril/support/loader.py @@ -58,7 +58,7 @@ class DynLoader: return data - def dynld(self, contract_address, dependency_address): + def dynld(self, dependency_address): """ :param contract_address: @@ -68,7 +68,7 @@ class DynLoader: if not self.contract_loading: raise ValueError("Cannot load contract when contract_loading flag is false") - log.debug("Dynld at contract " + contract_address + ": " + dependency_address) + log.debug("Dynld at contract " + dependency_address) # Ensure that dependency_address is the correct length, with 0s prepended as needed. dependency_address = ( From 58a32f6f067bab09c571e173d014d6d555acce6e Mon Sep 17 00:00:00 2001 From: Joran Honig Date: Fri, 29 Mar 2019 12:56:12 +0100 Subject: [PATCH 2/2] cleanup comment string --- mythril/support/loader.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mythril/support/loader.py b/mythril/support/loader.py index 7efa1e75..f46feff5 100644 --- a/mythril/support/loader.py +++ b/mythril/support/loader.py @@ -60,8 +60,6 @@ class DynLoader: def dynld(self, dependency_address): """ - - :param contract_address: :param dependency_address: :return: """