From 23478f43ecc8dc406acbf48b98f893ff8c55911e Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sun, 19 May 2019 16:00:54 +0200 Subject: [PATCH] Add typehints, remove debug statements --- .../analysis/modules/dependence_on_predictable_vars.py | 9 +++------ mythril/laser/ethereum/instructions.py | 5 ----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index efc326dd..8aaa375c 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.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 diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index ef15c879..f17d4401 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -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: