@cyfrin/aderyn 0.5.6 → 0.5.8
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 +55 -121
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
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,113 @@
|
|
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 code with ease.
|
54
40
|
|
55
41
|
## Features
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
42
|
+
|
43
|
+
- Off the shelf support for Foundry projects.
|
44
|
+
- Off the shelf support for Hardhat projects. (Sometimes `remappings.txt` maybe required)
|
45
|
+
- Configuration file (`adeyrn.toml`) needed to support custom frameworks.
|
46
|
+
- Markdown, JSON and Sarif reports
|
60
47
|
|
61
48
|
## Installation
|
62
49
|
|
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
|
50
|
+
> **NOTE** Windows users must have WSL installed
|
66
51
|
|
67
52
|
### Using Cyfrinup
|
68
53
|
|
69
|
-
|
54
|
+
**Cyfrinup** is the cross platform installation manager for Cyfrin tools.
|
70
55
|
|
71
|
-
|
56
|
+
[One time setup](https://github.com/Cyfrin/up).
|
72
57
|
|
73
|
-
|
74
|
-
|
75
|
-
```sh
|
76
|
-
curl -L https://raw.githubusercontent.com/Cyfrin/aderyn/dev/cyfrinup/install | bash
|
77
|
-
```
|
58
|
+
Run `aderyn --version` to check the installation.
|
78
59
|
|
79
|
-
|
60
|
+
Run `cyfrinup` to upgrade everything to the latest version.
|
80
61
|
|
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
|
-
```
|
62
|
+
---
|
90
63
|
|
91
|
-
|
64
|
+
### Using curl
|
92
65
|
|
93
66
|
```sh
|
94
|
-
aderyn
|
67
|
+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cyfrin/aderyn/releases/latest/download/aderyn-installer.sh | bash
|
95
68
|
```
|
96
69
|
|
97
|
-
|
70
|
+
##### Upgrade older versions by running: `aderyn-update`
|
98
71
|
|
99
|
-
|
100
|
-
```sh
|
101
|
-
cyfrinup
|
102
|
-
```
|
103
|
-
Cyfrinup will replace the existing version with the latest one.
|
72
|
+
---
|
104
73
|
|
105
|
-
|
106
|
-
Once Aderyn is installed on your system, you can run it against your Foundry-based codebase to find vulnerabilities in your code.
|
74
|
+
### Using Homebrew
|
107
75
|
|
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
76
|
```sh
|
114
|
-
|
77
|
+
brew install cyfrin/tap/aderyn
|
115
78
|
```
|
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
79
|
|
132
|
-
|
80
|
+
##### Upgrade older versions by running: `brew upgrade cyfrin/tap/aderyn`
|
133
81
|
|
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).
|
82
|
+
---
|
147
83
|
|
148
|
-
|
84
|
+
### Using npm
|
149
85
|
|
150
86
|
```sh
|
151
|
-
aderyn
|
87
|
+
npm install @cyfrin/aderyn -g
|
152
88
|
```
|
153
|
-
Find more examples on the official [Cyfrin Docs](https://docs.cyfrin.io)
|
154
89
|
|
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)
|
90
|
+
##### Upgrade older versions by (re)running: `npm install @cyfrin/aderyn -g`
|
158
91
|
|
159
|
-
|
92
|
+
---
|
160
93
|
|
161
|
-
|
94
|
+
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
95
|
|
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.
|
96
|
+
## Quick Start
|
97
|
+
|
98
|
+
[Quick Start](https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/quickstart) example with video guide.
|
168
99
|
|
169
|
-
Run Aderyn:
|
170
|
-
```sh
|
171
|
-
docker run -v /path/to/project/root/:/share aderyn
|
172
100
|
```
|
173
|
-
|
174
|
-
|
175
|
-
docker run -v /path/to/project/root/:/share aderyn -h
|
101
|
+
cd path/to/solidity/project/root
|
102
|
+
aderyn
|
176
103
|
```
|
177
104
|
|
178
|
-
|
105
|
+
This generates a [report.md](https://github.com/Cyfrin/aderyn/blob/dev/reports/report.md)
|
179
106
|
|
180
|
-
|
107
|
+
See examples using more CLI options [here](https://cyfrin.gitbook.io/cyfrin-docs/cli-options)
|
108
|
+
|
109
|
+
## VS Code extension
|
110
|
+
|
111
|
+
Officially supported [VSCode extension](https://github.com/Cyfrin/vscode-aderyn/) for Aderyn.
|
112
|
+
Download from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=Cyfrin.aderyn&ssr=false#overview)
|
181
113
|
|
182
114
|
## Contributing & License
|
183
115
|
|
184
|
-
Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTING.md).
|
116
|
+
Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTING.md) for in-depth developer environment setup and PR approval process.
|
185
117
|
Aderyn is an open-source software licensed under the [GPL-3.0 License](./LICENSE).
|
186
118
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
119
|
+
## Building a custom Aderyn detector
|
120
|
+
|
121
|
+
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.
|
122
|
+
To learn how to create your custom Aderyn detectors, [checkout the official docs](https://cyfrin.gitbook.io/cyfrin-docs/aderyn-cli/detectors-quickstart)
|
123
|
+
|
192
124
|
|
193
125
|
## Credits
|
194
126
|
|
195
|
-
This project exists thanks to all the people who [contribute](
|
127
|
+
This project exists thanks to all the people who [contribute](/CONTRIBUTING.md).<br>
|
196
128
|
|
197
129
|
<a href="https://github.com/cyfrin/Aderyn/graphs/contributors">
|
198
130
|
<img src="https://contrib.rocks/image?repo=cyfrin/Aderyn" />
|
199
131
|
</a>
|
200
132
|
|
201
133
|
## 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
134
|
|
135
|
+
- AST Visitor code from [solc-ast-rs](https://github.com/hrkrshnn/solc-ast-rs).
|
136
|
+
- Foundry Compilers for backend AST generation [foundry-compilers](https://github.com/foundry-rs/compilers)
|
137
|
+
- Original detectors based on [4naly3er](https://github.com/Picodes/4naly3er) detectors.
|
138
|
+
- Shoutout to the original king of static analysis [slither](https://github.com/crytic/slither).
|
139
|
+
- Solidity AST Generator [solidity-ast-rs](https://github.com/Cyfrin/solidity-ast-rs).
|
206
140
|
|
207
141
|
[contributors-shield]: https://img.shields.io/github/contributors/cyfrin/aderyn
|
208
142
|
[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.8"
|
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.8"
|
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.8",
|
3
3
|
"author": "Cyfrin <aderyn@cyfrin.io>",
|
4
4
|
"bin": {
|
5
5
|
"aderyn": "run-aderyn.js"
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"zipExt": ".tar.xz"
|
78
78
|
}
|
79
79
|
},
|
80
|
-
"version": "0.5.
|
80
|
+
"version": "0.5.8",
|
81
81
|
"volta": {
|
82
82
|
"node": "18.14.1",
|
83
83
|
"npm": "9.5.0"
|