From 83fedfaf4391a8d6a1717192f574c6a301341eed Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 28 Jul 2018 19:22:07 -0400 Subject: [PATCH] Force determinism in iterating over dictionary keys... and replace an "import *" with something specific --- mythril/ether/soliditycontract.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mythril/ether/soliditycontract.py b/mythril/ether/soliditycontract.py index f5825d0e..2fa6c78b 100644 --- a/mythril/ether/soliditycontract.py +++ b/mythril/ether/soliditycontract.py @@ -1,6 +1,6 @@ import mythril.laser.ethereum.util as helper from mythril.ether.ethcontract import ETHContract -from mythril.ether.util import * +from mythril.ether.util import get_solc_json from mythril.exceptions import NoContractFoundError @@ -54,7 +54,7 @@ class SolidityContract(ETHContract): # If a contract name has been specified, find the bytecode of that specific contract if name: - for key, contract in data['contracts'].items(): + for key, contract in sorted(data['contracts'].items()): filename, _name = key.split(":") if filename == input_file and name == _name and len(contract['bin-runtime']): @@ -67,7 +67,7 @@ class SolidityContract(ETHContract): # If no contract name is specified, get the last bytecode entry for the input file else: - for key, contract in data['contracts'].items(): + for key, contract in sorted(data['contracts'].items()): filename, name = key.split(":") if filename == input_file and len(contract['bin-runtime']):