@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 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="../.github/images/aderyn_logo.png" width="400" alt=""/></a>
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="../.github/images/poweredbycyfrinblue.png" width="145" alt=""/></a>
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://docs.cyfrin.io">Docs</a>
26
- <a href="https://discord.gg/cyfrin">Get support</a>
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
- 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.
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
- 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.
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
- You can read the [Cyfrin official documentation](https://docs.cyfrin.io) for an in-depth look at Aderyn's functionalities.
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
- * Supports any development framework (Foundry/Hardhat/Truffle/etc)
57
- * Modular [detectors](../aderyn_core/src/detect/)
58
- * AST Traversal
59
- * Markdown reports
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
- **Suggested VSCode extensions:**
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
- > Note: If you previously installed aderyn using cargo, run `cargo uninstall aderyn` before using `cyfrinup` to avoid conflicts.
55
+ **Cyfrinup** is the cross platform installation manager for Cyfrin tools.
70
56
 
71
- #### Step 1: Install Cyfrinup
57
+ [One time setup](https://github.com/Cyfrin/up).
72
58
 
73
- Cyfrinup is a CLI tool that simplifies the installation and management of Cyfrin tools. To install Cyfrinup, run the following command in your terminal:
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
- #### Step 2: Update Path
61
+ Run `cyfrinup` to upgrade everything to the latest version.
80
62
 
81
- The installer will prompt you to run a `source` command. Either run this command, or reload your terminal.
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
- #### Step 4: Verify installation
65
+ ### Using curl
92
66
 
93
67
  ```sh
94
- aderyn --version
68
+ curl --proto '=https' --tlsv1.2 -LsSf https://github.com/cyfrin/aderyn/releases/latest/download/aderyn-installer.sh | bash
95
69
  ```
96
70
 
97
- #### Future Updates
71
+ ##### Upgrade older versions by running: `aderyn-update`
98
72
 
99
- To update Aderyn to the latest version, you can run the cyfrinup:
100
- ```sh
101
- cyfrinup
102
- ```
103
- Cyfrinup will replace the existing version with the latest one.
73
+ ---
104
74
 
105
- ## Quick Start
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
- cd aderyn-contracts-playground
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
- `<ROOT>`: The path to the root of the codebase to be analyzed. Defaults to the current directory.
81
+ ##### Upgrade older versions by running: `brew upgrade cyfrin/tap/aderyn`
133
82
 
134
- Options:
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
- Examples:
85
+ ### Using npm
149
86
 
150
87
  ```sh
151
- aderyn /path/to/your/foundry/project/root/directory/
88
+ npm install @cyfrin/aderyn -g
152
89
  ```
153
- Find more examples on the official [Cyfrin Docs](https://docs.cyfrin.io)
154
90
 
155
- ## Building a custom Aderyn detector
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
- ## Docker
93
+ ---
160
94
 
161
- You can run Aderyn from a Docker container.
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
- Build the image:
164
- ```sh
165
- docker build -t aderyn .
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
- Run with flags:
174
- ```sh
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
- ## Single Solidity File Mode
106
+ This generates a [report.md](https://github.com/Cyfrin/aderyn/blob/dev/reports/report.md)
179
107
 
180
- 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.
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
- To build Aderyn locally:
188
- 1. [Install Rust](https://www.rust-lang.org/tools/install),
189
- 2. Clone this repo and `cd aderyn/`,
190
- 3. `make`,
191
- 4. Use [`cargo`](https://doc.rust-lang.org/cargo/getting-started/first-steps.html) commands to build, test and run locally.
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](../CONTRIBUTING.md).<br>
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
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "@cyfrin/aderyn",
26
- "version": "0.5.7"
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.7"
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.7",
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.7",
66
+ "version": "0.5.10",
81
67
  "volta": {
82
68
  "node": "18.14.1",
83
69
  "npm": "9.5.0"