Overview of LibClone Proxy Types
mainLibClone provides several minimal proxy patterns optimized for different use cases:
- Minimal Proxy: Uses the
0agepattern. It is optimized for Etherscan verification and has a small bytecode footprint. Saves 4 gas over ERC1167. - Minimal Proxy (PUSH0 variant): Uses the
PUSH0opcode (Shanghai upgrade). Optimized for minimal runtime gas, then minimal bytecode. Caution: Use with care as some EVM chains may not supportPUSH0immediately after the Shanghai upgrade. Functions are postfixed with_PUSH0. - Clones with Immutable Args (CWIA): An ERC1167 minimal proxy where immutable arguments are appended to the back of the runtime bytecode rather than being appended to the calldata. Uses the identity precompile (0x4) to copy args during deployment.
- Minimal ERC1967 Proxy: Intended for upgrades via UUPS. This is not a transparent proxy and does not include admin logic.
- ERC1967I Proxy: A variant of the ERC1967 proxy with a special code path. If
calldatasize() == 1, it skips thedelegatecalland directly returns the implementation address. This is valid if the proxy's code hash matchesERC1967I_CODE_HASH. - Minimal ERC1967 Beacon Proxy: Intended for upgrades via an upgradable beacon.
- ERC1967I Beacon Proxy: A variant of the beacon proxy with the same
calldatasize() == 1optimization as the standard ERC1967I proxy.