Skip to content
NFTVenue Ledger
Directory

Erc721 Erc1155 Eip712 Permit Security

ERC-1967 Transparent vs EIP-1822 UUPS Proxies: Storage Slots & Uninitialized Logic Exploits

EVM DELEGATECALL proxies execute upgradeable implementation bytecode against proxy storage, requiring deterministic ERC-1967 slot offsets and strict constructor initializer locks.

By Dr. Devon Kurosawa, PhDReview not recorded · Updated
ERC-1967 Transparent vs EIP-1822 UUPS Proxies: Storage Slots & Uninitialized Logic Exploits — NFTVenue Ledger 2026 quantitative & supervisory data card
NFTVenue Ledger (EIP-712 Signatures, Permit2 Allowance Security, Royalties & Proxy Timelocks): Unstructured keccak256(-1) slots, UUPS -2,100 gas savings, and _disableInitializers locks.Source: NFTVenue Ledger Institutional Research DeskLicense: CC-BY-4.0

When a Proxy contract at 0xProxy executes implementation.delegatecall(msg.data), EVM opcodes SLOAD and SSTORE inside implementation read and mutate 0xProxy's storage slots 0, 1, 2, ...! In early 2018 proxy designs, storing address implementation at Slot 0 inside the proxy collided catastrophically with address owner at Slot 0 inside the logic contract—allowing a routine state update to overwrite the implementation pointer! EIP-1967 (Standard Proxy Storage Slots) eradicated proxy-vs-logic collisions by parking implementation, admin, and beacon pointers at pseudo-random bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) offsets with missing preimages.

Anchored inside our EIP-712, Permit2 & proxy security master guide, choosing between Transparent, UUPS (EIP-1822), and Beacon proxies governs upgrade safety across regulated ERC-3643 RWA tokens and exchange vaults in our marketplaces directory (from Beethoven X to Astroport).

Function Selector Clashing: Transparent Proxy v5 vs UUPS (EIP-1822)#

Even with storage slots separated via EIP-1967, Solidity 4-byte function selectors (bytes4(keccak256(sig))) can collide between the Proxy (upgradeToAndCall(address,bytes)) and the Implementation (e.g., a crafted function sharing the exact same 4-byte hash!):

  1. OpenZeppelin v5 TransparentUpgradeableProxy: Deploys an isolated per-proxy ProxyAdmin contract at deployment and checks if (msg.sender == _proxyAdmin) in the fallback: ONLY ProxyAdmin can call upgradeToAndCall (never forwarding to logic), and every other caller (msg.sender != _proxyAdmin) forwards 100% of selectors to implementation! Trade-off: every single user swap or transfer pays an extra ~2,100-gas SLOAD reading the ERC-1967 admin slot!
  2. UUPSUpgradeable (EIP-1822): Removes admin branching from the proxy altogether (saving ~2,100 gas on every user call!) by placing upgradeToAndCall inside the Implementation contract itself, protected by _authorizeUpgrade(address newImpl) internal override onlyOwner and onlyProxy! Fatal Hazard: If you accidentally upgrade to a new Implementation that forgets to inherit UUPSUpgradeable, the proxy becomes permanently immutable (bricked upgrades) forever!
Comparison of ERC-1967 Transparent ProxyAdmin branching vs UUPS implementation-side proxiableUUID check
Comparison of ERC-1967 Transparent ProxyAdmin branching vs UUPS implementation-side proxiableUUID checkVerified Exhibit

The $10M Wormhole Bug Bounty Lesson: Uninitialized Logic Contracts!#

Why must every upgradeable implementation contract include /// @custom:oz-upgrades-unsafe-allow constructor constructor { _disableInitializers; }?

Remember that initialize runs via DELEGATECALL to set owner in 0xProxy's storage—leaving owner == address(0) inside the standalone 0xImplementation contract's own storage! Before Cancun's EIP-6780 neutered post-deployment SELFDESTRUCT, an attacker who called 0xImplementation.initialize directly became owner of the logic contract, called an internal delegatecall inside 0xImplementation to SELFDESTRUCT, and wiped 0xImplementation bytecode to 0 bytes—instantly bricking $300M+ locked inside 0xProxy! Even post-EIP-6780, leaving an implementation uninitialized lets attackers emit spoofed events from 0xImplementation or manipulate external registries trusting implementation state!

Proxy Pattern Engineering & Gas Comparison Matrix#

