Security analysis tool for EVM bytecode. Supports smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mythril/tests/graph_test.py

28 lines
900 B

"""
This test only checks whether dumping is successful, not whether the dumped state space makes sense
"""
from mythril.mythril import MythrilAnalyzer, MythrilDisassembler
from mythril.ethereum import util
from mythril.solidity.soliditycontract import EVMContract
from tests import TESTDATA_INPUTS
def test_generate_graph():
for input_file in TESTDATA_INPUTS.iterdir():
if input_file.name != "origin.sol.o":
continue
contract = EVMContract(input_file.read_text())
disassembler = MythrilDisassembler()
5 years ago
disassembler.contracts.append(contract)
analyzer = MythrilAnalyzer(
disassembler=disassembler,
strategy="dfs",
execution_timeout=5,
max_depth=30,
address=(util.get_indexed_address(0)),
5 years ago
solver_timeout=10000,
)
analyzer.graph_html(transaction_count=1)