From ef16ac834ec039b2fd44f5b7af698e661a1f43cd Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 19 Jun 2019 12:19:27 -0700 Subject: [PATCH 1/2] Fix lookup of on-chain storage --- mythril/laser/ethereum/call.py | 2 +- mythril/laser/ethereum/state/account.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index 08ef8773..945a83a7 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -96,7 +96,7 @@ def get_callee_address( # attempt to read the contract address from instance storage try: callee_address = dynamic_loader.read_storage( - str(hex(environment.active_account.address.value)), index + hex(environment.active_account.address.value), index ) # TODO: verify whether this happens or not except: diff --git a/mythril/laser/ethereum/state/account.py b/mythril/laser/ethereum/state/account.py index c85726d5..99feb70f 100644 --- a/mythril/laser/ethereum/state/account.py +++ b/mythril/laser/ethereum/state/account.py @@ -38,7 +38,7 @@ class Storage: self._storage[item] = symbol_factory.BitVecVal( int( self.dynld.read_storage( - contract_address=self.address, index=int(item) + contract_address=hex(self.address.value), index=int(item) ), 16, ), From 49ef7482ba69b532ebdde221b10904cb1d61a644 Mon Sep 17 00:00:00 2001 From: Nathan Date: Wed, 19 Jun 2019 12:27:40 -0700 Subject: [PATCH 2/2] Apply black --- mythril/laser/ethereum/state/account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mythril/laser/ethereum/state/account.py b/mythril/laser/ethereum/state/account.py index 99feb70f..191f0641 100644 --- a/mythril/laser/ethereum/state/account.py +++ b/mythril/laser/ethereum/state/account.py @@ -38,7 +38,8 @@ class Storage: self._storage[item] = symbol_factory.BitVecVal( int( self.dynld.read_storage( - contract_address=hex(self.address.value), index=int(item) + contract_address=hex(self.address.value), + index=int(item), ), 16, ),