Merge pull request #273 from JoranHonig/bugfix/271

Bugfix regex
pull/280/head
Bernhard Mueller 7 years ago committed by GitHub
commit 5340f1142c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      mythril/analysis/modules/delegatecall.py
  2. 2
      mythril/analysis/modules/transaction_order_independence.py

@ -69,15 +69,14 @@ def _symbolic_call(call, state, address, statespace):
if m:
idx = m.group(1)
func = statespace.find_storage_write(state.environment.active_account.address, idx)
func = statespace.find_storage_write(state.environment.active_account.address, idx)
if func:
issue.description = "This contract delegates execution to a contract address in storage slot " + str(
idx) + ". This storage slot can be written to by calling the function `" + func + "`. "
if (func):
issue.description = "This contract delegates execution to a contract address in storage slot " + str(
idx) + ". This storage slot can be written to by calling the function `" + func + "`. "
else:
logging.debug("[DELEGATECALL] No storage writes to index " + str(idx))
else:
logging.debug("[DELEGATECALL] No storage writes to index " + str(idx))
issue.description += "Be aware that the called contract gets unrestricted access to this contract's state."
return [issue]

@ -54,7 +54,7 @@ def _get_states_with_opcode(statespace, opcode):
def _dependent_on_storage(expression):
""" Checks if expression is dependent on a storage symbol and returns the influencing storages"""
pattern = re.compile(r"storage_[a-z0-9_&^]+")
pattern = re.compile(r"storage_[a-z0-9_&^]*[0-9]+")
return pattern.findall(str(simplify(expression)))

Loading…
Cancel
Save