Esta página se muestra en inglés. Una traducción al español está en curso.
ScriptsJul 22, 2026·3 min de lectura

Slither — Static Analysis Framework for Solidity Smart Contracts

A Python-based static analysis tool for Solidity that detects vulnerabilities, suggests optimizations, and surfaces code quality issues in Ethereum smart contracts.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Slither
Comando de instalación directa
npx -y tokrepo@latest install c8323e0e-85cf-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Slither is a static analysis framework for Solidity smart contracts, developed by Trail of Bits. It runs a suite of vulnerability detectors, code quality checks, and gas optimization suggestions against Solidity source code without executing it. Slither is widely used in the Ethereum security community for auditing contracts before deployment.

What Slither Does

  • Detects over 90 classes of vulnerabilities including reentrancy, uninitialized storage, and integer overflow
  • Analyzes inheritance graphs, function visibility, and state variable access patterns
  • Suggests gas optimizations like packing storage variables and removing dead code
  • Prints contract summaries, function call graphs, and inheritance diagrams for manual review
  • Supports custom detectors and printers via a Python plugin API

Architecture Overview

Slither parses Solidity source through the solc compiler to obtain an AST, then builds its own intermediate representation called SlithIR. SlithIR converts Solidity into a reduced instruction set (similar to SSA form) that enables precise dataflow analysis. Detectors run over SlithIR to identify vulnerability patterns, while printers generate human-readable summaries and visualizations of contract structure.

Self-Hosting & Configuration

  • Install from PyPI: pip install slither-analyzer
  • Requires a compatible solc compiler version installed (solc-select helps manage versions)
  • Run slither . in a Hardhat, Foundry, or Truffle project root to analyze all contracts
  • Configure which detectors to enable or exclude via command-line flags or a slither.config.json file
  • Integrate into CI by checking the exit code: non-zero means findings above the configured severity threshold

Key Features

  • 90+ built-in vulnerability detectors covering the OWASP Smart Contract Top 10
  • SlithIR intermediate representation enabling precise taint analysis and dataflow tracking
  • Support for Hardhat, Foundry, Truffle, and Dapp project structures out of the box
  • Printers for call graphs, inheritance trees, variable ordering, and contract summaries
  • Custom detector and printer API for writing organization-specific security rules

Comparison with Similar Tools

  • Mythril — uses symbolic execution and SMT solving for deeper path exploration; Slither is faster and catches more surface-level patterns
  • Securify2 — pattern-based analysis for Solidity; Slither has more detectors and active maintenance
  • Echidna — property-based fuzzer for Solidity; complements Slither by testing runtime behavior rather than static patterns
  • Foundry forge test — tests contract logic but does not perform security-focused static analysis
  • Aderyn — Rust-based Solidity analyzer; newer with fewer detectors than Slither's mature suite

FAQ

Q: Does Slither find all smart contract vulnerabilities? A: No static analyzer can guarantee complete coverage. Slither catches common vulnerability patterns but should be part of a broader audit that includes manual review and fuzzing.

Q: Can I use Slither with Foundry projects? A: Yes. Slither detects Foundry projects automatically and compiles via forge build before analysis.

Q: How do I suppress false positives? A: Use // slither-disable-next-line detector-name comments in the source or exclude detectors via --exclude flags.

Q: Does Slither support Vyper contracts? A: No. Slither is designed specifically for Solidity. For Vyper, consider dedicated tools like VyperLang's built-in compiler warnings.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados