Skip to content

Commit

Permalink
fix ignore error
Browse files Browse the repository at this point in the history
  • Loading branch information
shuo-young committed Jan 23, 2024
1 parent 599078e commit ec06ae0
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
gigahorse-toolchain/* linguist-vendored
gigahorse-toolchain/* linguist-vendored

*.html linguist-language=Rust
*.py linguist-language=Rust
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@

An Attacker Contract Identification Tool Implemented in Rust based on BlockWatchdog.

## Quick Start

```shell
RUST_LOG=info cargo run -- ETH 0x10C509AA9ab291C76c45414e7CdBd375e1D5AcE8
```
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
mod contract;
mod flow;
mod outputter;
use crate::contract::contract::Contract;
use crate::flow::flow_analysis::FlowAnalysis;
mod graph;
mod output;
use crate::graph::call_graph::CallGraph;
use crate::output::result_structure::{
use crate::outputter::result_structure::{
ExternalCall, OpCreation, Overlap, Result, SemanticFeatures,
};
#[allow(unused_imports)]
Expand Down
1 change: 1 addition & 0 deletions src/outputter/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod result_structure;
51 changes: 51 additions & 0 deletions src/outputter/result_structure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
use std::collections::HashMap;

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct Result {
pub is_attack: bool,
pub warning: String,
pub attack_matrix: HashMap<String, bool>,
pub analysis_loc: String,
pub platform: String,
pub block_number: u64,
pub time: Option<String>,
pub semantic_features: SemanticFeatures,
pub external_call: ExternalCall,
pub call_paths: Vec<String>,
pub visited_contracts: Vec<String>,
pub visited_contracts_num: usize,
pub visited_funcs: Vec<String>,
pub visited_funcs_num: usize,
pub max_call_depth: u32,
pub contract_funcsigs: Vec<String>,
pub contract_funcsigs_external_call: Vec<String>,
pub sensitive_callsigs: Vec<String>,
pub overlap: Overlap,
pub reentrancy_path_info: HashMap<String, String>,
}

#[derive(Serialize, Deserialize)]
pub struct SemanticFeatures {
pub op_creation: OpCreation,
pub op_selfdestruct: bool,
pub op_env: bool,
}

#[derive(Serialize, Deserialize)]
pub struct OpCreation {
pub op_multicreate: bool,
pub op_solecreate: bool,
}
#[derive(Serialize, Deserialize)]
pub struct ExternalCall {
pub externalcall_inhook: bool,
pub externalcall_infallback: bool,
pub hooks_focused: Vec<String>,
}
#[derive(Serialize, Deserialize)]
pub struct Overlap {
pub has_overlap: bool,
pub overlap_external_call: Vec<String>,
}

0 comments on commit ec06ae0

Please sign in to comment.