Rename ETHContract -> EVMContract

pull/730/head
Bernhard Mueller 6 years ago
parent cae6ef1491
commit 28326d6245
  1. 0
      mythril/ethereum/evmcontract.py
  2. 12
      tests/ethcontract_test.py
  3. 4
      tests/graph_test.py
  4. 4
      tests/report_test.py
  5. 4
      tests/svm_test.py

@ -1,5 +1,5 @@
import unittest
from mythril.ethereum.ethcontract import ETHContract
from mythril.ethereum.evmcontract import EVMContract
class ETHContractTestCase(unittest.TestCase):
@ -10,32 +10,32 @@ class ETHContractTestCase(unittest.TestCase):
class Getinstruction_listTestCase(ETHContractTestCase):
def runTest(self):
contract = ETHContract(self.code, self.creation_code)
contract = EVMContract(self.code, self.creation_code)
disassembly = contract.disassembly
self.assertEqual(
len(disassembly.instruction_list),
53,
"Error disassembling code using ETHContract.get_instruction_list()",
"Error disassembling code using EVMContract.get_instruction_list()",
)
class GetEASMTestCase(ETHContractTestCase):
def runTest(self):
contract = ETHContract(self.code)
contract = EVMContract(self.code)
instruction_list = contract.get_easm()
self.assertTrue(
"PUSH1 0x60" in instruction_list,
"Error obtaining EASM code through ETHContract.get_easm()",
"Error obtaining EASM code through EVMContract.get_easm()",
)
class MatchesExpressionTestCase(ETHContractTestCase):
def runTest(self):
contract = ETHContract(self.code)
contract = EVMContract(self.code)
self.assertTrue(
contract.matches_expression("code#PUSH1# or code#PUSH1#"),

@ -1,7 +1,7 @@
from mythril.analysis.callgraph import generate_graph
from mythril.analysis.symbolic import SymExecWrapper
from mythril.ethereum import util
from mythril.solidity.soliditycontract import ETHContract
from mythril.solidity.soliditycontract import EVMContract
from tests import *
import re
@ -17,7 +17,7 @@ class GraphTest(BaseTestCase):
input_file.name + ".graph.html"
)
contract = ETHContract(input_file.read_text())
contract = EVMContract(input_file.read_text())
sym = SymExecWrapper(
contract,

@ -2,7 +2,7 @@ from mythril.analysis.report import Report
from mythril.analysis.security import fire_lasers
from mythril.analysis.symbolic import SymExecWrapper
from mythril.ethereum import util
from mythril.solidity.soliditycontract import ETHContract
from mythril.solidity.soliditycontract import EVMContract
from multiprocessing import Pool, cpu_count
import pytest
import json
@ -22,7 +22,7 @@ def _fix_debug_data(json_str):
def _generate_report(input_file):
contract = ETHContract(input_file.read_text(), enable_online_lookup=False)
contract = EVMContract(input_file.read_text(), enable_online_lookup=False)
sym = SymExecWrapper(
contract,
address=(util.get_indexed_address(0)),

@ -2,7 +2,7 @@ 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.ethereum.ethcontract import ETHContract
from mythril.ethereum.evmcontract import EVMContract
from mythril.solidity.soliditycontract import SolidityContract
from mythril.laser.ethereum.state.account import Account
@ -105,7 +105,7 @@ class SVMTestCase(BaseTestCase):
code = "0x60606040525b603c5b60006010603e565b9050593681016040523660008237602060003683856040603f5a0204f41560545760206000f35bfe5b50565b005b73c3b2ae46792547a96b9f84405e36d0e07edcd05c5b905600a165627a7a7230582062a884f947232ada573f95940cce9c8bfb7e4e14e21df5af4e884941afb55e590029"
contract = ETHContract(code)
contract = EVMContract(code)
sym = SymExecWrapper(contract, "0xd0a6E6C543bC68Db5db3A191B171A77407Ff7ccf")
html = generate_graph(sym)

Loading…
Cancel
Save