---
eip: 3561
label: ERC-3561
title: Trust Minimized Upgradeability Proxy
status: Stagnant
type: Standards Track
category: ERC
created: 2021-05-09
official: https://eips.ethereum.org/EIPS/eip-3561
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-3561.md
canonical: https://eips.huatuo.xyz/eip-3561/
lang: en
tldr: An EIP-1967 proxy extension that forces every upgrade to be announced on-chain and wait out a delay before it takes effect, so users can exit before a malicious upgrade.
tags: [proxy, upgradeability, timelock, security, solidity]
---

# ERC-3561: Trust Minimized Upgradeability Proxy

> proxy with a delay before specified upgrade goes live

**TL;DR:** An EIP-1967 proxy extension that forces every upgrade to be announced on-chain and wait out a delay before it takes effect, so users can exit before a malicious upgrade.

## What problem does it solve?

An upgradeable proxy lets its admin swap the contract logic at any time. If the admin is anonymous, or their key is compromised, a malicious upgrade can drain users in a single transaction with no warning. That makes upgradeable contracts from anonymous developers hard to trust.

ERC-3561 adds a built-in waiting period to the standard [EIP-1967](/eip-1967/) transparent proxy. A new implementation must first be **proposed**, which emits an event; it can only be activated after a "Zero Trust Period" of blocks has passed. Users who dislike the new code have time to see it and leave.

## How it works

Four extra storage slots, each derived as `keccak256(label) - 1` like EIP-1967:

| Slot label | Holds |
| --- | --- |
| `eip3561.proxy.next.logic` | Proposed next implementation |
| `eip3561.proxy.next.logic.block` | Earliest block when `upgrade()` may run |
| `eip3561.proxy.propose.block` | Earliest block when a new proposal is allowed |
| `eip3561.proxy.zero.trust.period` | Delay length in blocks |

Admin flow:

1. `proposeTo(impl, data)` stores `impl` as next logic and emits `NextLogicDefined(impl, earliestArrivalBlock)`. If no implementation is set yet, or the period is still 0, it upgrades immediately.
2. After `earliestArrivalBlock`, `upgrade(data)` moves next logic into the EIP-1967 implementation slot and runs `data` via `delegatecall`.
3. `cancelUpgrade()` aborts a pending proposal.
4. `setZeroTrustPeriod(blocks)` can only **increase** the delay. While it is 0, the proxy behaves like a normal EIP-1967 transparent proxy.
5. `prolongLock(block)` forbids new proposals until a later block; setting it to the maximum value effectively freezes the code.

All admin actions must emit events and be restricted to the admin.

## Sample code

Checking a proxy's delay and watching for proposals (ethers v6):

```ts
import { JsonRpcProvider, Contract, keccak256, toUtf8Bytes, toBigInt, toBeHex, zeroPadValue } from "ethers";

const slot = (label: string) => zeroPadValue(toBeHex(toBigInt(keccak256(toUtf8Bytes(label))) - 1n), 32);

const provider = new JsonRpcProvider(process.env.RPC_URL);
const ztp = await provider.getStorage(proxy, slot("eip3561.proxy.zero.trust.period"));
console.log("zero trust period (blocks):", toBigInt(ztp));

const p = new Contract(proxy, [
  "event NextLogicDefined(address indexed nextLogic, uint earliestArrivalBlock)",
], provider);
p.on("NextLogicDefined", (next, block) => console.log(`upgrade to ${next} possible at block ${block}`));
```

## Things to know

- **Status: Stagnant.** Widely used libraries do not implement this proxy; the common pattern is an EIP-1967 or [UUPS](/eip-1822/) proxy whose admin is a separate timelock contract.
- The delay only helps if users actually watch for `NextLogicDefined` and can exit in time. The spec suggests a period of at least two weeks, and in most cases at least a month.
- The spec advises users to verify that a deployed proxy matches the reference implementation exactly; any deviation can undermine the guarantees.
- The delay is in blocks, so its wall-clock length depends on the chain's block time.


---

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