---
eip: 7511
label: ERC-7511
title: Minimal Proxy Contract with PUSH0
status: Draft
type: Standards Track
category: ERC
created: 2023-09-04
requires: 7, 211, 1167, 3855
official: https://eips.ethereum.org/EIPS/eip-7511
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7511.md
canonical: https://eips.huatuo.xyz/eip-7511/
lang: en
tldr: A 44-byte version of the ERC-1167 minimal proxy rewritten with the PUSH0 opcode, saving 200 gas at deployment and 5 gas per call while behaving the same.
tags: [proxy, clones, bytecode, gas, push0]
---

# ERC-7511: Minimal Proxy Contract with PUSH0

> Optimizes the previous Minimal Proxy Contract with the PUSH0 opcode

**TL;DR:** A 44-byte version of the ERC-1167 minimal proxy rewritten with the PUSH0 opcode, saving 200 gas at deployment and 5 gas per call while behaving the same.

## What problem does it solve?

[ERC-1167](/eip-1167/) "minimal proxies" (clones) are tiny contracts that forward every call via `DELEGATECALL` to a fixed implementation. They are the standard way to deploy many cheap copies of the same logic: wallets, vaults, token instances.

ERC-1167 was written before the Shanghai upgrade, so it pushes zeros using tricks like `RETURNDATASIZE` and `DUP`. [EIP-3855](/eip-3855/) added `PUSH0`, a dedicated 2-gas opcode for pushing zero. ERC-7511 redesigns the clone from scratch with `PUSH0`, making it one byte smaller, slightly cheaper and easier to read.

## How it works

The runtime code is exactly 44 bytes, with the 20-byte implementation address at byte indices 9–28 (shown here as `bebe…`):

```
365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3
```

It does four things:

1. `CALLDATACOPY` the full calldata to memory at 0.
2. `DELEGATECALL` the implementation with all remaining gas.
3. `RETURNDATACOPY` the result to memory at 0.
4. `JUMPI` on success: `RETURN` the data, otherwise `REVERT` with it.

The 53-byte creation code prepends a 9-byte initcode (`602c8060095f395ff3`) that copies the 44-byte runtime code into memory and returns it.

According to the spec, compared to ERC-1167 this saves 200 gas at deployment and 5 gas at runtime, with identical behaviour.

## Sample code

A factory from the spec that deploys a clone with `CREATE`:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

contract Clone0Factory {
    error FailedCreateClone();

    function clone0(address impl) public payable returns (address addr) {
        // first 18 bytes of the creation code
        bytes memory data1 = hex"602c8060095f395ff3365f5f375f5f365f73";
        // last 15 bytes of the creation code
        bytes memory data2 = hex"5af43d5f5f3e5f3d91602a57fd5bf3";
        bytes memory code = abi.encodePacked(data1, impl, data2);

        assembly {
            addr := create(callvalue(), add(code, 0x20), mload(code))
        }
        if (addr == address(0)) revert FailedCreateClone();
    }
}
```

Checking whether a deployed contract is an ERC-7511 clone (ethers v6):

```ts
const code = (await provider.getCode(addr)).toLowerCase();
const isClone0 =
  code.length === 2 + 44 * 2 &&
  code.startsWith("0x365f5f375f5f365f73") &&
  code.endsWith("5af43d5f5f3e5f3d91602a57fd5bf3");
const impl = isClone0 ? "0x" + code.slice(2 + 9 * 2, 2 + 29 * 2) : null;
```

## Things to know

- Status is **Draft**.
- Requires `PUSH0`, so it only works on chains that activated Shanghai (or equivalent) and with Solidity targeting an EVM version that supports it. On chains without `PUSH0`, deployment produces a broken contract; use ERC-1167 there.
- The same caveats as ERC-1167 apply: the implementation is fixed forever (not upgradeable), there is no constructor so you must call an initializer right after deployment, and a bug in the implementation affects every clone.
- Explorers and tools that only recognise the ERC-1167 bytecode may show these clones as unknown contracts.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7511
