Skip to content

Repository files navigation

evm-proxy-tools

CrateDocsLicense: 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

StandardDescription
EIP-1167Minimal Proxy Contract (clone factory)
EIP-1967Standard Proxy Storage Slots
EIP-1822Universal Upgradeable Proxy (UUPS)
EIP-2535Diamond Standard (multi-facet)
EIP-3448MetaProxy Standard
EIP-7511Minimal Proxy with PUSH0
EIP-897DelegateProxy 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();ifletSome((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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages