You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Slither** is a Solidity static analysis framework written in Python3. 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.
* Correctly parses 99.9% of all public Solidity code
47
+
* Average execution time of less than 1 second per contract
48
+
* Integrates with Github's code scanning in [CI](https://github.com/marketplace/actions/slither-action)
51
49
52
50
## Usage
53
51
@@ -102,9 +100,9 @@ docker run -it -v /home/share:/share trailofbits/eth-security-toolbox
102
100
103
101
### Integration
104
102
105
-
- For GitHub action integration, use [slither-action](https://github.com/marketplace/actions/slither-action).
106
-
- To generate a Markdown report, use `slither [target] --checklist`.
107
-
- To generate a Markdown with GitHub source code highlighting, use `slither [target] --checklist --markdown-root https://github.com/ORG/REPO/blob/COMMIT/` (replace `ORG`, `REPO`, `COMMIT`)
103
+
* For GitHub action integration, use [slither-action](https://github.com/marketplace/actions/slither-action).
104
+
* To generate a Markdown report, use `slither [target] --checklist`.
105
+
* To generate a Markdown with GitHub source code highlighting, use `slither [target] --checklist --markdown-root https://github.com/ORG/REPO/blob/COMMIT/` (replace `ORG`, `REPO`, `COMMIT`)
108
106
109
107
## Detectors
110
108
@@ -200,37 +198,38 @@ Num | Detector | What it Detects | Impact | Confidence
200
198
201
199
For more information, see
202
200
203
-
- The [Detector Documentation](https://github.com/crytic/slither/wiki/Detector-Documentation) for details on each detector
204
-
- The [Detection Selection](https://github.com/crytic/slither/wiki/Usage#detector-selection) to run only selected detectors. By default, all the detectors are run.
205
-
- The [Triage Mode](https://github.com/crytic/slither/wiki/Usage#triage-mode) to filter individual results
201
+
* The [Detector Documentation](https://github.com/crytic/slither/wiki/Detector-Documentation) for details on each detector
202
+
* The [Detection Selection](https://github.com/crytic/slither/wiki/Usage#detector-selection) to run only selected detectors. By default, all the detectors are run.
203
+
* The [Triage Mode](https://github.com/crytic/slither/wiki/Usage#triage-mode) to filter individual results
206
204
207
205
## Printers
206
+
208
207
### Quick Review Printers
209
-
-`human-summary`: [Print a human-readable summary of the contracts](https://github.com/trailofbits/slither/wiki/Printer-documentation#human-summary)
210
-
-`inheritance-graph`: [Export the inheritance graph of each contract to a dot file](https://github.com/trailofbits/slither/wiki/Printer-documentation#inheritance-graph)
211
-
-`contract-summary`: [Print a summary of the contracts](https://github.com/trailofbits/slither/wiki/Printer-documentation#contract-summary)
212
-
-`loc`: [Count the total number lines of code (LOC), source lines of code (SLOC), and comment lines of code (CLOC) found in source files (SRC), dependencies (DEP), and test files (TEST).](https://github.com/trailofbits/slither/wiki/Printer-documentation#loc)
208
+
*`human-summary`: [Print a human-readable summary of the contracts](https://github.com/trailofbits/slither/wiki/Printer-documentation#human-summary)
209
+
*`inheritance-graph`: [Export the inheritance graph of each contract to a dot file](https://github.com/trailofbits/slither/wiki/Printer-documentation#inheritance-graph)
210
+
*`contract-summary`: [Print a summary of the contracts](https://github.com/trailofbits/slither/wiki/Printer-documentation#contract-summary)
211
+
*`loc`: [Count the total number lines of code (LOC), source lines of code (SLOC), and comment lines of code (CLOC) found in source files (SRC), dependencies (DEP), and test files (TEST).](https://github.com/trailofbits/slither/wiki/Printer-documentation#loc)
213
212
214
213
### In-Depth Review Printers
215
-
-`call-graph`: [Export the call-graph of the contracts to a dot file](https://github.com/trailofbits/slither/wiki/Printer-documentation#call-graph)
216
-
-`cfg`: [Export the CFG of each functions](https://github.com/trailofbits/slither/wiki/Printer-documentation#cfg)
217
-
-`function-summary`: [Print a summary of the functions](https://github.com/trailofbits/slither/wiki/Printer-documentation#function-summary)
218
-
-`vars-and-auth`: [Print the state variables written and the authorization of the functions](https://github.com/crytic/slither/wiki/Printer-documentation#variables-written-and-authorization)
219
-
-`not-pausable`: [Print functions that do not use `whenNotPaused` modifier](https://github.com/trailofbits/slither/wiki/Printer-documentation#when-not-paused).
214
+
*`call-graph`: [Export the call-graph of the contracts to a dot file](https://github.com/trailofbits/slither/wiki/Printer-documentation#call-graph)
215
+
*`cfg`: [Export the CFG of each functions](https://github.com/trailofbits/slither/wiki/Printer-documentation#cfg)
216
+
*`function-summary`: [Print a summary of the functions](https://github.com/trailofbits/slither/wiki/Printer-documentation#function-summary)
217
+
*`vars-and-auth`: [Print the state variables written and the authorization of the functions](https://github.com/crytic/slither/wiki/Printer-documentation#variables-written-and-authorization)
218
+
*`not-pausable`: [Print functions that do not use `whenNotPaused` modifier](https://github.com/trailofbits/slither/wiki/Printer-documentation#when-not-paused).
220
219
221
220
To run a printer, use `--print` and a comma-separated list of printers.
222
221
223
222
See the [Printer documentation](https://github.com/crytic/slither/wiki/Printer-documentation) for the complete lists.
*`slither-read-storage`: [Read storage values from contracts](./slither/tools/read_storage/README.md)
232
+
*`slither-interface`: [Generate an interface for a contract](./slither/tools/interface/README.md)
234
233
235
234
See the [Tool documentation](https://github.com/crytic/slither/wiki/Tool-Documentation) for additional tools.
236
235
@@ -244,23 +243,23 @@ Documentation on Slither's internals is available [here](https://crytic.github.i
244
243
245
244
Feel free to stop by our [Slack channel](https://empireslacking.herokuapp.com) (#ethereum) for help using or extending Slither.
246
245
247
-
- The [Printer documentation](https://github.com/trailofbits/slither/wiki/Printer-documentation) describes the information Slither is capable of visualizing for each contract.
246
+
* The [Printer documentation](https://github.com/trailofbits/slither/wiki/Printer-documentation) describes the information Slither is capable of visualizing for each contract.
248
247
249
-
- The [Detector documentation](https://github.com/trailofbits/slither/wiki/Adding-a-new-detector) describes how to write a new vulnerability analyses.
248
+
* The [Detector documentation](https://github.com/trailofbits/slither/wiki/Adding-a-new-detector) describes how to write a new vulnerability analyses.
250
249
251
-
- The [API documentation](https://github.com/crytic/slither/wiki/Python-API) describes the methods and objects available for custom analyses.
250
+
* The [API documentation](https://github.com/crytic/slither/wiki/Python-API) describes the methods and objects available for custom analyses.
252
251
253
-
- The [SlithIR documentation](https://github.com/trailofbits/slither/wiki/SlithIR) describes the SlithIR intermediate representation.
252
+
* The [SlithIR documentation](https://github.com/trailofbits/slither/wiki/SlithIR) describes the SlithIR intermediate representation.
254
253
255
254
## FAQ
256
255
257
256
How do I exclude mocks or tests?
258
257
259
-
- View our documentation on [path filtering](https://github.com/crytic/slither/wiki/Usage#path-filtering).
258
+
* View our documentation on [path filtering](https://github.com/crytic/slither/wiki/Usage#path-filtering).
260
259
261
260
How do I fix "unknown file" or compilation issues?
262
261
263
-
- Because slither requires the solc AST, it must have all dependencies available.
262
+
* Because slither requires the solc AST, it must have all dependencies available.
264
263
If a contract has dependencies, `slither contract.sol` will fail.
265
264
Instead, use `slither .` in the parent directory of `contracts/` (you should see `contracts/` when you run `ls`).
266
265
If you have a `node_modules/` folder, it must be in the same directory as `contracts/`. To verify that this issue is related to slither,
@@ -275,7 +274,7 @@ Slither is licensed and distributed under the AGPLv3 license. [Contact us](mailt
275
274
276
275
### Trail of Bits publication
277
276
278
-
-[Slither: A Static Analysis Framework For Smart Contracts](https://arxiv.org/abs/1908.09878), Josselin Feist, Gustavo Grieco, Alex Groce - WETSEB '19
277
+
*[Slither: A Static Analysis Framework For Smart Contracts](https://arxiv.org/abs/1908.09878), Josselin Feist, Gustavo Grieco, Alex Groce - WETSEB '19
0 commit comments