From 2212e565a4be13970cf36d0f9d2a47698bbc0fda Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Sun, 24 Oct 2021 16:28:16 +0100 Subject: [PATCH] Use symbol_factory (#1533) * Use symbol_factory * Black --- mythril/laser/ethereum/state/constraints.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/state/constraints.py b/mythril/laser/ethereum/state/constraints.py index 69eaadf0..d9fc55cc 100644 --- a/mythril/laser/ethereum/state/constraints.py +++ b/mythril/laser/ethereum/state/constraints.py @@ -1,7 +1,7 @@ """This module contains the class used to represent state-change constraints in the call graph.""" from mythril.exceptions import UnsatError -from mythril.laser.smt import Bool, simplify +from mythril.laser.smt import symbol_factory, simplify, Bool from mythril.support.model import get_model from typing import Iterable, List, Optional, Union @@ -40,7 +40,9 @@ class Constraints(list): :param constraint: The constraint to be appended """ constraint = ( - simplify(constraint) if isinstance(constraint, Bool) else Bool(constraint) + simplify(constraint) + if isinstance(constraint, Bool) + else symbol_factory.Bool(constraint) ) super(Constraints, self).append(constraint) @@ -100,7 +102,9 @@ class Constraints(list): @staticmethod def _get_smt_bool_list(constraints: Iterable[Union[bool, Bool]]) -> List[Bool]: return [ - constraint if isinstance(constraint, Bool) else Bool(constraint) + constraint + if isinstance(constraint, Bool) + else symbol_factory.Bool(constraint) for constraint in constraints ]