Add typehints, remove debug statements

pull/1029/head
Bernhard Mueller 6 years ago
parent 990e84f66a
commit 23478f43ec
  1. 9
      mythril/analysis/modules/dependence_on_predictable_vars.py
  2. 5
      mythril/laser/ethereum/instructions.py

@ -18,18 +18,15 @@ predictable_ops = ["COINBASE", "GASLIMIT", "TIMESTAMP", "NUMBER"]
final_ops = ["CALL", "SUICIDE", "STOP", "RETURN"]
# One of Bernhard's trademark hacks!
def is_prehook():
"""Check if we are in prehook."""
def is_prehook() -> bool:
"""Check if we are in prehook. One of Bernhard's trademark hacks!"""
return "pre_hook" in traceback.format_stack()[-4]
class PredictableValueAnnotation:
"""Symbol annotation used if a variable is initialized from a predictable environment variable."""
def __init__(self, operation) -> None:
def __init__(self, operation: str) -> None:
self.operation = operation

@ -203,9 +203,6 @@ class Instruction:
end_time = datetime.now()
self.iprof.record(op, start_time, end_time)
for st in global_state.mstate.stack:
logging.debug(st)
return result
@StateTransition()
@ -1601,8 +1598,6 @@ class Instruction:
op0, condition = state.stack.pop(), state.stack.pop()
logging.debug(str(condition))
try:
jump_addr = util.get_concrete_int(op0)
except TypeError:

Loading…
Cancel
Save