Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging v0.0.10 #99

Merged
merged 9 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Yul Support & Multiple Foundry Compiler Support (#92)
  • Loading branch information
alexroan authored Dec 19, 2023
commit 0d4674321038903343970b22d1020a3a935ddce3
8 changes: 6 additions & 2 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ jobs:
args: -- -o report2.md ./tests/contract-playground/

- name: Check report.md vs report2.md
run: diff report.md report2.md
run: |
cat report2.md
diff report.md report2.md

- name: Generate report2.json
uses: actions-rs/cargo@v1
Expand All @@ -71,7 +73,9 @@ jobs:
args: -- -o report2.json ./tests/contract-playground/

- name: Check report.json vs report2.json
run: diff report.json report2.json
run: |
cat report2.json
diff report.json report2.json

lints:
name: Lints
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,15 @@ If it is a Solidity file path, then Aderyn will create a temporary Foundry proje
* [x] Support Foundry/Hardhat/Truffle/Solc output formats for ingesting AST
* [x] Foundry
* [x] Hardhat
* [ ] Complexity score (with Percentage YUL code & nsloc)
* [x] Markdown and JSON output
* [x] Yul Support
* [ ] Complexity metrics
* [ ] More complex static analysis detectors
* [ ] auto-fixes
* [ ] installer that doesn't require Rust (aderynup)
* [ ] VSCode Extension
* [ ] Python bindings
* [ ] JS/TS bindings
* [ ] VSCode Extension

**Long-term goals - Product**

Expand Down
3 changes: 2 additions & 1 deletion aderyn_core/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ mod types;
mod user_defined_value_types;
mod using_for_directives;
mod variables;
mod yul;

pub use self::{
blocks::*, contracts::*, documentation::*, enumerations::*, errors::*, events::*,
expressions::*, functions::*, identifiers::*, import_directives::*, literals::*, magic::*,
modifiers::*, node::*, pragma_directives::*, source_units::*, statements::*, structures::*,
types::*, user_defined_value_types::*, using_for_directives::*, variables::*,
types::*, user_defined_value_types::*, using_for_directives::*, variables::*, yul::*,
};
12 changes: 6 additions & 6 deletions aderyn_core/src/ast/statements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Display for Statement {
Statement::UncheckedBlock(stmt) => stmt.fmt(f),
Statement::Return(stmt) => stmt.fmt(f),
Statement::ExpressionStatement(stmt) => stmt.fmt(f),
Statement::InlineAssembly(_) => {
Statement::InlineAssembly(..) => {
f.write_str("assembly { /* WARNING: not implemented */ }")
}
Statement::UnhandledStatement { node_type, .. } => match node_type {
Expand Down Expand Up @@ -464,20 +464,20 @@ impl Display for Return {
#[derive(Clone, Debug, Deserialize, Eq, Serialize, PartialEq, Hash)]
#[serde(rename_all = "camelCase")]
pub struct InlineAssembly {
// FIXME
#[serde(rename = "AST")]
pub ast: Option<()>,
pub ast: Option<YulBlock>,
pub evm_version: Option<String>,
// FIXME
pub external_references: Vec<()>,
pub external_references: Vec<ExternalReference>,
pub operations: Option<String>,
pub src: String,
pub id: NodeID,
}

impl Node for InlineAssembly {
fn accept(&self, visitor: &mut impl ASTConstVisitor) -> Result<()> {
visitor.visit_inline_assembly(self)?;
if visitor.visit_inline_assembly(self)? && self.ast.is_some() {
self.ast.as_ref().unwrap().accept(visitor)?;
}
visitor.end_visit_inline_assembly(self)
}
}
Loading
Loading