diff --git a/mythril/analysis/symbolic.py b/mythril/analysis/symbolic.py index fd4ae156..4c8885f4 100644 --- a/mythril/analysis/symbolic.py +++ b/mythril/analysis/symbolic.py @@ -1,9 +1,8 @@ from mythril.analysis.security import get_detection_module_hooks from mythril.laser.ethereum import svm from mythril.laser.ethereum.state.account import Account -from mythril.ether.soliditycontract import SolidityContract, ETHContract +from mythril.solidity.soliditycontract import SolidityContract, ETHContract import copy -import logging from .ops import get_variable, SStore, Call, VarType from mythril.laser.ethereum.strategy.basic import ( DepthFirstSearchStrategy, diff --git a/mythril/disassembler/disassembly.py b/mythril/disassembler/disassembly.py index c7c80644..c0ddb48c 100644 --- a/mythril/disassembler/disassembly.py +++ b/mythril/disassembler/disassembly.py @@ -1,4 +1,4 @@ -from mythril.ether import util +from mythril.ethereum import util from mythril.disassembler import asm from mythril.support.signatures import SignatureDb import logging diff --git a/mythril/ether/__init__.py b/mythril/ether/__init__.py deleted file mode 100644 index 70ae0eda..00000000 --- a/mythril/ether/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -import time - -start_time = time.time() diff --git a/mythril/ether/ethcontract.py b/mythril/ethereum/ethcontract.py similarity index 100% rename from mythril/ether/ethcontract.py rename to mythril/ethereum/ethcontract.py diff --git a/mythril/ether/evm.py b/mythril/ethereum/evm.py similarity index 98% rename from mythril/ether/evm.py rename to mythril/ethereum/evm.py index 2dd84895..be6def00 100644 --- a/mythril/ether/evm.py +++ b/mythril/ethereum/evm.py @@ -1,7 +1,7 @@ from ethereum import vm, messages, transactions from ethereum.state import State from ethereum.slogging import get_logger -from mythril.ether import util +from mythril.ethereum import util from logging import StreamHandler from io import StringIO import re diff --git a/mythril/ethereum/interface/leveldb/accountindexing.py b/mythril/ethereum/interface/leveldb/accountindexing.py index 6452a6b9..ec75e73b 100644 --- a/mythril/ethereum/interface/leveldb/accountindexing.py +++ b/mythril/ethereum/interface/leveldb/accountindexing.py @@ -1,5 +1,5 @@ import logging -from mythril import ether +from mythril import ethereum import time from ethereum.messages import Log import rlp @@ -156,7 +156,7 @@ class AccountIndexer(object): processed += BATCH_SIZE blockNum = min(blockNum + BATCH_SIZE, self.lastBlock + 1) - cost_time = time.time() - ether.start_time + cost_time = time.time() - ethereum.start_time print( "%d blocks processed (in %d seconds), %d unique addresses found, next block: %d" % (processed, cost_time, count, min(self.lastBlock, blockNum)) diff --git a/mythril/ethereum/interface/leveldb/client.py b/mythril/ethereum/interface/leveldb/client.py index 46e6bc77..f45883df 100644 --- a/mythril/ethereum/interface/leveldb/client.py +++ b/mythril/ethereum/interface/leveldb/client.py @@ -10,7 +10,7 @@ from ethereum import utils from ethereum.block import BlockHeader, Block from mythril.ethereum.interface.leveldb.state import State from mythril.ethereum.interface.leveldb.eth_db import ETH_DB -from mythril.ether.ethcontract import ETHContract +from mythril.ethereum.ethcontract import ETHContract from mythril.exceptions import AddressNotFoundError # Per https://github.com/ethereum/go-ethereum/blob/master/core/rawdb/schema.go diff --git a/mythril/ether/util.py b/mythril/ethereum/util.py similarity index 100% rename from mythril/ether/util.py rename to mythril/ethereum/util.py diff --git a/mythril/mythril.py b/mythril/mythril.py index fb9cb2b8..4f5687d7 100644 --- a/mythril/mythril.py +++ b/mythril/mythril.py @@ -17,9 +17,9 @@ import solc from configparser import ConfigParser import platform -from mythril.ether import util -from mythril.ether.ethcontract import ETHContract -from mythril.ether.soliditycontract import SolidityContract, get_contracts_from_file +from mythril.ethereum import util +from mythril.ethereum.ethcontract import ETHContract +from mythril.solidity.soliditycontract import SolidityContract, get_contracts_from_file from mythril.ethereum.interface.rpc.client import EthJsonRpc from mythril.ethereum.interface.rpc.exceptions import ConnectionError from mythril.support import signatures diff --git a/mythril/solidity/__init__.py b/mythril/solidity/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/mythril/ether/soliditycontract.py b/mythril/solidity/soliditycontract.py similarity index 97% rename from mythril/ether/soliditycontract.py rename to mythril/solidity/soliditycontract.py index 9a7fa437..83e5cc32 100644 --- a/mythril/ether/soliditycontract.py +++ b/mythril/solidity/soliditycontract.py @@ -1,6 +1,6 @@ import mythril.laser.ethereum.util as helper -from mythril.ether.ethcontract import ETHContract -from mythril.ether.util import get_solc_json +from mythril.ethereum.ethcontract import ETHContract +from mythril.ethereum.util import get_solc_json from mythril.exceptions import NoContractFoundError diff --git a/mythril/support/truffle.py b/mythril/support/truffle.py index 0ef82ae5..26888f08 100644 --- a/mythril/support/truffle.py +++ b/mythril/support/truffle.py @@ -5,14 +5,13 @@ import sys import json import logging from ethereum.utils import sha3 -from mythril.ether.ethcontract import ETHContract -from mythril.ether.soliditycontract import SourceMapping -from mythril.exceptions import CriticalError +from mythril.ethereum.ethcontract import ETHContract +from mythril.solidity.soliditycontract import SourceMapping from mythril.analysis.security import fire_lasers from mythril.analysis.symbolic import SymExecWrapper from mythril.analysis.report import Report -from mythril.ether import util +from mythril.ethereum import util from mythril.laser.ethereum.util import get_instruction_index diff --git a/tests/disassembler_test.py b/tests/disassembler_test.py index b663b074..d3955d82 100644 --- a/tests/disassembler_test.py +++ b/tests/disassembler_test.py @@ -1,5 +1,5 @@ from mythril.disassembler.disassembly import Disassembly -from mythril.ether import util +from mythril.ethereum import util from tests import * diff --git a/tests/ethcontract_test.py b/tests/ethcontract_test.py index a2cdc5a6..43313867 100644 --- a/tests/ethcontract_test.py +++ b/tests/ethcontract_test.py @@ -1,5 +1,5 @@ import unittest -from mythril.ether.ethcontract import ETHContract +from mythril.ethereum.ethcontract import ETHContract class ETHContractTestCase(unittest.TestCase): diff --git a/tests/graph_test.py b/tests/graph_test.py index e5c41d4b..d517ed01 100644 --- a/tests/graph_test.py +++ b/tests/graph_test.py @@ -1,7 +1,7 @@ from mythril.analysis.callgraph import generate_graph from mythril.analysis.symbolic import SymExecWrapper -from mythril.ether import util -from mythril.ether.soliditycontract import ETHContract +from mythril.ethereum import util +from mythril.solidity.soliditycontract import ETHContract from tests import * import re diff --git a/tests/laser/transaction/create_transaction_test.py b/tests/laser/transaction/create_transaction_test.py index c013043a..3e319c02 100644 --- a/tests/laser/transaction/create_transaction_test.py +++ b/tests/laser/transaction/create_transaction_test.py @@ -1,9 +1,9 @@ from mythril.laser.ethereum.transaction import execute_contract_creation -from mythril.ether import util +from mythril.ethereum import util import mythril.laser.ethereum.svm as svm from mythril.disassembler.disassembly import Disassembly from datetime import datetime -from mythril.ether.soliditycontract import SolidityContract +from mythril.solidity.soliditycontract import SolidityContract import tests from mythril.analysis.security import fire_lasers from mythril.analysis.symbolic import SymExecWrapper diff --git a/tests/native_test.py b/tests/native_test.py index 0e8841ff..01eda4a8 100644 --- a/tests/native_test.py +++ b/tests/native_test.py @@ -1,4 +1,4 @@ -from mythril.ether.soliditycontract import SolidityContract +from mythril.solidity.soliditycontract import SolidityContract from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.machine_state import MachineState from mythril.laser.ethereum.state.global_state import GlobalState diff --git a/tests/report_test.py b/tests/report_test.py index 396124b1..757bf365 100644 --- a/tests/report_test.py +++ b/tests/report_test.py @@ -1,10 +1,9 @@ from mythril.analysis.report import Report from mythril.analysis.security import fire_lasers from mythril.analysis.symbolic import SymExecWrapper -from mythril.ether import util -from mythril.ether.soliditycontract import ETHContract +from mythril.ethereum import util +from mythril.solidity.soliditycontract import ETHContract from multiprocessing import Pool, cpu_count -import datetime import pytest import json from tests import * diff --git a/tests/solidity_contract_test.py b/tests/solidity_contract_test.py index 5513c4c1..dd7cc3fb 100644 --- a/tests/solidity_contract_test.py +++ b/tests/solidity_contract_test.py @@ -1,6 +1,6 @@ from pathlib import Path -from mythril.ether.soliditycontract import SolidityContract +from mythril.solidity.soliditycontract import SolidityContract from tests import BaseTestCase TEST_FILES = Path(__file__).parent / "testdata/input_contracts" diff --git a/tests/svm_test.py b/tests/svm_test.py index 73fe7ffb..f2d6f94e 100644 --- a/tests/svm_test.py +++ b/tests/svm_test.py @@ -2,8 +2,8 @@ import json from mythril.analysis.security import get_detection_module_hooks from mythril.analysis.symbolic import SymExecWrapper from mythril.analysis.callgraph import generate_graph -from mythril.ether.ethcontract import ETHContract -from mythril.ether.soliditycontract import SolidityContract +from mythril.ethereum.ethcontract import ETHContract +from mythril.solidity.soliditycontract import SolidityContract from mythril.laser.ethereum.state.account import Account from mythril.laser.ethereum.state.machine_state import MachineState diff --git a/tests/testdata/compile.py b/tests/testdata/compile.py index 3811daeb..bf9eb309 100644 --- a/tests/testdata/compile.py +++ b/tests/testdata/compile.py @@ -1,6 +1,6 @@ # compile test contracts from pathlib import Path -from mythril.ether.soliditycontract import SolidityContract +from mythril.solidity.soliditycontract import SolidityContract # Recompiles all the to be tested contracts root = Path(__file__).parent