{"id":27400,"library":"slither-analyzer","title":"Slither","description":"Slither is a Solidity and Vyper static analysis framework written in Python 3. It provides a suite of vulnerability detectors, visualizes contract details via printers, and includes tools for upgradeability checks, mutation testing, and code flattening. Current version: 0.11.5 (requires Python >=3.10). Releases occur several times per year.","status":"active","version":"0.11.5","language":"python","source_language":"en","source_url":"https://github.com/crytic/slither","tags":["static-analysis","solidity","ethereum","smart-contracts","security"],"install":[{"cmd":"pip install slither-analyzer","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Managing multiple Solidity compiler versions","package":"solc-select","optional":true},{"reason":"Underlying compilation infrastructure for Solidity and Vyper","package":"crytic-compile","optional":false}],"imports":[{"note":"Slither is a class, not a module.","wrong":"import slither","symbol":"Slither","correct":"from slither import Slither"},{"note":"Use the all_detectors list to iterate; avoid wildcard imports.","wrong":"from slither.detectors.all_detectors import *","symbol":"detectors","correct":"from slither.detectors import all_detectors"},{"note":"The CLI entry point is in __main__.","wrong":"from slither import main","symbol":"slither_main","correct":"from slither.__main__ import main"}],"quickstart":{"code":"from slither import Slither\n\n# Analyze a Solidity file\nslither = Slither('path/to/contract.sol')\nfor contract in slither.contracts:\n    print(f\"Contract: {contract.name}\")\n    for function in contract.functions:\n        print(f\"  Function: {function.name}\")\n\n# Run all detectors\nfrom slither.detectors import all_detectors\nresults = slither.run_detectors(all_detectors)\nfor detector_result in results:\n    print(detector_result)","lang":"python","description":"Basic usage: load a contract, iterate over its structure, and run all built-in detectors."},"warnings":[{"fix":"Upgrade to Python 3.10+ or pin slither-analyzer<0.11.5.","message":"Python 3.10 or higher is required as of version 0.11.5. Older Python versions (3.8, 3.9) are no longer supported.","severity":"breaking","affected_versions":">=0.11.5"},{"fix":"Use contract.variables_as_dict() or contract.functions_as_dict() for dictionary access. Refer to the changelog for details.","message":"In version 0.11.0, the Contract class properties for variables and the *Calls API were refactored. Code accessing contract.variables or contract.functions may break.","severity":"breaking","affected_versions":">=0.11.0"},{"fix":"Install solc-select and set the desired version: pip install solc-select && solc-select install 0.8.20 && solc-select use 0.8.20","message":"Slither requires a Solidity compiler (solc) installed. If solc is not in PATH, analysis fails. Use solc-select to manage versions.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove --detect similar-names from your command line.","message":"The detector 'similar-names' was removed in version 0.10.3.","severity":"deprecated","affected_versions":">=0.10.3"},{"fix":"Call slither.run_detectors() with the list of detectors you wish to execute.","message":"When using slither in a script, you must call slither.run_detectors() explicitly; just creating a Slither object does not run detectors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"pip install crytic-compile","cause":"crytic-compile is an optional dependency but required for compilation. It is not installed automatically in all environments.","error":"ModuleNotFoundError: No module named 'crytic_compile'"},{"fix":"Remove --detect similar-names from your command. Use a different detector or update your scripts.","cause":"The 'similar-names' detector was removed in slither 0.10.3.","error":"slither: error: unrecognized arguments: --detect similar-names"},{"fix":"Install solc (e.g., via solc-select: pip install solc-select && solc-select install 0.8.20 && solc-select use 0.8.20) or ensure solc is in your PATH.","cause":"Slither cannot find the solc binary. It is required to compile contracts.","error":"Exception: Solc is not in PATH. Is Solidity installed?"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}