Quantitative Distribution · Per-Call User Gas Overhead
Per-Call User Gas OverheadMulti-Instance Mass Upgrade?
01Transparent Proxy (OZ v5)~4,700 gas (IMP…02UUPS Proxy (EIP-1822)~2,600 gas (IMP…03Beacon Proxy (EIP-1967)~4,900 gas (BEA…04EIP-1167 Minimal Clone~780 gas (Hardc…
Proxy ArchitecturePer-Call User Gas OverheadUpgrade Code LocationMulti-Instance Mass Upgrade?Primary Audit Failure Mode
Transparent Proxy (OZ v5)~4,700 gas (IMPL + ADMIN SLOAD + DELEGATECALL)Minimal Proxy (ProxyAdmin gated)1 tx per proxyHigher gas on high-frequency DEX calls
UUPS Proxy (EIP-1822)~2,600 gas (IMPL SLOAD + DELEGATECALL)Implementation Contract1 tx per proxyForgetting UUPSUpgradeable bricks upgrades
Beacon Proxy (EIP-1967)~4,900 gas (BEACON SLOAD + STATICCALL + DELEGATECALL)Central UpgradeableBeacon1 tx upgrades 10,000+ vaults!Compromised Beacon key rugs all vaults at once
EIP-1167 Minimal Clone~780 gas (Hardcoded push20 address)Immutable (Non-Upgradeable)ImpossibleZero upgrade bug surface (e.g., SudoAMM pairs)
Cumulative annual user gas cost across 1M transactions comparing EIP-1167 Clones, UUPS, Transparent, and Beacon
Cumulative annual user gas cost across 1M transactions comparing EIP-1167 Clones, UUPS, Transparent, and BeaconVerified Exhibit

Exact ERC-1967 Slot Derivation & Why Subtracting 1 Prevents Mapping Collisions#

Why does EIP-1967 subtract 1 outside keccak256 (uint256(keccak256("eip1967.proxy.implementation")) - 1) rather than simply using keccak256("...") directly? Because Solidity computes mapping(k => v) and dynamic array slots via keccak256(abi.encode(key, slot))! Subtracting 1 guarantees nobody knows the keccak256 preimage of the resulting 256-bit integer, making an accidental or crafted mapping collision cryptographically infeasible (p = 2^-256):

Formula or model from the articleNot independently verified
ERC-1967 Canonical Unstructured Storage Slot Constants:
  • IMPLEMENTATION_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)
  • = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
  • ADMIN_SLOT = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)
  • = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103
  • BEACON_SLOT = bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)
  • = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50
  • Worked Atomic Deployment Check (Prevents Mempool initialize Hijack):
  • NEVER deploy ERC1967Proxy(impl, "") in Tx1 and call proxy.initialize(admin) in Tx2!
  • ALWAYS pass initData = abi.encodeCall(VaultV1.initialize, (timelockAddr)) inside ERC1967Proxy constructor!

Scaling Beyond 24 KB Bytecode Limits & Locking Admin Keys#

What happens when a complex DEX or lending protocol exceeds Ethereum's EIP-170 24,576-byte (24 KB) contract code size limit? Examine multi-facet selector routing next in EIP-2535 Diamond multi-facet proxies, inheritance storage safety in EIP-7201 namespaced storage layouts, and governance delays in TimelockController multisig vetoes inside our EIP-712, Permit2 & Proxy Security hub.

Frequently asked questions

Why does EIP-1967 subtract 1 from the keccak256 hash when computing proxy storage slots?

Solidity stores dynamic arrays and mappings at keccak256(key . slot); subtracting 1 after hashing ensures the proxy slot has no known keccak256 preimage and can never collide with a crafted mapping key.

Why is UUPS cheaper per swap for end users than a TransparentUpgradeableProxy?

A Transparent Proxy must SLOAD the ERC-1967 ADMIN_SLOT (~2,100 cold gas) on every single call to check whether msg.sender is the ProxyAdmin, whereas UUPS proxies read only the IMPLEMENTATION_SLOT.

How did Cancun EIP-6780 reduce the severity of uninitialized UUPS logic contracts?

Prior to EIP-6780, hijacking an uninitialized UUPS logic contract allowed calling delegatecall -> SELFDESTRUCT to erase the logic bytecode and freeze all proxy funds; EIP-6780 restricts bytecode deletion strictly to same-tx creation.

When should a DeFi protocol choose a Beacon Proxy instead of UUPS?

When deploying hundreds or thousands of identical per-pair vaults or user smart accounts that must all upgrade simultaneously via a single UpgradeableBeacon.upgradeTo governance transaction.

Publication record

Published
November 13, 2026
Updated
November 14, 2026
Author
Dr. Devon Kurosawa, PhD
Review
Review not recorded
Automated fact check
Passed in the stored pipeline record
Source URLs
3 recorded

AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.

Academic & Institutional Attribution

Cite This Research & Embed Live Data Card

Open Attribution License (CC BY 4.0)

Standard academic & institutional research paper citation format.

Dr. Devon Kurosawa, PhD. (2026, November 14). ERC-1967 Transparent vs EIP-1822 UUPS Proxies: Storage Slots & Uninitialized Logic Exploits. NFTVenue Ledger. https://nftvenueledger.com/protocols/erc-1967-transparent-vs-eip-1822-uups-proxy-storage-slots
Explore Erc721 Erc1155 Eip712 Permit Security Hub (20) →

NFTVenue Ledger Data, Benchmarks & Contributor Records

ERC-1967 Transparent vs UUPS Proxies & Storage Slot Audits | NFTVenue Ledger