Skip to content

Commit

Permalink
docs: Update URLs in README.md to point to the new Cyfrin documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Ehimen committed Mar 7, 2025
1 parent 798bf95 commit 331fcc1
Showing 1 changed file with 51 additions and 36 deletions.
87 changes: 51 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


<p align="center">
<br />
<a href="https://cyfrin.io/">
Expand All @@ -15,7 +13,6 @@
<br />
</p>


<p align="center">
<a href="https://support.cyfrin.io/en/collections/11474635-aderyn">Docs</a>
<a href="https://discord.gg/cyfrin">Get support</a>
Expand All @@ -34,28 +31,27 @@

</div>





## 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.
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://support.cyfrin.io/en/articles/10455808-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.
You can read the [Cyfrin official documentation](https://support.cyfrin.io/en) for an in-depth look at Aderyn's functionalities.

## Features
* Supports any development framework (Foundry/Hardhat/Truffle/etc)
* Modular [detectors](./aderyn_core/src/detect/)
* AST Traversal
* Markdown reports

- Supports any development framework (Foundry/Hardhat/Truffle/etc)
- Modular [detectors](./aderyn_core/src/detect/)
- AST Traversal
- Markdown reports

## Installation

> **NOTE** Windows users must have WSL installed
### Using Cyfrinup

**Cyfrinup** simplifies the installation and management of Cyfrin tools.
Expand All @@ -64,51 +60,63 @@ Follow the instructions to install [here](https://github.com/Cyfrin/up).

Run `aderyn --version` to check the installation.


##### Upgrade older versions by (re)running: `cyfrinup`

----------
---

### Using Homebrew

```sh
brew install cyfrin/tap/aderyn
```

##### Upgrade older versions by running: `brew upgrade cyfrin/tap/aderyn`

----------
### Using npm
---

### Using npm

```sh
npm install @cyfrin/aderyn -g
```

##### Upgrade older versions by (re)running: `npm install @cyfrin/aderyn -g`

-----------
---

If you are installing with Homebrew or npm, ensure that the correct version of Aderyn in your path comes from either the Homebrew or npm global packages directory. If an older version exists at `~/.cyfrin/bin/aderyn`, remove it using `rm -f ~/.cyfrin/bin/aderyn`, as this is no longer the default installation location.


## 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
```

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)
For an in-depth walkthrough on how to get started using Aderyn, check the [Cyfrin official docs](https://support.cyfrin.io/en/articles/10456310-quickstart)

### Arguments

Expand All @@ -117,16 +125,16 @@ Usage: `aderyn [OPTIONS] <ROOT>`
`<ROOT>`: The path to the root of the codebase to be analyzed. Defaults to the current directory.

Options:
- `-s`, `--src`: Path to the source contracts. Used to avoid analyzing libraries, tests or scripts and focus on the contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used.
- In foundry projects, this is usually the `src/` folder unless stated otherwise in `foundry.toml`.
- In Hardhat projects, this is usually the `contracts/` folder unless stated otherwise in the config.
- `-i`, `--path-includes <PATH_INCLUDES>`: List of path strings to include, delimited by comma (no spaces). It allows to include only one or more specific contracts in the analysis. Any solidity file path not containing these strings will be ignored.
- `-x`, `--path-excludes <PATH_EXCLUDES>`: List of path strings to exclude, delimited by comma (no spaces). It allows to exclude one or more specific contracts from the analysis. Any solidity file path containing these strings will be ignored
- `-o`, `--output <OUTPUT>`: Desired file path for the final report (will overwrite the existing one) [default: report.md]
- `-n`, `--no-snippets`: Do not include code snippets in the report (reduces report size in large repos)
- `-h`, `--help`: Print help
- `-V`, `--version`: Print version

- `-s`, `--src`: Path to the source contracts. Used to avoid analyzing libraries, tests or scripts and focus on the contracts. If not provided, or if aderyn can't find famous files to read (like `foundry.toml`, which it automatically searches for) the ROOT directory will be used.
- In foundry projects, this is usually the `src/` folder unless stated otherwise in `foundry.toml`.
- In Hardhat projects, this is usually the `contracts/` folder unless stated otherwise in the config.
- `-i`, `--path-includes <PATH_INCLUDES>`: List of path strings to include, delimited by comma (no spaces). It allows to include only one or more specific contracts in the analysis. Any solidity file path not containing these strings will be ignored.
- `-x`, `--path-excludes <PATH_EXCLUDES>`: List of path strings to exclude, delimited by comma (no spaces). It allows to exclude one or more specific contracts from the analysis. Any solidity file path containing these strings will be ignored
- `-o`, `--output <OUTPUT>`: Desired file path for the final report (will overwrite the existing one) [default: report.md]
- `-n`, `--no-snippets`: Do not include code snippets in the report (reduces report size in large repos)
- `-h`, `--help`: Print help
- `-V`, `--version`: Print version

You must provide the root directory of the repo you want to analyze. Alternatively, you can provide a single Solidity file path (this mode requires [Foundry](https://book.getfoundry.sh/) to be installed).

Expand All @@ -135,27 +143,34 @@ Examples:
```sh
aderyn /path/to/your/foundry/project/root/directory/
```
Find more examples on the official [Cyfrin Docs](https://docs.cyfrin.io)

Find more examples on the official [Cyfrin Docs](https://support.cyfrin.io/en/)

## Building a custom Aderyn detector

Aderyn makes it easy to build Static Analysis detectors that can adapt to any Solidity codebase and protocol. This guide will teach you how to build, test, and run your custom Aderyn detectors.
To learn how to create your custom Aderyn detectors, [checkout the official docs](https://docs.cyfrin.io/aderyn-custom-detectors/detectors-quickstart)
To learn how to create your custom Aderyn detectors, [checkout the official docs](https://support.cyfrin.io/en/articles/10456310-quickstart)

## Docker

You can run Aderyn from a Docker container.
You can run Aderyn from a Docker container.

Build the image:

```sh
docker build -t aderyn .
```

`/path/to/project/root` should be the path to your Foundry or Hardhat project root directory and it will be mounted to `/share` in the container.

Run Aderyn:

```sh
docker run -v /path/to/project/root/:/share aderyn
```

Run with flags:

```sh
docker run -v /path/to/project/root/:/share aderyn -h
```
Expand All @@ -170,6 +185,7 @@ Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTIN
Aderyn is an open-source software licensed under the [GPL-3.0 License](./LICENSE).

To build Aderyn locally:

1. [Install Rust](https://www.rust-lang.org/tools/install),
2. Clone this repo and `cd aderyn/`,
3. `make`,
Expand All @@ -179,7 +195,6 @@ To build Aderyn locally:
[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


## Credits

This project exists thanks to all the people who [contribute](/CONTRIBUTING.md).<br>
Expand All @@ -189,10 +204,10 @@ This project exists thanks to all the people who [contribute](/CONTRIBUTING.md).
</a>

## Attribution
* AST Visitor code from [solc-ast-rs](https://github.com/hrkrshnn/solc-ast-rs).
* Original detectors based on [4naly3er](https://github.com/Picodes/4naly3er) detectors.
* Shoutout to the original king of static analysis [slither](https://github.com/crytic/slither).

- AST Visitor code from [solc-ast-rs](https://github.com/hrkrshnn/solc-ast-rs).
- Original detectors based on [4naly3er](https://github.com/Picodes/4naly3er) detectors.
- Shoutout to the original king of static analysis [slither](https://github.com/crytic/slither).

[contributors-shield]: https://img.shields.io/github/contributors/cyfrin/aderyn
[contributors-url]: https://github.com/cyfrin/aderyn/graphs/contributors
Expand Down

0 comments on commit 331fcc1

Please sign in to comment.