From 0a15da042e524c8eb67e06ab2a10afbebc35a188 Mon Sep 17 00:00:00 2001 From: Jon-Becker Date: Mon, 11 Dec 2023 09:36:06 -0500 Subject: [PATCH] chore(inspect): add inspect example --- examples/inspect/Cargo.toml | 11 +++++++++++ examples/inspect/src/main.rs | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 examples/inspect/Cargo.toml create mode 100644 examples/inspect/src/main.rs diff --git a/examples/inspect/Cargo.toml b/examples/inspect/Cargo.toml new file mode 100644 index 00000000..c8ca14e4 --- /dev/null +++ b/examples/inspect/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "heimdall-rs-inspect-example" +version = "0.6.5" +edition = "2021" +description = "Heimdall is an advanced Ethereum smart contract toolkit for forensic and heuristic analysis." +keywords = ["ethereum", "web3", "decompiler", "evm", "crypto"] +license = "MIT" + +[dependencies] +heimdall-core = { git = "https://github.com/Jon-Becker/heimdall-rs.git", branch = "main" } +tokio = {version = "1", features = ["full"]} diff --git a/examples/inspect/src/main.rs b/examples/inspect/src/main.rs new file mode 100644 index 00000000..f1a5e5a3 --- /dev/null +++ b/examples/inspect/src/main.rs @@ -0,0 +1,16 @@ +use heimdall_core::inspect::InspectArgsBuilder; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let result = heimdall_core::inspect::inspect( + InspectArgsBuilder::new() + .target("0xa5f676d0ee4c23cc1ccb0b802be5aaead5827a3337c06e9da8b0a85dfa3e7dd5".to_string()) + .rpc_url("https://eth.llamarpc.com".to_string()) + .build()?, + ) + .await?; + + println!("InspectResult: {:#?}", result); + + Ok(()) +}