Merge branch 'develop' into hzzhang/fix-bvmul-overflow-check

pull/648/head
JoranHonig 6 years ago committed by GitHub
commit cb71b479e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      mythril/analysis/modules/integer.py
  2. 1
      mythril/analysis/modules/transaction_order_dependence.py
  3. 7
      mythril/laser/ethereum/instructions.py

@ -131,11 +131,8 @@ def _try_constraints(constraints, new_constraints):
Tries new constraints Tries new constraints
:return Model if satisfiable otherwise None :return Model if satisfiable otherwise None
""" """
_constraints = copy.deepcopy(constraints)
for constraint in new_constraints:
_constraints.append(copy.deepcopy(constraint))
try: try:
model = solver.get_model(_constraints) model = solver.get_model(constraints + new_constraints)
return model return model
except UnsatError: except UnsatError:
return None return None

@ -1,5 +1,6 @@
import logging import logging
import re import re
import copy
from mythril.analysis import solver from mythril.analysis import solver
from mythril.analysis.ops import * from mythril.analysis.ops import *

@ -18,7 +18,6 @@ from z3 import (
URem, URem,
SRem, SRem,
BitVec, BitVec,
Solver,
is_true, is_true,
BitVecVal, BitVecVal,
If, If,
@ -43,7 +42,6 @@ from mythril.laser.ethereum.transaction import (
TransactionStartSignal, TransactionStartSignal,
ContractCreationTransaction, ContractCreationTransaction,
) )
from mythril.analysis.solver import get_model
TT256 = 2 ** 256 TT256 = 2 ** 256
TT256M1 = 2 ** 256 - 1 TT256M1 = 2 ** 256 - 1
@ -924,9 +922,6 @@ class Instruction:
storage_keys = global_state.environment.active_account.storage.keys() storage_keys = global_state.environment.active_account.storage.keys()
keccak_keys = filter(keccak_function_manager.is_keccak, storage_keys) keccak_keys = filter(keccak_function_manager.is_keccak, storage_keys)
solver = Solver()
solver.set(timeout=1000)
results = [] results = []
new = False new = False
@ -934,7 +929,7 @@ class Instruction:
key_argument = keccak_function_manager.get_argument(keccak_key) key_argument = keccak_function_manager.get_argument(keccak_key)
index_argument = keccak_function_manager.get_argument(index) index_argument = keccak_function_manager.get_argument(index)
if is_true(key_argument == index_argument): if is_true(simplify(key_argument == index_argument)):
return self._sstore_helper( return self._sstore_helper(
copy(global_state), copy(global_state),
keccak_key, keccak_key,

Loading…
Cancel
Save