Giter VIP home page Giter VIP logo

aderyn's Introduction



A powerful Solidity static analyzer that takes a bird's eye view over your smart contracts.



Twitter Website Discord


Stargazers Forks Contributors Issues MIT License

What is Aderyn?

Aderyn is a Solidity Static Analyzer. It takes a bird's eye view over your smart contracts, traversing the Abstract Syntax Trees (AST) to pinpoint suspected vulnerabilities. Aderyn prints out these potential issues in an easy-to-consume markdown format.

When/Why to Use it?

Use Aderyn when developing or auditing Solidity smart contracts to quickly identify areas where the code may not be following best practices or has potential vulnerabilities.

Features

Usage

To get started using Aderyn make sure to have Rust installed on your device. For more information, refer to the official Rust documentation.

Mac, Linux, Unix

You can install Rust and Cargo by running the following command on your terminal:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Windows

You can install Rust and Cargo by downloading and running rustup-init.exe.

Installation

In the command line, run:

cargo install aderyn

Quick Start

The root path you're running Aderyn on should be either a Foundry or compiled Hardhat project.

aderyn /path/to/your/foundry/project/root/directory/

That's it! Aderyn identifies whether the project root is a Foundry or Hardhat repo, then uses the compiled AST files to hunt for vulnerabilities.

report.md will be output in the directory in which you ran the command.

Arguments

Usage: aderyn [OPTIONS] <ROOT>

Options:

  • -o, --output <OUTPUT>: Desired file path for the final report (will overwrite existing one) [default: report.md]
  • -s, --scope <SCOPE>: List of path strings to include, delimited by comma (no spaces). Any solidity file path not containing these strings will be ignored
  • -e, --exclude <EXCLUDE>: List of path strings to exclude, delimited by comma (no spaces). Any solidity file path containing these strings will be ignored
  • -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 filepath (this mode requires Foundry to be installed).

Examples:

aderyn /path/to/your/foundry/project/root/directory/

Run Aderyn in the folder you're currently in:

aderyn .

Output to a different markdown file:

aderyn -o output.md .

Refine the scope to a subdirectory called /uniswap/:

aderyn . --scope uniswap

Exclude a contract called Counter.sol:

aderyn . --exclude Counter.sol

Run on a single Solidity file (requires Foundry to be installed on your machine):

aderyn src/MyContract.sol

Supported Development Frameworks

If the <ROOT> is a directory, Aderyn automatically detects the development framework so long as it's Foundry or Hardhat.

Foundry

If Foundry is detected in the project root, Aderyn will first run forge build to ensure that the contract compiles correctly and the latest artifacts are available.

Hardhat

If Hardhat is detected, Aderyn does not auto-compile. Make sure to run hardhat compile BEFORE running Aderyn.

Single Solidity File Mode

If it is a Solidity file path, then Aderyn will create a temporary Foundry project, copy the contract into it, compile the contract and then analyze the AST generated by that temporary project.

Contributing & License

Help us build Aderyn ๐Ÿฆœ Please see our contribution guidelines. Aderyn is an open source software licensed under the MIT License.

To build Aderyn locally, install Rust, clone this repo, and use cargo commands to build, test and run locally

Credits

This project exists thanks to all the people who contribute.

Attribution

aderyn's People

Contributors

alexroan avatar anaarsonist avatar tilakmaddy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.