slither v0.6.6 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
0.6.6 – 2019-08-16
This release changes internal functions and how modifiers are represented, improves the JSON format, removes detectors’ false positives, and fixes numerous bugs.
- Add Optimization type and
--exclude-optimizationflag (#265), #269)
- AragonOS detection (#276)
- New printer: constructor calls (#299)
- [Breaking change] Remove the instance sharing for functions and modifiers. Each function or modifier has now
contract_declarerproperties, where contract points to the contract’s instance and the contract declarer to the contract where the function was originally declared (#213).
- [Breaking change] Use unique JSON element per detector finding (#263)
- [Breaking change] Add type to JSON result and improve the log in console/file (#266)
- Move third parties tools to
- Remove false positive in external function detector in case of parameter written (#257)
- Remove false positive in naming convention in case of unnamed parameters (#260)
- Remove false positive in naming convention for constructor (aec680c)
- Improve ternary operators support (#301)
- Late conversion of the subdenomination value (#305)
- Refactor reentrancy detector and add support for create-based reentrancy (#311)
- Incorrect source mapping for if/while/for condition (#245)
- Incorrect variable order in printer (#254)
- Incorrect source mapping due to text conversion (#252)
- Incorrect type for constant with implicit conversion (#283)
- Incorrect arguments to crytic-compile (4cbe048)
Note: 0.6.5 contained a bug in the reentrancy detector. Please avoid this version since it unnecessarily reported false-positives.
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