Skip to content

Commit

Permalink
callgraph structure
Browse files Browse the repository at this point in the history
  • Loading branch information
TilakMaddy committed Sep 24, 2024
1 parent 8fb8547 commit 14a330c
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions aderyn_core/src/context/graph/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod callgraph;
mod callgraph_tests;
mod serialize_callgraph;
mod traits;
mod workspace_callgraph;

Expand Down
64 changes: 64 additions & 0 deletions aderyn_core/src/context/graph/serialize_callgraph.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
use crate::context::workspace_context::WorkspaceContext;

use super::WorkspaceCallGraph;

// Define a JSON structure that represents a call graph
//
// {
//
// ID -> Metadata
//
// "contracts" : {
// "0": {
// "name": "C1",
// "state_var_ids" : [
// "12", "11", "10"
// ],
// "modifier_ids": [
// "6", "7", "8"
// ],
// "func_ids": [
// "1", "2", "3"
// ],
// },
// "1": {
// ...
// }
// },
// "state_variable_ids": {
// "12": {
// name: "s_count",
// visibility: "..."
// },
// ...
// },
// "functions": {
// "1" : {
// name: "_func1",
// visibility: "internal" | "public" | "external" | "external"
// },
// ...
// }
// "modifiers": {
// "1" : {
// name: "_modif1",
// visibility: "internal" | "public" | "external" | "external"
// },
// ...
// },
//
// // adjacency list representation of callgraph
// // every node id in raw_callgraph represents a modifier or a function
//
// "raw_callgraph" : {
// "1": ["2", "3"],
// "2": ["1", "5"],
// ...
// }
//
//
// }

impl WorkspaceCallGraph {
fn serialize(context: &WorkspaceContext) {}

Check failure on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Lints

unused variable: `context`

Check failure on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Lints

associated function `serialize` is never used

Check failure on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Lints

unused variable: `context`

Check failure on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Lints

associated function `serialize` is never used

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

unused variable: `context`

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

associated function `serialize` is never used

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

unused variable: `context`

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

associated function `serialize` is never used

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

unused variable: `context`

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

associated function `serialize` is never used

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

unused variable: `context`

Check warning on line 63 in aderyn_core/src/context/graph/serialize_callgraph.rs

View workflow job for this annotation

GitHub Actions / Check

associated function `serialize` is never used
}

0 comments on commit 14a330c

Please sign in to comment.