From 19ce7c7526358f88dc1021a1219d7b4eef24ce39 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Wed, 15 May 2019 06:09:53 +0200 Subject: [PATCH] Of course, black has to be done --- .../modules/dependence_on_predictable_vars.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 5cb26202..cab8bee3 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -20,6 +20,7 @@ final_ops = ["CALL", "SUICIDE", "STOP"] # One of Bernhard's trademark hacks! + def is_prehook(): """Check if we are in prehook.""" return "pre_hook" in traceback.format_stack()[-4] @@ -108,19 +109,23 @@ def _analyze_states(state: GlobalState) -> list: "generation or to make critical control flow decisions." ) - ''' + """ Usually report low severity except in cases where thje hash of a previous block is used to determine control flow. - ''' + """ severity = "Medium" if "hash" in annotation.operation else "Low" - ''' + """ Note: We report the location of the JUMPI that lead to this path. Usually this maps to an if or require statement. - ''' + """ - swc_id = TIMESTAMP_DEPENDENCE if "timestamp" in annotation.operation else WEAK_RANDOMNESS + swc_id = ( + TIMESTAMP_DEPENDENCE + if "timestamp" in annotation.operation + else WEAK_RANDOMNESS + ) issue = Issue( contract=state.environment.active_account.contract_name,