Expand description
EVM proxy contract pattern detection and resolution.
Detects common proxy patterns and identifies the implementation contract address.
§Supported Patterns
| Pattern | Detection | Standard |
|---|---|---|
| EIP-1967 Logic Proxy | Storage slot | EIP-1967 |
| EIP-1822 UUPS Proxy | proxiableUUID() slot | EIP-1822 |
| OpenZeppelin Transparent Proxy | Admin slot + logic slot | OZ |
| EIP-1167 Minimal Proxy (Clone) | Bytecode prefix | EIP-1167 |
| Gnosis Safe | masterCopy() call | Gnosis |
§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§
- Proxy
Info - Result of proxy detection.
Enums§
- Proxy
Kind - 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.