Fix contract names of deployed contracts (#1284)

* Fix contract names of deployed contracts

* Fix padding of address
pull/1289/head
Nathan 5 years ago committed by Nikhil Parasaram
parent fc5435f281
commit 0610454705
  1. 11
      mythril/laser/ethereum/state/account.py

@ -93,7 +93,7 @@ class Account:
self,
address: Union[BitVec, str],
code=None,
contract_name="unknown",
contract_name=None,
balances: Array = None,
concrete_storage=False,
dynamic_loader=None,
@ -119,7 +119,14 @@ class Account:
)
# Metadata
self.contract_name = contract_name
if contract_name is None:
self.contract_name = (
"{0:#0{1}x}".format(self.address.value, 40)
if not self.address.symbolic
else "unknown"
)
else:
self.contract_name = contract_name
self.deleted = False

Loading…
Cancel
Save