Security analysis tool for EVM bytecode. Supports smart contracts built for Ethereum, Hedera, Quorum, Vechain, Roostock, Tron and other EVM-compatible blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Daniel Bast 0717111a55
Enable+apply isort via ruff/pre-commit (#1871)
3 months ago
.circleci Run black + ruff via pre-commit, fix findings to reduce requirements.txt (#1865) 4 months ago
.github Add pre-commit hook definition + test (#1877) 3 months ago
docker Allow z3-solver<=4.13.0.0, streamline Dockerfile (#1867) 4 months ago
docs Update module-list.rst (#1868) 4 months ago
mypy-stubs/z3 Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
mythril Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
solidity_examples comment misspell (#1846) 8 months ago
static Rename logo file 6 years ago
tests Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
.dockerignore Arm64 Docker support (#1770) 2 years ago
.drone.yml Stop Edelweiss temporarily (#1593) 3 years ago
.editorconfig An extra newline was being added by the editor 7 years ago
.gitattributes Add highlight for solidity files (#732) 6 years ago
.gitignore Mock leveldb and fire_lasers tests 6 years ago
.pre-commit-config.yaml Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
.pre-commit-hooks.yaml Add pre-commit hook definition + test (#1877) 3 months ago
CONTRIBUTING.md Fix some minor typos (#1003) 6 years ago
Dockerfile Allow z3-solver<=4.13.0.0, streamline Dockerfile (#1867) 4 months ago
LICENSE Update LICENSE (#1585) 3 years ago
MANIFEST.in Use requirements in setup (#1564) 3 years ago
README.md Add pre-commit hook definition + test (#1877) 3 months ago
all_tests.sh Allow z3-solver<=4.13.0.0, streamline Dockerfile (#1867) 4 months ago
coverage_report.sh Use xml coverage report 6 years ago
docker-bake.hcl Arm64 Docker support (#1770) 2 years ago
docker_build_and_deploy.sh Allow z3-solver<=4.13.0.0, streamline Dockerfile (#1867) 4 months ago
myth Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
pyproject.toml Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
requirements.txt Manual pinning updates (#1878) 3 months ago
setup.py Enable+apply isort via ruff/pre-commit (#1871) 3 months ago
tox.ini Supports Python3.12 and fixes some bugs (#1860) 4 months ago

README.md

Mythril

Discord PyPI Read the Docs CircleCI Sonarcloud - Maintainability Pypi Installs DockerHub Pulls

Mythril is a security analysis tool for EVM bytecode. It detects security vulnerabilities in smart contracts built for Ethereum, Hedera, Quorum, Vechain, Rootstock, Tron and other EVM-compatible blockchains. It uses symbolic execution, SMT solving and taint analysis to detect a variety of security vulnerabilities.

Whether you want to contribute, need support, or want to learn what we have cooking for the future, you can checkout diligence-mythx channel in ConsenSys Discord server.

Installation and setup

Get it with Docker:

$ docker pull mythril/myth

Install from Pypi (Python 3.7-3.10):

$ pip3 install mythril

Use it via pre-commit hook (replace $GIT_TAG with real tag):

- repo: https://github.com/Consensys/mythril
  rev: $GIT_TAG
  hooks:
    - id: mythril

Additionally, set args: [disassemble] or args: [read-storage] to use a different command than analyze.

See the docs for more detailed instructions.

Usage

Run:

$ myth analyze <solidity-file>

Or:

$ myth analyze -a <contract-address>

Specify the maximum number of transactions to explore with -t <number>. You can also set a timeout with --execution-timeout <seconds>.

Here is an example of running Mythril on the file killbilly.sol which is in the solidity_examples directory for 3 transactions:

> myth a killbilly.sol -t 3
==== Unprotected Selfdestruct ====
SWC ID: 106
Severity: High
Contract: KillBilly
Function name: commencekilling()
PC address: 354
Estimated Gas Usage: 974 - 1399
Any sender can cause the contract to self-destruct.
Any sender can trigger execution of the SELFDESTRUCT instruction to destroy this contract account and withdraw its balance to an arbitrary address. Review the transaction trace generated for this issue and make sure that appropriate security controls are in place to prevent unrestricted access.
--------------------
In file: killbilly.sol:22

selfdestruct(msg.sender)

--------------------
Initial State:

Account: [CREATOR], balance: 0x2, nonce:0, storage:{}
Account: [ATTACKER], balance: 0x1001, nonce:0, storage:{}

Transaction Sequence:

Caller: [CREATOR], calldata: , decoded_data: , value: 0x0
Caller: [ATTACKER], function: killerize(address), txdata: 0x9fa299cc000000000000000000000000deadbeefdeadbeefdeadbeefdeadbeefdeadbeef, decoded_data: ('0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',), value: 0x0
Caller: [ATTACKER], function: activatekillability(), txdata: 0x84057065, value: 0x0
Caller: [ATTACKER], function: commencekilling(), txdata: 0x7c11da20, value: 0x0

Instructions for using Mythril are found on the docs.

For support or general discussions please checkout diligence-mythx channel in ConsenSys Discord server..

Building the Documentation

Mythril's documentation is contained in the docs folder and is published to Read the Docs. It is based on Sphinx and can be built using the Makefile contained in the subdirectory:

cd docs
make html

This will create a build output directory containing the HTML output. Alternatively, PDF documentation can be built with make latexpdf. The available output format options can be seen with make help.

Vulnerability Remediation

Visit the Smart Contract Vulnerability Classification Registry to find detailed information and remediation guidance for the vulnerabilities reported.