Skip to main content

Module proxy

Module proxy 

Source
Expand description

EVM proxy contract pattern detection and resolution.

Detects common proxy patterns and identifies the implementation contract address.

§Supported Patterns

PatternDetectionStandard
EIP-1967 Logic ProxyStorage slotEIP-1967
EIP-1822 UUPS ProxyproxiableUUID() slotEIP-1822
OpenZeppelin Transparent ProxyAdmin slot + logic slotOZ
EIP-1167 Minimal Proxy (Clone)Bytecode prefixEIP-1167
Gnosis SafemasterCopy() callGnosis

§Usage with an RPC client

The detection functions require reading blockchain state (storage slots or bytecode), so they take an RpcAdapter trait object. Provide a concrete implementation backed by eth_getStorageAt and eth_getCode.

Structs§

ProxyInfo
Result of proxy detection.

Enums§

ProxyKind
The detected proxy pattern.

Constants§

EIP1167_BYTECODE_PREFIX
EIP-1167 minimal proxy bytecode prefix (20-byte address embedded at offset 10)
EIP1167_BYTECODE_SUFFIX
EIP-1167 minimal proxy bytecode suffix
EIP1822_PROXIABLE_SLOT
EIP-1822 UUPS proxiable slot: keccak256("PROXIABLE")
EIP1967_ADMIN_SLOT
EIP-1967 admin slot: keccak256("eip1967.proxy.admin") - 1
EIP1967_BEACON_SLOT
EIP-1967 beacon slot: keccak256("eip1967.proxy.beacon") - 1
EIP1967_IMPL_SLOT
EIP-1967 implementation slot: keccak256("eip1967.proxy.implementation") - 1

Functions§

classify_from_storage
Classify a proxy based on known storage slot values from an RPC call.
detect_eip1167_clone
Detect an EIP-1167 minimal proxy from raw bytecode.
proxy_detection_slots
Async-friendly helper: build the storage slots to query for proxy detection.
storage_to_address
Check if a storage slot value looks like a non-zero address.