@cyfrin/aderyn 0.5.7 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -121
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -16
package/README.md
CHANGED
@@ -1,14 +1,7 @@
|
|
1
|
-
|
2
|
-
> ⚠️ **Installing via crates is no longer fully supported. `cyfrinup` is the preferred installation method.**.
|
3
|
-
>
|
4
|
-
> For the best experience, please remove the legacy crate installation by running `cargo uninstall aderyn`, and use `cyfrinup` instead.
|
5
|
-
>
|
6
|
-
> Full install instructions are [here](#installation).
|
7
|
-
|
8
1
|
<p align="center">
|
9
2
|
<br />
|
10
3
|
<a href="https://cyfrin.io/">
|
11
|
-
<img src="
|
4
|
+
<img src="https://github.com/Cyfrin/aderyn/blob/dev/.github/images/aderyn_logo.png" width="400" alt=""/></a>
|
12
5
|
<br />
|
13
6
|
</p>
|
14
7
|
<p align="center"><strong>A powerful Solidity static analyzer that takes a bird's eye view over your smart contracts.
|
@@ -16,15 +9,13 @@
|
|
16
9
|
<p align="center">
|
17
10
|
<br />
|
18
11
|
<a href="https://cyfrin.io/">
|
19
|
-
<img src="
|
12
|
+
<img src="https://github.com/Cyfrin/aderyn/blob/dev/.github/images/poweredbycyfrinblue.png" width="145" alt=""/></a>
|
20
13
|
<br />
|
21
14
|
</p>
|
22
15
|
|
23
|
-
|
24
16
|
<p align="center">
|
25
|
-
<a href="https://
|
26
|
-
<a href="https://discord.gg/cyfrin">
|
27
|
-
<a href="https://cyfrin.io">Website</a>
|
17
|
+
<a href="https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/readme">Docs</a>
|
18
|
+
<a href="https://discord.gg/cyfrin">Discord</a>
|
28
19
|
<a href="https://twitter.com/cyfrinaudits">Twitter</a>
|
29
20
|
<p>
|
30
21
|
|
@@ -39,170 +30,114 @@
|
|
39
30
|
|
40
31
|
</div>
|
41
32
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
33
|
## What is Aderyn?
|
47
|
-
**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.
|
48
34
|
|
49
|
-
|
35
|
+
**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.
|
50
36
|
|
51
|
-
|
37
|
+
You can read the [Cyfrin official documentation](https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/readme) for an in-depth look at Aderyn's functionalities.
|
52
38
|
|
53
|
-
|
39
|
+
There is also an officially supported [VSCode extension](https://github.com/Cyfrin/vscode-aderyn/) for Aderyn. Download from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Cyfrin.aderyn&ssr=false#overview) and start identifying vulnerabilities in your Solidity
|
40
|
+
code with ease.
|
54
41
|
|
55
42
|
## Features
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
43
|
+
|
44
|
+
- Off the shelf support for Foundry projects.
|
45
|
+
- Off the shelf support for Hardhat projects. (Sometimes `remappings.txt` maybe required)
|
46
|
+
- Configuration file (`adeyrn.toml`) needed to support custom frameworks.
|
47
|
+
- Markdown, JSON and Sarif reports
|
60
48
|
|
61
49
|
## Installation
|
62
50
|
|
63
|
-
**
|
64
|
-
[rust-analyzer](https://marketplace.visualstudio.com/items?itemName=dustypomerleau.rust-syntax) - Rust language support for Visual Studio Code
|
65
|
-
[Rust Syntax](https://marketplace.visualstudio.com/items?itemName=dustypomerleau.rust-syntax) - Improved Rust syntax highlighting
|
51
|
+
> **NOTE** Windows users must have WSL installed
|
66
52
|
|
67
53
|
### Using Cyfrinup
|
68
54
|
|
69
|
-
|
55
|
+
**Cyfrinup** is the cross platform installation manager for Cyfrin tools.
|
70
56
|
|
71
|
-
|
57
|
+
[One time setup](https://github.com/Cyfrin/up).
|
72
58
|
|
73
|
-
|
74
|
-
|
75
|
-
```sh
|
76
|
-
curl -L https://raw.githubusercontent.com/Cyfrin/aderyn/dev/cyfrinup/install | bash
|
77
|
-
```
|
59
|
+
Run `aderyn --version` to check the installation.
|
78
60
|
|
79
|
-
|
61
|
+
Run `cyfrinup` to upgrade everything to the latest version.
|
80
62
|
|
81
|
-
|
82
|
-
|
83
|
-
#### Step 3: Install Aderyn using Cyfrinup
|
84
|
-
|
85
|
-
After installing Cyfrinup, you can use it to install Aderyn. Run the following command in your terminal:
|
86
|
-
|
87
|
-
```sh
|
88
|
-
cyfrinup
|
89
|
-
```
|
63
|
+
---
|
90
64
|
|
91
|
-
|
65
|
+
### Using curl
|
92
66
|
|
93
67
|
```sh
|
94
|
-
aderyn
|
68
|
+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cyfrin/aderyn/releases/latest/download/aderyn-installer.sh | bash
|
95
69
|
```
|
96
70
|
|
97
|
-
|
71
|
+
##### Upgrade older versions by running: `aderyn-update`
|
98
72
|
|
99
|
-
|
100
|
-
```sh
|
101
|
-
cyfrinup
|
102
|
-
```
|
103
|
-
Cyfrinup will replace the existing version with the latest one.
|
73
|
+
---
|
104
74
|
|
105
|
-
|
106
|
-
Once Aderyn is installed on your system, you can run it against your Foundry-based codebase to find vulnerabilities in your code.
|
75
|
+
### Using Homebrew
|
107
76
|
|
108
|
-
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:
|
109
|
-
```sh
|
110
|
-
git clone https://github.com/Cyfrin/aderyn-contracts-playground.git
|
111
|
-
```
|
112
|
-
Navigate inside the repository:
|
113
77
|
```sh
|
114
|
-
|
78
|
+
brew install cyfrin/tap/aderyn
|
115
79
|
```
|
116
|
-
We usually use several smart contracts and tests to try new detectors. Build the contracts by running:
|
117
|
-
```sh
|
118
|
-
forge build
|
119
|
-
```
|
120
|
-
Once your smart contracts have been successfully compiled, run Aderyn using the following command:
|
121
|
-
```sh
|
122
|
-
aderyn [OPTIONS] path/to/your/project
|
123
|
-
```
|
124
|
-
Replace [OPTIONS] with specific command-line arguments as needed.
|
125
|
-
|
126
|
-
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)
|
127
|
-
|
128
|
-
### Arguments
|
129
|
-
|
130
|
-
Usage: `aderyn [OPTIONS] <ROOT>`
|
131
80
|
|
132
|
-
|
81
|
+
##### Upgrade older versions by running: `brew upgrade cyfrin/tap/aderyn`
|
133
82
|
|
134
|
-
|
135
|
-
- `-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.
|
136
|
-
- In foundry projects, this is usually the `src/` folder unless stated otherwise in `foundry.toml`.
|
137
|
-
- In Hardhat projects, this is usually the `contracts/` folder unless stated otherwise in the config.
|
138
|
-
- `-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.
|
139
|
-
- `-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
|
140
|
-
- `-o`, `--output <OUTPUT>`: Desired file path for the final report (will overwrite the existing one) [default: report.md]
|
141
|
-
- `-n`, `--no-snippets`: Do not include code snippets in the report (reduces report size in large repos)
|
142
|
-
- `-h`, `--help`: Print help
|
143
|
-
- `-V`, `--version`: Print version
|
144
|
-
|
145
|
-
|
146
|
-
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).
|
83
|
+
---
|
147
84
|
|
148
|
-
|
85
|
+
### Using npm
|
149
86
|
|
150
87
|
```sh
|
151
|
-
aderyn
|
88
|
+
npm install @cyfrin/aderyn -g
|
152
89
|
```
|
153
|
-
Find more examples on the official [Cyfrin Docs](https://docs.cyfrin.io)
|
154
90
|
|
155
|
-
|
156
|
-
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.
|
157
|
-
To learn how to create your custom Aderyn detectors, [checkout the official docs](https://docs.cyfrin.io/aderyn-custom-detectors/detectors-quickstart)
|
91
|
+
##### Upgrade older versions by (re)running: `npm install @cyfrin/aderyn -g`
|
158
92
|
|
159
|
-
|
93
|
+
---
|
160
94
|
|
161
|
-
|
95
|
+
If you are installing with Curl or 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.
|
162
96
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
```
|
167
|
-
`/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.
|
97
|
+
## Quick Start
|
98
|
+
|
99
|
+
[Quick Start](https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/quickstart) example with video guide.
|
168
100
|
|
169
|
-
Run Aderyn:
|
170
|
-
```sh
|
171
|
-
docker run -v /path/to/project/root/:/share aderyn
|
172
101
|
```
|
173
|
-
|
174
|
-
|
175
|
-
docker run -v /path/to/project/root/:/share aderyn -h
|
102
|
+
cd path/to/solidity/project/root
|
103
|
+
aderyn
|
176
104
|
```
|
177
105
|
|
178
|
-
|
106
|
+
This generates a [report.md](https://github.com/Cyfrin/aderyn/blob/dev/reports/report.md)
|
179
107
|
|
180
|
-
|
108
|
+
See examples using more CLI options [here](https://cyfrin.gitbook.io/cyfrin-docs/cli-options)
|
109
|
+
|
110
|
+
## VS Code extension
|
111
|
+
|
112
|
+
Officially supported [VSCode extension](https://github.com/Cyfrin/vscode-aderyn/) for Aderyn.
|
113
|
+
Download from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Cyfrin.aderyn&ssr=false#overview)
|
181
114
|
|
182
115
|
## Contributing & License
|
183
116
|
|
184
|
-
Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTING.md).
|
117
|
+
Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTING.md) for in-depth developer environment setup and PR approval process.
|
185
118
|
Aderyn is an open-source software licensed under the [GPL-3.0 License](./LICENSE).
|
186
119
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
120
|
+
## Building a custom Aderyn detector
|
121
|
+
|
122
|
+
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.
|
123
|
+
To learn how to create your custom Aderyn detectors, [checkout the official docs](https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/detectors-quickstart)
|
124
|
+
|
192
125
|
|
193
126
|
## Credits
|
194
127
|
|
195
|
-
This project exists thanks to all the people who [contribute](
|
128
|
+
This project exists thanks to all the people who [contribute](/CONTRIBUTING.md).<br>
|
196
129
|
|
197
130
|
<a href="https://github.com/cyfrin/Aderyn/graphs/contributors">
|
198
131
|
<img src="https://contrib.rocks/image?repo=cyfrin/Aderyn" />
|
199
132
|
</a>
|
200
133
|
|
201
134
|
## Attribution
|
202
|
-
* AST Visitor code from [solc-ast-rs](https://github.com/hrkrshnn/solc-ast-rs).
|
203
|
-
* Original detectors based on [4naly3er](https://github.com/Picodes/4naly3er) detectors.
|
204
|
-
* Shoutout to the original king of static analysis [slither](https://github.com/crytic/slither).
|
205
135
|
|
136
|
+
- AST Visitor code from [solc-ast-rs](https://github.com/hrkrshnn/solc-ast-rs).
|
137
|
+
- Foundry Compilers for backend AST generation [foundry-compilers](https://github.com/foundry-rs/compilers)
|
138
|
+
- Original detectors based on [4naly3er](https://github.com/Picodes/4naly3er) detectors.
|
139
|
+
- Shoutout to the original king of static analysis [slither](https://github.com/crytic/slither).
|
140
|
+
- Solidity AST Generator [solidity-ast-rs](https://github.com/Cyfrin/solidity-ast-rs).
|
206
141
|
|
207
142
|
[contributors-shield]: https://img.shields.io/github/contributors/cyfrin/aderyn
|
208
143
|
[contributors-url]: https://github.com/cyfrin/aderyn/graphs/contributors
|
package/npm-shrinkwrap.json
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
"hasInstallScript": true,
|
24
24
|
"license": "MIT",
|
25
25
|
"name": "@cyfrin/aderyn",
|
26
|
-
"version": "0.5.
|
26
|
+
"version": "0.5.10"
|
27
27
|
},
|
28
28
|
"node_modules/@isaacs/cliui": {
|
29
29
|
"dependencies": {
|
@@ -713,5 +713,5 @@
|
|
713
713
|
}
|
714
714
|
},
|
715
715
|
"requires": true,
|
716
|
-
"version": "0.5.
|
716
|
+
"version": "0.5.10"
|
717
717
|
}
|
package/package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"artifactDownloadUrl": "https://github.com/cyfrin/aderyn/releases/download/aderyn-v0.5.
|
2
|
+
"artifactDownloadUrl": "https://github.com/cyfrin/aderyn/releases/download/aderyn-v0.5.10",
|
3
3
|
"author": "Cyfrin <aderyn@cyfrin.io>",
|
4
4
|
"bin": {
|
5
5
|
"aderyn": "run-aderyn.js"
|
@@ -61,23 +61,9 @@
|
|
61
61
|
"aderyn": "aderyn"
|
62
62
|
},
|
63
63
|
"zipExt": ".tar.xz"
|
64
|
-
},
|
65
|
-
"x86_64-unknown-linux-musl-dynamic": {
|
66
|
-
"artifactName": "aderyn-x86_64-unknown-linux-musl.tar.xz",
|
67
|
-
"bins": {
|
68
|
-
"aderyn": "aderyn"
|
69
|
-
},
|
70
|
-
"zipExt": ".tar.xz"
|
71
|
-
},
|
72
|
-
"x86_64-unknown-linux-musl-static": {
|
73
|
-
"artifactName": "aderyn-x86_64-unknown-linux-musl.tar.xz",
|
74
|
-
"bins": {
|
75
|
-
"aderyn": "aderyn"
|
76
|
-
},
|
77
|
-
"zipExt": ".tar.xz"
|
78
64
|
}
|
79
65
|
},
|
80
|
-
"version": "0.5.
|
66
|
+
"version": "0.5.10",
|
81
67
|
"volta": {
|
82
68
|
"node": "18.14.1",
|
83
69
|
"npm": "9.5.0"
|