├── .circleci └── config.yml ├── .drone.yml ├── .editorconfig ├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ ├── analysis-module.md │ ├── bug-report.md │ └── feature-request.md ├── .gitignore ├── .pre-commit-config.yaml ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── MANIFEST.in ├── README.md ├── all_tests.sh ├── coverage_report.sh ├── docker_build_and_deploy.sh ├── docs ├── Makefile ├── make.bat └── source │ ├── about.rst │ ├── analysis-modules.rst │ ├── conf.py │ ├── create-module.rst │ ├── index.rst │ ├── installation.rst │ ├── module-list.rst │ ├── mythril.analysis.modules.rst │ ├── mythril.analysis.rst │ ├── mythril.disassembler.rst │ ├── mythril.ethereum.interface.leveldb.rst │ ├── mythril.ethereum.interface.rpc.rst │ ├── mythril.ethereum.interface.rst │ ├── mythril.ethereum.rst │ ├── mythril.interfaces.rst │ ├── mythril.laser.ethereum.rst │ ├── mythril.laser.ethereum.state.rst │ ├── mythril.laser.ethereum.strategy.rst │ ├── mythril.laser.ethereum.transaction.rst │ ├── mythril.laser.rst │ ├── mythril.laser.smt.rst │ ├── mythril.rst │ ├── mythril.solidity.rst │ ├── mythril.support.rst │ ├── security-analysis.rst │ └── wiki.rst ├── mypy-stubs └── z3 │ ├── __init__.pyi │ ├── z3core.pyi │ └── z3types.pyi ├── myth ├── mythril ├── __init__.py ├── __main__.py ├── __version__.py ├── analysis │ ├── __init__.py │ ├── analysis_args.py │ ├── call_helpers.py │ ├── callgraph.py │ ├── module │ │ ├── __init__.py │ │ ├── base.py │ │ ├── loader.py │ │ ├── module_helpers.py │ │ ├── modules │ │ │ ├── __init__.py │ │ │ ├── arbitrary_jump.py │ │ │ ├── arbitrary_write.py │ │ │ ├── delegatecall.py │ │ │ ├── dependence_on_origin.py │ │ │ ├── dependence_on_predictable_vars.py │ │ │ ├── ether_thief.py │ │ │ ├── exceptions.py │ │ │ ├── external_calls.py │ │ │ ├── integer.py │ │ │ ├── multiple_sends.py │ │ │ ├── state_change_external_calls.py │ │ │ ├── suicide.py │ │ │ ├── unchecked_retval.py │ │ │ └── user_assertions.py │ │ └── util.py │ ├── ops.py │ ├── potential_issues.py │ ├── report.py │ ├── security.py │ ├── solver.py │ ├── swc_data.py │ ├── symbolic.py │ ├── templates │ │ ├── callgraph.html │ │ ├── report_as_markdown.jinja2 │ │ └── report_as_text.jinja2 │ └── traceexplore.py ├── disassembler │ ├── __init__.py │ ├── asm.py │ └── disassembly.py ├── ethereum │ ├── __init__.py │ ├── evmcontract.py │ ├── interface │ │ ├── __init__.py │ │ └── rpc │ │ │ ├── __init__.py │ │ │ ├── base_client.py │ │ │ ├── client.py │ │ │ ├── constants.py │ │ │ ├── exceptions.py │ │ │ └── utils.py │ └── util.py ├── exceptions.py ├── interfaces │ ├── __init__.py │ ├── cli.py │ └── epic.py ├── laser │ ├── __init__.py │ ├── ethereum │ │ ├── __init__.py │ │ ├── call.py │ │ ├── cfg.py │ │ ├── evm_exceptions.py │ │ ├── function_managers │ │ │ ├── __init__.py │ │ │ ├── exponent_function_manager.py │ │ │ └── keccak_function_manager.py │ │ ├── instruction_data.py │ │ ├── instructions.py │ │ ├── natives.py │ │ ├── state │ │ │ ├── __init__.py │ │ │ ├── account.py │ │ │ ├── annotation.py │ │ │ ├── calldata.py │ │ │ ├── constraints.py │ │ │ ├── environment.py │ │ │ ├── global_state.py │ │ │ ├── machine_state.py │ │ │ ├── memory.py │ │ │ └── world_state.py │ │ ├── strategy │ │ │ ├── __init__.py │ │ │ ├── basic.py │ │ │ └── extensions │ │ │ │ ├── __init__.py │ │ │ │ └── bounded_loops.py │ │ ├── svm.py │ │ ├── time_handler.py │ │ ├── transaction │ │ │ ├── __init__.py │ │ │ ├── concolic.py │ │ │ ├── symbolic.py │ │ │ └── transaction_models.py │ │ └── util.py │ ├── execution_info.py │ ├── plugin │ │ ├── __init__.py │ │ ├── builder.py │ │ ├── interface.py │ │ ├── loader.py │ │ ├── plugins │ │ │ ├── __init__.py │ │ │ ├── benchmark.py │ │ │ ├── call_depth_limiter.py │ │ │ ├── coverage │ │ │ │ ├── __init__.py │ │ │ │ ├── coverage_plugin.py │ │ │ │ └── coverage_strategy.py │ │ │ ├── dependency_pruner.py │ │ │ ├── instruction_profiler.py │ │ │ ├── mutation_pruner.py │ │ │ ├── plugin_annotations.py │ │ │ └── summary_backup │ │ │ │ └── __init__.py │ │ └── signals.py │ └── smt │ │ ├── __init__.py │ │ ├── array.py │ │ ├── bitvec.py │ │ ├── bitvec_helper.py │ │ ├── bool.py │ │ ├── expression.py │ │ ├── function.py │ │ ├── model.py │ │ └── solver │ │ ├── __init__.py │ │ ├── independence_solver.py │ │ ├── solver.py │ │ └── solver_statistics.py ├── mythril │ ├── __init__.py │ ├── mythril_analyzer.py │ ├── mythril_config.py │ └── mythril_disassembler.py ├── plugin │ ├── __init__.py │ ├── discovery.py │ ├── interface.py │ └── loader.py ├── solidity │ ├── __init__.py │ └── soliditycontract.py └── support │ ├── __init__.py │ ├── assets │ └── signatures.db │ ├── loader.py │ ├── model.py │ ├── opcodes.py │ ├── signatures.py │ ├── source_support.py │ ├── start_time.py │ ├── support_args.py │ └── support_utils.py ├── requirements.txt ├── setup.py ├── solidity_examples ├── BECToken.sol ├── WalletLibrary.sol ├── calls.sol ├── etherstore.sol ├── exceptions.sol ├── hashforether.sol ├── origin.sol ├── returnvalue.sol ├── rubixi.sol ├── suicide.sol ├── timelock.sol ├── token.sol └── weak_random.sol ├── static ├── Ownable.html ├── assertions.html ├── callgraph7.png ├── callgraph8.png ├── mythril.html ├── mythril_new.png └── sample_report.md ├── tests ├── __init__.py ├── cli_tests │ └── test_cli_opts.py ├── cmd_line_test.py ├── disassembler │ ├── __init__.py │ ├── asm.py │ └── disassembly.py ├── disassembler_test.py ├── evmcontract_test.py ├── graph_test.py ├── instructions │ ├── __init__.py │ ├── berlin_fork_opcodes_test.py │ ├── codecopy_test.py │ ├── create2_test.py │ ├── create_test.py │ ├── extcodecopy_test.py │ ├── extcodehash_test.py │ ├── sar_test.py │ ├── shl_test.py │ ├── shr_test.py │ ├── static_call_test.py │ └── test_basefee.py ├── integration_tests │ ├── analysis_tests.py │ ├── test_safe_functions.py │ └── test_solc_settings.py ├── laser │ ├── Precompiles │ │ ├── test_blake2.py │ │ ├── test_ec_add.py │ │ ├── test_ecrecover.py │ │ ├── test_elliptic_curves.py │ │ ├── test_elliptic_mul.py │ │ ├── test_identity.py │ │ ├── test_mod_exp.py │ │ ├── test_ripemd.py │ │ └── test_sha256.py │ ├── __init__.py │ ├── evm_testsuite │ │ ├── VMTests │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── vmArithmeticTest │ │ │ │ ├── add0.json │ │ │ │ ├── add1.json │ │ │ │ ├── add2.json │ │ │ │ ├── add3.json │ │ │ │ ├── add4.json │ │ │ │ ├── addmod0.json │ │ │ │ ├── addmod1.json │ │ │ │ ├── addmod1_overflow2.json │ │ │ │ ├── addmod1_overflow3.json │ │ │ │ ├── addmod1_overflow4.json │ │ │ │ ├── addmod1_overflowDiff.json │ │ │ │ ├── addmod2.json │ │ │ │ ├── addmod2_0.json │ │ │ │ ├── addmod2_1.json │ │ │ │ ├── addmod3.json │ │ │ │ ├── addmod3_0.json │ │ │ │ ├── addmodBigIntCast.json │ │ │ │ ├── addmodDivByZero.json │ │ │ │ ├── addmodDivByZero1.json │ │ │ │ ├── addmodDivByZero2.json │ │ │ │ ├── addmodDivByZero3.json │ │ │ │ ├── arith1.json │ │ │ │ ├── div1.json │ │ │ │ ├── divBoostBug.json │ │ │ │ ├── divByNonZero0.json │ │ │ │ ├── divByNonZero1.json │ │ │ │ ├── divByNonZero2.json │ │ │ │ ├── divByNonZero3.json │ │ │ │ ├── divByZero.json │ │ │ │ ├── divByZero_2.json │ │ │ │ ├── exp0.json │ │ │ │ ├── exp1.json │ │ │ │ ├── exp2.json │ │ │ │ ├── exp3.json │ │ │ │ ├── exp4.json │ │ │ │ ├── exp5.json │ │ │ │ ├── exp6.json │ │ │ │ ├── exp7.json │ │ │ │ ├── exp8.json │ │ │ │ ├── expPowerOf256Of256_0.json │ │ │ │ ├── expPowerOf256Of256_1.json │ │ │ │ ├── expPowerOf256Of256_10.json │ │ │ │ ├── expPowerOf256Of256_11.json │ │ │ │ ├── expPowerOf256Of256_12.json │ │ │ │ ├── expPowerOf256Of256_13.json │ │ │ │ ├── expPowerOf256Of256_14.json │ │ │ │ ├── expPowerOf256Of256_15.json │ │ │ │ ├── expPowerOf256Of256_16.json │ │ │ │ ├── expPowerOf256Of256_17.json │ │ │ │ ├── expPowerOf256Of256_18.json │ │ │ │ ├── expPowerOf256Of256_19.json │ │ │ │ ├── expPowerOf256Of256_2.json │ │ │ │ ├── expPowerOf256Of256_20.json │ │ │ │ ├── expPowerOf256Of256_21.json │ │ │ │ ├── expPowerOf256Of256_22.json │ │ │ │ ├── expPowerOf256Of256_23.json │ │ │ │ ├── expPowerOf256Of256_24.json │ │ │ │ ├── expPowerOf256Of256_25.json │ │ │ │ ├── expPowerOf256Of256_26.json │ │ │ │ ├── expPowerOf256Of256_27.json │ │ │ │ ├── expPowerOf256Of256_28.json │ │ │ │ ├── expPowerOf256Of256_29.json │ │ │ │ ├── expPowerOf256Of256_3.json │ │ │ │ ├── expPowerOf256Of256_30.json │ │ │ │ ├── expPowerOf256Of256_31.json │ │ │ │ ├── expPowerOf256Of256_32.json │ │ │ │ ├── expPowerOf256Of256_33.json │ │ │ │ ├── expPowerOf256Of256_4.json │ │ │ │ ├── expPowerOf256Of256_5.json │ │ │ │ ├── expPowerOf256Of256_6.json │ │ │ │ ├── expPowerOf256Of256_7.json │ │ │ │ ├── expPowerOf256Of256_8.json │ │ │ │ ├── expPowerOf256Of256_9.json │ │ │ │ ├── expPowerOf256_1.json │ │ │ │ ├── expPowerOf256_10.json │ │ │ │ ├── expPowerOf256_11.json │ │ │ │ ├── expPowerOf256_12.json │ │ │ │ ├── expPowerOf256_13.json │ │ │ │ ├── expPowerOf256_14.json │ │ │ │ ├── expPowerOf256_15.json │ │ │ │ ├── expPowerOf256_16.json │ │ │ │ ├── expPowerOf256_17.json │ │ │ │ ├── expPowerOf256_18.json │ │ │ │ ├── expPowerOf256_19.json │ │ │ │ ├── expPowerOf256_2.json │ │ │ │ ├── expPowerOf256_20.json │ │ │ │ ├── expPowerOf256_21.json │ │ │ │ ├── expPowerOf256_22.json │ │ │ │ ├── expPowerOf256_23.json │ │ │ │ ├── expPowerOf256_24.json │ │ │ │ ├── expPowerOf256_25.json │ │ │ │ ├── expPowerOf256_26.json │ │ │ │ ├── expPowerOf256_27.json │ │ │ │ ├── expPowerOf256_28.json │ │ │ │ ├── expPowerOf256_29.json │ │ │ │ ├── expPowerOf256_3.json │ │ │ │ ├── expPowerOf256_30.json │ │ │ │ ├── expPowerOf256_31.json │ │ │ │ ├── expPowerOf256_32.json │ │ │ │ ├── expPowerOf256_33.json │ │ │ │ ├── expPowerOf256_4.json │ │ │ │ ├── expPowerOf256_5.json │ │ │ │ ├── expPowerOf256_6.json │ │ │ │ ├── expPowerOf256_7.json │ │ │ │ ├── expPowerOf256_8.json │ │ │ │ ├── expPowerOf256_9.json │ │ │ │ ├── expPowerOf2_128.json │ │ │ │ ├── expPowerOf2_16.json │ │ │ │ ├── expPowerOf2_2.json │ │ │ │ ├── expPowerOf2_256.json │ │ │ │ ├── expPowerOf2_32.json │ │ │ │ ├── expPowerOf2_4.json │ │ │ │ ├── expPowerOf2_64.json │ │ │ │ ├── expPowerOf2_8.json │ │ │ │ ├── expXY.json │ │ │ │ ├── expXY_success.json │ │ │ │ ├── fibbonacci_unrolled.json │ │ │ │ ├── mod0.json │ │ │ │ ├── mod1.json │ │ │ │ ├── mod2.json │ │ │ │ ├── mod3.json │ │ │ │ ├── mod4.json │ │ │ │ ├── modByZero.json │ │ │ │ ├── mul0.json │ │ │ │ ├── mul1.json │ │ │ │ ├── mul2.json │ │ │ │ ├── mul3.json │ │ │ │ ├── mul4.json │ │ │ │ ├── mul5.json │ │ │ │ ├── mul6.json │ │ │ │ ├── mul7.json │ │ │ │ ├── mulmod0.json │ │ │ │ ├── mulmod1.json │ │ │ │ ├── mulmod1_overflow.json │ │ │ │ ├── mulmod1_overflow2.json │ │ │ │ ├── mulmod1_overflow3.json │ │ │ │ ├── mulmod1_overflow4.json │ │ │ │ ├── mulmod2.json │ │ │ │ ├── mulmod2_0.json │ │ │ │ ├── mulmod2_1.json │ │ │ │ ├── mulmod3.json │ │ │ │ ├── mulmod3_0.json │ │ │ │ ├── mulmod4.json │ │ │ │ ├── mulmoddivByZero.json │ │ │ │ ├── mulmoddivByZero1.json │ │ │ │ ├── mulmoddivByZero2.json │ │ │ │ ├── mulmoddivByZero3.json │ │ │ │ ├── not1.json │ │ │ │ ├── sdiv0.json │ │ │ │ ├── sdiv1.json │ │ │ │ ├── sdiv2.json │ │ │ │ ├── sdiv3.json │ │ │ │ ├── sdiv4.json │ │ │ │ ├── sdiv5.json │ │ │ │ ├── sdiv6.json │ │ │ │ ├── sdiv7.json │ │ │ │ ├── sdiv8.json │ │ │ │ ├── sdiv9.json │ │ │ │ ├── sdivByZero0.json │ │ │ │ ├── sdivByZero1.json │ │ │ │ ├── sdivByZero2.json │ │ │ │ ├── sdiv_dejavu.json │ │ │ │ ├── sdiv_i256min.json │ │ │ │ ├── sdiv_i256min2.json │ │ │ │ ├── sdiv_i256min3.json │ │ │ │ ├── signextendInvalidByteNumber.json │ │ │ │ ├── signextend_00.json │ │ │ │ ├── signextend_0_BigByte.json │ │ │ │ ├── signextend_AlmostBiggestByte.json │ │ │ │ ├── signextend_BigByteBigByte.json │ │ │ │ ├── signextend_BigBytePlus1_2.json │ │ │ │ ├── signextend_BigByte_0.json │ │ │ │ ├── signextend_BitIsNotSet.json │ │ │ │ ├── signextend_BitIsNotSetInHigherByte.json │ │ │ │ ├── signextend_BitIsSetInHigherByte.json │ │ │ │ ├── signextend_Overflow_dj42.json │ │ │ │ ├── signextend_bigBytePlus1.json │ │ │ │ ├── signextend_bitIsSet.json │ │ │ │ ├── smod0.json │ │ │ │ ├── smod1.json │ │ │ │ ├── smod2.json │ │ │ │ ├── smod3.json │ │ │ │ ├── smod4.json │ │ │ │ ├── smod5.json │ │ │ │ ├── smod6.json │ │ │ │ ├── smod7.json │ │ │ │ ├── smod8_byZero.json │ │ │ │ ├── smod_i256min1.json │ │ │ │ ├── smod_i256min2.json │ │ │ │ ├── stop.json │ │ │ │ ├── sub0.json │ │ │ │ ├── sub1.json │ │ │ │ ├── sub2.json │ │ │ │ ├── sub3.json │ │ │ │ └── sub4.json │ │ │ ├── vmBitwiseLogicOperation │ │ │ │ ├── and0.json │ │ │ │ ├── and1.json │ │ │ │ ├── and2.json │ │ │ │ ├── and3.json │ │ │ │ ├── and4.json │ │ │ │ ├── and5.json │ │ │ │ ├── byte0.json │ │ │ │ ├── byte1.json │ │ │ │ ├── byte10.json │ │ │ │ ├── byte11.json │ │ │ │ ├── byte2.json │ │ │ │ ├── byte3.json │ │ │ │ ├── byte4.json │ │ │ │ ├── byte5.json │ │ │ │ ├── byte6.json │ │ │ │ ├── byte7.json │ │ │ │ ├── byte8.json │ │ │ │ ├── byte9.json │ │ │ │ ├── eq0.json │ │ │ │ ├── eq1.json │ │ │ │ ├── eq2.json │ │ │ │ ├── gt0.json │ │ │ │ ├── gt1.json │ │ │ │ ├── gt2.json │ │ │ │ ├── gt3.json │ │ │ │ ├── iszeo2.json │ │ │ │ ├── iszero0.json │ │ │ │ ├── iszero1.json │ │ │ │ ├── lt0.json │ │ │ │ ├── lt1.json │ │ │ │ ├── lt2.json │ │ │ │ ├── lt3.json │ │ │ │ ├── not0.json │ │ │ │ ├── not1.json │ │ │ │ ├── not2.json │ │ │ │ ├── not3.json │ │ │ │ ├── not4.json │ │ │ │ ├── not5.json │ │ │ │ ├── or0.json │ │ │ │ ├── or1.json │ │ │ │ ├── or2.json │ │ │ │ ├── or3.json │ │ │ │ ├── or4.json │ │ │ │ ├── or5.json │ │ │ │ ├── sgt0.json │ │ │ │ ├── sgt1.json │ │ │ │ ├── sgt2.json │ │ │ │ ├── sgt3.json │ │ │ │ ├── sgt4.json │ │ │ │ ├── slt0.json │ │ │ │ ├── slt1.json │ │ │ │ ├── slt2.json │ │ │ │ ├── slt3.json │ │ │ │ ├── slt4.json │ │ │ │ ├── xor0.json │ │ │ │ ├── xor1.json │ │ │ │ ├── xor2.json │ │ │ │ ├── xor3.json │ │ │ │ ├── xor4.json │ │ │ │ └── xor5.json │ │ │ ├── vmEnvironmentalInfo │ │ │ │ ├── address0.json │ │ │ │ ├── address1.json │ │ │ │ ├── calldatacopy0.json │ │ │ │ ├── calldatacopy0_return.json │ │ │ │ ├── calldatacopy1.json │ │ │ │ ├── calldatacopy1_return.json │ │ │ │ ├── calldatacopy2.json │ │ │ │ ├── calldatacopy2_return.json │ │ │ │ ├── calldatacopyUnderFlowerror.json │ │ │ │ ├── calldatacopyZeroMemExpansion.json │ │ │ │ ├── calldatacopyZeroMemExpansion_return.json │ │ │ │ ├── calldatacopy_DataIndexTooHigh.json │ │ │ │ ├── calldatacopy_DataIndexTooHigh2.json │ │ │ │ ├── calldatacopy_DataIndexTooHigh2_return.json │ │ │ │ ├── calldatacopy_DataIndexTooHigh_return.json │ │ │ │ ├── calldatacopy_sec.json │ │ │ │ ├── calldataload0.json │ │ │ │ ├── calldataload1.json │ │ │ │ ├── calldataload2.json │ │ │ │ ├── calldataloadSizeTooHigh.json │ │ │ │ ├── calldataloadSizeTooHighPartial.json │ │ │ │ ├── calldataload_BigOffset.json │ │ │ │ ├── calldatasize0.json │ │ │ │ ├── calldatasize1.json │ │ │ │ ├── calldatasize2.json │ │ │ │ ├── caller.json │ │ │ │ ├── callvalue.json │ │ │ │ ├── codecopy0.json │ │ │ │ ├── codecopyZeroMemExpansion.json │ │ │ │ ├── codecopy_DataIndexTooHigh.json │ │ │ │ ├── codesize.json │ │ │ │ ├── gasprice.json │ │ │ │ └── origin.json │ │ │ ├── vmIOandFlowOperations │ │ │ │ ├── BlockNumberDynamicJump0_AfterJumpdest.json │ │ │ │ ├── BlockNumberDynamicJump0_AfterJumpdest3.json │ │ │ │ ├── BlockNumberDynamicJump0_foreverOutOfGas.json │ │ │ │ ├── BlockNumberDynamicJump0_jumpdest0.json │ │ │ │ ├── BlockNumberDynamicJump0_jumpdest2.json │ │ │ │ ├── BlockNumberDynamicJump0_withoutJumpdest.json │ │ │ │ ├── BlockNumberDynamicJump1.json │ │ │ │ ├── BlockNumberDynamicJumpInsidePushWithJumpDest.json │ │ │ │ ├── BlockNumberDynamicJumpInsidePushWithoutJumpDest.json │ │ │ │ ├── BlockNumberDynamicJumpi0.json │ │ │ │ ├── BlockNumberDynamicJumpi1.json │ │ │ │ ├── BlockNumberDynamicJumpi1_jumpdest.json │ │ │ │ ├── BlockNumberDynamicJumpiAfterStop.json │ │ │ │ ├── BlockNumberDynamicJumpiOutsideBoundary.json │ │ │ │ ├── BlockNumberDynamicJumpifInsidePushWithJumpDest.json │ │ │ │ ├── BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json │ │ │ │ ├── DyanmicJump0_outOfBoundary.json │ │ │ │ ├── DynamicJump0_AfterJumpdest.json │ │ │ │ ├── DynamicJump0_AfterJumpdest3.json │ │ │ │ ├── DynamicJump0_foreverOutOfGas.json │ │ │ │ ├── DynamicJump0_jumpdest0.json │ │ │ │ ├── DynamicJump0_jumpdest2.json │ │ │ │ ├── DynamicJump0_withoutJumpdest.json │ │ │ │ ├── DynamicJump1.json │ │ │ │ ├── DynamicJumpAfterStop.json │ │ │ │ ├── DynamicJumpInsidePushWithJumpDest.json │ │ │ │ ├── DynamicJumpInsidePushWithoutJumpDest.json │ │ │ │ ├── DynamicJumpJD_DependsOnJumps0.json │ │ │ │ ├── DynamicJumpJD_DependsOnJumps1.json │ │ │ │ ├── DynamicJumpPathologicalTest0.json │ │ │ │ ├── DynamicJumpPathologicalTest1.json │ │ │ │ ├── DynamicJumpPathologicalTest2.json │ │ │ │ ├── DynamicJumpPathologicalTest3.json │ │ │ │ ├── DynamicJumpStartWithJumpDest.json │ │ │ │ ├── DynamicJump_value1.json │ │ │ │ ├── DynamicJump_value2.json │ │ │ │ ├── DynamicJump_value3.json │ │ │ │ ├── DynamicJump_valueUnderflow.json │ │ │ │ ├── DynamicJumpi0.json │ │ │ │ ├── DynamicJumpi1.json │ │ │ │ ├── DynamicJumpi1_jumpdest.json │ │ │ │ ├── DynamicJumpiAfterStop.json │ │ │ │ ├── DynamicJumpiOutsideBoundary.json │ │ │ │ ├── DynamicJumpifInsidePushWithJumpDest.json │ │ │ │ ├── DynamicJumpifInsidePushWithoutJumpDest.json │ │ │ │ ├── JDfromStorageDynamicJump0_AfterJumpdest.json │ │ │ │ ├── JDfromStorageDynamicJump0_AfterJumpdest3.json │ │ │ │ ├── JDfromStorageDynamicJump0_foreverOutOfGas.json │ │ │ │ ├── JDfromStorageDynamicJump0_jumpdest0.json │ │ │ │ ├── JDfromStorageDynamicJump0_jumpdest2.json │ │ │ │ ├── JDfromStorageDynamicJump0_withoutJumpdest.json │ │ │ │ ├── JDfromStorageDynamicJump1.json │ │ │ │ ├── JDfromStorageDynamicJumpInsidePushWithJumpDest.json │ │ │ │ ├── JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json │ │ │ │ ├── JDfromStorageDynamicJumpi0.json │ │ │ │ ├── JDfromStorageDynamicJumpi1.json │ │ │ │ ├── JDfromStorageDynamicJumpi1_jumpdest.json │ │ │ │ ├── JDfromStorageDynamicJumpiAfterStop.json │ │ │ │ ├── JDfromStorageDynamicJumpiOutsideBoundary.json │ │ │ │ ├── JDfromStorageDynamicJumpifInsidePushWithJumpDest.json │ │ │ │ ├── JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json │ │ │ │ ├── bad_indirect_jump1.json │ │ │ │ ├── bad_indirect_jump2.json │ │ │ │ ├── byte1.json │ │ │ │ ├── calldatacopyMemExp.json │ │ │ │ ├── codecopyMemExp.json │ │ │ │ ├── deadCode_1.json │ │ │ │ ├── dupAt51becameMload.json │ │ │ │ ├── for_loop1.json │ │ │ │ ├── for_loop2.json │ │ │ │ ├── gas0.json │ │ │ │ ├── gas1.json │ │ │ │ ├── gasOverFlow.json │ │ │ │ ├── indirect_jump1.json │ │ │ │ ├── indirect_jump2.json │ │ │ │ ├── indirect_jump3.json │ │ │ │ ├── indirect_jump4.json │ │ │ │ ├── jump0_AfterJumpdest.json │ │ │ │ ├── jump0_AfterJumpdest3.json │ │ │ │ ├── jump0_foreverOutOfGas.json │ │ │ │ ├── jump0_jumpdest0.json │ │ │ │ ├── jump0_jumpdest2.json │ │ │ │ ├── jump0_outOfBoundary.json │ │ │ │ ├── jump0_withoutJumpdest.json │ │ │ │ ├── jump1.json │ │ │ │ ├── jumpAfterStop.json │ │ │ │ ├── jumpDynamicJumpSameDest.json │ │ │ │ ├── jumpHigh.json │ │ │ │ ├── jumpInsidePushWithJumpDest.json │ │ │ │ ├── jumpInsidePushWithoutJumpDest.json │ │ │ │ ├── jumpOntoJump.json │ │ │ │ ├── jumpTo1InstructionafterJump.json │ │ │ │ ├── jumpTo1InstructionafterJump_jumpdestFirstInstruction.json │ │ │ │ ├── jumpTo1InstructionafterJump_noJumpDest.json │ │ │ │ ├── jumpToUint64maxPlus1.json │ │ │ │ ├── jumpToUintmaxPlus1.json │ │ │ │ ├── jumpdestBigList.json │ │ │ │ ├── jumpi0.json │ │ │ │ ├── jumpi1.json │ │ │ │ ├── jumpi1_jumpdest.json │ │ │ │ ├── jumpiAfterStop.json │ │ │ │ ├── jumpiOutsideBoundary.json │ │ │ │ ├── jumpiToUint64maxPlus1.json │ │ │ │ ├── jumpiToUintmaxPlus1.json │ │ │ │ ├── jumpi_at_the_end.json │ │ │ │ ├── jumpifInsidePushWithJumpDest.json │ │ │ │ ├── jumpifInsidePushWithoutJumpDest.json │ │ │ │ ├── kv1.json │ │ │ │ ├── log1MemExp.json │ │ │ │ ├── loop_stacklimit_1020.json │ │ │ │ ├── loop_stacklimit_1021.json │ │ │ │ ├── memory1.json │ │ │ │ ├── mloadError0.json │ │ │ │ ├── mloadError1.json │ │ │ │ ├── mloadMemExp.json │ │ │ │ ├── mloadOutOfGasError2.json │ │ │ │ ├── msize0.json │ │ │ │ ├── msize1.json │ │ │ │ ├── msize2.json │ │ │ │ ├── msize3.json │ │ │ │ ├── mstore0.json │ │ │ │ ├── mstore1.json │ │ │ │ ├── mstore8MemExp.json │ │ │ │ ├── mstore8WordToBigError.json │ │ │ │ ├── mstore8_0.json │ │ │ │ ├── mstore8_1.json │ │ │ │ ├── mstoreMemExp.json │ │ │ │ ├── mstoreWordToBigError.json │ │ │ │ ├── mstore_mload0.json │ │ │ │ ├── pc0.json │ │ │ │ ├── pc1.json │ │ │ │ ├── pop0.json │ │ │ │ ├── pop1.json │ │ │ │ ├── return1.json │ │ │ │ ├── return2.json │ │ │ │ ├── sha3MemExp.json │ │ │ │ ├── sstore_load_0.json │ │ │ │ ├── sstore_load_1.json │ │ │ │ ├── sstore_load_2.json │ │ │ │ ├── sstore_underflow.json │ │ │ │ ├── stack_loop.json │ │ │ │ ├── stackjump1.json │ │ │ │ ├── swapAt52becameMstore.json │ │ │ │ └── when.json │ │ │ ├── vmPushDupSwapTest │ │ │ │ ├── dup1.json │ │ │ │ ├── dup10.json │ │ │ │ ├── dup11.json │ │ │ │ ├── dup12.json │ │ │ │ ├── dup13.json │ │ │ │ ├── dup14.json │ │ │ │ ├── dup15.json │ │ │ │ ├── dup16.json │ │ │ │ ├── dup2.json │ │ │ │ ├── dup2error.json │ │ │ │ ├── dup3.json │ │ │ │ ├── dup4.json │ │ │ │ ├── dup5.json │ │ │ │ ├── dup6.json │ │ │ │ ├── dup7.json │ │ │ │ ├── dup8.json │ │ │ │ ├── dup9.json │ │ │ │ ├── push1.json │ │ │ │ ├── push10.json │ │ │ │ ├── push11.json │ │ │ │ ├── push12.json │ │ │ │ ├── push13.json │ │ │ │ ├── push14.json │ │ │ │ ├── push15.json │ │ │ │ ├── push16.json │ │ │ │ ├── push17.json │ │ │ │ ├── push18.json │ │ │ │ ├── push19.json │ │ │ │ ├── push1_missingStack.json │ │ │ │ ├── push2.json │ │ │ │ ├── push20.json │ │ │ │ ├── push21.json │ │ │ │ ├── push22.json │ │ │ │ ├── push23.json │ │ │ │ ├── push24.json │ │ │ │ ├── push25.json │ │ │ │ ├── push26.json │ │ │ │ ├── push27.json │ │ │ │ ├── push28.json │ │ │ │ ├── push29.json │ │ │ │ ├── push3.json │ │ │ │ ├── push30.json │ │ │ │ ├── push31.json │ │ │ │ ├── push32.json │ │ │ │ ├── push32AndSuicide.json │ │ │ │ ├── push32FillUpInputWithZerosAtTheEnd.json │ │ │ │ ├── push32Undefined.json │ │ │ │ ├── push32Undefined2.json │ │ │ │ ├── push32Undefined3.json │ │ │ │ ├── push33.json │ │ │ │ ├── push4.json │ │ │ │ ├── push5.json │ │ │ │ ├── push6.json │ │ │ │ ├── push7.json │ │ │ │ ├── push8.json │ │ │ │ ├── push9.json │ │ │ │ ├── swap1.json │ │ │ │ ├── swap10.json │ │ │ │ ├── swap11.json │ │ │ │ ├── swap12.json │ │ │ │ ├── swap13.json │ │ │ │ ├── swap14.json │ │ │ │ ├── swap15.json │ │ │ │ ├── swap16.json │ │ │ │ ├── swap2.json │ │ │ │ ├── swap2error.json │ │ │ │ ├── swap3.json │ │ │ │ ├── swap4.json │ │ │ │ ├── swap5.json │ │ │ │ ├── swap6.json │ │ │ │ ├── swap7.json │ │ │ │ ├── swap8.json │ │ │ │ ├── swap9.json │ │ │ │ └── swapjump1.json │ │ │ ├── vmRandomTest │ │ │ │ ├── 201503102320PYTHON.json │ │ │ │ ├── 201503110206PYTHON.json │ │ │ │ ├── 201503110219PYTHON.json │ │ │ │ ├── 201503110346PYTHON_PUSH24.json │ │ │ │ ├── 201503111844PYTHON.json │ │ │ │ └── 201503112218PYTHON.json │ │ │ ├── vmSha3Test │ │ │ │ ├── sha3_0.json │ │ │ │ ├── sha3_1.json │ │ │ │ ├── sha3_2.json │ │ │ │ ├── sha3_3oog.json │ │ │ │ ├── sha3_4oog.json │ │ │ │ ├── sha3_5oog.json │ │ │ │ ├── sha3_6oog.json │ │ │ │ ├── sha3_bigOffset2.json │ │ │ │ ├── sha3_bigOffsetoog.json │ │ │ │ ├── sha3_bigSizeoog.json │ │ │ │ ├── sha3_memSizeNoQuadraticCost31.json │ │ │ │ ├── sha3_memSizeQuadraticCost32.json │ │ │ │ ├── sha3_memSizeQuadraticCost32_zeroSize.json │ │ │ │ ├── sha3_memSizeQuadraticCost33.json │ │ │ │ ├── sha3_memSizeQuadraticCost63.json │ │ │ │ ├── sha3_memSizeQuadraticCost64.json │ │ │ │ ├── sha3_memSizeQuadraticCost64_2.json │ │ │ │ └── sha3_memSizeQuadraticCost65.json │ │ │ ├── vmSystemOperations │ │ │ │ ├── TestNameRegistrator.json │ │ │ │ ├── return0.json │ │ │ │ ├── return1.json │ │ │ │ ├── return2.json │ │ │ │ ├── suicide0.json │ │ │ │ ├── suicideNotExistingAccount.json │ │ │ │ └── suicideSendEtherToMe.json │ │ │ └── vmTests │ │ │ │ └── suicide.json │ │ └── evm_test.py │ ├── keccak_tests.py │ ├── smt │ │ ├── __init__.py │ │ ├── independece_solver_test.py │ │ └── model_test.py │ ├── state │ │ ├── __init__.py │ │ ├── calldata_test.py │ │ ├── mstack_test.py │ │ ├── mstate_test.py │ │ ├── storage_test.py │ │ └── world_state_account_exist_load_test.py │ ├── strategy │ │ └── test_loop_bound.py │ ├── test_transaction.py │ └── transaction │ │ ├── __init__.py │ │ ├── create_transaction_test.py │ │ └── symbolic_test.py ├── mythril │ ├── mythril_analyzer_test.py │ ├── mythril_config_test.py │ └── mythril_disassembler_test.py ├── plugin │ ├── interface_test.py │ └── loader_test.py ├── rpc_test.py ├── solidity_contract_test.py ├── statespace_test.py ├── testdata │ ├── __init__.py │ ├── compile.py │ ├── input_contracts │ │ ├── calls.sol │ │ ├── constructor_assert.sol │ │ ├── environments.sol │ │ ├── ether_send.sol │ │ ├── exceptions.sol │ │ ├── exceptions_0.8.0.sol │ │ ├── flag_array.sol │ │ ├── kinds_of_calls.sol │ │ ├── metacoin.sol │ │ ├── multi_contracts.sol │ │ ├── nonascii.sol │ │ ├── origin.sol │ │ ├── overflow.sol │ │ ├── returnvalue.sol │ │ ├── rubixi.sol │ │ ├── safe_funcs.sol │ │ ├── suicide.sol │ │ ├── symbolic_exec_bytecode.sol │ │ ├── underflow.sol │ │ └── weak_random.sol │ ├── inputs │ │ ├── calls.sol.o │ │ ├── environments.sol.o │ │ ├── ether_send.sol.o │ │ ├── exceptions.sol.o │ │ ├── exceptions_0.8.0.sol.o │ │ ├── flag_array.sol.o │ │ ├── kinds_of_calls.sol.o │ │ ├── metacoin.sol.o │ │ ├── multi_contracts.sol.o │ │ ├── nonascii.sol.o │ │ ├── origin.sol.o │ │ ├── overflow.sol.o │ │ ├── returnvalue.sol.o │ │ ├── safe_funcs.sol.o │ │ ├── suicide.sol.o │ │ ├── symbolic_exec_bytecode.sol.o │ │ └── underflow.sol.o │ ├── json_test_dir │ │ ├── PRC20.sol │ │ ├── dir_a │ │ │ └── input_file.sol │ │ └── test_file.json │ ├── mythril_config_inputs │ │ └── config.ini │ └── outputs_expected │ │ ├── calls.sol.o.easm │ │ ├── calls.sol.o.graph.html │ │ ├── environments.sol.o.easm │ │ ├── environments.sol.o.graph.html │ │ ├── ether_send.sol.o.easm │ │ ├── ether_send.sol.o.graph.html │ │ ├── exceptions.sol.o.easm │ │ ├── exceptions.sol.o.graph.html │ │ ├── kinds_of_calls.sol.o.easm │ │ ├── kinds_of_calls.sol.o.graph.html │ │ ├── metacoin.sol.o.easm │ │ ├── metacoin.sol.o.graph.html │ │ ├── multi_contracts.sol.o.easm │ │ ├── multi_contracts.sol.o.graph.html │ │ ├── nonascii.sol.o.easm │ │ ├── nonascii.sol.o.graph.html │ │ ├── origin.sol.o.easm │ │ ├── origin.sol.o.graph.html │ │ ├── overflow.sol.o.easm │ │ ├── overflow.sol.o.graph.html │ │ ├── returnvalue.sol.o.easm │ │ ├── returnvalue.sol.o.graph.html │ │ ├── suicide.sol.o.easm │ │ ├── suicide.sol.o.graph.html │ │ ├── underflow.sol.o.easm │ │ └── underflow.sol.o.graph.html └── teststorage │ ├── contractstorage.fs │ ├── contractstorage.fs.index │ └── contractstorage.fs.tmp └── tox.ini /.drone.yml: -------------------------------------------------------------------------------- 1 | kind: pipeline 2 | name: default 3 | 4 | platform: 5 | os: linux 6 | arch: amd64 7 | 8 | steps: 9 | - name: edelweiss_swc 10 | image: mythx.azurecr.io/tools/edelweiss 11 | environment: 12 | IGNORE_FALSE_POSITIVES: 13 | from_secret: IGNORE_FALSE_POSITIVES 14 | IGNORE_REGRESSIONS: 15 | from_secret: IGNORE_REGRESSIONS 16 | AWS_DEFAULT_REGION: 17 | from_secret: AWS_DEFAULT_REGION 18 | AWS_ACCESS_KEY_ID: 19 | from_secret: AWS_ACCESS_KEY_ID 20 | AWS_SECRET_ACCESS_KEY: 21 | from_secret: AWS_SECRET_ACCESS_KEY 22 | MONGO_URL: 23 | from_secret: MONGO_URL 24 | commands: 25 | # CIRCLE_* env vars is used by edelweiss cli to generate 26 | # the reports storage directory structure 27 | - export CIRCLE_BUILD_NUM=$DRONE_BUILD_NUMBER 28 | - export CIRCLE_BUILD_URL=$DRONE_BUILD_LINK 29 | - export CIRCLE_BRANCH=$DRONE_BRANCH 30 | - export CIRCLE_SHA1=$DRONE_COMMIT_SHA 31 | # install pip module from current dir 32 | - pip3 install $(pwd) 33 | # update SWC-registry 34 | - cd /edelweiss 35 | - git submodule update --init --recursive 36 | - git submodule update --remote --recursive 37 | # run edelewiss tests 38 | - edelweiss-cli 39 | -p mythril 40 | --timeout 90 41 | --output-dir $(pwd) 42 | --s3 43 | --dynamodb 44 | --circle-ci CircleCI/mythril.csv 45 | --ignore-false-positives $IGNORE_FALSE_POSITIVES 46 | --ignore-regressions $IGNORE_REGRESSIONS 47 | when: 48 | branch: 49 | - develop 50 | - master 51 | event: 52 | - push 53 | - tag 54 | 55 | image_pull_secrets: 56 | - DOCKER_CONFIG_JSON 57 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*.py] 8 | indent_style = space 9 | indent_size = 4 10 | charset = utf-8 11 | 12 | [*.jinja2] 13 | insert_final_newline = false 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/testdata/* linguist-detectable=false 2 | static/* linguist-documentation 3 | 4 | # Solidity 5 | *.sol linguist-language=Solidity 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/analysis-module.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Analysis module 3 | about: Create an analysis module feature request 4 | 5 | --- 6 | 7 | 8 | 9 | ## Description 10 | 11 | 13 | 14 | ## Tests 15 | 16 | 21 | 22 | ## Implementation details 23 | 24 | 28 | 29 | ## Links 30 | 31 | 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Tell us about a new feature that would make Mythril better 4 | 5 | --- 6 | 7 | ## Description 8 | 9 | 10 | 11 | ## Background 12 | 13 | 15 | 16 | ## Tests 17 | 18 | 28 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | repos: 4 | - repo: https://github.com/psf/black 5 | rev: 21.12b0 6 | hooks: 7 | - id: black 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Mythril 2 | Hi, if you are reading this that means that you probably want to contribute to Mythril, awesome! If not, then this file might not contain much useful information for you. 3 | 4 | ## Creating an issue 5 | If you have found a problem with Mythril or want to propose a new feature then you can do this using GitHub issues. 6 | We already created some templates to make this process easier, but if your issue/feature request does not fit within the template then feel free to deviate. 7 | 8 | If you have a small question or aren't sure if you should create an issue for your problem/suggestion then you can always hop by on our [Discord server](https://discord.gg/FGMkcU2). 9 | 10 | # Coding 11 | If you want to help out with the development of Mythril then you can take a look at our issues or [Waffle board](https://waffle.io/ConsenSys/mythril). 12 | 13 | Before you start working on an issue please stop by on Discord to message a collaborator, this way we can assign you to the issue making sure nobody does double work. We can also provide you with support through Discord if there are any questions during the development process. 14 | 15 | ## New ideas 16 | Before you start working on a new idea, it's useful to create an issue on GitHub, that way we know what you want to implement and that you are working on it. Additionally, it might happen that your feature does not fit with our roadmap, in which case it would be unfortunate if you have already spent some time working on it. 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal 2 | 3 | ARG DEBIAN_FRONTEND=noninteractive 4 | 5 | # Space-separated version string without leading 'v' (e.g. "0.4.21 0.4.22") 6 | ARG SOLC 7 | 8 | RUN apt-get update \ 9 | && apt-get install -y \ 10 | libsqlite3-0 \ 11 | libsqlite3-dev \ 12 | && apt-get install -y \ 13 | apt-utils \ 14 | build-essential \ 15 | locales \ 16 | python-pip-whl \ 17 | python3-pip \ 18 | python3-setuptools \ 19 | software-properties-common \ 20 | && add-apt-repository -y ppa:ethereum/ethereum \ 21 | && apt-get update \ 22 | && apt-get install -y \ 23 | solc \ 24 | libssl-dev \ 25 | python3-dev \ 26 | pandoc \ 27 | git \ 28 | wget \ 29 | && ln -s /usr/bin/python3 /usr/local/bin/python 30 | 31 | COPY ./requirements.txt /opt/mythril/requirements.txt 32 | 33 | RUN cd /opt/mythril \ 34 | && pip3 install -r requirements.txt 35 | 36 | RUN locale-gen en_US.UTF-8 37 | ENV LANG en_US.UTF-8 38 | ENV LANGUAGE en_US.en 39 | ENV LC_ALL en_US.UTF-8 40 | 41 | COPY . /opt/mythril 42 | RUN cd /opt/mythril \ 43 | && python setup.py install 44 | 45 | WORKDIR /home/mythril 46 | 47 | RUN ( [ ! -z "${SOLC}" ] && set -e && for ver in $SOLC; do python -m solc.install v${ver}; done ) || true 48 | 49 | COPY ./mythril/support/assets/signatures.db /home/mythril/.mythril/signatures.db 50 | 51 | ENTRYPOINT ["/usr/local/bin/myth"] 52 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) since 2017 Bernhard Mueller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include mythril/support/assets/* 2 | include mythril/analysis/templates/* 3 | include requirements.txt -------------------------------------------------------------------------------- /all_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo -n "Checking Python version... " 4 | python -c 'import sys 5 | print(sys.version) 6 | assert sys.version_info[0:2] >= (3,5), \ 7 | """Please make sure you are using Python 3.5 or later. 8 | You ran with {}""".format(sys.version)' || exit $? 9 | 10 | echo "Checking that truffle is installed..." 11 | if ! which truffle ; then 12 | echo "Please make sure you have etherum truffle installed (npm install -g truffle)" 13 | exit 2 14 | fi 15 | 16 | rm -rf ./tests/testdata/outputs_current/ 17 | mkdir -p ./tests/testdata/outputs_current/ 18 | rm -rf ./tests/testdata/outputs_current_laser_result/ 19 | mkdir -p ./tests/testdata/outputs_current_laser_result/ 20 | mkdir -p /tmp/test-reports 21 | pytest --junitxml=/tmp/test-reports/junit.xml 22 | -------------------------------------------------------------------------------- /coverage_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | python --version 4 | echo "Please make sure you are using python 3.6.x" 5 | 6 | rm -rf ./tests/testdata/outputs_current/ 7 | mkdir -p ./tests/testdata/outputs_current/ 8 | rm -rf ./tests/testdata/outputs_current_laser_result/ 9 | mkdir -p ./tests/testdata/outputs_current_laser_result/ 10 | rm -rf coverage_html_report 11 | 12 | py.test \ 13 | --cov=mythril \ 14 | --cov-config=tox.ini \ 15 | --cov-report=html:coverage_reports/coverage_html_report \ 16 | --cov-report=xml:coverage_reports/coverage_xml_report.xml 17 | -------------------------------------------------------------------------------- /docker_build_and_deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eo pipefail 4 | 5 | NAME=$1 6 | 7 | if [ ! -z $CIRCLE_TAG ]; 8 | then 9 | VERSION=${CIRCLE_TAG#?} 10 | else 11 | VERSION=${CIRCLE_SHA1} 12 | fi 13 | 14 | VERSION_TAG=${NAME}:${VERSION} 15 | LATEST_TAG=${NAME}:latest 16 | 17 | docker build -t ${VERSION_TAG} . 18 | docker tag ${VERSION_TAG} ${LATEST_TAG} 19 | 20 | docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD 21 | 22 | docker push ${VERSION_TAG} 23 | docker push ${LATEST_TAG} 24 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SOURCEDIR = source 8 | BUILDDIR = build 9 | 10 | # Put it first so that "make" without argument is like "make help". 11 | help: 12 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 13 | 14 | .PHONY: help Makefile 15 | 16 | # Catch-all target: route all unknown targets to Sphinx using the new 17 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 18 | %: Makefile 19 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/about.rst: -------------------------------------------------------------------------------- 1 | What is Mythril? 2 | ======================== 3 | 4 | Mythril is a security analysis tool for Ethereum smart contracts. It was `introduced at HITBSecConf 2018 `_. 5 | 6 | Mythril detects a range of security issues, including integer underflows, owner-overwrite-to-Ether-withdrawal, and others. Note that Mythril is targeted at finding common vulnerabilities, and is not able to discover issues in the business logic of an application. Furthermore, Mythril and symbolic executors are generally unsound, as they are often unable to explore all possible states of a program. 7 | -------------------------------------------------------------------------------- /docs/source/analysis-modules.rst: -------------------------------------------------------------------------------- 1 | Analysis Modules 2 | ================ 3 | 4 | Mythril's detection capabilities are written in modules in the `/analysis/modules `_ directory. 5 | 6 | 7 | .. toctree:: 8 | :maxdepth: 2 9 | 10 | module-list.rst 11 | create-module.rst 12 | -------------------------------------------------------------------------------- /docs/source/create-module.rst: -------------------------------------------------------------------------------- 1 | Creating a Module 2 | ================= 3 | 4 | Create a module in the :code:`analysis/modules` directory, and create an instance of a class that inherits :code:`DetectionModule` named :code:`detector`. Take a look at the `suicide module `_ as an example. 5 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Mythril's documentation! 2 | =========================================== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | :caption: Table of Contents: 7 | 8 | about 9 | installation 10 | security-analysis 11 | analysis-modules 12 | mythx-analysis 13 | mythril 14 | 15 | 16 | Indices and Tables 17 | ================== 18 | 19 | * :ref:`genindex` 20 | * :ref:`modindex` 21 | * :ref:`search` 22 | 23 | -------------------------------------------------------------------------------- /docs/source/mythril.disassembler.rst: -------------------------------------------------------------------------------- 1 | mythril.disassembler package 2 | ============================ 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.disassembler.asm module 8 | ------------------------------- 9 | 10 | .. automodule:: mythril.disassembler.asm 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.disassembler.disassembly module 16 | --------------------------------------- 17 | 18 | .. automodule:: mythril.disassembler.disassembly 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: mythril.disassembler 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/source/mythril.ethereum.interface.leveldb.rst: -------------------------------------------------------------------------------- 1 | mythril.ethereum.interface.leveldb package 2 | ========================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.ethereum.interface.leveldb.accountindexing module 8 | --------------------------------------------------------- 9 | 10 | .. automodule:: mythril.ethereum.interface.leveldb.accountindexing 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.ethereum.interface.leveldb.client module 16 | ------------------------------------------------ 17 | 18 | .. automodule:: mythril.ethereum.interface.leveldb.client 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | mythril.ethereum.interface.leveldb.eth\_db module 24 | ------------------------------------------------- 25 | 26 | .. automodule:: mythril.ethereum.interface.leveldb.eth_db 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | mythril.ethereum.interface.leveldb.state module 32 | ----------------------------------------------- 33 | 34 | .. automodule:: mythril.ethereum.interface.leveldb.state 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: mythril.ethereum.interface.leveldb 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/source/mythril.ethereum.interface.rpc.rst: -------------------------------------------------------------------------------- 1 | mythril.ethereum.interface.rpc package 2 | ====================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.ethereum.interface.rpc.base\_client module 8 | -------------------------------------------------- 9 | 10 | .. automodule:: mythril.ethereum.interface.rpc.base_client 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.ethereum.interface.rpc.client module 16 | -------------------------------------------- 17 | 18 | .. automodule:: mythril.ethereum.interface.rpc.client 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | mythril.ethereum.interface.rpc.constants module 24 | ----------------------------------------------- 25 | 26 | .. automodule:: mythril.ethereum.interface.rpc.constants 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | mythril.ethereum.interface.rpc.exceptions module 32 | ------------------------------------------------ 33 | 34 | .. automodule:: mythril.ethereum.interface.rpc.exceptions 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | mythril.ethereum.interface.rpc.utils module 40 | ------------------------------------------- 41 | 42 | .. automodule:: mythril.ethereum.interface.rpc.utils 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | 48 | Module contents 49 | --------------- 50 | 51 | .. automodule:: mythril.ethereum.interface.rpc 52 | :members: 53 | :undoc-members: 54 | :show-inheritance: 55 | -------------------------------------------------------------------------------- /docs/source/mythril.ethereum.interface.rst: -------------------------------------------------------------------------------- 1 | mythril.ethereum.interface package 2 | ================================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | mythril.ethereum.interface.leveldb 10 | mythril.ethereum.interface.rpc 11 | 12 | Module contents 13 | --------------- 14 | 15 | .. automodule:: mythril.ethereum.interface 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | -------------------------------------------------------------------------------- /docs/source/mythril.ethereum.rst: -------------------------------------------------------------------------------- 1 | mythril.ethereum package 2 | ======================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | mythril.ethereum.interface 10 | 11 | Submodules 12 | ---------- 13 | 14 | mythril.ethereum.evmcontract module 15 | ----------------------------------- 16 | 17 | .. automodule:: mythril.ethereum.evmcontract 18 | :members: 19 | :undoc-members: 20 | :show-inheritance: 21 | 22 | mythril.ethereum.util module 23 | ---------------------------- 24 | 25 | .. automodule:: mythril.ethereum.util 26 | :members: 27 | :undoc-members: 28 | :show-inheritance: 29 | 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: mythril.ethereum 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/source/mythril.interfaces.rst: -------------------------------------------------------------------------------- 1 | mythril.interfaces package 2 | ========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.interfaces.cli module 8 | ----------------------------- 9 | 10 | .. automodule:: mythril.interfaces.cli 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.interfaces.epic module 16 | ------------------------------ 17 | 18 | .. automodule:: mythril.interfaces.epic 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | 24 | Module contents 25 | --------------- 26 | 27 | .. automodule:: mythril.interfaces 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | -------------------------------------------------------------------------------- /docs/source/mythril.laser.ethereum.strategy.rst: -------------------------------------------------------------------------------- 1 | mythril.laser.ethereum.strategy package 2 | ======================================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.laser.ethereum.strategy.basic module 8 | -------------------------------------------- 9 | 10 | .. automodule:: mythril.laser.ethereum.strategy.basic 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: mythril.laser.ethereum.strategy 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /docs/source/mythril.laser.ethereum.transaction.rst: -------------------------------------------------------------------------------- 1 | mythril.laser.ethereum.transaction package 2 | ========================================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.laser.ethereum.transaction.concolic module 8 | -------------------------------------------------- 9 | 10 | .. automodule:: mythril.laser.ethereum.transaction.concolic 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.laser.ethereum.transaction.symbolic module 16 | -------------------------------------------------- 17 | 18 | .. automodule:: mythril.laser.ethereum.transaction.symbolic 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | mythril.laser.ethereum.transaction.transaction\_models module 24 | ------------------------------------------------------------- 25 | 26 | .. automodule:: mythril.laser.ethereum.transaction.transaction_models 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | 32 | Module contents 33 | --------------- 34 | 35 | .. automodule:: mythril.laser.ethereum.transaction 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | -------------------------------------------------------------------------------- /docs/source/mythril.laser.rst: -------------------------------------------------------------------------------- 1 | mythril.laser package 2 | ===================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | mythril.laser.ethereum 10 | mythril.laser.smt 11 | 12 | Module contents 13 | --------------- 14 | 15 | .. automodule:: mythril.laser 16 | :members: 17 | :undoc-members: 18 | :show-inheritance: 19 | -------------------------------------------------------------------------------- /docs/source/mythril.laser.smt.rst: -------------------------------------------------------------------------------- 1 | mythril.laser.smt package 2 | ========================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.laser.smt.bitvec module 8 | ------------------------------- 9 | 10 | .. automodule:: mythril.laser.smt.bitvec 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.laser.smt.bool module 16 | ----------------------------- 17 | 18 | .. automodule:: mythril.laser.smt.bool 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | mythril.laser.smt.expression module 24 | ----------------------------------- 25 | 26 | .. automodule:: mythril.laser.smt.expression 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | 32 | Module contents 33 | --------------- 34 | 35 | .. automodule:: mythril.laser.smt 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | -------------------------------------------------------------------------------- /docs/source/mythril.rst: -------------------------------------------------------------------------------- 1 | Mythril Package 2 | =============== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | 9 | mythril.analysis 10 | mythril.disassembler 11 | mythril.ethereum 12 | mythril.interfaces 13 | mythril.laser 14 | mythril.solidity 15 | mythril.support 16 | 17 | Submodules 18 | ---------- 19 | 20 | mythril.exceptions module 21 | ------------------------- 22 | 23 | .. automodule:: mythril.exceptions 24 | :members: 25 | :undoc-members: 26 | :show-inheritance: 27 | 28 | mythril.mythril module 29 | ---------------------- 30 | 31 | .. automodule:: mythril.mythril 32 | :members: 33 | :undoc-members: 34 | :show-inheritance: 35 | 36 | mythril.version module 37 | ---------------------- 38 | 39 | .. automodule:: mythril.version 40 | :members: 41 | :undoc-members: 42 | :show-inheritance: 43 | 44 | 45 | Module contents 46 | --------------- 47 | 48 | .. automodule:: mythril 49 | :members: 50 | :undoc-members: 51 | :show-inheritance: 52 | -------------------------------------------------------------------------------- /docs/source/mythril.solidity.rst: -------------------------------------------------------------------------------- 1 | mythril.solidity package 2 | ======================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.solidity.soliditycontract module 8 | ---------------------------------------- 9 | 10 | .. automodule:: mythril.solidity.soliditycontract 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | 16 | Module contents 17 | --------------- 18 | 19 | .. automodule:: mythril.solidity 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | -------------------------------------------------------------------------------- /docs/source/mythril.support.rst: -------------------------------------------------------------------------------- 1 | mythril.support package 2 | ======================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | mythril.support.loader module 8 | ----------------------------- 9 | 10 | .. automodule:: mythril.support.loader 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | mythril.support.signatures module 16 | --------------------------------- 17 | 18 | .. automodule:: mythril.support.signatures 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | mythril.support.support\_utils module 24 | ------------------------------------- 25 | 26 | .. automodule:: mythril.support.support_utils 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | mythril.support.truffle module 32 | ------------------------------ 33 | 34 | .. automodule:: mythril.support.truffle 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | 40 | Module contents 41 | --------------- 42 | 43 | .. automodule:: mythril.support 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | -------------------------------------------------------------------------------- /docs/source/wiki.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/docs/source/wiki.rst -------------------------------------------------------------------------------- /mypy-stubs/z3/z3core.pyi: -------------------------------------------------------------------------------- 1 | from .z3types import Ast, ContextObj 2 | 3 | def Z3_mk_eq(ctx: ContextObj, a: Ast, b: Ast) -> Ast: ... 4 | def Z3_mk_div(ctx: ContextObj, a: Ast, b: Ast) -> Ast: ... 5 | -------------------------------------------------------------------------------- /mypy-stubs/z3/z3types.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | class Z3Exception(Exception): 4 | def __init__(self, a: Any) -> None: 5 | self.value = a 6 | ... 7 | 8 | class ContextObj: ... 9 | class Ast: ... 10 | -------------------------------------------------------------------------------- /myth: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | """mythril.py: Bug hunting on the Ethereum blockchain 4 | http://www.github.com/ConsenSys/mythril 5 | """ 6 | from sys import exit 7 | import mythril.interfaces.cli 8 | 9 | 10 | if __name__ == "__main__": 11 | mythril.interfaces.cli.main() 12 | exit() 13 | 14 | -------------------------------------------------------------------------------- /mythril/__init__.py: -------------------------------------------------------------------------------- 1 | # We use RsT document formatting in docstring. For example :param to mark parameters. 2 | # See PEP 287 3 | __docformat__ = "restructuredtext" 4 | import logging 5 | 6 | # Accept mythril.VERSION to get mythril's current version number 7 | from .__version__ import __version__ as VERSION # NOQA 8 | from mythril.plugin.loader import MythrilPluginLoader 9 | 10 | log = logging.getLogger(__name__) 11 | -------------------------------------------------------------------------------- /mythril/__main__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: UTF-8 -*- 3 | import mythril.interfaces.cli 4 | 5 | if __name__ == "__main__": 6 | mythril.interfaces.cli.main() 7 | -------------------------------------------------------------------------------- /mythril/__version__.py: -------------------------------------------------------------------------------- 1 | """This file contains the current Mythril version. 2 | 3 | This file is suitable for sourcing inside POSIX shell, e.g. bash as well 4 | as for importing into Python. 5 | """ 6 | 7 | __version__ = "v0.22.36" 8 | -------------------------------------------------------------------------------- /mythril/analysis/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/analysis/__init__.py -------------------------------------------------------------------------------- /mythril/analysis/analysis_args.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/analysis/analysis_args.py -------------------------------------------------------------------------------- /mythril/analysis/module/__init__.py: -------------------------------------------------------------------------------- 1 | from mythril.analysis.module.base import EntryPoint, DetectionModule 2 | from mythril.analysis.module.loader import ModuleLoader 3 | from mythril.analysis.module.util import ( 4 | get_detection_module_hooks, 5 | reset_callback_modules, 6 | ) 7 | -------------------------------------------------------------------------------- /mythril/analysis/module/module_helpers.py: -------------------------------------------------------------------------------- 1 | import traceback 2 | 3 | 4 | def is_prehook() -> bool: 5 | """Check if we are in prehook. One of Bernhard's trademark hacks! 6 | Let's leave it to this for now, unless we need to check prehook for 7 | a lot more modules. 8 | """ 9 | 10 | assert ("pre_hook" in traceback.format_stack()[-5]) or ( 11 | "post_hook" in traceback.format_stack()[-5] 12 | ) 13 | return "pre_hook" in traceback.format_stack()[-5] 14 | -------------------------------------------------------------------------------- /mythril/analysis/module/modules/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /mythril/analysis/security.py: -------------------------------------------------------------------------------- 1 | """This module contains functionality for hooking in detection modules and 2 | executing them.""" 3 | 4 | from mythril.analysis.module import ModuleLoader, reset_callback_modules 5 | from mythril.analysis.module.base import EntryPoint 6 | from mythril.analysis.report import Issue 7 | 8 | from typing import Optional, List 9 | import logging 10 | 11 | log = logging.getLogger(__name__) 12 | 13 | 14 | def retrieve_callback_issues(white_list: Optional[List[str]] = None) -> List[Issue]: 15 | """Get the issues discovered by callback type detection modules""" 16 | issues = [] # type: List[Issue] 17 | for module in ModuleLoader().get_detection_modules( 18 | entry_point=EntryPoint.CALLBACK, white_list=white_list 19 | ): 20 | log.debug("Retrieving results for " + module.name) 21 | issues += module.issues 22 | 23 | reset_callback_modules(module_names=white_list) 24 | 25 | return issues 26 | 27 | 28 | def fire_lasers(statespace, white_list: Optional[List[str]] = None) -> List[Issue]: 29 | """Fire lasers at analysed statespace object 30 | 31 | :param statespace: Symbolic statespace to analyze 32 | :param white_list: Optionally whitelist modules to use for the analysis 33 | :return: Discovered issues 34 | """ 35 | log.info("Starting analysis") 36 | 37 | issues = [] # type: List[Issue] 38 | for module in ModuleLoader().get_detection_modules( 39 | entry_point=EntryPoint.POST, white_list=white_list 40 | ): 41 | log.info("Executing " + module.name) 42 | issues += module.execute(statespace) 43 | 44 | issues += retrieve_callback_issues(white_list) 45 | return issues 46 | -------------------------------------------------------------------------------- /mythril/disassembler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/disassembler/__init__.py -------------------------------------------------------------------------------- /mythril/ethereum/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/ethereum/__init__.py -------------------------------------------------------------------------------- /mythril/ethereum/interface/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/ethereum/interface/__init__.py -------------------------------------------------------------------------------- /mythril/ethereum/interface/rpc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/ethereum/interface/rpc/__init__.py -------------------------------------------------------------------------------- /mythril/ethereum/interface/rpc/constants.py: -------------------------------------------------------------------------------- 1 | """This file contains constants used used by the Ethereum JSON RPC 2 | interface.""" 3 | BLOCK_TAG_EARLIEST = "earliest" 4 | BLOCK_TAG_LATEST = "latest" 5 | BLOCK_TAG_PENDING = "pending" 6 | BLOCK_TAGS = (BLOCK_TAG_EARLIEST, BLOCK_TAG_LATEST, BLOCK_TAG_PENDING) 7 | -------------------------------------------------------------------------------- /mythril/ethereum/interface/rpc/exceptions.py: -------------------------------------------------------------------------------- 1 | """This module contains exceptions regarding JSON-RPC communication.""" 2 | 3 | 4 | class EthJsonRpcError(Exception): 5 | """The JSON-RPC base exception type.""" 6 | 7 | pass 8 | 9 | 10 | class ConnectionError(EthJsonRpcError): 11 | """An RPC exception denoting there was an error in connecting to the RPC 12 | instance.""" 13 | 14 | pass 15 | 16 | 17 | class BadStatusCodeError(EthJsonRpcError): 18 | """An RPC exception denoting a bad status code returned by the RPC 19 | instance.""" 20 | 21 | pass 22 | 23 | 24 | class BadJsonError(EthJsonRpcError): 25 | """An RPC exception denoting that the RPC instance returned a bad JSON 26 | object.""" 27 | 28 | pass 29 | 30 | 31 | class BadResponseError(EthJsonRpcError): 32 | """An RPC exception denoting that the RPC instance returned a bad 33 | response.""" 34 | 35 | pass 36 | -------------------------------------------------------------------------------- /mythril/ethereum/interface/rpc/utils.py: -------------------------------------------------------------------------------- 1 | """This module contains various utility functions regarding the RPC data format 2 | and validation.""" 3 | from .constants import BLOCK_TAGS 4 | 5 | 6 | def hex_to_dec(x): 7 | """Convert hex to decimal. 8 | 9 | :param x: 10 | :return: 11 | """ 12 | return int(x, 16) 13 | 14 | 15 | def clean_hex(d): 16 | """Convert decimal to hex and remove the "L" suffix that is appended to 17 | large numbers. 18 | 19 | :param d: 20 | :return: 21 | """ 22 | return hex(d).rstrip("L") 23 | 24 | 25 | def validate_block(block): 26 | """ 27 | 28 | :param block: 29 | :return: 30 | """ 31 | if isinstance(block, str): 32 | if block not in BLOCK_TAGS: 33 | raise ValueError("invalid block tag") 34 | if isinstance(block, int): 35 | block = hex(block) 36 | return block 37 | 38 | 39 | def wei_to_ether(wei): 40 | """Convert wei to ether. 41 | 42 | :param wei: 43 | :return: 44 | """ 45 | return 1.0 * wei / 10 ** 18 46 | 47 | 48 | def ether_to_wei(ether): 49 | """Convert ether to wei. 50 | 51 | :param ether: 52 | :return: 53 | """ 54 | return ether * 10 ** 18 55 | -------------------------------------------------------------------------------- /mythril/exceptions.py: -------------------------------------------------------------------------------- 1 | """This module contains general exceptions used by Mythril.""" 2 | 3 | 4 | class MythrilBaseException(Exception): 5 | """The Mythril exception base type.""" 6 | 7 | pass 8 | 9 | 10 | class CompilerError(MythrilBaseException): 11 | """A Mythril exception denoting an error during code compilation.""" 12 | 13 | pass 14 | 15 | 16 | class UnsatError(MythrilBaseException): 17 | """A Mythril exception denoting the unsatisfiability of a series of 18 | constraints.""" 19 | 20 | pass 21 | 22 | 23 | class NoContractFoundError(MythrilBaseException): 24 | """A Mythril exception denoting that a given contract file was not 25 | found.""" 26 | 27 | pass 28 | 29 | 30 | class CriticalError(MythrilBaseException): 31 | """A Mythril exception denoting an unknown critical error has been 32 | encountered.""" 33 | 34 | pass 35 | 36 | 37 | class DetectorNotFoundError(MythrilBaseException): 38 | """A Mythril exception denoting attempted usage of a non-existant 39 | detection module.""" 40 | 41 | pass 42 | -------------------------------------------------------------------------------- /mythril/interfaces/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/interfaces/__init__.py -------------------------------------------------------------------------------- /mythril/laser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/laser/__init__.py -------------------------------------------------------------------------------- /mythril/laser/ethereum/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/laser/ethereum/__init__.py -------------------------------------------------------------------------------- /mythril/laser/ethereum/evm_exceptions.py: -------------------------------------------------------------------------------- 1 | """This module contains EVM exception types used by LASER.""" 2 | 3 | 4 | class VmException(Exception): 5 | """The base VM exception type.""" 6 | 7 | pass 8 | 9 | 10 | class StackUnderflowException(IndexError, VmException): 11 | """A VM exception regarding stack underflows.""" 12 | 13 | pass 14 | 15 | 16 | class StackOverflowException(VmException): 17 | """A VM exception regarding stack overflows.""" 18 | 19 | pass 20 | 21 | 22 | class InvalidJumpDestination(VmException): 23 | """A VM exception regarding JUMPs to invalid destinations.""" 24 | 25 | pass 26 | 27 | 28 | class InvalidInstruction(VmException): 29 | """A VM exception denoting an invalid op code has been encountered.""" 30 | 31 | pass 32 | 33 | 34 | class OutOfGasException(VmException): 35 | """A VM exception denoting the current execution has run out of gas.""" 36 | 37 | pass 38 | 39 | 40 | class WriteProtection(VmException): 41 | """A VM exception denoting that a write operation is executed on a write protected environment""" 42 | 43 | pass 44 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/function_managers/__init__.py: -------------------------------------------------------------------------------- 1 | from .exponent_function_manager import exponent_function_manager 2 | from .keccak_function_manager import keccak_function_manager 3 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/instruction_data.py: -------------------------------------------------------------------------------- 1 | from eth._utils.numeric import ceil32 2 | from typing import Tuple 3 | from mythril.support.opcodes import OPCODES, STACK, GAS 4 | from eth.constants import ( 5 | GAS_ECRECOVER, 6 | GAS_SHA256WORD, 7 | GAS_SHA256, 8 | GAS_RIPEMD160, 9 | GAS_RIPEMD160WORD, 10 | GAS_IDENTITY, 11 | GAS_IDENTITYWORD, 12 | GAS_SHA3WORD, 13 | GAS_SHA3, 14 | ) 15 | 16 | 17 | def calculate_sha3_gas(length: int): 18 | """ 19 | 20 | :param length: 21 | :return: 22 | """ 23 | gas_val = GAS_SHA3 + GAS_SHA3WORD * (ceil32(length) // 32) 24 | return gas_val, gas_val 25 | 26 | 27 | def calculate_native_gas(size: int, contract: str): 28 | """ 29 | 30 | :param size: 31 | :param contract: 32 | :return: 33 | """ 34 | gas_value = 0 35 | word_num = ceil32(size) // 32 36 | if contract == "ecrecover": 37 | gas_value = GAS_ECRECOVER 38 | elif contract == "sha256": 39 | gas_value = GAS_SHA256 + word_num * GAS_SHA256WORD 40 | elif contract == "ripemd160": 41 | gas_value = GAS_RIPEMD160 + word_num * GAS_RIPEMD160WORD 42 | elif contract == "identity": 43 | gas_value = GAS_IDENTITY + word_num * GAS_IDENTITYWORD 44 | else: 45 | # TODO: Add gas for other precompiles, computation should be shifted to natives.py 46 | # as some data isn't available here 47 | pass 48 | return gas_value, gas_value 49 | 50 | 51 | def get_opcode_gas(opcode: str) -> Tuple[int, int]: 52 | return OPCODES[opcode][GAS] 53 | 54 | 55 | def get_required_stack_elements(opcode: str) -> int: 56 | return OPCODES[opcode][STACK][0] 57 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/state/__init__.py: -------------------------------------------------------------------------------- 1 | # Hello! 2 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/strategy/__init__.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | from typing import List 3 | from mythril.laser.ethereum.state.global_state import GlobalState 4 | 5 | 6 | class BasicSearchStrategy(ABC): 7 | """""" 8 | 9 | __slots__ = "work_list", "max_depth" 10 | 11 | def __init__(self, work_list, max_depth): 12 | self.work_list = work_list # type: List[GlobalState] 13 | self.max_depth = max_depth 14 | 15 | def __iter__(self): 16 | return self 17 | 18 | @abstractmethod 19 | def get_strategic_global_state(self): 20 | """""" 21 | raise NotImplementedError("Must be implemented by a subclass") 22 | 23 | def __next__(self): 24 | try: 25 | global_state = self.get_strategic_global_state() 26 | if global_state.mstate.depth >= self.max_depth: 27 | return self.__next__() 28 | return global_state 29 | except IndexError: 30 | raise StopIteration 31 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/strategy/extensions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/laser/ethereum/strategy/extensions/__init__.py -------------------------------------------------------------------------------- /mythril/laser/ethereum/time_handler.py: -------------------------------------------------------------------------------- 1 | import time 2 | from mythril.support.support_utils import Singleton 3 | 4 | 5 | class TimeHandler(object, metaclass=Singleton): 6 | def __init__(self): 7 | self._start_time = None 8 | self._execution_time = None 9 | 10 | def start_execution(self, execution_time): 11 | self._start_time = int(time.time() * 1000) 12 | self._execution_time = execution_time * 1000 13 | 14 | def time_remaining(self): 15 | return self._execution_time - (int(time.time() * 1000) - self._start_time) 16 | 17 | 18 | time_handler = TimeHandler() 19 | -------------------------------------------------------------------------------- /mythril/laser/ethereum/transaction/__init__.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.ethereum.transaction.transaction_models import * 2 | from mythril.laser.ethereum.transaction.symbolic import ( 3 | execute_message_call, 4 | execute_contract_creation, 5 | ) 6 | -------------------------------------------------------------------------------- /mythril/laser/execution_info.py: -------------------------------------------------------------------------------- 1 | from abc import ABC, abstractmethod 2 | 3 | 4 | class ExecutionInfo(ABC): 5 | @abstractmethod 6 | def as_dict(self): 7 | """Returns a dictionary with the execution info contained in this object 8 | 9 | The returned dictionary only uses primitive types. 10 | """ 11 | pass 12 | -------------------------------------------------------------------------------- /mythril/laser/plugin/__init__.py: -------------------------------------------------------------------------------- 1 | """ Laser plugins 2 | 3 | This module contains everything to do with laser plugins 4 | 5 | Laser plugins are a way of extending laser's functionality without complicating the core business logic. 6 | Different features that have been implemented in the form of plugins are: 7 | - benchmarking 8 | - path pruning 9 | 10 | Plugins also provide a way to implement optimisations outside of the mythril code base and to inject them. 11 | The api that laser currently provides is still unstable and will probably change to suit our needs 12 | as more plugins get developed. 13 | 14 | For the implementation of plugins the following modules are of interest: 15 | - laser.plugins.plugin 16 | - laser.plugins.signals 17 | - laser.svm 18 | 19 | Which show the basic interfaces with which plugins are able to interact 20 | """ 21 | -------------------------------------------------------------------------------- /mythril/laser/plugin/builder.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.plugin.interface import LaserPlugin 2 | 3 | from abc import ABC, abstractmethod 4 | 5 | 6 | class PluginBuilder(ABC): 7 | """PluginBuilder 8 | 9 | The plugin builder interface enables construction of Laser plugins 10 | """ 11 | 12 | name = "Default Plugin Name" 13 | 14 | def __init__(self): 15 | self.enabled = True 16 | 17 | @abstractmethod 18 | def __call__(self, *args, **kwargs) -> LaserPlugin: 19 | """Constructs the plugin""" 20 | pass 21 | -------------------------------------------------------------------------------- /mythril/laser/plugin/interface.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.ethereum.svm import LaserEVM 2 | 3 | 4 | class LaserPlugin: 5 | """Base class for laser plugins 6 | 7 | Functionality in laser that the symbolic execution process does not need to depend on 8 | can be implemented in the form of a laser plugin. 9 | 10 | Laser plugins implement the function initialize(symbolic_vm) which is called with the laser virtual machine 11 | when they are loaded. 12 | Regularly a plugin will introduce several hooks into laser in this function 13 | 14 | Plugins can direct actions by raising Signals defined in mythril.laser.ethereum.plugins.signals 15 | For example, a pruning plugin might raise the PluginSkipWorldState signal. 16 | """ 17 | 18 | def initialize(self, symbolic_vm: LaserEVM) -> None: 19 | """Initializes this plugin on the symbolic virtual machine 20 | 21 | :param symbolic_vm: symbolic virtual machine to initialize the laser plugin on 22 | """ 23 | raise NotImplementedError 24 | -------------------------------------------------------------------------------- /mythril/laser/plugin/plugins/__init__.py: -------------------------------------------------------------------------------- 1 | """ Plugin implementations 2 | 3 | This module contains the implementation of some features 4 | 5 | - benchmarking 6 | - pruning 7 | """ 8 | from mythril.laser.plugin.plugins.benchmark import BenchmarkPluginBuilder 9 | from mythril.laser.plugin.plugins.coverage.coverage_plugin import CoveragePluginBuilder 10 | from mythril.laser.plugin.plugins.dependency_pruner import DependencyPrunerBuilder 11 | from mythril.laser.plugin.plugins.mutation_pruner import MutationPrunerBuilder 12 | from mythril.laser.plugin.plugins.call_depth_limiter import CallDepthLimitBuilder 13 | from mythril.laser.plugin.plugins.instruction_profiler import InstructionProfilerBuilder 14 | -------------------------------------------------------------------------------- /mythril/laser/plugin/plugins/call_depth_limiter.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.plugin.signals import PluginSkipState 2 | from mythril.laser.plugin.interface import LaserPlugin 3 | from mythril.laser.plugin.builder import PluginBuilder 4 | from mythril.laser.ethereum.state.global_state import GlobalState 5 | from mythril.laser.ethereum.svm import LaserEVM 6 | 7 | 8 | class CallDepthLimitBuilder(PluginBuilder): 9 | name = "call-depth-limit" 10 | 11 | def __call__(self, *args, **kwargs): 12 | return CallDepthLimit(kwargs["call_depth_limit"]) 13 | 14 | 15 | class CallDepthLimit(LaserPlugin): 16 | def __init__(self, call_depth_limit: int): 17 | self.call_depth_limit = call_depth_limit 18 | 19 | def initialize(self, symbolic_vm: LaserEVM): 20 | """Initializes the mutation pruner 21 | 22 | Introduces hooks for SSTORE operations 23 | :param symbolic_vm: 24 | :return: 25 | """ 26 | 27 | @symbolic_vm.pre_hook("CALL") 28 | def sstore_mutator_hook(global_state: GlobalState): 29 | if len(global_state.transaction_stack) - 1 == self.call_depth_limit: 30 | raise PluginSkipState 31 | -------------------------------------------------------------------------------- /mythril/laser/plugin/plugins/coverage/__init__.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.plugin.plugins.coverage.coverage_plugin import ( 2 | InstructionCoveragePlugin, 3 | ) 4 | -------------------------------------------------------------------------------- /mythril/laser/plugin/plugins/summary_backup/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/laser/plugin/plugins/summary_backup/__init__.py -------------------------------------------------------------------------------- /mythril/laser/plugin/signals.py: -------------------------------------------------------------------------------- 1 | class PluginSignal(Exception): 2 | """Base plugin signal 3 | 4 | These signals are used by the laser plugins to create intent for certain actions in the symbolic virtual machine 5 | """ 6 | 7 | pass 8 | 9 | 10 | class PluginSkipWorldState(PluginSignal): 11 | """Plugin to skip world state 12 | 13 | Plugins that raise this signal while the add_world_state hook is being executed 14 | will force laser to abandon that world state. 15 | """ 16 | 17 | pass 18 | 19 | 20 | class PluginSkipState(PluginSignal): 21 | """Plugin to skip world state 22 | 23 | Plugins that raise this signal while the add_world_state hook is being executed 24 | will force laser to abandon that world state. 25 | """ 26 | 27 | pass 28 | -------------------------------------------------------------------------------- /mythril/laser/smt/function.py: -------------------------------------------------------------------------------- 1 | from typing import cast, List, Any, Set 2 | import z3 3 | 4 | from mythril.laser.smt.bitvec import BitVec 5 | 6 | 7 | class Function: 8 | """An uninterpreted function.""" 9 | 10 | def __init__(self, name: str, domain: List[int], value_range: int): 11 | """Initializes an uninterpreted function. 12 | 13 | :param name: Name of the Function 14 | :param domain: The domain for the Function (10 -> all the values that a bv of size 10 could take) 15 | :param value_range: The range for the values of the function (10 -> all the values that a bv of size 10 could take) 16 | """ 17 | self.domain = [] 18 | for element in domain: 19 | self.domain.append(z3.BitVecSort(element)) 20 | self.range = z3.BitVecSort(value_range) 21 | self.raw = z3.Function(name, *self.domain, self.range) 22 | 23 | def __call__(self, *items) -> BitVec: 24 | """Function accessor, item can be symbolic.""" 25 | annotations: Set[Any] = set().union(*[item.annotations for item in items]) 26 | return BitVec( 27 | cast(z3.BitVecRef, self.raw(*[item.raw for item in items])), 28 | annotations=annotations, 29 | ) 30 | -------------------------------------------------------------------------------- /mythril/laser/smt/solver/__init__.py: -------------------------------------------------------------------------------- 1 | import z3 2 | 3 | from mythril.laser.smt.solver.solver import Solver, Optimize, BaseSolver 4 | from mythril.laser.smt.solver.independence_solver import IndependenceSolver 5 | from mythril.laser.smt.solver.solver_statistics import SolverStatistics 6 | from mythril.support.support_args import args 7 | 8 | if args.parallel_solving: 9 | z3.set_param("parallel.enable", True) 10 | -------------------------------------------------------------------------------- /mythril/laser/smt/solver/solver_statistics.py: -------------------------------------------------------------------------------- 1 | from time import time 2 | 3 | from mythril.support.support_utils import Singleton 4 | 5 | from typing import Callable 6 | 7 | 8 | def stat_smt_query(func: Callable): 9 | """Measures statistics for annotated smt query check function""" 10 | stat_store = SolverStatistics() 11 | 12 | def function_wrapper(*args, **kwargs): 13 | if not stat_store.enabled: 14 | return func(*args, **kwargs) 15 | 16 | stat_store.query_count += 1 17 | begin = time() 18 | 19 | result = func(*args, **kwargs) 20 | 21 | end = time() 22 | stat_store.solver_time += end - begin 23 | 24 | return result 25 | 26 | return function_wrapper 27 | 28 | 29 | class SolverStatistics(object, metaclass=Singleton): 30 | """Solver Statistics Class 31 | 32 | Keeps track of the important statistics around smt queries 33 | """ 34 | 35 | def __init__(self): 36 | self.enabled = False 37 | self.query_count = 0 38 | self.solver_time = 0 39 | 40 | def __repr__(self): 41 | return "Query count: {} \nSolver time: {}".format( 42 | self.query_count, self.solver_time 43 | ) 44 | -------------------------------------------------------------------------------- /mythril/mythril/__init__.py: -------------------------------------------------------------------------------- 1 | from .mythril_disassembler import MythrilDisassembler 2 | from .mythril_analyzer import MythrilAnalyzer 3 | from .mythril_config import MythrilConfig 4 | -------------------------------------------------------------------------------- /mythril/plugin/__init__.py: -------------------------------------------------------------------------------- 1 | from mythril.plugin.interface import MythrilPlugin, MythrilCLIPlugin 2 | from mythril.plugin.loader import MythrilPluginLoader 3 | -------------------------------------------------------------------------------- /mythril/plugin/interface.py: -------------------------------------------------------------------------------- 1 | from abc import ABC 2 | from mythril.laser.plugin.builder import PluginBuilder as LaserPluginBuilder 3 | 4 | 5 | class MythrilPlugin: 6 | """MythrilPlugin interface 7 | 8 | Mythril Plugins can be used to extend Mythril in different ways: 9 | 1. Extend Laser, in which case the LaserPlugin interface must also be extended 10 | 2. Extend Laser with a new search strategy in which case the SearchStrategy needs to be implemented 11 | 3. Add an analysis module, in this case the AnalysisModule interface needs to be implemented 12 | 4. Add new commands to the Mythril cli, using the MythrilCLIPlugin Interface 13 | """ 14 | 15 | author = "Default Author" 16 | name = "Plugin Name" 17 | plugin_license = "All rights reserved." 18 | plugin_type = "Mythril Plugin" 19 | plugin_version = "0.0.1 " 20 | plugin_description = "This is an example plugin description" 21 | 22 | def __init__(self, **kwargs): 23 | pass 24 | 25 | def __repr__(self): 26 | plugin_name = type(self).__name__ 27 | return f"{plugin_name} - {self.plugin_version} - {self.author}" 28 | 29 | 30 | class MythrilCLIPlugin(MythrilPlugin): 31 | """MythrilCLIPlugin interface 32 | 33 | This interface should be implemented by mythril plugins that aim to add commands to the mythril cli 34 | """ 35 | 36 | pass 37 | 38 | 39 | class MythrilLaserPlugin(MythrilPlugin, LaserPluginBuilder, ABC): 40 | """Mythril Laser Plugin interface 41 | 42 | Plugins of this type are used to instrument the laser EVM 43 | """ 44 | 45 | pass 46 | -------------------------------------------------------------------------------- /mythril/solidity/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/solidity/__init__.py -------------------------------------------------------------------------------- /mythril/support/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/support/__init__.py -------------------------------------------------------------------------------- /mythril/support/assets/signatures.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/mythril/support/assets/signatures.db -------------------------------------------------------------------------------- /mythril/support/start_time.py: -------------------------------------------------------------------------------- 1 | from time import time 2 | from mythril.support.support_utils import Singleton 3 | 4 | 5 | class StartTime(metaclass=Singleton): 6 | """Maintains the start time of the current contract in execution""" 7 | 8 | def __init__(self): 9 | self.global_start_time = time() 10 | -------------------------------------------------------------------------------- /mythril/support/support_args.py: -------------------------------------------------------------------------------- 1 | class Args: 2 | """ 3 | This module helps in preventing args being sent through multiple of classes to reach 4 | any analysis/laser module 5 | """ 6 | 7 | def __init__(self): 8 | self.solver_timeout = 10000 9 | self.sparse_pruning = True 10 | self.unconstrained_storage = False 11 | self.parallel_solving = False 12 | self.call_depth_limit = 3 13 | self.iprof = True 14 | self.solver_log = None 15 | 16 | 17 | args = Args() 18 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | blake2b-py 2 | coloredlogs>=10.0 3 | coincurve>=13.0.0 4 | asn1crypto>=0.22.0 5 | configparser>=3.5.0 6 | coverage>6.0 7 | py_ecc<5.0.0,>=1.4.7 8 | eth_abi<3.0.0,>=2.0.0b4 9 | eth-account<0.6.0,>=0.5.6 10 | ethereum-input-decoder>=0.2.2 11 | eth-hash>=0.3.1 12 | eth-keyfile<0.6.0,>=0.5.1 13 | eth-keys<0.4.0,>=0.2.1 14 | eth-rlp<0.3.0,>=0.1.0 15 | eth-typing<3.0.0,>=2.1.0 16 | eth-utils<2 17 | jinja2>=2.9 18 | mock 19 | persistent>=4.2.0 20 | py-flags 21 | py-evm==0.5.0a1 22 | pysha3 23 | py-solc-x 24 | py-solc 25 | pytest>=3.6.0 26 | pyparsing<3,>=2.0.2 27 | pytest-cov 28 | pytest_mock 29 | requests 30 | rlp<3 31 | semantic_version 32 | transaction>=2.2.1 33 | typing-extensions<4,>=3.7.4 34 | z3-solver>=4.8.8.0 35 | pysha3 36 | matplotlib 37 | pre-commit 38 | certifi>=2020.06.20 39 | -------------------------------------------------------------------------------- /solidity_examples/calls.sol: -------------------------------------------------------------------------------- 1 | 2 | 3 | contract Caller { 4 | 5 | address public fixed_address; 6 | address public stored_address; 7 | 8 | uint256 statevar; 9 | 10 | constructor(address addr) public { 11 | fixed_address = addr; 12 | } 13 | 14 | function thisisfine() public { 15 | fixed_address.call(""); 16 | } 17 | 18 | function reentrancy() public { 19 | fixed_address.call(""); 20 | statevar = 0; 21 | } 22 | 23 | function calluseraddress(address addr) public { 24 | addr.call(""); 25 | } 26 | 27 | function callstoredaddress() public { 28 | stored_address.call(""); 29 | } 30 | 31 | function setstoredaddress(address addr) public { 32 | stored_address = addr; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /solidity_examples/etherstore.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract EtherStore { 5 | 6 | uint256 public withdrawalLimit = 1 ether; 7 | mapping(address => uint256) public lastWithdrawTime; 8 | mapping(address => uint256) public balances; 9 | 10 | function depositFunds() public payable { 11 | balances[msg.sender] += msg.value; 12 | } 13 | 14 | function withdrawFunds (uint256 _weiToWithdraw) public { 15 | require(balances[msg.sender] >= _weiToWithdraw); 16 | // limit the withdrawal 17 | require(_weiToWithdraw <= withdrawalLimit); 18 | // limit the time allowed to withdraw 19 | require(now >= lastWithdrawTime[msg.sender] + 1 weeks); 20 | (bool success, bytes memory data) = msg.sender.call.value(_weiToWithdraw)(""); 21 | require(success); 22 | balances[msg.sender] -= _weiToWithdraw; 23 | lastWithdrawTime[msg.sender] = now; 24 | } 25 | } -------------------------------------------------------------------------------- /solidity_examples/exceptions.sol: -------------------------------------------------------------------------------- 1 | 2 | 3 | contract Exceptions { 4 | 5 | uint256[8] myarray; 6 | 7 | function assert1() public pure { 8 | uint256 i = 1; 9 | assert(i == 0); 10 | } 11 | 12 | function assert2() public pure { 13 | uint256 i = 1; 14 | assert(i > 0); 15 | } 16 | 17 | function assert3(uint256 input) public pure { 18 | assert(input != 23); 19 | } 20 | 21 | function requireisfine(uint256 input) public pure { 22 | require(input != 23); 23 | } 24 | 25 | function divisionby0(uint256 input) public pure { 26 | uint256 i = 1/input; 27 | } 28 | 29 | function thisisfine(uint256 input) public pure { 30 | if (input > 0) { 31 | uint256 i = 1/input; 32 | } 33 | } 34 | 35 | function arrayaccess(uint256 index) public view { 36 | uint256 i = myarray[index]; 37 | } 38 | 39 | function thisisalsofind(uint256 index) public view { 40 | if (index < 8) { 41 | uint256 i = myarray[index]; 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /solidity_examples/hashforether.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract HashForEther { 5 | 6 | function withdrawWinnings() public { 7 | // Winner if the last 8 hex characters of the address are 0. 8 | require(uint32(msg.sender) == 0); 9 | _sendWinnings(); 10 | } 11 | 12 | function _sendWinnings() public { 13 | msg.sender.transfer(address(this).balance); 14 | } 15 | } -------------------------------------------------------------------------------- /solidity_examples/origin.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract Origin { 5 | address public owner; 6 | 7 | 8 | /** 9 | * @dev The Ownable constructor sets the original `owner` of the contract to the sender 10 | * account. 11 | */ 12 | constructor() public { 13 | owner = msg.sender; 14 | } 15 | 16 | 17 | /** 18 | * @dev Throws if called by any account other than the owner. 19 | */ 20 | modifier onlyOwner() { 21 | require(tx.origin != owner); 22 | _; 23 | } 24 | 25 | 26 | /** 27 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 28 | * @param newOwner The address to transfer ownership to. 29 | */ 30 | function transferOwnership(address newOwner) public onlyOwner { 31 | if (newOwner != address(0)) { 32 | owner = newOwner; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /solidity_examples/returnvalue.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract ReturnValue { 5 | 6 | address public callee = 0xE0f7e56E62b4267062172495D7506087205A4229; 7 | 8 | function callnotchecked() public { 9 | callee.call(""); 10 | } 11 | 12 | function callchecked() public { 13 | (bool success, bytes memory data) = callee.call(""); 14 | require(success); 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /solidity_examples/suicide.sol: -------------------------------------------------------------------------------- 1 | 2 | 3 | contract Suicide { 4 | 5 | function kill(address payable addr) public { 6 | if (addr == address(0x0)) { 7 | selfdestruct(addr); 8 | } 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /solidity_examples/timelock.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract TimeLock { 5 | 6 | mapping(address => uint) public balances; 7 | mapping(address => uint) public lockTime; 8 | 9 | function deposit() public payable { 10 | balances[msg.sender] += msg.value; 11 | lockTime[msg.sender] = now + 1 weeks; 12 | } 13 | 14 | function increaseLockTime(uint _secondsToIncrease) public { 15 | lockTime[msg.sender] += _secondsToIncrease; 16 | } 17 | 18 | function withdraw() public { 19 | require(balances[msg.sender] > 0); 20 | require(now > lockTime[msg.sender]); 21 | balances[msg.sender] = 0; 22 | msg.sender.transfer(balances[msg.sender]); 23 | } 24 | } -------------------------------------------------------------------------------- /solidity_examples/token.sol: -------------------------------------------------------------------------------- 1 | 2 | 3 | contract Token { 4 | 5 | mapping(address => uint) balances; 6 | uint public totalSupply; 7 | 8 | constructor(uint _initialSupply) public { 9 | balances[msg.sender] = totalSupply = _initialSupply; 10 | } 11 | 12 | function transfer(address _to, uint _value) public returns (bool) { 13 | require(balances[msg.sender] - _value >= 0); 14 | balances[msg.sender] -= _value; 15 | balances[_to] += _value; 16 | return true; 17 | } 18 | 19 | function balanceOf(address _owner) public view returns (uint balance) { 20 | return balances[_owner]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /solidity_examples/weak_random.sol: -------------------------------------------------------------------------------- 1 | pragma solidity 0.5.0; 2 | 3 | 4 | contract WeakRandom { 5 | struct Contestant { 6 | address payable addr; 7 | uint gameId; 8 | } 9 | 10 | uint public prize = 2.5 ether; 11 | uint public totalTickets = 50; 12 | uint public pricePerTicket = prize / totalTickets; 13 | 14 | uint public gameId = 1; 15 | uint public nextTicket = 0; 16 | mapping (uint => Contestant) public contestants; 17 | 18 | function () payable external { 19 | uint moneySent = msg.value; 20 | 21 | while (moneySent >= pricePerTicket && nextTicket < totalTickets) { 22 | uint currTicket = nextTicket++; 23 | contestants[currTicket] = Contestant(msg.sender, gameId); 24 | moneySent -= pricePerTicket; 25 | } 26 | 27 | if (nextTicket == totalTickets) { 28 | chooseWinner(); 29 | } 30 | 31 | // Send back leftover money 32 | if (moneySent > 0) { 33 | msg.sender.transfer(moneySent); 34 | } 35 | } 36 | 37 | function chooseWinner() private { 38 | address seed1 = contestants[uint(block.coinbase) % totalTickets].addr; 39 | address seed2 = contestants[uint(msg.sender) % totalTickets].addr; 40 | uint seed3 = block.difficulty; 41 | bytes32 randHash = keccak256(abi.encode(seed1, seed2, seed3)); 42 | 43 | uint winningNumber = uint(randHash) % totalTickets; 44 | address payable winningAddress = contestants[winningNumber].addr; 45 | 46 | gameId++; 47 | nextTicket = 0; 48 | winningAddress.transfer(prize); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /static/callgraph7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/static/callgraph7.png -------------------------------------------------------------------------------- /static/callgraph8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/static/callgraph8.png -------------------------------------------------------------------------------- /static/mythril_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/static/mythril_new.png -------------------------------------------------------------------------------- /tests/cli_tests/test_cli_opts.py: -------------------------------------------------------------------------------- 1 | from mythril.interfaces.cli import main 2 | import pytest 3 | import json 4 | 5 | import sys 6 | 7 | 8 | def test_version_opt(capsys): 9 | # Check that "myth --version" returns a string with the word 10 | # "version" in it 11 | sys.argv = ["mythril", "version"] 12 | with pytest.raises(SystemExit) as pytest_wrapped_e: 13 | main() 14 | assert pytest_wrapped_e.type == SystemExit 15 | captured = capsys.readouterr() 16 | assert captured.out.find(" version ") >= 1 17 | 18 | # Check that "myth --version -o json" returns a JSON object 19 | sys.argv = ["mythril", "version", "-o", "json"] 20 | with pytest.raises(SystemExit) as pytest_wrapped_e: 21 | main() 22 | assert pytest_wrapped_e.type == SystemExit 23 | captured = capsys.readouterr() 24 | d = json.loads(captured.out) 25 | assert isinstance(d, dict) 26 | assert d["version_str"] 27 | -------------------------------------------------------------------------------- /tests/disassembler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/disassembler/__init__.py -------------------------------------------------------------------------------- /tests/graph_test.py: -------------------------------------------------------------------------------- 1 | """ 2 | This test only checks whether dumping is successful, not whether the dumped state space makes sense 3 | """ 4 | from mythril.mythril import MythrilAnalyzer, MythrilDisassembler 5 | from mythril.ethereum import util 6 | from mythril.solidity.soliditycontract import EVMContract 7 | from tests import TESTDATA_INPUTS 8 | 9 | 10 | def test_generate_graph(): 11 | for input_file in TESTDATA_INPUTS.iterdir(): 12 | if input_file.name != "origin.sol.o": 13 | continue 14 | contract = EVMContract(input_file.read_text()) 15 | disassembler = MythrilDisassembler() 16 | 17 | disassembler.contracts.append(contract) 18 | analyzer = MythrilAnalyzer( 19 | disassembler=disassembler, 20 | strategy="dfs", 21 | execution_timeout=5, 22 | max_depth=30, 23 | address=(util.get_indexed_address(0)), 24 | solver_timeout=10000, 25 | ) 26 | 27 | analyzer.graph_html(transaction_count=1) 28 | -------------------------------------------------------------------------------- /tests/instructions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/instructions/__init__.py -------------------------------------------------------------------------------- /tests/instructions/codecopy_test.py: -------------------------------------------------------------------------------- 1 | from mythril.disassembler.disassembly import Disassembly 2 | from mythril.laser.ethereum.state.environment import Environment 3 | from mythril.laser.ethereum.state.account import Account 4 | from mythril.laser.ethereum.state.machine_state import MachineState 5 | from mythril.laser.ethereum.state.global_state import GlobalState 6 | from mythril.laser.ethereum.state.world_state import WorldState 7 | from mythril.laser.ethereum.instructions import Instruction 8 | from mythril.laser.ethereum.transaction.transaction_models import MessageCallTransaction 9 | 10 | 11 | def test_codecopy_concrete(): 12 | # Arrange 13 | world_state = WorldState() 14 | account = world_state.create_account(balance=10, address=101) 15 | account.code = Disassembly("60606040") 16 | environment = Environment(account, None, None, None, None, None, None) 17 | og_state = GlobalState( 18 | world_state, environment, None, MachineState(gas_limit=8000000) 19 | ) 20 | og_state.transaction_stack.append( 21 | (MessageCallTransaction(world_state=WorldState(), gas_limit=8000000), None) 22 | ) 23 | 24 | og_state.mstate.stack = [2, 2, 2] 25 | instruction = Instruction("codecopy", dynamic_loader=None) 26 | 27 | # Act 28 | new_state = instruction.evaluate(og_state)[0] 29 | 30 | # Assert 31 | assert new_state.mstate.memory[2] == 96 32 | assert new_state.mstate.memory[3] == 64 33 | -------------------------------------------------------------------------------- /tests/instructions/test_basefee.py: -------------------------------------------------------------------------------- 1 | from mythril.disassembler.disassembly import Disassembly 2 | from mythril.laser.ethereum.state.environment import Environment 3 | from mythril.laser.ethereum.state.machine_state import MachineState 4 | from mythril.laser.ethereum.state.global_state import GlobalState 5 | from mythril.laser.ethereum.state.world_state import WorldState 6 | from mythril.laser.ethereum.instructions import Instruction 7 | from mythril.laser.ethereum.transaction.transaction_models import MessageCallTransaction 8 | from mythril.laser.smt import symbol_factory 9 | 10 | 11 | def test_basefee(): 12 | # Arrange 13 | world_state = WorldState() 14 | account = world_state.create_account(balance=10, address=101) 15 | account.code = Disassembly("60606040") 16 | environment = Environment( 17 | account, 18 | None, 19 | None, 20 | None, 21 | None, 22 | None, 23 | basefee=symbol_factory.BitVecSym("gasfee", 256), 24 | ) 25 | og_state = GlobalState( 26 | world_state, environment, None, MachineState(gas_limit=8000000) 27 | ) 28 | og_state.transaction_stack.append( 29 | (MessageCallTransaction(world_state=WorldState(), gas_limit=8000000), None) 30 | ) 31 | 32 | og_state.mstate.stack = [] 33 | instruction = Instruction("basefee", dynamic_loader=None) 34 | 35 | # Act 36 | new_state = instruction.evaluate(og_state)[0] 37 | 38 | # Assert 39 | assert new_state.mstate.stack == [symbol_factory.BitVecSym("gasfee", 256)] 40 | -------------------------------------------------------------------------------- /tests/integration_tests/test_solc_settings.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | import json 3 | import sys 4 | 5 | from subprocess import check_output, STDOUT 6 | from tests import PROJECT_DIR, TESTDATA 7 | 8 | MYTH = str(PROJECT_DIR / "myth") 9 | 10 | 11 | def test_positive_solc_settings(): 12 | file_dir = str(TESTDATA / "json_test_dir" / "dir_a") 13 | json_file_path = str(TESTDATA / "json_test_dir" / "test_file.json") 14 | file_path = file_dir + "/input_file.sol" 15 | 16 | command = f"cd {file_dir} && python3 {MYTH} analyze {file_path} --solc-json {json_file_path} --solv 0.8.0" 17 | output = check_output(command, shell=True, stderr=STDOUT).decode("UTF-8") 18 | assert "The analysis was completed successfully" in output 19 | 20 | 21 | def test_negative_solc_settings(): 22 | file_path = str(TESTDATA / "json_test_dir" / "dir_a" / "input_file.sol") 23 | 24 | command = f"python3 {MYTH} analyze {file_path} --solv 0.8.0" 25 | output = check_output(command, shell=True, stderr=STDOUT).decode("UTF-8") 26 | assert ( 27 | """ParserError: Source "@openzeppelin/contracts/token/PRC20/PRC20.sol""" 28 | in output 29 | ) 30 | -------------------------------------------------------------------------------- /tests/laser/Precompiles/test_ec_add.py: -------------------------------------------------------------------------------- 1 | from mock import patch 2 | from eth_utils import decode_hex 3 | from mythril.laser.ethereum.natives import ec_add 4 | from py_ecc.optimized_bn128 import FQ 5 | 6 | VECTOR_A = decode_hex( 7 | "0000000000000000000000000000000000000000000000000000000000000001" 8 | "0000000000000000000000000000000000000000000000000000000000000020" 9 | "0000000000000000000000000000000000000000000000000000000000000020" 10 | "03" 11 | "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e" 12 | "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f" 13 | ) 14 | 15 | 16 | def test_ec_add_sanity(): 17 | assert ec_add(VECTOR_A) == [] 18 | 19 | 20 | @patch("mythril.laser.ethereum.natives.validate_point", return_value=1) 21 | @patch("mythril.laser.ethereum.natives.bn128.add", return_value=1) 22 | @patch("mythril.laser.ethereum.natives.bn128.normalize") 23 | def test_ec_add(f1, f2, f3): 24 | FQ.fielf_modulus = 128 25 | a = FQ(val=1) 26 | f1.return_value = (a, a) 27 | assert ec_add(VECTOR_A) == ([0] * 31 + [1]) * 2 28 | -------------------------------------------------------------------------------- /tests/laser/Precompiles/test_elliptic_curves.py: -------------------------------------------------------------------------------- 1 | from mock import patch 2 | from mythril.laser.ethereum.natives import ec_pair 3 | from py_ecc.optimized_bn128 import FQ 4 | 5 | 6 | def test_ec_pair_192_check(): 7 | vec_c = [0] * 100 8 | assert ec_pair(vec_c) == [] 9 | 10 | 11 | @patch("mythril.laser.ethereum.natives.validate_point", return_value=1) 12 | @patch("mythril.laser.ethereum.natives.bn128.is_on_curve", return_value=True) 13 | @patch("mythril.laser.ethereum.natives.bn128.pairing", return_value=1) 14 | @patch("mythril.laser.ethereum.natives.bn128.normalize") 15 | def test_ec_pair(f1, f2, f3, f4): 16 | FQ.fielf_modulus = 100 17 | a = FQ(val=1) 18 | f1.return_value = (a, a) 19 | vec_c = [0] * 192 20 | assert ec_pair(vec_c) == [0] * 31 + [1] 21 | 22 | 23 | @patch("mythril.laser.ethereum.natives.validate_point", return_value=False) 24 | def test_ec_pair_point_validation_failure(f1): 25 | vec_c = [0] * 192 26 | assert ec_pair(vec_c) == [] 27 | 28 | 29 | @patch("mythril.laser.ethereum.natives.validate_point", return_value=1) 30 | def test_ec_pair_field_exceed_mod(f1): 31 | FQ.fielf_modulus = 100 32 | a = FQ(val=1) 33 | f1.return_value = (a, a) 34 | vec_c = [10] * 192 35 | assert ec_pair(vec_c) == [] 36 | -------------------------------------------------------------------------------- /tests/laser/Precompiles/test_elliptic_mul.py: -------------------------------------------------------------------------------- 1 | from mock import patch 2 | from eth_utils import decode_hex 3 | from mythril.laser.ethereum.natives import ec_mul 4 | from py_ecc.optimized_bn128 import FQ 5 | 6 | VECTOR_A = decode_hex( 7 | "0000000000000000000000000000000000000000000000000000000000000001" 8 | "0000000000000000000000000000000000000000000000000000000000000020" 9 | "0000000000000000000000000000000000000000000000000000000000000020" 10 | "03" 11 | "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e" 12 | "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f" 13 | ) 14 | 15 | 16 | @patch("mythril.laser.ethereum.natives.validate_point", return_value=1) 17 | @patch("mythril.laser.ethereum.natives.bn128.multiply", return_value=1) 18 | @patch("mythril.laser.ethereum.natives.bn128.normalize") 19 | def test_ec_mul(f1, f2, f3): 20 | FQ.fielf_modulus = 128 21 | a = FQ(val=1) 22 | f1.return_value = (a, a) 23 | assert ec_mul(VECTOR_A) == ([0] * 31 + [1]) * 2 24 | 25 | 26 | def test_ec_mul_validation_failure(): 27 | assert ec_mul(VECTOR_A) == [] 28 | -------------------------------------------------------------------------------- /tests/laser/Precompiles/test_identity.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from mock import patch 4 | from eth_utils import decode_hex 5 | from mythril.laser.ethereum.natives import identity, NativeContractException 6 | from mythril.laser.smt import symbol_factory 7 | 8 | 9 | @pytest.mark.parametrize( 10 | "input_list, expected_result", (([], []), ([10, 20], [10, 20])) 11 | ) 12 | def test_identity(input_list, expected_result): 13 | assert identity(input_list) == expected_result 14 | -------------------------------------------------------------------------------- /tests/laser/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/laser/__init__.py -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Ethereum Foundation 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/README.md: -------------------------------------------------------------------------------- 1 | Files found in this directory are taken from https://github.com/ethereum/tests, released under the 2 | license LICENSE in the same directory as this file. 3 | 4 | All credit goes to the awesome people that made this! 5 | -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmEnvironmentalInfo/calldatacopyUnderFlowerror.json: -------------------------------------------------------------------------------- 1 | { 2 | "calldatacopyUnderFlowerror" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmEnvironmentalInfo/calldatacopyUnderFlowFiller.json", 8 | "sourceHash" : "55ea90b15f19bf8f4838c35234d202eab4473284e5895af23b885368f34200a1" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6001600237", 21 | "data" : "0x1234567890abcdef01234567890abcdef0", 22 | "gas" : "0x174876e800", 23 | "gasPrice" : "0x3b9aca00", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6001600237", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGas.json: -------------------------------------------------------------------------------- 1 | { 2 | "BlockNumberDynamicJump0_foreverOutOfGas" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump0_foreverOutOfGasFiller.json", 8 | "sourceHash" : "0900beba73811b8aafaefadcff3a7cd9954ccb5e4986b9cf03ca44881efd4e9c" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x02", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x5b600060000156", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x5b600060000156", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJump1.json: -------------------------------------------------------------------------------- 1 | { 2 | "BlockNumberDynamicJump1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJump1Filler.json", 8 | "sourceHash" : "88e43b5985cc4dfbcbc8476c570157e6e7bc0ee0cb3609e9e9f3dd9aa2a3a528" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x02", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x620fffff620fffff01430156", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x620fffff620fffff01430156", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/BlockNumberDynamicJumpi0.json: -------------------------------------------------------------------------------- 1 | { 2 | "BlockNumberDynamicJumpi0" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/BlockNumberDynamicJumpi0Filler.json", 8 | "sourceHash" : "620bba922f5a1732f512d726a26e71b09d3837018a66a9aacb581b212a4f4b13" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x02", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6023600160094301576001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6023600160094301576001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJump0_AfterJumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_AfterJumpdestFiller.json", 8 | "sourceHash" : "605f607251cd4a7c73bd7c814edcada6a9008fcd2896af2caf371beb31db196b" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x602360086003015660015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x602360086003015660015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJump0_AfterJumpdest3" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_AfterJumpdest3Filler.json", 8 | "sourceHash" : "b7367314ce66b1a937c05550ac901971b5850d2a0ef03acf1feb4d6c9f38925d" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6023600b6008506003015660015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6023600b6008506003015660015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_foreverOutOfGas.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJump0_foreverOutOfGas" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_foreverOutOfGasFiller.json", 8 | "sourceHash" : "68b687a344b0f44d7459e095f05f6b302ee3f5d15b3c3e7765d5642fb1f46689" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x5b600060000156", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x5b600060000156", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump0_withoutJumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJump0_withoutJumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump0_withoutJumpdestFiller.json", 8 | "sourceHash" : "84c524e0cafc2ddcebdef720e46a23d10061f4a35bb06bfe7bdfe444990593a6" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60236007600301566001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60236007600301566001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJump1.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJump1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJump1Filler.json", 8 | "sourceHash" : "2369bac56afc1e0946f608c52027fbc88faf3844cdc2fa46954a0916221b8432" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x620fffff620fffff0160030156", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x620fffff620fffff0160030156", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpInsidePushWithJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpInsidePushWithJumpDestFiller.json", 8 | "sourceHash" : "3f3586292e12e696029f38f833fe8c7cea86a0e7cda83c0cbe783aa2c3b22b0c" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600460030156655b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600460030156655b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpInsidePushWithoutJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpInsidePushWithoutJumpDestFiller.json", 8 | "sourceHash" : "4e320bace2f65884d59f95dbbba6e4f9aea39e243bffd309be9bb6c5a3c1bedb" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60056003015661eeff", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60056003015661eeff", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpJD_DependsOnJumps0" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpJD_DependsOnJumps0Filler.json", 8 | "sourceHash" : "e96143bec9697fb0d565026f5fcc5ed70833bf89eb8c63aa87e0155b4e61d8f4" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x01", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6009436006575b566001", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6009436006575b566001", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest2.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpPathologicalTest2" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest2Filler.json", 8 | "sourceHash" : "957bc609a0322452da86a59c96e7eea17c5463dcd7bad6ed97b57c6460a90b80" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x04", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x435631615b60615b60615b606001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x435631615b60615b60615b606001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpPathologicalTest3.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpPathologicalTest3" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpPathologicalTest3Filler.json", 8 | "sourceHash" : "a906b3dcb41da1cdacb67bdf49111ecd2bdaab0e3584dbd3993ef0f0555766f6" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x07", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x435631615b60615b60615b606001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x435631615b60615b60615b606001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi0.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpi0" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpi0Filler.json", 8 | "sourceHash" : "394cae3e06d120cc1a5df5e14cfae3598d62e1fefa06dce4055c6ff59c367b63" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x602360016009600301576001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x602360016009600301576001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpi1_jumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpi1_jumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpi1_jumpdestFiller.json", 8 | "sourceHash" : "fb4060a7f68c0f3ad9643dcfc93fa90ea0fe6123e65499ae65f400e22db20bcc" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60236001600a6003015760015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60236001600a6003015760015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "DynamicJumpifInsidePushWithoutJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/DynamicJumpifInsidePushWithoutJumpDestFiller.json", 8 | "sourceHash" : "cadedb13e141e3b7bf1f0763cc831dace3ff150fc623e81fb00e798168d01188" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600160076003015761eeff", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600160076003015761eeff", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump1.json: -------------------------------------------------------------------------------- 1 | { 2 | "bad_indirect_jump1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/bad_indirect_jump1Filler.json", 8 | "sourceHash" : "15744a7158d6982822dc8a0c272c329f8dfdf93810e8f2f3f468a56db9bd2d90" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x601b602502565b", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x601b602502565b", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/bad_indirect_jump2.json: -------------------------------------------------------------------------------- 1 | { 2 | "bad_indirect_jump2" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/bad_indirect_jump2Filler.json", 8 | "sourceHash" : "6dd2730ab6f27b43eead1633f104f5d60d6a98fa7c81d5a8ba0d2f6434706813" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60016003600302576000600056", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60016003600302576000600056", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/calldatacopyMemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "calldatacopyMemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/calldatacopyMemExpFiller.json", 8 | "sourceHash" : "fcf33988ecf7e66eae80382111d1128eb302e201be169ca20b306eac49231142" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60ff60ff630fffffff630fffffff37", 21 | "data" : "0x", 22 | "gas" : "0x01f4153d80", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60ff60ff630fffffff630fffffff37", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/codecopyMemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "codecopyMemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/codecopyMemExpFiller.json", 8 | "sourceHash" : "baf738ce30cb457d16aa2f71f866ce00ddb998371757f2c6a30a5d1ca3a9e135" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60ff60ff630fffffff630fffffff39", 21 | "data" : "0x", 22 | "gas" : "0x01f4153d80", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60ff60ff630fffffff630fffffff39", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump0_AfterJumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_AfterJumpdestFiller.json", 8 | "sourceHash" : "8e933f0185d188f6eeb002d4ac8dace70a34a196e4c59932957eaac4cef27849" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x602360085660015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x602360085660015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_AfterJumpdest3.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump0_AfterJumpdest3" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_AfterJumpdest3Filler.json", 8 | "sourceHash" : "dc15eff9141416358f3f9960ef23b930d70b7cb8d3e13d7d5b6832954605d062" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6023600b6008505660015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6023600b6008505660015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_foreverOutOfGas.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump0_foreverOutOfGas" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_foreverOutOfGasFiller.json", 8 | "sourceHash" : "06656a40346ccda59a2d1852d9bb59447d34fb9eb80706e378c5a067e337a080" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x5b600056", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x5b600056", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_outOfBoundary.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump0_outOfBoundary" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_outOfBoundaryFiller.json", 8 | "sourceHash" : "9442ba4b2e4625b3ba5d7a3c43a5c1bcbb0f71fb8977d9cb291a58f956e5d014" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60236007566001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60236007566001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump0_withoutJumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump0_withoutJumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump0_withoutJumpdestFiller.json", 8 | "sourceHash" : "4023b9b32fabb7baeb154e319422cc24e852c858eb124713508a241df86f3969" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60236007566001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60236007566001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jump1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jump1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jump1Filler.json", 8 | "sourceHash" : "c86900065dc3ca2743c247f2c7f305795833184ab64acf0c6911a899533ab628" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x620fffff620fffff0156", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x620fffff620fffff0156", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpHigh.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpHigh" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpHighFiller.json", 8 | "sourceHash" : "a7725bef6c1ff691ae5ad3b73c3b44a6d16f9c9b1c0e57671d7ff59fe9ac9800" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x630fffffff565b5b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x630fffffff565b5b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpInsidePushWithJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpInsidePushWithJumpDestFiller.json", 8 | "sourceHash" : "d200f4e72a16a6960609912d97797b467afb3a98c1eef6f9eed2006c4111a7f3" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600456655b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600456655b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpInsidePushWithoutJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpInsidePushWithoutJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpInsidePushWithoutJumpDestFiller.json", 8 | "sourceHash" : "451d199b9c77c3a3297bb20ba2a01c238e984283e3690b22c9614121c878d8ec" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60055661eeff", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60055661eeff", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpOntoJump.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpOntoJump" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpOntoJumpFiller.json", 8 | "sourceHash" : "b7af74ccb70e4242810a2f47181f0c95ee1b9558385cff3a33896f29c7775d7e" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x565b600056", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x565b600056", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpTo1InstructionafterJump" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpTo1InstructionafterJumpFiller.json", 8 | "sourceHash" : "88eb8cc46a28df3e813fc9d859aaa7c10bd7246272ed7af7c7e119e18e7c6592" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6003565b6001600055", 21 | "data" : "0x", 22 | "gas" : "0x2710", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x0de0b6b3a7640000", 30 | "code" : "0x6003565b6001600055", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpTo1InstructionafterJump_noJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpTo1InstructionafterJump_noJumpDestFiller.json", 8 | "sourceHash" : "91502d2804896fda92630c93005fc5c0e26591bac75b7fff576409271f81cdb6" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6003566001600055", 21 | "data" : "0x", 22 | "gas" : "0x2710", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x0de0b6b3a7640000", 30 | "code" : "0x6003566001600055", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUint64maxPlus1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpToUint64maxPlus1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpToUint64maxPlus1Filler.json", 8 | "sourceHash" : "17b7f86769171233d32af7b23fc33ba8e71f03a64f0625aadfe65a696dff36a6" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6801000000000000000b565b5b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6801000000000000000b565b5b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpToUintmaxPlus1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpToUintmaxPlus1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpToUintmaxPlus1Filler.json", 8 | "sourceHash" : "6897e3a469257a7905bf719e9ae36ac49f830eab122209a9c2e89c879cdaa2d7" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x640100000007565b5b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x640100000007565b5b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi0.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpi0" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi0Filler.json", 8 | "sourceHash" : "86fb0cc0becb3234b287df55e90da9a860eff30714976e3395b25ee2e2b47c48" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x602360016009576001600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x602360016009576001600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpi1_jumpdest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpi1_jumpdest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpi1_jumpdestFiller.json", 8 | "sourceHash" : "ad83573b03f45ffbef8bfcea78a8cb61b1c793b36475000cf9222dea41696717" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60236001600a5760015b600255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60236001600a5760015b600255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUint64maxPlus1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpiToUint64maxPlus1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiToUint64maxPlus1Filler.json", 8 | "sourceHash" : "43b7965f24cac2b1b88fb4781bccd2cbcdcc1569812c2c9e28ebded71ebd172e" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60016801000000000000000d575b5b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60016801000000000000000d575b5b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpiToUintmaxPlus1.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpiToUintmaxPlus1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpiToUintmaxPlus1Filler.json", 8 | "sourceHash" : "58d51b8cb46082033f726f1bca929fb1713048436d52029e31f5bfcaaaded691" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6001640100000009575b5b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6001640100000009575b5b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpifInsidePushWithJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpifInsidePushWithJumpDestFiller.json", 8 | "sourceHash" : "790a546e29160af651f091890cd367d79d28b345f43847fa5d19b6a0dab087e9" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6001600657655b6001600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6001600657655b6001600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDest.json: -------------------------------------------------------------------------------- 1 | { 2 | "jumpifInsidePushWithoutJumpDest" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/jumpifInsidePushWithoutJumpDestFiller.json", 8 | "sourceHash" : "c69048c65f19388408ec0027e2c9372b393d057d91c9e0eff2ea96f8bb59f66b" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600160075761eeff", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600160075761eeff", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/log1MemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "log1MemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/log1MemExpFiller.json", 8 | "sourceHash" : "241dbcb0d33d25f1db0b51b65c38c4e3ef2f5b52c799264979423508e3fcf934" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60ff60ff630fffffffa1", 21 | "data" : "0x", 22 | "gas" : "0x01f4153d80", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60ff60ff630fffffffa1", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadMemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "mloadMemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadMemExpFiller.json", 8 | "sourceHash" : "b12ca5b81a2d597d774f63fd3e6301a3808c7090e1b5ee00ea980c846ddadf32" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x630fffffff51", 21 | "data" : "0x", 22 | "gas" : "0x800570", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x630fffffff51", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mloadOutOfGasError2.json: -------------------------------------------------------------------------------- 1 | { 2 | "mloadOutOfGasError2" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/mloadOutOfGasError2Filler.json", 8 | "sourceHash" : "8df8c3070849692634e4e7af44885da9c5d41df0717fd6d337aa7d5bfed56d52" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6272482551600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6272482551600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstore8MemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "mstore8MemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstore8MemExpFiller.json", 8 | "sourceHash" : "df32f3b06a7e748f5fdd93a878f7687f4f28864f8a5956d8e3a4fff7463b47f0" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60f1630fffffff53", 21 | "data" : "0x", 22 | "gas" : "0x800570", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60f1630fffffff53", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/mstoreMemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "mstoreMemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/mstoreMemExpFiller.json", 8 | "sourceHash" : "eb43769a562c8a34bcb776fd312cc723bf2e8f4e64c75d7d3e36451760d9fd44" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60f1630fffffff52", 21 | "data" : "0x", 22 | "gas" : "0x01f4153d80", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60f1630fffffff52", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/pop1.json: -------------------------------------------------------------------------------- 1 | { 2 | "pop1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/pop1Filler.json", 8 | "sourceHash" : "f87d71b88a272f122f6ea9dbd4680f8b4bf659a1b2bae4634398e6ecdcc9f487" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x5060026003600455", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x5060026003600455", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/return1.json: -------------------------------------------------------------------------------- 1 | { 2 | "return1" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/return1Filler.json", 8 | "sourceHash" : "fe0798e0775da11e784482b44b51322ad70f4deaa8ce8643841257d3abee2e1f" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6001620f4240f3", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6001620f4240f3", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sha3MemExp.json: -------------------------------------------------------------------------------- 1 | { 2 | "sha3MemExp" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/sha3MemExpFiller.json", 8 | "sourceHash" : "6672d6b321654fc8397f1a89903d0fb859013f50a4483c33e7b14b08ba490886" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x01f4153d80", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60ff630fffffff20", 21 | "data" : "0x", 22 | "gas" : "0x01f4153d80", 23 | "gasPrice" : "0x01", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60ff630fffffff20", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_load_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "sstore_load_2" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_load_2Filler.json", 8 | "sourceHash" : "6eeaf23d94ef3fc20edf8997eea5636ef20031039916c445404cfbe6ed8fbd42" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x60ff60005560ee60015560dd600255600154600a55600254601455", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x60ff60005560ee60015560dd600255600154600a55600254601455", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/sstore_underflow.json: -------------------------------------------------------------------------------- 1 | { 2 | "sstore_underflow" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/sstore_underflowFiller.json", 8 | "sourceHash" : "805b307827e4870e9e3bf9655a71a4ca5c327223280c4c3125522d053732de4b" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600155", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600155", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmIOandFlowOperations/swapAt52becameMstore.json: -------------------------------------------------------------------------------- 1 | { 2 | "swapAt52becameMstore" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmIOandFlowOperations/swapAt52becameMstoreFiller.json", 8 | "sourceHash" : "b014aac7021775f56b763921bf12a663ca35c4aa230888cd7908edfa705b1413" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x600260035255", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x600260035255", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmRandomTest/201503102320PYTHON.json: -------------------------------------------------------------------------------- 1 | { 2 | "201503102320PYTHON" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmRandomTest/201503102320PYTHONFiller.json", 8 | "sourceHash" : "38aa9ba7f7836987852734619b0192d42434bd7106da17663d5fc85d81a1e6cf" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x012c", 15 | "currentTimestamp" : "0x02" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x434342444244454597", 21 | "data" : "0x", 22 | "gas" : "0x2710", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x0de0b6b3a7640000", 30 | "code" : "0x434342444244454597", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmRandomTest/201503110219PYTHON.json: -------------------------------------------------------------------------------- 1 | { 2 | "201503110219PYTHON" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmRandomTest/201503110219PYTHONFiller.json", 8 | "sourceHash" : "93dd23cbf213b07ac96a1fdfc826f41475452fea6da2e4f8d3f5d206e9a1adb9" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x012c", 15 | "currentTimestamp" : "0x02" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x4040459143404144809759886d608f", 21 | "data" : "0x", 22 | "gas" : "0x2710", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x0de0b6b3a7640000", 30 | "code" : "0x4040459143404144809759886d608f", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmRandomTest/201503112218PYTHON.json: -------------------------------------------------------------------------------- 1 | { 2 | "201503112218PYTHON" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "testeth 1.5.0.dev2-52+commit.d419e0a2", 6 | "lllcversion" : "Version: 0.4.26-develop.2018.9.19+commit.785cbf40.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmRandomTest/201503112218PYTHONFiller.json", 8 | "sourceHash" : "6fc205d30fd7493b6e120e18c91e1e41f6fe334b94abadbac37d2817066ebccb" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x012c", 15 | "currentTimestamp" : "0x02" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x4041", 21 | "data" : "0x", 22 | "gas" : "0x2710", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x0de0b6b3a7640000", 30 | "code" : "0x4041", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_3oog.json: -------------------------------------------------------------------------------- 1 | { 2 | "sha3_3oog" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", 6 | "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmSha3Test/sha3_3Filler.json", 8 | "sourceHash" : "1f474f7dac8971615e641354d809db332975d1ea5ca589d855fb02a1da559033" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x620fffff6103e820600055", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x620fffff6103e820600055", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_4oog.json: -------------------------------------------------------------------------------- 1 | { 2 | "sha3_4oog" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", 6 | "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmSha3Test/sha3_4Filler.json", 8 | "sourceHash" : "100da75ff0b63159ca86aa4ef7457a956027af5c6c1ed1f0fa894aaa63849887" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x6064640fffffffff20600055", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x6064640fffffffff20600055", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/laser/evm_testsuite/VMTests/vmSha3Test/sha3_5oog.json: -------------------------------------------------------------------------------- 1 | { 2 | "sha3_5oog" : { 3 | "_info" : { 4 | "comment" : "", 5 | "filledwith" : "cpp-1.3.0+commit.6e0ce939.Linux.g++", 6 | "lllcversion" : "Version: 0.4.18-develop.2017.9.25+commit.a72237f2.Linux.g++", 7 | "source" : "src/VMTestsFiller/vmSha3Test/sha3_5Filler.json", 8 | "sourceHash" : "066bcf3a8e9e7b4c15ec2240c8e1bb0d53de0230c76989e21e4b6aaac83f577d" 9 | }, 10 | "env" : { 11 | "currentCoinbase" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", 12 | "currentDifficulty" : "0x0100", 13 | "currentGasLimit" : "0x0f4240", 14 | "currentNumber" : "0x00", 15 | "currentTimestamp" : "0x01" 16 | }, 17 | "exec" : { 18 | "address" : "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", 19 | "caller" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 20 | "code" : "0x640fffffffff61271020600055", 21 | "data" : "0x", 22 | "gas" : "0x0186a0", 23 | "gasPrice" : "0x5af3107a4000", 24 | "origin" : "0xcd1722f3947def4cf144679da39c4c32bdc35681", 25 | "value" : "0x0de0b6b3a7640000" 26 | }, 27 | "pre" : { 28 | "0x0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { 29 | "balance" : "0x152d02c7e14af6800000", 30 | "code" : "0x640fffffffff61271020600055", 31 | "nonce" : "0x00", 32 | "storage" : { 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/laser/smt/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/laser/smt/__init__.py -------------------------------------------------------------------------------- /tests/laser/smt/model_test.py: -------------------------------------------------------------------------------- 1 | from mythril.laser.smt import Solver, symbol_factory 2 | import z3 3 | 4 | 5 | def test_decls(): 6 | # Arrange 7 | solver = Solver() 8 | x = symbol_factory.BitVecSym("x", 256) 9 | expression = x == symbol_factory.BitVecVal(2, 256) 10 | 11 | # Act 12 | solver.add(expression) 13 | result = solver.check() 14 | model = solver.model() 15 | 16 | decls = model.decls() 17 | 18 | # Assert 19 | assert z3.sat == result 20 | assert x.raw.decl() in decls 21 | 22 | 23 | def test_get_item(): 24 | # Arrange 25 | solver = Solver() 26 | x = symbol_factory.BitVecSym("x", 256) 27 | expression = x == symbol_factory.BitVecVal(2, 256) 28 | 29 | # Act 30 | solver.add(expression) 31 | result = solver.check() 32 | model = solver.model() 33 | 34 | x_concrete = model[x.raw.decl()] 35 | 36 | # Assert 37 | assert z3.sat == result 38 | assert 2 == x_concrete 39 | 40 | 41 | def test_as_long(): 42 | # Arrange 43 | solver = Solver() 44 | x = symbol_factory.BitVecSym("x", 256) 45 | expression = x == symbol_factory.BitVecVal(2, 256) 46 | 47 | # Act 48 | solver.add(expression) 49 | result = solver.check() 50 | model = solver.model() 51 | 52 | x_concrete = model.eval(x.raw).as_long() 53 | 54 | # Assert 55 | assert z3.sat == result 56 | assert 2 == x_concrete 57 | -------------------------------------------------------------------------------- /tests/laser/state/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/laser/state/__init__.py -------------------------------------------------------------------------------- /tests/laser/state/mstack_test.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from mythril.laser.ethereum.state.machine_state import MachineStack 4 | from mythril.laser.ethereum.evm_exceptions import * 5 | from tests import BaseTestCase 6 | 7 | 8 | class MachineStackTest(BaseTestCase): 9 | @staticmethod 10 | def test_mstack_constructor(): 11 | mstack = MachineStack([1, 2]) 12 | assert mstack == [1, 2] 13 | 14 | @staticmethod 15 | def test_mstack_append_single_element(): 16 | mstack = MachineStack() 17 | 18 | mstack.append(0) 19 | 20 | assert mstack == [0] 21 | 22 | @staticmethod 23 | def test_mstack_append_multiple_elements(): 24 | 25 | mstack = MachineStack() 26 | 27 | for i in range(mstack.STACK_LIMIT): 28 | mstack.append(1) 29 | 30 | with pytest.raises(StackOverflowException): 31 | mstack.append(1000) 32 | 33 | @staticmethod 34 | def test_mstack_pop(): 35 | mstack = MachineStack([2]) 36 | 37 | assert mstack.pop() == 2 38 | 39 | with pytest.raises(StackUnderflowException): 40 | mstack.pop() 41 | 42 | @staticmethod 43 | def test_mstack_no_support_add(): 44 | mstack = MachineStack([0, 1]) 45 | 46 | with pytest.raises(NotImplementedError): 47 | mstack + [2] 48 | 49 | @staticmethod 50 | def test_mstack_no_support_iadd(): 51 | mstack = MachineStack() 52 | 53 | with pytest.raises(NotImplementedError): 54 | mstack += mstack 55 | -------------------------------------------------------------------------------- /tests/laser/strategy/test_loop_bound.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from mythril.laser.ethereum.strategy.extensions.bounded_loops import ( 3 | BoundedLoopsStrategy, 4 | ) 5 | 6 | 7 | @pytest.mark.parametrize( 8 | "trace, count", 9 | [ 10 | ([6, 7, 7, 7], 3), 11 | ([6, 8, 6, 7, 6, 7, 6, 7, 6, 7], 4), 12 | ([6, 6, 6, 6], 4), 13 | ([6, 7, 8] * 10, 10), 14 | ([7, 9, 10] + list(range(1, 100)) * 100, 100), 15 | ([7, 10, 15], 0), 16 | ([7] * 100, 100), 17 | ], 18 | ) 19 | def test_loop_count(trace, count): 20 | assert count == BoundedLoopsStrategy.get_loop_count(trace) 21 | -------------------------------------------------------------------------------- /tests/laser/transaction/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/laser/transaction/__init__.py -------------------------------------------------------------------------------- /tests/mythril/mythril_analyzer_test.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | from mythril.mythril import MythrilDisassembler, MythrilAnalyzer 3 | from mythril.analysis.report import Issue 4 | from mock import patch, PropertyMock 5 | 6 | 7 | @patch("mythril.analysis.report.Issue.add_code_info", return_value=None) 8 | @patch( 9 | "mythril.mythril.mythril_analyzer.fire_lasers", 10 | return_value=[Issue("", "", "234", "101", "title", "0x02445")], 11 | ) 12 | @patch("mythril.mythril.mythril_analyzer.SymExecWrapper") 13 | def test_fire_lasers(mock_sym, mock_fire_lasers, mock_code_info): 14 | type(mock_sym.return_value).execution_info = PropertyMock(return_value=[]) 15 | disassembler = MythrilDisassembler(eth=None, solc_version="v0.5.0") 16 | disassembler.load_from_solidity( 17 | [ 18 | str( 19 | ( 20 | Path(__file__).parent.parent / "testdata/input_contracts/origin.sol" 21 | ).absolute() 22 | ) 23 | ] 24 | ) 25 | analyzer = MythrilAnalyzer(disassembler, strategy="dfs") 26 | 27 | issues = analyzer.fire_lasers(modules=[]).sorted_issues() 28 | mock_sym.assert_called() 29 | mock_fire_lasers.assert_called() 30 | mock_code_info.assert_called() 31 | assert len(issues) == 1 32 | assert issues[0]["swc-id"] == "101" 33 | -------------------------------------------------------------------------------- /tests/plugin/interface_test.py: -------------------------------------------------------------------------------- 1 | from mythril.plugin.interface import MythrilCLIPlugin, MythrilPlugin 2 | 3 | 4 | def test_construct_cli_plugin(): 5 | _ = MythrilCLIPlugin() 6 | 7 | 8 | def test_construct_mythril_plugin(): 9 | _ = MythrilPlugin 10 | -------------------------------------------------------------------------------- /tests/plugin/loader_test.py: -------------------------------------------------------------------------------- 1 | from mythril.plugin import MythrilPluginLoader, MythrilPlugin 2 | from mythril.plugin.loader import UnsupportedPluginType 3 | 4 | import pytest 5 | 6 | 7 | def test_typecheck_load(): 8 | # Arrange 9 | loader = MythrilPluginLoader() 10 | 11 | # Act 12 | with pytest.raises(ValueError): 13 | loader.load(None) 14 | 15 | 16 | def test_unsupported_plugin_type(): 17 | # Arrange 18 | loader = MythrilPluginLoader() 19 | 20 | # Act 21 | with pytest.raises(UnsupportedPluginType): 22 | loader.load(MythrilPlugin()) 23 | -------------------------------------------------------------------------------- /tests/statespace_test.py: -------------------------------------------------------------------------------- 1 | from mythril.mythril import MythrilAnalyzer, MythrilDisassembler 2 | from mythril.ethereum import util 3 | from mythril.solidity.soliditycontract import EVMContract 4 | from tests import TESTDATA_INPUTS 5 | 6 | 7 | def test_statespace_dump(): 8 | for input_file in TESTDATA_INPUTS.iterdir(): 9 | if input_file.name not in ("origin.sol.o", "suicide.sol.o"): 10 | # It's too slow, so it's better to skip some tests. 11 | continue 12 | contract = EVMContract(input_file.read_text()) 13 | disassembler = MythrilDisassembler() 14 | disassembler.contracts.append(contract) 15 | analyzer = MythrilAnalyzer( 16 | disassembler=disassembler, 17 | strategy="dfs", 18 | execution_timeout=5, 19 | max_depth=30, 20 | address=(util.get_indexed_address(0)), 21 | solver_timeout=10000, 22 | ) 23 | 24 | analyzer.dump_statespace(contract=contract) 25 | -------------------------------------------------------------------------------- /tests/testdata/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/testdata/__init__.py -------------------------------------------------------------------------------- /tests/testdata/compile.py: -------------------------------------------------------------------------------- 1 | # compile test contracts 2 | from pathlib import Path 3 | from mythril.solidity.soliditycontract import SolidityContract 4 | 5 | # Recompiles all the to be tested contracts 6 | root = Path(__file__).parent 7 | input = root / "input_contracts" 8 | output = root / "inputs" 9 | 10 | for contract in input.iterdir(): 11 | sol = SolidityContract(str(contract)) 12 | code = sol.code 13 | 14 | output_file = output / "{}.o".format(contract.name) 15 | output_file.write_text(code) 16 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/calls.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Caller { 5 | 6 | address public fixed_address; 7 | address public stored_address; 8 | 9 | uint256 statevar; 10 | 11 | constructor(address addr) public { 12 | fixed_address = address(0x552254CbAaF32613C6c0450CF19524594eF84044); 13 | } 14 | 15 | function thisisfine() public { 16 | fixed_address.call(""); 17 | } 18 | 19 | function reentrancy() public { 20 | fixed_address.call(""); 21 | statevar = 0; 22 | } 23 | 24 | function calluseraddress(address addr) public { 25 | addr.call(""); 26 | } 27 | 28 | function callstoredaddress() public { 29 | stored_address.call(""); 30 | statevar = 0; 31 | } 32 | 33 | function setstoredaddress(address addr) public { 34 | stored_address = addr; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/constructor_assert.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract AssertFail { 5 | constructor(uint8 var1) public { 6 | assert(var1 > 0); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/environments.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract IntegerOverflow2 { 5 | uint256 public count = 7; 6 | mapping(address => uint256) balances; 7 | 8 | function batchTransfer(address[] memory _receivers, uint256 _value) public returns(bool){ 9 | uint cnt = _receivers.length; 10 | uint256 amount = uint256(cnt) * _value; 11 | 12 | require(cnt > 0 && cnt <= 20); 13 | 14 | balances[msg.sender] -=amount; 15 | 16 | return true; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/ether_send.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | 5 | contract Crowdfunding { 6 | 7 | mapping(address => uint) public balances; 8 | address public owner; 9 | uint256 INVEST_MIN = 1 ether; 10 | uint256 INVEST_MAX = 10 ether; 11 | 12 | modifier onlyOwner() { 13 | require(msg.sender == owner); 14 | _; 15 | } 16 | 17 | function crowdfunding() public { 18 | owner = msg.sender; 19 | } 20 | 21 | function withdrawfunds() public onlyOwner { 22 | msg.sender.transfer(address(this).balance); 23 | } 24 | 25 | function invest() public payable { 26 | require(msg.value > INVEST_MIN && msg.value < INVEST_MAX); 27 | 28 | balances[msg.sender] += msg.value; 29 | } 30 | 31 | function getBalance() public view returns (uint) { 32 | return balances[msg.sender]; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/exceptions.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Exceptions { 5 | 6 | uint256[8] myarray; 7 | 8 | function assert1() public pure { 9 | uint256 i = 1; 10 | assert(i == 0); 11 | } 12 | 13 | function assert2() public pure { 14 | uint256 i = 1; 15 | assert(i > 0); 16 | } 17 | 18 | function assert3(uint256 input) public pure { 19 | assert(input != 23); 20 | } 21 | 22 | function requireisfine(uint256 input) public pure { 23 | require(input != 23); 24 | } 25 | 26 | function divisionby0(uint256 input) public pure { 27 | uint256 i = 1/input; 28 | } 29 | 30 | function thisisfine(uint256 input) public pure { 31 | if (input > 0) { 32 | uint256 i = 1/input; 33 | } 34 | } 35 | 36 | function arrayaccess(uint256 index) public view { 37 | uint256 i = myarray[index]; 38 | } 39 | 40 | function thisisalsofind(uint256 index) public view { 41 | if (index < 8) { 42 | uint256 i = myarray[index]; 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/exceptions_0.8.0.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | 4 | contract Exceptions { 5 | 6 | uint val; 7 | 8 | function change_val() public { 9 | val = 1; 10 | } 11 | function assert1() public pure { 12 | uint256 i = 1; 13 | assert(i == 0); 14 | } 15 | 16 | function fail() public view { 17 | assert(val==2); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/flag_array.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | contract BasicLiquidation { 4 | bool[4096] _flags; 5 | constructor() payable 6 | { 7 | require(msg.value == 0.1 ether); 8 | _flags[1234] = true; 9 | } 10 | function extractMoney(uint256 idx) public payable 11 | { 12 | require(idx >= 0); 13 | require(idx < 4096); 14 | require(_flags[idx]); 15 | payable(msg.sender).transfer(address(this).balance); 16 | } 17 | } -------------------------------------------------------------------------------- /tests/testdata/input_contracts/kinds_of_calls.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract D { 5 | uint public n; 6 | address public sender; 7 | 8 | function callSetN(address _e, uint _n) public { 9 | _e.call(abi.encode(bytes4(keccak256("setN(uint256)")), _n)); 10 | } 11 | 12 | function callcodeSetN(address _e, uint _n) public view { 13 | _e.staticcall(abi.encode(bytes4(keccak256("setN(uint256)")), _n)); 14 | } 15 | 16 | function delegatecallSetN(address _e, uint _n) public { 17 | _e.delegatecall(abi.encode(bytes4(keccak256("setN(uint256)")), _n)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/metacoin.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract MetaCoin { 5 | mapping (address => uint) public balances; 6 | constructor() public { 7 | balances[msg.sender] = 10000; 8 | } 9 | 10 | function sendToken(address receiver, uint amount) public returns(bool successful){ 11 | if (balances[msg.sender] < amount) return false; 12 | balances[msg.sender] -= amount; 13 | balances[receiver] += amount; 14 | return false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/multi_contracts.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Transfer1 { 5 | function transfer() public { 6 | msg.sender.transfer(1 ether); 7 | } 8 | 9 | } 10 | 11 | 12 | contract Transfer2 { 13 | function transfer() public { 14 | msg.sender.transfer(2 ether); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/nonascii.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract nonAscii { 5 | function renderNonAscii () public pure returns (string memory) { 6 | return "Хэллоу Ворлд"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/origin.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Origin { 5 | address public owner; 6 | 7 | 8 | /** 9 | * @dev The Ownable constructor sets the original `owner` of the contract to the sender 10 | * account. 11 | */ 12 | constructor() public { 13 | owner = msg.sender; 14 | } 15 | 16 | 17 | /** 18 | * @dev Throws if called by any account other than the owner. 19 | */ 20 | modifier onlyOwner() { 21 | require(tx.origin != owner); 22 | _; 23 | } 24 | 25 | 26 | /** 27 | * @dev Allows the current owner to transfer control of the contract to a newOwner. 28 | * @param newOwner The address to transfer ownership to. 29 | */ 30 | function transferOwnership(address newOwner) public onlyOwner { 31 | if (newOwner != address(0)) { 32 | owner = newOwner; 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/overflow.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Over { 5 | 6 | mapping(address => uint) balances; 7 | uint public totalSupply; 8 | 9 | constructor(uint _initialSupply) public { 10 | balances[msg.sender] = totalSupply = _initialSupply; 11 | } 12 | 13 | function sendeth(address _to, uint _value) public returns (bool) { 14 | require(balances[msg.sender] - _value >= 0); 15 | balances[msg.sender] -= _value; 16 | balances[_to] += _value; 17 | return true; 18 | } 19 | 20 | function balanceOf(address _owner) public view returns (uint balance) { 21 | return balances[_owner]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/returnvalue.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract ReturnValue { 5 | 6 | address public callee = 0xE0f7e56E62b4267062172495D7506087205A4229; 7 | 8 | function callnotchecked() public { 9 | callee.call(""); 10 | } 11 | 12 | function callchecked() public { 13 | (bool success, bytes memory data) = callee.call(""); 14 | require(success); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/safe_funcs.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | 4 | contract Exceptions { 5 | 6 | uint val; 7 | 8 | function change_val() public { 9 | val = 1; 10 | } 11 | function assert1() public pure { 12 | uint256 i = 1; 13 | assert(i == 0); 14 | } 15 | 16 | function fail() public view { 17 | assert(val==2); 18 | } 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/suicide.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Suicide { 5 | 6 | function kill(address payable addr) public { 7 | selfdestruct(addr); 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/symbolic_exec_bytecode.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | contract Test { 4 | uint256 immutable inputSize; 5 | 6 | constructor(uint256 _log2Size) { 7 | inputSize = (1 << _log2Size); 8 | } 9 | 10 | function getBytes(bytes calldata _input) public view returns (bytes32) { 11 | require( 12 | _input.length > 0 && _input.length <= inputSize, 13 | "input len: (0,inputSize]" 14 | ); 15 | 16 | return "123"; 17 | } 18 | 19 | function commencekilling() public { 20 | address payable receiver = payable(msg.sender); 21 | selfdestruct(receiver); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/underflow.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract Under { 5 | 6 | mapping(address => uint) balances; 7 | uint public totalSupply; 8 | 9 | constructor(uint _initialSupply) public { 10 | balances[msg.sender] = totalSupply = _initialSupply; 11 | } 12 | 13 | function sendeth(address _to, uint _value) public returns (bool) { 14 | require(balances[msg.sender] - _value >= 0); 15 | balances[msg.sender] -= _value; 16 | balances[_to] += _value; 17 | return true; 18 | } 19 | 20 | function balanceOf(address _owner) public view returns (uint balance) { 21 | return balances[_owner]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /tests/testdata/input_contracts/weak_random.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.5.0; 2 | 3 | 4 | contract WeakRandom { 5 | struct Contestant { 6 | address payable addr; 7 | uint gameId; 8 | } 9 | 10 | uint public prize = 2.5 ether; 11 | uint public totalTickets = 50; 12 | uint public pricePerTicket = prize / totalTickets; 13 | 14 | uint public gameId = 1; 15 | uint public nextTicket = 0; 16 | mapping (uint => Contestant) public contestants; 17 | 18 | function () payable external { 19 | uint moneySent = msg.value; 20 | 21 | while (moneySent >= pricePerTicket && nextTicket < totalTickets) { 22 | uint currTicket = nextTicket++; 23 | contestants[currTicket] = Contestant(msg.sender, gameId); 24 | moneySent -= pricePerTicket; 25 | } 26 | 27 | if (nextTicket == totalTickets) { 28 | chooseWinner(); 29 | } 30 | 31 | // Send back leftover money 32 | if (moneySent > 0) { 33 | msg.sender.transfer(moneySent); 34 | } 35 | } 36 | 37 | function chooseWinner() private { 38 | address seed1 = contestants[uint(block.coinbase) % totalTickets].addr; 39 | address seed2 = contestants[uint(msg.sender) % totalTickets].addr; 40 | uint seed3 = block.difficulty; 41 | bytes32 randHash = keccak256(abi.encode(seed1, seed2, seed3)); 42 | 43 | uint winningNumber = uint(randHash) % totalTickets; 44 | address payable winningAddress = contestants[winningNumber].addr; 45 | 46 | gameId++; 47 | nextTicket = 0; 48 | winningAddress.transfer(prize); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /tests/testdata/inputs/environments.sol.o: -------------------------------------------------------------------------------- 1 | 60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306661abd1461005157806383f12fec1461007c575b600080fd5b34801561005d57600080fd5b50610066610104565b6040518082815260200191505060405180910390f35b34801561008857600080fd5b506100ea600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019092919050505061010a565b604051808215151515815260200191505060405180910390f35b60005481565b6000806000845191508382029050600082118015610129575060148211155b151561013457600080fd5b80600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600192505050929150505600a165627a7a7230582016b81221eb990028632ba9b34d3c01599d24acdb5b81dd6789845696f5db257c0029 -------------------------------------------------------------------------------- /tests/testdata/inputs/exceptions.sol.o: -------------------------------------------------------------------------------- 1 | 60606040526004361061008e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301d4277c14610093578063546455b5146100b657806378375f14146100d957806392dd38ea146100fc578063a08299f11461011f578063b34c361014610142578063b630d70614610157578063f44f13d81461017a575b600080fd5b341561009e57600080fd5b6100b4600480803590602001909190505061018f565b005b34156100c157600080fd5b6100d760048080359060200190919050506101b2565b005b34156100e457600080fd5b6100fa60048080359060200190919050506101c2565b005b341561010757600080fd5b61011d60048080359060200190919050506101d5565b005b341561012a57600080fd5b61014060048080359060200190919050506101ed565b005b341561014d57600080fd5b610155610202565b005b341561016257600080fd5b6101786004808035906020019091905050610217565b005b341561018557600080fd5b61018d610235565b005b600060088210156101ae576000826008811015156101a957fe5b015490505b5050565b601781141515156101bf57fe5b50565b601781141515156101d257600080fd5b50565b600080826008811015156101e557fe5b015490505050565b60008160018115156101fb57fe5b0490505050565b60006001905060008114151561021457fe5b50565b6000808211156102315781600181151561022d57fe5b0490505b5050565b60006001905060008111151561024757fe5b505600a165627a7a72305820b9f98ad234dd4e1d09a659013e7ffd1ecad3628194c307decc294b637820bb550029 -------------------------------------------------------------------------------- /tests/testdata/inputs/exceptions_0.8.0.sol.o: -------------------------------------------------------------------------------- 1 | 608060405234801561001057600080fd5b5060f18061001f6000396000f3fe6080604052348015600f57600080fd5b5060043610603c5760003560e01c8063a02f5b99146041578063a9cc4718146049578063b34c3610146051575b600080fd5b60476059565b005b604f6063565b005b60576075565b005b6001600081905550565b6002600054146073576072608c565b5b565b600060019050600081146089576088608c565b5b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea2646970667358221220cdbce6751f5dd32798edbe8c5cefae09753627f94e3f6e4a1f33afdb28a32e5464736f6c63430008060033 2 | -------------------------------------------------------------------------------- /tests/testdata/inputs/flag_array.sol.o: -------------------------------------------------------------------------------- 1 | 608060405267016345785d8a0000341461001857600080fd5b600160006104d2611000811061003157610030610055565b5b602091828204019190066101000a81548160ff021916908315150217905550610084565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6101a6806100936000396000f3fe60806040526004361061001e5760003560e01c8063ab12585814610023575b600080fd5b61003d600480360381019061003891906100ee565b61003f565b005b600081101561004d57600080fd5b611000811061005b57600080fd5b60008161100081106100705761006f610125565b5b602091828204019190069054906101000a900460ff1661008f57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156100d5573d6000803e3d6000fd5b5050565b6000813590506100e881610159565b92915050565b60006020828403121561010457610103610154565b5b6000610112848285016100d9565b91505092915050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6101628161011b565b811461016d57600080fd5b5056fea264697066735822122038d1a63a64c5408c7008a0f3746ab94e43a04b5bc74f52e4869d3f15cf5b2b9e64736f6c63430008060033 -------------------------------------------------------------------------------- /tests/testdata/inputs/metacoin.sol.o: -------------------------------------------------------------------------------- 1 | 60606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806327e235e314610051578063412664ae1461009e575b600080fd5b341561005c57600080fd5b610088600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506100f8565b6040518082815260200191505060405180910390f35b34156100a957600080fd5b6100de600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610110565b604051808215151515815260200191505060405180910390f35b60006020528060005260406000206000915090505481565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561016157600090506101fe565b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600090505b929150505600a165627a7a72305820c860d60246e215343f02c5025aeef4ad1f207b0a7d2dec05e43f6ecaaebe9cec0029 -------------------------------------------------------------------------------- /tests/testdata/inputs/multi_contracts.sol.o: -------------------------------------------------------------------------------- 1 | 606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638a4068dd146044575b600080fd5b3415604e57600080fd5b60546056565b005b3373ffffffffffffffffffffffffffffffffffffffff166108fc671bc16d674ec800009081150290604051600060405180830381858888f193505050501515609d57600080fd5b5600a165627a7a7230582028cb917d4f69cc2ea0fcd75329aa874b2bc743cfcde6b5197f571cff635aec130029 -------------------------------------------------------------------------------- /tests/testdata/inputs/nonascii.sol.o: -------------------------------------------------------------------------------- 1 | 608060405260043610610041576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806324ff38a214610046575b600080fd5b34801561005257600080fd5b5061005b6100d6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561009b578082015181840152602081019050610080565b50505050905090810190601f1680156100c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60606040805190810160405280601781526020017fd0a5d18dd0bbd0bbd0bed18320d092d0bed180d0bbd0b40000000000000000008152509050905600a165627a7a72305820a11284868fc6a38ff1d72ce9ec40db9c6c7c49902b5cabec3680e88e5ab92dcb0029 -------------------------------------------------------------------------------- /tests/testdata/inputs/origin.sol.o: -------------------------------------------------------------------------------- 1 | 60606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680638da5cb5b14610051578063f2fde38b146100a6575b600080fd5b341561005c57600080fd5b6100646100df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100b157600080fd5b6100dd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610104565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614151561015f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156101d657806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b505600a165627a7a7230582094f3b40753c82d05a159fa87a8b075fa6226d092f90191c0f813a12c032ffaac0029 -------------------------------------------------------------------------------- /tests/testdata/inputs/overflow.sol.o: -------------------------------------------------------------------------------- 1 | 608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a3210e87146100ec575b600080fd5b34801561006857600080fd5b5061007161015f565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100d6600480360360208110156100aa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610165565b6040518082815260200191505060405180910390f35b3480156100f857600080fd5b506101456004803603604081101561010f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506101ad565b604051808215151515815260200191505060405180910390f35b60015481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403101515156101fe57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600190509291505056fea165627a7a72305820fd522172282e2304f6e94eb345fcb4a11ab5e1102b64333180676726d88159a00029 2 | -------------------------------------------------------------------------------- /tests/testdata/inputs/returnvalue.sol.o: -------------------------------------------------------------------------------- 1 | 60606040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063633ab5e014610051578063e3bea28214610066575b600080fd5b341561005c57600080fd5b61006461007b565b005b341561007157600080fd5b6100796100d4565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516000604051808303816000865af191505015156100d257600080fd5b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166040516000604051808303816000865af1915050505600a165627a7a72305820ca8be054abc9437f3c7d25b22fda833fed76e2687a94e19ec61b094b7ae089d70029 -------------------------------------------------------------------------------- /tests/testdata/inputs/safe_funcs.sol.o: -------------------------------------------------------------------------------- 1 | 6080604052348015600f57600080fd5b5060043610603c5760003560e01c8063a02f5b99146041578063a9cc4718146049578063b34c3610146051575b600080fd5b60476059565b005b604f6063565b005b60576075565b005b6001600081905550565b6002600054146073576072608c565b5b565b600060019050600081146089576088608c565b5b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfea2646970667358221220e4fd4d461febf90b9c09fc5f55e8dc77f373e513a4448395d2073e8c3f388ecf64736f6c63430008060033 2 | -------------------------------------------------------------------------------- /tests/testdata/inputs/suicide.sol.o: -------------------------------------------------------------------------------- 1 | 606060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063cbf0b0c0146044575b600080fd5b3415604e57600080fd5b6078600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050607a565b005b8073ffffffffffffffffffffffffffffffffffffffff16ff00a165627a7a723058207c36f2082aef9ddde7fe0dc12aca42e091159cac6d4e9cb1b97983ea4e005d940029 -------------------------------------------------------------------------------- /tests/testdata/inputs/underflow.sol.o: -------------------------------------------------------------------------------- 1 | 606060405260043610610062576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd146100675780636241bfd11461009057806370a08231146100b3578063a3210e8714610100575b600080fd5b341561007257600080fd5b61007a61015a565b6040518082815260200191505060405180910390f35b341561009b57600080fd5b6100b16004808035906020019091905050610160565b005b34156100be57600080fd5b6100ea600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101ab565b6040518082815260200191505060405180910390f35b341561010b57600080fd5b610140600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506101f3565b604051808215151515815260200191505060405180910390f35b60015481565b8060018190556000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054031015151561024457600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060019050929150505600a165627a7a72305820acf4c21d1fe3e6f27af08897642fb3b8cc64265635081cf3ae7fe1f06b4af6490029 -------------------------------------------------------------------------------- /tests/testdata/json_test_dir/PRC20.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.8.0; 2 | 3 | contract PRC20{ 4 | function nothing1(uint256 a, uint256 b) public pure returns(uint256) { 5 | return a+b; 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tests/testdata/json_test_dir/dir_a/input_file.sol: -------------------------------------------------------------------------------- 1 | import "@openzeppelin/contracts/token/PRC20/PRC20.sol"; 2 | 3 | contract Nothing is PRC20{ 4 | function nothing() public pure{ 5 | } 6 | } 7 | 8 | -------------------------------------------------------------------------------- /tests/testdata/json_test_dir/test_file.json: -------------------------------------------------------------------------------- 1 | { 2 | "remappings": [ "@openzeppelin/contracts/token/PRC20/=../" ], 3 | "optimizer": { 4 | "enabled": true 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tests/testdata/mythril_config_inputs/config.ini: -------------------------------------------------------------------------------- 1 | [defaults] 2 | dynamic_loading = infura 3 | -------------------------------------------------------------------------------- /tests/testdata/outputs_expected/multi_contracts.sol.o.easm: -------------------------------------------------------------------------------- 1 | 0 PUSH1 0x60 2 | 2 PUSH1 0x40 3 | 4 MSTORE 4 | 5 PUSH1 0x04 5 | 7 CALLDATASIZE 6 | 8 LT 7 | 9 PUSH1 0x3f 8 | 11 JUMPI 9 | 12 PUSH1 0x00 10 | 14 CALLDATALOAD 11 | 15 PUSH29 0x0100000000000000000000000000000000000000000000000000000000 12 | 45 SWAP1 13 | 46 DIV 14 | 47 PUSH4 0xffffffff 15 | 52 AND 16 | 53 DUP1 17 | 54 PUSH4 0x8a4068dd 18 | 59 EQ 19 | 60 PUSH1 0x44 20 | 62 JUMPI 21 | 63 JUMPDEST 22 | 64 PUSH1 0x00 23 | 66 DUP1 24 | 67 REVERT 25 | 68 JUMPDEST 26 | 69 CALLVALUE 27 | 70 ISZERO 28 | 71 PUSH1 0x4e 29 | 73 JUMPI 30 | 74 PUSH1 0x00 31 | 76 DUP1 32 | 77 REVERT 33 | 78 JUMPDEST 34 | 79 PUSH1 0x54 35 | 81 PUSH1 0x56 36 | 83 JUMP 37 | 84 JUMPDEST 38 | 85 STOP 39 | 86 JUMPDEST 40 | 87 CALLER 41 | 88 PUSH20 0xffffffffffffffffffffffffffffffffffffffff 42 | 109 AND 43 | 110 PUSH2 0x08fc 44 | 113 PUSH8 0x1bc16d674ec80000 45 | 122 SWAP1 46 | 123 DUP2 47 | 124 ISZERO 48 | 125 MUL 49 | 126 SWAP1 50 | 127 PUSH1 0x40 51 | 129 MLOAD 52 | 130 PUSH1 0x00 53 | 132 PUSH1 0x40 54 | 134 MLOAD 55 | 135 DUP1 56 | 136 DUP4 57 | 137 SUB 58 | 138 DUP2 59 | 139 DUP6 60 | 140 DUP9 61 | 141 DUP9 62 | 142 CALL 63 | 143 SWAP4 64 | 144 POP 65 | 145 POP 66 | 146 POP 67 | 147 POP 68 | 148 ISZERO 69 | 149 ISZERO 70 | 150 PUSH1 0x9d 71 | 152 JUMPI 72 | 153 PUSH1 0x00 73 | 155 DUP1 74 | 156 REVERT 75 | 157 JUMPDEST 76 | 158 JUMP 77 | 159 STOP 78 | -------------------------------------------------------------------------------- /tests/testdata/outputs_expected/suicide.sol.o.easm: -------------------------------------------------------------------------------- 1 | 0 PUSH1 0x60 2 | 2 PUSH1 0x40 3 | 4 MSTORE 4 | 5 PUSH1 0x04 5 | 7 CALLDATASIZE 6 | 8 LT 7 | 9 PUSH1 0x3f 8 | 11 JUMPI 9 | 12 PUSH1 0x00 10 | 14 CALLDATALOAD 11 | 15 PUSH29 0x0100000000000000000000000000000000000000000000000000000000 12 | 45 SWAP1 13 | 46 DIV 14 | 47 PUSH4 0xffffffff 15 | 52 AND 16 | 53 DUP1 17 | 54 PUSH4 0xcbf0b0c0 18 | 59 EQ 19 | 60 PUSH1 0x44 20 | 62 JUMPI 21 | 63 JUMPDEST 22 | 64 PUSH1 0x00 23 | 66 DUP1 24 | 67 REVERT 25 | 68 JUMPDEST 26 | 69 CALLVALUE 27 | 70 ISZERO 28 | 71 PUSH1 0x4e 29 | 73 JUMPI 30 | 74 PUSH1 0x00 31 | 76 DUP1 32 | 77 REVERT 33 | 78 JUMPDEST 34 | 79 PUSH1 0x78 35 | 81 PUSH1 0x04 36 | 83 DUP1 37 | 84 DUP1 38 | 85 CALLDATALOAD 39 | 86 PUSH20 0xffffffffffffffffffffffffffffffffffffffff 40 | 107 AND 41 | 108 SWAP1 42 | 109 PUSH1 0x20 43 | 111 ADD 44 | 112 SWAP1 45 | 113 SWAP2 46 | 114 SWAP1 47 | 115 POP 48 | 116 POP 49 | 117 PUSH1 0x7a 50 | 119 JUMP 51 | 120 JUMPDEST 52 | 121 STOP 53 | 122 JUMPDEST 54 | 123 DUP1 55 | 124 PUSH20 0xffffffffffffffffffffffffffffffffffffffff 56 | 145 AND 57 | 146 SUICIDE 58 | 147 STOP 59 | -------------------------------------------------------------------------------- /tests/teststorage/contractstorage.fs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/teststorage/contractstorage.fs -------------------------------------------------------------------------------- /tests/teststorage/contractstorage.fs.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/teststorage/contractstorage.fs.index -------------------------------------------------------------------------------- /tests/teststorage/contractstorage.fs.tmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muellerberndt/mythril/8718a4501fcb7e8773b25354c4cb2e031b1d5c63/tests/teststorage/contractstorage.fs.tmp -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py36 3 | 4 | [testenv] 5 | deps = 6 | pytest 7 | pytest-mock 8 | passenv = MYTHRIL_DIR INFURA_ID 9 | whitelist_externals = mkdir 10 | commands = 11 | mkdir -p {toxinidir}/tests/testdata/outputs_current/ 12 | mkdir -p {toxinidir}/tests/testdata/outputs_current_laser_result/ 13 | py.test -v \ 14 | --junitxml={toxworkdir}/output/{envname}/junit.xml \ 15 | --disable-pytest-warnings \ 16 | {posargs} 17 | 18 | [testenv:py36] 19 | basepython = python3.6 20 | setenv = 21 | COVERAGE_FILE = .coverage.{envname} 22 | deps = 23 | mypy==0.782 24 | pytest 25 | pytest-mock 26 | pytest-cov 27 | 28 | passenv = MYTHRIL_DIR INFURA_ID 29 | whitelist_externals = mkdir 30 | commands = 31 | mypy --follow-imports=silent --warn-unused-ignores --ignore-missing-imports --no-strict-optional mythril 32 | mkdir -p {toxinidir}/tests/testdata/outputs_current/ 33 | mkdir -p {toxinidir}/tests/testdata/outputs_current_laser_result/ 34 | py.test -v \ 35 | --cov=mythril \ 36 | --cov-config=tox.ini \ 37 | --cov-report=xml:{toxworkdir}/output/{envname}/coverage.xml \ 38 | --cov-report=html:{toxworkdir}/output/{envname}/covhtml \ 39 | --junitxml={toxworkdir}/output/{envname}/junit.xml \ 40 | --disable-pytest-warnings \ 41 | {posargs} 42 | 43 | 44 | 45 | [coverage:report] 46 | omit = 47 | *__init__.py 48 | /usr/* 49 | *_test.py 50 | setup.py 51 | --------------------------------------------------------------------------------