Skip to content

BitFinding/evm-proxy-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

evm-proxy-tools

Crate Docs License: MIT

Detect and read EVM proxy contract implementations.

Features

  • Detect proxy patterns from EVM bytecode
  • Resolve implementation addresses for upgradeable contracts
  • Support for all major proxy standards

Supported Proxy Types

Standard Description
EIP-1167 Minimal Proxy Contract (clone factory)
EIP-1967 Standard Proxy Storage Slots
EIP-1822 Universal Upgradeable Proxy (UUPS)
EIP-2535 Diamond Standard (multi-facet)
EIP-3448 MetaProxy Standard
EIP-7511 Minimal Proxy with PUSH0
EIP-897 DelegateProxy interface

Installation

Add to your Cargo.toml:

[dependencies]
evm-proxy-tools = "0.1"

Usage

Detect Proxy Type

use evm_proxy_tools::{get_proxy_type, ProxyType, Dispatch};

let bytecode = hex::decode("363d3d373d3d3d363d73...").unwrap();
if let Some((proxy_type, dispatch)) = get_proxy_type(&bytecode) {
    println!("Proxy type: {:?}", proxy_type);
    println!("Dispatch: {:?}", dispatch);
}

Read Implementation Address

use evm_proxy_tools::{get_proxy_implementation, Dispatch};
use alloy::providers::ProviderBuilder;

let provider = ProviderBuilder::new()
    .connect_http("https://eth.llamarpc.com".parse().unwrap());

let dispatch = Dispatch::Storage(slot);
let implementation = get_proxy_implementation(
    provider,
    &proxy_address,
    &dispatch,
    None, // latest block
).await?;

CLI Tools

proxy_tools

Analyze a proxy contract on-chain:

cargo run --bin proxy_tools -- 0x1234... -r https://eth.llamarpc.com

Building

# Debug build
cargo build

# Release build
cargo build --release

# Maximum performance build
RUSTFLAGS='-C target-cpu=native' cargo build --profile maxperf

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages