{"eip":7760,"title":"Minimal Upgradeable Proxies","description":"Minimal upgradeable proxies with immutable arguments and support for onchain implementation queries","authors":["Atarpara (@Atarpara)","JT Riley (@jtriley-eth)","Thomas (@0xth0mas)","xiaobaiskill (@xiaobaiskill)","Vectorized (@Vectorized)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-08-19","requires":[1967],"discussionsTo":"https://ethereum-magicians.org/t/erc-7760-minimal-upgradeable-proxies/20868","repo":"ERCs","label":"ERC-7760","officialUrl":"https://eips.ethereum.org/EIPS/eip-7760","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7760.md","url":"https://eips.huatuo.xyz/eip-7760/","tldr":{"en":"Standard hand-written bytecode for minimal ERC-1967 upgradeable proxies (transparent, UUPS and beacon), with optional immutable arguments and 'I-variants' that report their implementation onchain, so cheap upgradeable clones can be auto-verified and inspected.","ja":"最小構成の ERC-1967 アップグレード可能プロキシ（transparent、UUPS、beacon）向けの標準的な手書きバイトコード。任意の immutable 引数と、実装先をオンチェーンで報告する「I バリアント」を備え、安価なアップグレード可能クローンを自動検証・検査できる。","ko":"최소 ERC-1967 업그레이드 가능 프록시(transparent, UUPS, beacon)를 위한 표준 수작업 바이트코드. 선택적 immutable 인자와 구현체를 온체인에서 알려주는 'I 변형'을 갖추어, 저렴한 업그레이드 가능 클론을 자동으로 검증하고 점검할 수 있다.","zh":"为最小化 ERC-1967 可升级代理（transparent、UUPS 和 beacon）提供标准的手写字节码，带有可选的不可变参数，以及可在链上报告其实现的\"I 变体\"，使廉价的可升级克隆可以被自动验证和检查。"},"tags":["proxy","upgradeable","bytecode","erc1967","clones"],"explainers":{"en":{"lang":"en","tldr":"Standard hand-written bytecode for minimal ERC-1967 upgradeable proxies (transparent, UUPS and beacon), with optional immutable arguments and 'I-variants' that report their implementation onchain, so cheap upgradeable clones can be auto-verified and inspected.","tags":["proxy","upgradeable","bytecode","erc1967","clones"],"related":[1967,1167,3448,3855],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7760/","markdown":"## What problem does it solve?\n\n[ERC-1167](/eip-1167/) minimal proxies made it cheap to deploy many clones of one contract, but those clones cannot be upgraded. Upgradeable proxies, on the other hand, are usually full Solidity contracts: bigger to deploy, a bit more expensive per call, and each project's bytecode is slightly different, so explorers cannot verify them automatically.\n\nERC-7760 fixes one set of tiny, hand-optimized bytecodes for the three common [ERC-1967](/eip-1967/) upgrade patterns. Because every deployment uses the same bytes, explorers can recognise and verify them automatically, other contracts can read immutable arguments at a known offset, and (with I-variants) the implementation address can be checked onchain.\n\n## How it works\n\nThree proxy kinds, each with a **basic** variant and an **I-variant**:\n\n- **Transparent:** the factory's address is baked into the bytecode, which saves an `SLOAD` per call. Only the factory can upgrade, by calling the proxy with `abi.encodePacked(uint256(uint160(newImpl)), IMPLEMENTATION_SLOT, optionalCalldata)`. The proxy writes that word into that slot and, if more calldata follows, delegatecalls it. There are 20-byte and shorter 14-byte factory-address subvariants; the latter suits a vanity factory address with six leading zero bytes.\n- **UUPS:** no upgrade logic in the proxy; the implementation contract handles upgrades. The init code must write the implementation slot `0x3608…2bbc`.\n- **Beacon:** asks the beacon stored in the ERC-1967 beacon slot for `implementation()` and delegatecalls the result.\n\nCommon rules:\n\n- **Immutable arguments** may be appended after the runtime bytecode. They are *not* added to forwarded calldata; read them with `EXTCODECOPY`.\n- **I-variants:** a call with exactly **1 byte** of calldata returns the implementation address instead of forwarding. Plain ETH transfers send 0 bytes and Solidity calls send at least 4, so there is no clash. Before trusting the answer, a caller must check that the proxy's bytecode (with the factory address zeroed) hashes to the expected value.\n- The proxies avoid `PUSH0` ([EIP-3855](/eip-3855/)) so they run on chains without it, and they do not emit ERC-1967 events; indexers should read the slots.\n\n## Sample code\n\nQuerying a proxy's implementation (ethers v6):\n\n```ts\nimport { JsonRpcProvider, getAddress, dataSlice } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst IMPL_SLOT = \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\";\n\n// Any ERC-1967 proxy: read the storage slot\nconst raw = await provider.getStorage(proxy, IMPL_SLOT);\nconsole.log(\"impl:\", getAddress(dataSlice(raw, 12)));\n\n// ERC-7760 I-variant: 1-byte calldata returns the implementation\nconst ret = await provider.call({ to: proxy, data: \"0x00\" });\nconsole.log(\"impl (I-variant):\", getAddress(dataSlice(ret, 12)));\n// Onchain, also verify the proxy's code hash before trusting this value.\n```\n\n## Things to know\n\n- Status is **Draft**.\n- Factories, beacons and the onchain verification logic for I-variants are out of scope; they need careful, audited implementations of their own.\n- The transparent proxy lets the factory write *any* storage slot, so the factory's own access control is the real security boundary.\n- If you only need non-upgradeable clones, [ERC-1167](/eip-1167/) or [ERC-3448](/eip-3448/) (clones with metadata) are simpler.\n"},"ja":{"lang":"ja","tldr":"最小構成の ERC-1967 アップグレード可能プロキシ（transparent、UUPS、beacon）向けの標準的な手書きバイトコード。任意の immutable 引数と、実装先をオンチェーンで報告する「I バリアント」を備え、安価なアップグレード可能クローンを自動検証・検査できる。","tags":["proxy","upgradeable","bytecode","erc1967","clones"],"related":[1967,1167,3448,3855],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7760/","markdown":"## 何を解決するのか\n\n[ERC-1167](/eip-1167/) の最小プロキシにより、1 つのコントラクトのクローンを安価に多数デプロイできるようになりましたが、それらのクローンはアップグレードできません。一方、アップグレード可能なプロキシは通常フル機能の Solidity コントラクトです。デプロイが大きく、呼び出しごとのコストも少し高く、プロジェクトごとにバイトコードが微妙に異なるため、エクスプローラーが自動的に検証できません。\n\nERC-7760 は、3 つの一般的な [ERC-1967](/eip-1967/) アップグレードパターンについて、小さく手作業で最適化された 1 セットのバイトコードを固定します。どのデプロイでも同じバイト列を使うため、エクスプローラーは自動的に認識・検証でき、他のコントラクトは既知のオフセットで immutable 引数を読め、（I バリアントなら）実装アドレスをオンチェーンで確認できます。\n\n## 仕組み\n\nプロキシは 3 種類で、それぞれに**基本**バリアントと **I バリアント**があります。\n\n- **Transparent:** ファクトリのアドレスがバイトコードに埋め込まれ、呼び出しごとの `SLOAD` を 1 回節約できます。アップグレードできるのはファクトリだけで、`abi.encodePacked(uint256(uint160(newImpl)), IMPLEMENTATION_SLOT, optionalCalldata)` を渡してプロキシを呼び出します。プロキシはそのワードをそのスロットに書き込み、さらに calldata が続けば、それを delegatecall します。ファクトリアドレスが 20 バイトのサブバリアントと、より短い 14 バイトのサブバリアントがあり、後者は先頭に 6 バイトのゼロがあるバニティなファクトリアドレスに向いています。\n- **UUPS:** プロキシにアップグレードロジックはなく、実装コントラクトがアップグレードを処理します。init コードは実装スロット `0x3608…2bbc` に書き込む必要があります。\n- **Beacon:** ERC-1967 の beacon スロットに保存された beacon に `implementation()` を問い合わせ、その結果を delegatecall します。\n\n共通ルール:\n\n- **Immutable 引数**はランタイムバイトコードの後ろに付加できます。転送される calldata には*追加されません*。`EXTCODECOPY` で読み取ります。\n- **I バリアント:** calldata がちょうど **1 バイト**の呼び出しは、転送せずに実装アドレスを返します。通常の ETH 送金は 0 バイトを送り、Solidity の呼び出しは少なくとも 4 バイトを送るため、衝突しません。答えを信頼する前に、呼び出し側はプロキシのバイトコード（ファクトリアドレスをゼロにしたもの）のハッシュが期待値と一致することを確認する必要があります。\n- プロキシは `PUSH0`（[EIP-3855](/eip-3855/)）を使わないため、それがないチェーンでも動作します。また ERC-1967 のイベントは emit しないため、インデクサーはスロットを読む必要があります。\n\n## サンプルコード\n\nプロキシの実装先を問い合わせる（ethers v6）:\n\n```ts\nimport { JsonRpcProvider, getAddress, dataSlice } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst IMPL_SLOT = \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\";\n\n// Any ERC-1967 proxy: read the storage slot\nconst raw = await provider.getStorage(proxy, IMPL_SLOT);\nconsole.log(\"impl:\", getAddress(dataSlice(raw, 12)));\n\n// ERC-7760 I-variant: 1-byte calldata returns the implementation\nconst ret = await provider.call({ to: proxy, data: \"0x00\" });\nconsole.log(\"impl (I-variant):\", getAddress(dataSlice(ret, 12)));\n// Onchain, also verify the proxy's code hash before trusting this value.\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。\n- ファクトリ、beacon、I バリアントのオンチェーン検証ロジックはスコープ外です。それぞれ、監査を受けた慎重な実装が必要です。\n- Transparent プロキシでは、ファクトリが*任意の*ストレージスロットを書き込めるため、ファクトリ自身のアクセス制御が本当のセキュリティ境界になります。\n- アップグレード不要のクローンだけでよいなら、[ERC-1167](/eip-1167/) や [ERC-3448](/eip-3448/)（メタデータ付きクローン）のほうが単純です。\n"},"ko":{"lang":"ko","tldr":"최소 ERC-1967 업그레이드 가능 프록시(transparent, UUPS, beacon)를 위한 표준 수작업 바이트코드. 선택적 immutable 인자와 구현체를 온체인에서 알려주는 'I 변형'을 갖추어, 저렴한 업그레이드 가능 클론을 자동으로 검증하고 점검할 수 있다.","tags":["proxy","upgradeable","bytecode","erc1967","clones"],"related":[1967,1167,3448,3855],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7760/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-1167](/eip-1167/) 최소 프록시 덕분에 하나의 컨트랙트를 복제한 클론을 저렴하게 많이 배포할 수 있게 되었지만, 이런 클론은 업그레이드할 수 없습니다. 반면 업그레이드 가능한 프록시는 보통 완전한 Solidity 컨트랙트입니다. 배포 크기가 더 크고, 호출당 비용도 조금 더 들며, 프로젝트마다 바이트코드가 조금씩 달라 탐색기가 자동으로 검증할 수 없습니다.\n\nERC-7760은 세 가지 흔한 [ERC-1967](/eip-1967/) 업그레이드 패턴에 대해 작고 수작업으로 최적화된 바이트코드 한 세트를 고정합니다. 모든 배포가 같은 바이트를 사용하므로 탐색기가 이를 자동으로 인식하고 검증할 수 있고, 다른 컨트랙트가 알려진 오프셋에서 immutable 인자를 읽을 수 있으며, (I 변형을 쓰면) 구현 주소를 온체인에서 확인할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n프록시는 세 종류이며, 각각 **기본** 변형과 **I 변형**이 있습니다.\n\n- **Transparent:** 팩토리 주소가 바이트코드에 박혀 있어 호출마다 `SLOAD` 한 번을 아낍니다. 업그레이드는 팩토리만 할 수 있으며, `abi.encodePacked(uint256(uint160(newImpl)), IMPLEMENTATION_SLOT, optionalCalldata)`로 프록시를 호출합니다. 프록시는 그 워드를 해당 슬롯에 쓰고, 뒤에 calldata가 더 있으면 그것을 delegatecall합니다. 팩토리 주소가 20바이트인 하위 변형과 더 짧은 14바이트 하위 변형이 있으며, 후자는 앞에 0 바이트가 6개 붙는 배니티 팩토리 주소에 적합합니다.\n- **UUPS:** 프록시에는 업그레이드 로직이 없고, 구현 컨트랙트가 업그레이드를 처리합니다. init 코드는 구현 슬롯 `0x3608…2bbc`에 값을 써야 합니다.\n- **Beacon:** ERC-1967 beacon 슬롯에 저장된 beacon에 `implementation()`을 요청하고 그 결과를 delegatecall합니다.\n\n공통 규칙:\n\n- **Immutable 인자**는 런타임 바이트코드 뒤에 덧붙일 수 있습니다. 전달되는 calldata에는 *추가되지 않으며*, `EXTCODECOPY`로 읽습니다.\n- **I 변형:** calldata가 정확히 **1바이트**인 호출은 전달하는 대신 구현 주소를 반환합니다. 일반 ETH 전송은 0바이트를 보내고 Solidity 호출은 최소 4바이트를 보내므로 충돌하지 않습니다. 응답을 신뢰하기 전에 호출자는 프록시의 바이트코드(팩토리 주소를 0으로 만든 것)의 해시가 기대값과 같은지 확인해야 합니다.\n- 프록시는 `PUSH0`([EIP-3855](/eip-3855/))를 피하므로 이를 지원하지 않는 체인에서도 동작하며, ERC-1967 이벤트를 emit하지 않으므로 인덱서는 슬롯을 읽어야 합니다.\n\n## 샘플 코드\n\n프록시의 구현 조회(ethers v6):\n\n```ts\nimport { JsonRpcProvider, getAddress, dataSlice } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst IMPL_SLOT = \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\";\n\n// Any ERC-1967 proxy: read the storage slot\nconst raw = await provider.getStorage(proxy, IMPL_SLOT);\nconsole.log(\"impl:\", getAddress(dataSlice(raw, 12)));\n\n// ERC-7760 I-variant: 1-byte calldata returns the implementation\nconst ret = await provider.call({ to: proxy, data: \"0x00\" });\nconsole.log(\"impl (I-variant):\", getAddress(dataSlice(ret, 12)));\n// Onchain, also verify the proxy's code hash before trusting this value.\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다.\n- 팩토리, beacon, I 변형의 온체인 검증 로직은 범위 밖입니다. 각각 감사를 거친 신중한 구현이 필요합니다.\n- Transparent 프록시는 팩토리가 *어떤* 스토리지 슬롯이든 쓸 수 있게 하므로, 팩토리 자체의 접근 제어가 실제 보안 경계입니다.\n- 업그레이드가 필요 없는 클론만 원한다면 [ERC-1167](/eip-1167/)이나 [ERC-3448](/eip-3448/)(메타데이터가 있는 클론)이 더 간단합니다.\n"},"zh":{"lang":"zh","tldr":"为最小化 ERC-1967 可升级代理（transparent、UUPS 和 beacon）提供标准的手写字节码，带有可选的不可变参数，以及可在链上报告其实现的\"I 变体\"，使廉价的可升级克隆可以被自动验证和检查。","tags":["proxy","upgradeable","bytecode","erc1967","clones"],"related":[1967,1167,3448,3855],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7760/","markdown":"## 它解决什么问题？\n\n[ERC-1167](/eip-1167/) 最小代理让部署同一个合约的大量克隆变得便宜，但这些克隆无法升级。而可升级代理通常是完整的 Solidity 合约：部署更大，每次调用稍贵，而且每个项目的字节码略有不同，浏览器无法自动验证它们。\n\nERC-7760 为三种常见的 [ERC-1967](/eip-1967/) 升级模式固定了一组小巧的、手工优化的字节码。由于每次部署都使用相同的字节，浏览器可以自动识别并验证它们，其他合约可以在已知偏移处读取不可变参数，并且（借助 I 变体）可以在链上检查实现地址。\n\n## 它如何运作\n\n三种代理，每种都有**基础**变体和 **I 变体**：\n\n- **Transparent：**工厂地址被写死在字节码中，每次调用可节省一次 `SLOAD`。只有工厂可以升级，方法是用 `abi.encodePacked(uint256(uint160(newImpl)), IMPLEMENTATION_SLOT, optionalCalldata)` 调用代理。代理把这个字写入该存储槽，如果后面还有 calldata，则对其执行 delegatecall。有 20 字节和更短的 14 字节两种工厂地址子变体；后者适合以六个零字节开头的靓号工厂地址。\n- **UUPS：**代理中没有升级逻辑；由实现合约处理升级。初始化代码必须写入实现槽 `0x3608…2bbc`。\n- **Beacon：**向存放在 ERC-1967 beacon 槽中的 beacon 请求 `implementation()`，并对结果执行 delegatecall。\n\n通用规则：\n\n- **不可变参数**可以追加在运行时字节码之后。它们*不会*被加入转发的 calldata；请用 `EXTCODECOPY` 读取。\n- **I 变体：**calldata 恰好为 **1 字节**的调用会返回实现地址，而不是转发。普通的 ETH 转账发送 0 字节，Solidity 调用至少发送 4 字节，因此不会冲突。在信任返回结果之前，调用者必须检查代理的字节码（工厂地址清零后）的哈希是否等于预期值。\n- 这些代理避免使用 `PUSH0`（[EIP-3855](/eip-3855/)），因此可在不支持它的链上运行，并且它们不会触发 ERC-1967 事件；索引器应读取存储槽。\n\n## 示例代码\n\n查询代理的实现（ethers v6）：\n\n```ts\nimport { JsonRpcProvider, getAddress, dataSlice } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst IMPL_SLOT = \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\";\n\n// Any ERC-1967 proxy: read the storage slot\nconst raw = await provider.getStorage(proxy, IMPL_SLOT);\nconsole.log(\"impl:\", getAddress(dataSlice(raw, 12)));\n\n// ERC-7760 I-variant: 1-byte calldata returns the implementation\nconst ret = await provider.call({ to: proxy, data: \"0x00\" });\nconsole.log(\"impl (I-variant):\", getAddress(dataSlice(ret, 12)));\n// Onchain, also verify the proxy's code hash before trusting this value.\n```\n\n## 需要注意\n\n- 状态为 **Draft**。\n- 工厂、beacon 以及 I 变体的链上验证逻辑不在范围之内；它们需要各自经过审计的谨慎实现。\n- Transparent 代理允许工厂写入*任意*存储槽，因此工厂自身的访问控制才是真正的安全边界。\n- 如果只需要不可升级的克隆，[ERC-1167](/eip-1167/) 或 [ERC-3448](/eip-3448/)（带元数据的克隆）更简单。\n"}}}
