From 1b891fafaec18738cee4de4590ea3d177494f4f1 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Tue, 14 May 2019 00:12:26 +0200 Subject: [PATCH] Fix wrong instantiation of OldBlockNumberUsedAnnotation --- mythril/analysis/modules/dependence_on_predictable_vars.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mythril/analysis/modules/dependence_on_predictable_vars.py b/mythril/analysis/modules/dependence_on_predictable_vars.py index 09da72e7..7d9b2d5e 100644 --- a/mythril/analysis/modules/dependence_on_predictable_vars.py +++ b/mythril/analysis/modules/dependence_on_predictable_vars.py @@ -120,7 +120,7 @@ def _analyze_states(state: GlobalState) -> list: # Why the second constraint? Because otherwise, Z3 returns a solution where param overflows. solver.get_model(constraint) - state.annotate(OldBlockNumberUsedAnnotation) + state.annotate(OldBlockNumberUsedAnnotation()) except UnsatError: pass @@ -141,9 +141,7 @@ def _analyze_states(state: GlobalState) -> list: I added a string comparison as a workaround. """ - if isinstance( - annotation, OldBlockNumberUsedAnnotation - ) or "OldBlockNumber" in str(annotation): + if isinstance(annotation, OldBlockNumberUsedAnnotation): state.mstate.stack[-1].annotate( PredictableValueAnnotation("block hash of a previous block") )