Skip to content

Commit

Permalink
Staging: v0.0.11 (#108)
Browse files Browse the repository at this point in the history
Co-authored-by: Tilak Madichetti <[email protected]>
Co-authored-by: Ana <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2024
1 parent d1c9f55 commit 29e5e0b
Show file tree
Hide file tree
Showing 127 changed files with 6,278 additions and 1,072,511 deletions.
41 changes: 15 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ 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

Expand All @@ -117,6 +120,18 @@ Output to a different markdown file:
aderyn -o output.md .
```

Refine the scope to a subdirectory called `/uniswap/`:

```sh
aderyn . --scope uniswap
```

Exclude a contract called `Counter.sol`:

```sh
aderyn . --exclude Counter.sol
```

Run on a single Solidity file (requires [Foundry](https://book.getfoundry.sh/) to be installed on your machine):

```sh
Expand All @@ -139,32 +154,6 @@ If Hardhat is detected, Aderyn does not auto-compile. Make sure to run `hardhat

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.

# Roadmap

**Medium-term goals - Auditor Aid:**
* [x] Support Multiple Abstract Syntax Trees representing multiple Solidity files
* [x] Support Foundry/Hardhat/Truffle/Solc output formats for ingesting AST
* [x] Foundry
* [x] Hardhat
* [x] Markdown and JSON output
* [x] Yul Support
* [ ] Complexity metrics
* [ ] More complex static analysis detectors
* [ ] auto-fixes
* [ ] installer that doesn't require Rust (aderynup)
* [ ] Python bindings
* [ ] JS/TS bindings
* [ ] VSCode Extension

**Long-term goals - Product**

* [ ] Provide automated gas optimizations
* [ ] Custom subscribable detectors
* [ ] Control/data flow analyses
* [ ] Symbolic execution
* [ ] Invariant handler generation
* [ ] Vyper support

## Contributing & License

Help us build Aderyn 🦜 Please see our [contribution guidelines](./CONTRIBUTING.md).
Expand Down
17 changes: 17 additions & 0 deletions aderyn/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ pub struct CommandLineArgs {
/// Desired file path for the final report (will overwrite existing one)
#[arg(short, long, default_value = "report.md")]
output: String,

/// List of path strings to include, delimited by comma (no spaces).
/// Any solidity file path not containing these strings will be ignored
#[clap(short, long, use_value_delimiter = true)]
scope: Option<Vec<String>>,

/// List of path strings to exclude, delimited by comma (no spaces).
/// Any solidity file path containing these strings will be ignored
#[clap(short, long, use_value_delimiter = true)]
exclude: Option<Vec<String>>,

/// Do not include code snippets in the report (reduces report size in large repos)
#[arg(short, long)]
no_snippets: bool,
}

fn main() {
Expand All @@ -18,6 +32,9 @@ fn main() {
let args: Args = Args {
root: cmd_args.root,
output: cmd_args.output,
scope: cmd_args.scope,
exclude: cmd_args.exclude,
no_snippets: cmd_args.no_snippets,
};

driver::drive(args);
Expand Down
6 changes: 3 additions & 3 deletions aderyn_core/src/ast/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ impl Node for FunctionTypeName {
#[serde(rename_all = "camelCase")]
pub struct ArrayTypeName {
pub base_type: Box<TypeName>,
pub length: Option<Literal>,
pub length: Box<Option<Expression>>,
pub type_descriptions: TypeDescriptions,
}

impl Node for ArrayTypeName {
fn accept(&self, visitor: &mut impl ASTConstVisitor) -> Result<()> {
if visitor.visit_array_type_name(self)? {
self.base_type.accept(visitor)?;
if self.length.is_some() {
self.length.as_ref().unwrap().accept(visitor)?;
if let Some(length) = self.length.as_ref() {
length.accept(visitor)?;
}
}
visitor.end_visit_array_type_name(self)
Expand Down
29 changes: 0 additions & 29 deletions aderyn_core/src/context/browser/assignments.rs

This file was deleted.

58 changes: 0 additions & 58 deletions aderyn_core/src/context/browser/binary_checks.rs

This file was deleted.

Loading

0 comments on commit 29e5e0b

Please sign in to comment.