slither v0.6.12 releases: Static Analyzer for Solidity
Slither, the Solidity source analyzer
Slither is a Solidity static analysis framework written in Python 3. It runs a suite of vulnerability detectors, prints visual information about contract details, and provides an API to easily write custom analyses. Slither enables developers to find vulnerabilities, enhance their code comprehension, and quickly prototype custom analyses.
- Detects vulnerable Solidity code with low false positives
- Identifies where the error condition occurs in the source code
- Easy integration into continuous integration and Truffle builds
- Built-in ‘printers’ quickly report crucial contract information
- Detector API to write custom analyses in Python
- Ability to analyze contracts written with Solidity >= 0.4
- Intermediate representation (SlithIR) enables simple, high-precision analyses
- zip export (#453)
- Use crytic-compile 0.1.8, which adds buidler support.
- Human summary printer: run the detectors only once, and add their results to the printer’s json (#451)
- Echidna printer: export the constant values as string to facilitate Echidna’s parsing (#454) [BREAKING CHANGE]
- Revert the changes made in (#445) which lead to incorrectly parse functions with a contract used in a parameter (#458)
- Use Decimal instead of float to prevent loss of precision (#454)
- Echidna printer: fix incorrect support of state variable calls (#455)
Slither requires Python 3.6+ and solc, the Solidity compiler.
$ pip install slither-analyzer
$ git clone https://github.com/trailofbits/slither.git && cd slither $ python setup.py install
Run Slither on a Truffle application:
Run Slither on a single file:
Slither can be run on:
- A Truffle directory
- A directory containing
*.solfiles (all the
*.solfiles will be analyzed)
- A glob (be sure to quote the argument when using a glob)
--solc SOLC: Path to
--solc-args SOLC_ARGS: Add custom solc arguments.
SOLC_ARGScan contain multiple arguments
--disable-solc-warnings: Do not print solc warnings
--solc-ast: Use the solc AST file as input (
solc file.sol --ast-json > file.ast.json)
--json FILE: Export results as JSON
By default, all the detectors are run.
To run a printer, use –print and a comma-separated list of printers.
|1||Export the call-graph of the contracts to a dot file|
|2||Print a summary of the contracts|
|3||Print a summary of the functions|
|4||Print a human-readable summary of the contracts|
|5||Print the inheritance relations between contracts|
|6||Export the inheritance graph of each contract to a dot file|
|7||Print the slithIR representation of the functions|
|8||Print the state variables written and the authorization of the functions|
Copyright (C) 2018