• Stars
    star
    359
  • Rank 118,537 (Top 3 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created about 1 year ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Aderyn 🦜 Rust-based Solidity AST analyzer.



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 Rust-based static analyzer specifically designed for Web3 smart contract security and development. 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.

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.

Docker

You can run Aderyn from Docker container.

Build the image:

  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:

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

Run with flags:

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

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>

<ROOT>: The path to the root of the codebase to be analyzed. Defaults to the current directory.

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 ./path/to/repo/

Refine the scope to a subdirectory called /uniswap/:

aderyn --scope uniswap ./path/to/repo/

Exclude a contract called Counter.sol:

aderyn --exclude Counter.sol ./path/to/repo/

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

More Repositories

1

foundry-full-course-cu

3,269
star
2

security-and-auditing-full-course-s23

The ultimate, most advanced, security, DeFi, assembly, web3 auditor course ever created.
Solidity
1,170
star
3

foundry-devops

Solidity
388
star
4

sc-exploits-minimized

A repo to showcase web3 hacks
Solidity
305
star
5

audit-report-templating

263
star
6

foundry-defi-stablecoin-cu

Solidity
236
star
7

audit-checklist

Aggregated audit checklist
171
star
8

cyfrin-audit-reports

A list of public audit reports conducted by the Cyfrin team
133
star
9

chainlink-lottery

A web3 implementation of a lottery using Chainlink VRF and Chainlink alarm clock to have a totally decentralized lottery
JavaScript
80
star
10

assembly-evm-opcodes-and-formal-verification-course

78
star
11

foundry-fund-me-cu

Solidity
74
star
12

forge-template

Solidity
62
star
13

OpenPositions

51
star
14

foundry-smart-contract-lottery-cu

Solidity
45
star
15

4-puppy-raffle-audit

Solidity
45
star
16

Updraft

Python
45
star
17

remix-simple-storage-cu

Solidity
43
star
18

2023-07-foundry-defi-stablecoin

Solidity
37
star
19

remix-fund-me-cu

Solidity
32
star
20

foundry-simple-storage-cu

Solidity
32
star
21

minimal-account-abstraction

Solidity
29
star
22

evm-wallet-and-post-deployment-course

29
star
23

TSender

A hyper gas optimized and formally verified smart contract, written in huff. 🐎
Solidity
27
star
24

remix-storage-factory-cu

Solidity
25
star
25

advanced-defi-2024

Solidity
24
star
26

foundry-upgrades-cu

Solidity
23
star
27

ctf

A minimal repo to create EVM/solidity capture the flags
Solidity
22
star
28

foundry-nft-cu

Solidity
21
star
29

foundry-erc20-cu

Solidity
21
star
30

8-vault-guardians-audit

Solidity
21
star
31

7-boss-bridge-audit

Solidity
20
star
32

alchemy_sdk_py

An SDK to use the Alchemy API
Python
19
star
33

1-horse-store-s23

C++
19
star
34

2023-07-beedle

Solidity
18
star
35

audit-repo-cloner

A Python package to clone a repo and automatically prepare it for audit report generation
Python
18
star
36

6-thunder-loan-audit

Solidity
18
star
37

5-t-swap-audit

Solidity
18
star
38

html-fund-me-cu

JavaScript
17
star
39

trello_to_audit_report

Python
17
star
40

2023-07-escrow

Solidity
16
star
41

3-passwordstore-audit

Makefile
16
star
42

gaboon

Python
16
star
43

codehawks-docs

πŸ¦… CodeHawks documentation
15
star
44

foundry-dao-cu

Solidity
13
star
45

2023-09-ditto

Solidity
13
star
46

chainlink_feeds

This gets the data from the Chainlink Price feeds in an easy way. Can use either an RPC_URL or the Chainlink Subgraph.
Python
13
star
47

2023-11-Thunder-Loan

Solidity
11
star
48

2023-10-PasswordStore

Solidity
11
star
49

2024-05-Sablier

Solidity
11
star
50

2024-07-zaros

Solidity
11
star
51

2023-08-sparkn

Solidity
10
star
52

foundry-era-contracts

Solidity
10
star
53

brownie-stablecoin-v23

Python
9
star
54

2023-10-SteadeFi

Solidity
9
star
55

zksync-contracts

Solidity
9
star
56

2023-12-the-standard

JavaScript
8
star
57

2-math-master-audit

Solidity
8
star
58

js-backend-engineer

7
star
59

2023-09-vyper-compiler

Vyper Compiler Audit competition
Python
7
star
60

2023-10-Puppy-Raffle

Solidity
7
star
61

diverge-converge-audit

TeX
7
star
62

2024-04-beanstalk-2

TypeScript
7
star
63

2024-07-ark-project

TypeScript
7
star
64

foundry-merkle-airdrop-cu

Solidity
7
star
65

3-gas-bad-nft-marketplace-audit

Solidity
6
star
66

2024-04-Beanstalk-DIB

Solidity
6
star
67

ccip-contracts

Solidity
6
star
68

2024-07-templegold

TypeScript
6
star
69

2024-02-Beanstalk-1

TypeScript
6
star
70

flux-link

View and withdraw your LINK in one command
Python
5
star
71

2024-05-Beanstalk-3

TypeScript
5
star
72

2024-05-beanstalk-the-finale

TypeScript
5
star
73

demo_code

Python
4
star
74

gas-optimization-tips

Contracts and Test for Gas optimization Article
Solidity
4
star
75

remix-favorites-cu

Vyper
4
star
76

2024-07-CL-CCIP

Solidity
4
star
77

2024-07-biconomy

Solidity
4
star
78

2024-08-tadle

Solidity
4
star
79

2024-08-fjord

Solidity
4
star
80

2023-12-stake-link

TypeScript
4
star
81

2024-01-Morpheus

TypeScript
4
star
82

chainlink-gmx-automation

High Frequency Price Automation for GMX, Using Chainlink Keeper Data Streams
Solidity
3
star
83

2024-03-Moonwell

Solidity
3
star
84

2023-11-Boss-Bridge

Solidity
3
star
85

2024-02-soulmate

Solidity
3
star
86

2023-11-Santas-List

Solidity
3
star
87

2023-12-Voting-Booth

Solidity
3
star
88

2024-06-Dussehra

Solidity
3
star
89

2024-05-TSender

Solidity
3
star
90

2024-04-Baba-Marta

Solidity
3
star
91

2024-07-Mondrian-Wallet_v2

Solidity
3
star
92

2024-08-steaking

Solidity
3
star
93

2024-08-kitty-fi

Solidity
3
star
94

2024-03-snek-raffle

Python
3
star
95

dup-hawk

AI Triage Bot - Groups and labels issues submitted to a CodeHawks audits
Python
2
star
96

2024-02-one-shot

Solidity
2
star
97

2024-01-horse-store

Solidity
2
star
98

2024-01-math-master

Solidity
2
star
99

2024-03-kitty-connect

Solidity
2
star
100

2024-05-Mondrian-Wallet

Solidity
2
star