Static Analyzer for Solidity and Vyper
Join the Empire Hacking Slack
- Discussions and Support
Slither is a Solidity & Vyper 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.
Run Slither on a Hardhat/Foundry/Dapp/Brownie application:
slither .This is the preferred option if your project has dependencies as Slither relies on the underlying compilation framework to compile source code.
However, you can run Slither on a single file that does not import dependencies:
slither tests/uninitialized.solNote Slither requires Python 3.10+. If you're not going to use one of the supported compilation frameworks, you need solc, the Solidity compiler; we recommend using solc-select to conveniently switch between solc versions.
uv is a fast Python package manager that's 10-100x faster than pip.
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install slither as a tool
uv tool install slither-analyzer
# Or run slither without installation
uvx --from slither-analyzer slither <target>To upgrade:
uv tool upgrade slither-analyzerpython3 -m pip install slither-analyzerTo upgrade:
python3 -m pip install --upgrade slither-analyzerbrew install slither-analyzergit clone https://github.com/crytic/slither.git && cd slither
# Install as editable for development
uv tool install -e .
# Or use uv run for testing without installation
uv run slither <target>The -e flag installs in editable mode, meaning changes to the source code are immediately reflected without reinstalling.
Use the eth-security-toolbox docker image. It includes all of our security tools and every major version of Solidity in a single image. /home/share will be mounted to /share in the container.
docker pull trailofbits/eth-security-toolboxTo share a directory in the container:
docker run -it -v /home/share:/share trailofbits/eth-security-toolbox$GIT_TAG with real tag)- repo: https://github.com/crytic/slither
rev: $GIT_TAG
hooks:
- id: slitherslither [target] --checklist.slither [target] --checklist --markdown-root https://github.com/ORG/REPO/blob/COMMIT/ (replace ORG, REPO, COMMIT)[Bug-Candidate]: "Impossible to generate IR" when a `using for` library function is called on a mixed-width sum whose left operand is narrower
A detector for [ERC-7562](https://eips.ethereum.org/EIPS/eip-7562) banned opcodes reachable from an ERC-4337 validation function (`validateUserOp`, `validatePaymasterUserOp`), following internal calls, library calls and modifiers.
[Bug]: IR generation crashes on ERC7739-style calldata tuple destructuring ('NoneType' object has no attribute 'parameters'), silently dropping inheriting contracts from analysis
Feature request: detector for quantum-vulnerable signature schemes (ecrecover / ECDSA.recover)
slither-doc: generate doc from natspec
[False-Positive]: incorrect-shift and incorrect-exp produce 24 High-severity false positives on lib/solady
solidity_signature is wrong for structs with repeated convertible field types (shared `seen` set)
[False-Positive]: arbitrary-send-erc20 fires on EIP-712 signed order patterns
[False-Positive]: incorrect-equality
Detectors related to improper usage of Oracle APIs