|
|
@ -49,7 +49,7 @@ def get_callee_address(global_state:GlobalState, dynamic_loader: DynLoader, symb |
|
|
|
try: |
|
|
|
try: |
|
|
|
callee_address = hex(util.get_concrete_int(symbolic_to_address)) |
|
|
|
callee_address = hex(util.get_concrete_int(symbolic_to_address)) |
|
|
|
except AttributeError: |
|
|
|
except AttributeError: |
|
|
|
logging.info("Symbolic call encountered") |
|
|
|
logging.debug("Symbolic call encountered") |
|
|
|
|
|
|
|
|
|
|
|
match = re.search(r'storage_(\d+)', str(simplify(symbolic_to_address))) |
|
|
|
match = re.search(r'storage_(\d+)', str(simplify(symbolic_to_address))) |
|
|
|
logging.debug("CALL to: " + str(simplify(symbolic_to_address))) |
|
|
|
logging.debug("CALL to: " + str(simplify(symbolic_to_address))) |
|
|
@ -58,7 +58,7 @@ def get_callee_address(global_state:GlobalState, dynamic_loader: DynLoader, symb |
|
|
|
raise ValueError() |
|
|
|
raise ValueError() |
|
|
|
|
|
|
|
|
|
|
|
index = int(match.group(1)) |
|
|
|
index = int(match.group(1)) |
|
|
|
logging.info("Dynamic contract address at storage index {}".format(index)) |
|
|
|
logging.debug("Dynamic contract address at storage index {}".format(index)) |
|
|
|
|
|
|
|
|
|
|
|
# attempt to read the contract address from instance storage |
|
|
|
# attempt to read the contract address from instance storage |
|
|
|
try: |
|
|
|
try: |
|
|
@ -89,22 +89,22 @@ def get_callee_account(global_state, callee_address, dynamic_loader): |
|
|
|
return global_state.accounts[callee_address] |
|
|
|
return global_state.accounts[callee_address] |
|
|
|
except KeyError: |
|
|
|
except KeyError: |
|
|
|
# We have a valid call address, but contract is not in the modules list |
|
|
|
# We have a valid call address, but contract is not in the modules list |
|
|
|
logging.info("Module with address " + callee_address + " not loaded.") |
|
|
|
logging.debug("Module with address " + callee_address + " not loaded.") |
|
|
|
|
|
|
|
|
|
|
|
if dynamic_loader is None: |
|
|
|
if dynamic_loader is None: |
|
|
|
raise ValueError() |
|
|
|
raise ValueError() |
|
|
|
|
|
|
|
|
|
|
|
logging.info("Attempting to load dependency") |
|
|
|
logging.debug("Attempting to load dependency") |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
code = dynamic_loader.dynld(environment.active_account.address, callee_address) |
|
|
|
code = dynamic_loader.dynld(environment.active_account.address, callee_address) |
|
|
|
except Exception as e: |
|
|
|
except Exception as e: |
|
|
|
logging.info("Unable to execute dynamic loader.") |
|
|
|
logging.debug("Unable to execute dynamic loader.") |
|
|
|
raise ValueError() |
|
|
|
raise ValueError() |
|
|
|
if code is None: |
|
|
|
if code is None: |
|
|
|
logging.info("No code returned, not a contract account?") |
|
|
|
logging.debug("No code returned, not a contract account?") |
|
|
|
raise ValueError() |
|
|
|
raise ValueError() |
|
|
|
logging.info("Dependency loaded: " + callee_address) |
|
|
|
logging.debug("Dependency loaded: " + callee_address) |
|
|
|
|
|
|
|
|
|
|
|
callee_account = Account(callee_address, code, callee_address, dynamic_loader=dynamic_loader) |
|
|
|
callee_account = Account(callee_address, code, callee_address, dynamic_loader=dynamic_loader) |
|
|
|
accounts[callee_address] = callee_account |
|
|
|
accounts[callee_address] = callee_account |
|
|
|