Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

slither

> 编程语言
Open source

Static Analyzer for Solidity and Vyper

6.3K stars0 likes1 views
WebsiteGitHub

About

Static Analyzer for Solidity and Vyper

Slither, the smart contract static analyzer

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.

  • Features
  • Usage
  • How to install
    • Using uv (Recommended)
    • Using Pip
    • Using Git
    • Using Docker
    • Integration
  • Detectors
  • Printers
    • Quick Review Printers
    • In-Depth Review Printers
  • Tools
  • API Documentation
  • Getting Help
  • FAQ
  • License
  • Publications
    • Trail of Bits publication
    • External publications

Features

  • Detects vulnerable Solidity code with low false positives (see the list of trophies)
  • Identifies where the error condition occurs in the source code
  • Easily integrates into continuous integration and Hardhat/Foundry 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
  • Correctly parses 99.9% of all public Solidity code
  • Average execution time of less than 1 second per contract
  • Integrates with Github's code scanning in CI
  • Support for Vyper smart contracts

Usage

Run Slither on a Hardhat/Foundry/Dapp/Brownie application:

bash
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:

bash
slither tests/uninitialized.sol

How to install

Note 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.

Using uv (Recommended)

uv is a fast Python package manager that's 10-100x faster than pip.

bash
# 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:

bash
uv tool upgrade slither-analyzer

Using Pip

bash
python3 -m pip install slither-analyzer

To upgrade:

bash
python3 -m pip install --upgrade slither-analyzer

Using Brew

bash
brew install slither-analyzer

Using Git (Development)

bash
git 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.

Using Docker

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.

bash
docker pull trailofbits/eth-security-toolbox

To share a directory in the container:

bash
docker run -it -v /home/share:/share trailofbits/eth-security-toolbox

Integration

  • For GitHub action integration, use slither-action.
  • For pre-commit integration, use (replace $GIT_TAG with real tag)
    yaml
    - repo: https://github.com/crytic/slither
      rev: $GIT_TAG
      hooks:
        - id: slither
  • To generate a Markdown report, use slither [target] --checklist.
  • 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)

Detectors

Num Detector What it Detects Impact Confidence
1 abiencoderv2-array Storage abiencoderv2 array High High
2 arbitrary-send-erc20 transferFrom uses arbitrary from High High
3 array-by-reference Modifying storage array by value High High
4 encode-packed-collision ABI encodePacked Collision High High
5 incorrect-shift The order of parameters in a shift instruction is incorrect. High High
6 multiple-constructors Multiple constructor schemes High High
7 name-reused Contract's name reused High High
8 protected-vars Detected unprotected variables High High
9 public-mappings-nested Public mappings with nested variables High High
10 rtlo Right-To-Left-Override control character is used High High
11 shadowing-state State variables shadowing High High
12 suicidal Functions allowing anyone to destruct the contract High High
13 uninitialized-state Uninitialized state variables High High
14 uninitialized-storage Uninitialized storage variables High High
15 unprotected-upgrade Unprotected upgradeable contract High High
16 arbitrary-send-erc20-permit transferFrom uses arbitrary from with permit High Medium
17 arbitrary-send-eth Functions that send Ether to arbitrary destinations High Medium
18 controlled-array-length Tainted array length assignment High Medium
19 controlled-delegatecall Controlled delegatecall destination High Medium
20 delegatecall-loop Payable functions using delegatecall inside a loop High Medium
21 incorrect-exp Incorrect exponentiation High Medium
22 incorrect-return If a return is incorrectly used in assembly mode. High Medium
23 msg-value-loop msg.value inside a loop High Medium
24 reentrancy-eth Reentrancy vulnerabilities (theft of ethers) High Medium
25 reentrancy-balance Reentrancy vulnerabilities leading to outdated balance checks High Medium
26 return-leave If a return is used instead of a leave. High Medium
27 storage-array Signed storage integer array compiler bug High Medium
28 unchecked-transfer Unchecked tokens transfer High Medium
29 weak-prng Weak PRNG High Medium
30 domain-separator-collision Detects ERC20 tokens that have a function whose signature collides with EIP-2612's DOMAIN_SEPARATOR() Medium High
31 enum-conversion Detect dangerous enum conversion Medium High
32 erc20-interface Incorrect ERC20 interfaces Medium High
33 erc721-interface Incorrect ERC721 interfaces Medium High
34 incorrect-equality Dangerous strict equalities Medium High
35 locked-ether Contracts that lock ether Medium High
36 mapping-deletion Deletion on mapping containing a structure Medium High
37 pyth-deprecated-functions Detect Pyth deprecated functions Medium High
38 pyth-unchecked-confidence Detect when the confidence level of a Pyth price is not checked Medium High
39 pyth-unchecked-publishtime Detect when the publishTime of a Pyth price is not checked Medium High
40 shadowing-abstract State variables shadowing from abstract contracts Medium High
41 `tautological-c

Issues· 479 open

View all issuesOpen on GitHub
  • #3103

    [Bug-Candidate]: "Impossible to generate IR" when a `using for` library function is called on a mixed-width sum whose left operand is narrower

    bug-candidateUpdated Sep 24, 2026
  • #3095

    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.

    enhancementUpdated Sep 6, 2026
  • #3082

    [Bug]: IR generation crashes on ERC7739-style calldata tuple destructuring ('NoneType' object has no attribute 'parameters'), silently dropping inheriting contracts from analysis

    Updated Sep 6, 2026
  • #3070

    Feature request: detector for quantum-vulnerable signature schemes (ecrecover / ECDSA.recover)

    enhancementUpdated Sep 5, 2026
  • #857

    slither-doc: generate doc from natspec

    enhancementhelp wantedgood first issueUpdated Aug 12, 2026
  • #3054

    [False-Positive]: incorrect-shift and incorrect-exp produce 24 High-severity false positives on lib/solady

    Updated Aug 11, 2026
  • #3064

    solidity_signature is wrong for structs with repeated convertible field types (shared `seen` set)

    Updated Jul 29, 2026
  • #3055

    [False-Positive]: arbitrary-send-erc20 fires on EIP-712 signed order patterns

    Updated Jul 20, 2026
  • #2759

    [False-Positive]: incorrect-equality

    false-positiveUpdated Jul 20, 2026
  • #2283

    Detectors related to improper usage of Oracle APIs

    enhancementUpdated Jul 15, 2026

> Tags

Pythonethereumsoliditystatic-analysisvyper

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 25, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言