- Find vulnerabilities before deployment
- Enhance code comprehension
- Quickly prototype custom analyses
- Detect common security issues automatically
Installation
Install Slither using pip:Running Slither
The Across Protocol contracts have been analyzed using Slither v0.9.2 with no major bugs found.Basic Usage
Command Breakdown
contracts/SpokePool.sol- The contract file to analyze (replace with any contract)--solc-remaps @=node_modules/@- Maps@imports tonode_modules/@--solc-args "--optimize --optimize-runs 1000000"- Passes optimization flags to solc (matches production settings)--filter-paths "node_modules"- Excludes node_modules from analysis--exclude naming-convention- Skips naming convention warnings (style-only issues)
Analyzing Other Contracts
You can analyze any contract in the repository:Vulnerability Detection
Slither includes over 70+ built-in detectors for common vulnerabilities and code issues:High Severity Issues
- Reentrancy vulnerabilities
- Arbitrary
delegatecallfrom user-supplied addresses - Unprotected upgrades
- State variables shadowing
- Incorrect ERC20 implementation
Medium Severity Issues
- Locked Ether
- Dangerous strict equalities
- Block timestamp manipulation
- Assembly usage
- Low-level calls
Low Severity Issues
- Unused return values
- Conformance to Solidity naming conventions
- Missing zero-address validation
- Unused state variables
Informational
- Public functions that could be external
- Constant functions using assembly
- Dead code
- Pragma version
Common Options
Understanding Output
Slither categorizes findings by impact and confidence: Impact Levels:- High: Critical security issues that should be fixed immediately
- Medium: Potential issues that require review
- Low: Minor issues or optimizations
- Informational: Code quality suggestions
- High: Very likely to be an issue
- Medium: Might be an issue, requires manual review
- Low: Possibly a false positive
Example Output
Integration with CI/CD
Add Slither to your continuous integration pipeline:GitHub Actions Example
Advanced Usage
Generate Contract Summary
- Contract inheritance
- Function visibility
- State variables
- Modifiers
Analyze Inheritance Graph
Check for Upgradability Issues
Function Call Graph
Best Practices
- Run Slither regularly - Include it in your development workflow
- Fix high-severity issues first - Prioritize by impact level
- Review medium-severity findings - Many require manual review and context
- Don’t ignore informational findings - They improve code quality
- Use the same compiler settings - Match production optimization settings (1,000,000 runs)
- Update Slither regularly - New detectors are added frequently
- Combine with other tools - Use alongside Mythril, Echidna, or formal verification
Limitations
- False positives - Static analysis can flag non-issues; manual review required
- Context-dependent - Some patterns are safe in specific contexts but flagged anyway
- No runtime analysis - Doesn’t catch issues that only appear during execution
- EVM-only - For Solana/SVM contracts, use different tools
Related Tools
- Mythril - Symbolic execution and taint analysis
- Echidna - Property-based fuzz testing
- Manticore - Dynamic symbolic execution
- Securify - Automated security analysis
Resources
Security Audits
The Across Protocol contracts have been continuously audited by OpenZeppelin. All audit reports are available at: https://docs.across.to/resources/audits Slither is a complementary tool to professional audits, not a replacement.Related
- Scripts & Deployment - Build and deployment commands
- Testing Guide - Running tests
- HubPool Contract - Core L1 contract security patterns