Zokyo Automated Tools
  • πŸ€–Unlocking Smart Contract Security: A Comprehensive Guide to Automated Vulnerability Analysis
  • 🐍Mastering Slither: A Comprehensive Guide to Smart Contract Vulnerability Detection
    • πŸš€Prerequisites
      • πŸ’»Code Editor
      • 🐍Setting up Python and Configuring Virtual Environments
      • πŸ”­Setting Up Git
      • πŸ‘ŠGit Bash
    • ⚑What Is Static Analysis
    • 🐍What Is Slither
    • πŸ“©Setting Up Slither: Installation and Virtual Environment Configuration
    • πŸ”©Installing solc and Crytic Compile: Foundation Tools for Slither
    • πŸ”Analyzing Smart Contracts Locally with Slither
      • πŸ—ΊοΈHandling Import Errors in Slither: A Guide on Solc Remappings
      • πŸ›£οΈHandling Path Errors In Slither
    • 🌍Analyzing Smart Contracts Already Deployed On Main-nets
    • πŸ”ŒExploring Slither's Tools and Printers: A Comprehensive Tutorial
    • πŸ€–Using Bash Scripts for Batch Analysis with Slither
    • πŸ’»Slither Intermediate Representation
    • 🌐Slither Python API
    • ⚠️Custom Detectors in Slither
      • 🀝Leveraging Custom Detectors from the Community
        • πŸ€—Leveraging Custom Detectors from the Community: Spotlight on the pessimistic.io Team
      • 🌱Making your own detectors
  • βš›οΈOyente: Symbolic Execution Tool
    • 😎What Is Symbolic Execution?
Powered by GitBook
On this page
  • Introduction
  • Why Use a Virtual Environment?
  • Creating a Virtual Environment
  • Installing Slither
  • Conclusion: A Ready-to-Use Slither Environment
  1. Mastering Slither: A Comprehensive Guide to Smart Contract Vulnerability Detection

Setting Up Slither: Installation and Virtual Environment Configuration

PreviousWhat Is SlitherNextInstalling solc and Crytic Compile: Foundation Tools for Slither

Last updated 1 year ago

Introduction

Before diving into the vast sea of smart contract analysis with Slither, it's imperative to ensure that your environment is correctly set up. This section aims to guide you through the installation of Slither and setting up a virtual environment to house this powerful tool.

Why Use a Virtual Environment?

Working within a virtual environment is a best practice that helps manage dependencies and creates an isolated workspace for your project. This isolation prevents potential conflicts between system-wide installed packages and the packages that you will install specifically for Slither. Moreover, it makes the management and replication of your project more effortless, enhancing the overall workflow and productivity.

Creating a Virtual Environment

  1. Install Python: Ensure you have Python installed on your system. Slither requires Python 3.6 or newer. You can download Python from .

  2. Install virtualenv: Install virtualenv using the following command. This tool helps in creating isolated Python environments.

    pip install virtualenv
  3. Create a New Virtual Environment: Navigate to your project directory and create a new virtual environment using the following command.

    virtualenv slither-env
  4. Activate the Virtual Environment:

    • Windows:

      .\slither-env\Scripts\activate
    • macOS and Linux:

      source slither-env/bin/activate

Installing Slither

With the virtual environment active, you can proceed to install Slither. The isolation ensures that all dependencies and packages required by Slither are encapsulated, maintaining the environment's integrity.

  1. Install Slither: Use the following command to install Slither in your virtual environment.

    pip install slither-analyzer
  2. Verify Installation: You can verify the installation by running the slither command followed by --version, which should display the version of the installed Slither tool.

    slither --version

Conclusion: A Ready-to-Use Slither Environment

Congratulations! You’ve successfully set up Slither in a virtual environment. This setup not only ensures that Slither runs smoothly but also maintains a clean and organized workspace, avoiding any potential dependency conflicts. You are now equipped with a robust toolset in an optimized environment to start analyzing, optimizing, and securing your smart contracts.

🐍
πŸ“©
Book an audit with Zokyo
here