From 1f783792b257b435bb67d02c3f8c867ffe5533af Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Sat, 15 Feb 2020 09:11:15 +0700 Subject: [PATCH] Greater trace length and some black --- mythril/laser/ethereum/strategy/extensions/bounded_loops.py | 4 ++-- tests/instructions/create2_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mythril/laser/ethereum/strategy/extensions/bounded_loops.py b/mythril/laser/ethereum/strategy/extensions/bounded_loops.py index 21843ddf..e3c11bdf 100644 --- a/mythril/laser/ethereum/strategy/extensions/bounded_loops.py +++ b/mythril/laser/ethereum/strategy/extensions/bounded_loops.py @@ -77,8 +77,8 @@ class BoundedLoopsStrategy(BasicSearchStrategy): key = cur_instr["address"] - for i in range(2, min(32, len(annotation.trace))): - key |= annotation.trace[-i] << (16 * i) + for i in range(1, min(128, len(annotation.trace))): + key |= annotation.trace[-i] << (i * 8) if key in annotation._reached_count: annotation._reached_count[key] += 1 diff --git a/tests/instructions/create2_test.py b/tests/instructions/create2_test.py index eb927f76..30cfc239 100644 --- a/tests/instructions/create2_test.py +++ b/tests/instructions/create2_test.py @@ -24,7 +24,7 @@ def generate_salted_address(code_str, salt, caller): salt = "0" * (64 - len(salt)) + salt contract_address = int( - get_code_hash("0xff" + addr + salt + get_code_hash(code_str)[2:])[26:], 16, + get_code_hash("0xff" + addr + salt + get_code_hash(code_str)[2:])[26:], 16 ) return contract_address