A powerful Solidity static analyzer that takes a bird's eye view over your smart contracts.
Docs
Get support
Website
Twitter
---
[![Stargazers][stars-shield]][stars-url] [![Forks][forks-shield]][forks-url]
[![Contributors][contributors-shield]][contributors-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
## What is Aderyn?
**Aderyn is an open-source public good developer tool.** It is a Rust-based solidity smart contract static analyzer designed to help protocol engineers and security researchers find vulnerabilities in Solidity code bases.
Thanks to its collection of static vulnerability detectors, running Cyfrin Aderyn on your Solidity codebase will **highlight potential vulnerabilities**, drastically reducing the potential for unknown issues in your Solidity code and giving you the time to focus on more complex problems.
Built using **Rust**, Aderyn integrates seamlessly into small and **enterprise-level development workflows**, offering lighting-fast command-line functionality and a framework to [build custom detectors](https://docs.cyfrin.io/aderyn-custom-detectors/what-is-a-detector) to adapt to your codebase.
You can read the [Cyfrin official documentation](https://docs.cyfrin.io) for an in-depth look at Aderyn's functionalities.
## Features
* [Foundry](https://book.getfoundry.sh/) support
* Modular [detectors](./aderyn_core/src/detect/)
* AST Traversal
* Markdown reports
## Installation
### Prerequisites
Before installing Aderyn, ensure you have the following:
* Rust: Aderyn is built in Rust. Before running, you must install Rust and Cargo (Rust's package manager). If you still need to install Rust, follow the instructions on the [official Rust website](https://www.rust-lang.org/learn/get-started).
Aderyn currently only supports Foundry-based projects. If you're using Hardhat, please take a look at the [contribution guidelines]() and [issues]() for information on how to contribute.
**Suggested VSCode extensions:**
[rust-analyzer](https://marketplace.visualstudio.com/items?itemName=dustypomerleau.rust-syntax) - Rust language support for Visual Studio Code
[Rust Syntax](https://marketplace.visualstudio.com/items?itemName=dustypomerleau.rust-syntax) - Improved Rust syntax highlighting
### Installing Aderyn
**Step 1: Install Aderyn using cargo**
Aderyn is currently installed using Cargo, Rust's package manager. Open your command line interface and run the following command:
```sh
cargo install aderyn
```
This command downloads and installs the Aderyn package.
**Step 2: Verify installation**
After the installation, you can verify that Aderyn is correctly installed by checking its version. In your command line, execute:
```sh
aderyn --version
```
This command should return the installed version of Aderyn, confirming that the installation was successful.
**Step 3: Update PATH (if necessary)**
If you cannot run the aderyn after installation, you may need to add Cargo's bin directory to your PATH. The exact instructions can vary based on your operating system. Typically, it involves adding ~/.cargo/bin to your PATH in your shell profile script (like .bashrc or .zshrc).
**Step 4: Future Updates**
To update Aderyn to the latest version, you can run the install command again:
```sh
cargo install aderyn
```
Cargo will replace the existing version with the latest one.
## Quick Start
Once Aderyn is installed on your system, you can run it against your Foundry-based codebase to find vulnerabilities in your code.
We will use the [aderyn-contracts-playground](https://github.com/Cyfrin/aderyn-contracts-playground) repository in this example. You can follow along by cloning it to your system:
```sh
git clone https://github.com/Cyfrin/aderyn-contracts-playground.git
```
Navigate inside the repository:
```sh
cd aderyn-contracts-playground
```
We usually use several smart contracts and tests to try new detectors. Build the contracts by running:
```sh
forge build
```
Building your project by running forge build --ast will save you time the first time you run Aderyn.
Once your smart contracts have been successfully compiled, run Aderyn using the following command:
```sh
aderyn [OPTIONS] path/to/your/project
```
Replace [OPTIONS] with specific command-line arguments as needed.
For an in-depth walkthrough on how to get started using Aderyn, check the [Cyfrin official docs](https://docs.cyfrin.io/aderyn-static-analyzer/quickstart)
### Arguments
Usage: `aderyn [OPTIONS]
`
``: The path to the root of the codebase to be analyzed. Defaults to the current directory.
Options:
- `-o`, `--output