# ERC-1967 Transparent vs UUPS Proxies & Storage Slot Audits

> Audit ERC-1967 unstructured keccak256(-1) proxy slots, OpenZeppelin v5 Transparent ProxyAdmin isolation, UUPS bricking hazards, and _disableInitializers.

Canonical: https://nftvenueledger.com/protocols/erc-1967-transparent-vs-eip-1822-uups-proxy-storage-slots
Last updated: 2026-11-14T19:48:22.284Z

**Publication:** NFTVenue Ledger
**Category:** Erc721 Erc1155 Eip712 Permit Security
**Published:** 2026-11-13T22:45:25.915Z
**Author:** Dr. Devon Kurosawa, PhD (PhD in Distributed Systems & Cryptographic Protocol Verification)
**Reviewer:** Not recorded

## Answer-first summary

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

## Key takeaways

- ERC-1967 stores implementation, admin, and beacon addresses at keccak256("eip1967.proxy.*") - 1, subtracting 1 outside the hash so no known preimage can collide with Solidity mappings.
- UUPS (EIP-1822) saves ~2,100 gas on every user transaction compared to Transparent Proxies by moving upgrade authorization into the implementation contract.
- Every upgradeable implementation constructor MUST invoke _disableInitializers, and proxy initialization calldata must execute atomically inside the proxy deployment transaction.
- OpenZeppelin v5 UUPS enforces IERC1822Proxiable.proxiableUUID == IMPLEMENTATION_SLOT during upgrades to prevent bricking the proxy with a non-UUPS target.

## Related financial entities

- **Checks-Effects-Interactions (CEI) Security Pattern** (CEI-SEC) — product: Foundational programming design pattern in smart contract development preventing reentrancy attacks by executing internal state updates before external calls.
- **ERC-3643 Tokenized Securities Standard (T-REX)** (ERC-3643) — product: Suite of open-source smart contracts enabling the compliant issuance, management, and transfer of permissioned security tokens using on-chain identity.

## Analysis

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](/protocols/eip712-permit2-erc721-royalty-proxy-timelock-security-2026), choosing between **Transparent**, **UUPS (`EIP-1822`)**, and **Beacon** proxies governs upgrade safety across regulated [ERC-3643 RWA](/tokens/erc-3643-rwa-standard) tokens and exchange vaults in our [marketplaces directory](/marketplaces) (from [Beethoven X](/marketplaces/beethoven-x) to [Astroport](/marketplaces/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](/api/figure?type=flow&title=UUPS%20Upgrade%20Safety%20%26%20Uninitialized%20Logic%20Defense&subtitle=Four-gate%20verification%20preventing%20permanent%20UUPS%20bricking%20and%20Wormhole-style%20logic%20hijacks&steps=1.%20Logic%20Constructor%3A%3ACall%20_disableInitializers%28%29%20setting%20_initialized%20%3D%20type%28uint64%29.max%7C2.%20Atomic%20Proxy%20Init%3A%3APass%20initialize%28...%29%20calldata%20inside%20ERC1967Proxy%20constructor!%7C3.%20UUPS%20UUID%20Check%3A%3AupgradeToAndCall%20verifies%20newImpl.proxiableUUID%28%29%20%3D%3D%20IMPL_SLOT%7C4.%20Storage%20Layout%20Diff%3A%3AVerify%20zero%20variable%20reordering%2Finsertion%20via%20EIP-7201%20%2F%20OZ%20Upgrades&metrics=IMPL%20SLOT%20HASH%3A%3A0x360894..bbc%3A%3Akeccak256%28eip1967.proxy.implementation%29-1%7CUUPS%20USER%20SAVING%3A%3A-2%2C100%20Gas%2FTx%3A%3ASkips%20cold%20ProxyAdmin%20slot%20SLOAD%7CPREIMAGE%20SHIFT%3A%3A-%201%20Offset%3A%3ABlocks%20Solidity%20mapping%20keccak256%20match%7CDENCUN%20SELFDESTRUCT%3A%3AEIP-6780%20Safe%3A%3ANo%20longer%20deletes%20deployed%20logic%20code!)

## 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

| Proxy Architecture | Per-Call User Gas Overhead | Upgrade Code Location | Multi-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 proxy | Higher gas on high-frequency DEX calls |
| **UUPS Proxy (EIP-1822)** | **~2,600 gas** (`IMPL` SLOAD + `DELEGATECALL`) | **Implementation Contract** | 1 tx per proxy | Forgetting `UUPSUpgradeable` bricks upgrades |
| **Beacon Proxy (EIP-1967)** | ~4,900 gas (`BEACON` SLOAD + `STATICCALL` + `DELEGATECALL`) | Central `UpgradeableBeacon` | **1 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)** | Impossible | Zero upgrade bug surface (e.g., SudoAMM pairs) |

![Cumulative annual user gas cost across 1M transactions comparing EIP-1167 Clones, UUPS, Transparent, and Beacon](/api/figure?type=bars&title=Proxy%20Pattern%20Overhead%20per%201%2C000%2C000%20User%20Calls&subtitle=Incremental%20proxy%20routing%20gas%20units%20%28excluding%20business%20logic%29%20across%20four%20EVM%20proxy%20standards&steps=EIP-1167%20Immutable%20Clone%3A%3A780M%20gas%20%2F%201M%20txs%3B%2045-byte%20bytecode%2C%20zero%20SLOAD%7CEIP-1822%20UUPS%20Proxy%3A%3A2%2C600M%20gas%20%2F%201M%20txs%3B%201%20cold%20SLOAD%20for%20ERC-1967%20IMPL_SLOT%7CTransparent%20Proxy%20%28OZ%20v5%29%3A%3A4%2C700M%20gas%20%2F%201M%20txs%3B%202%20cold%20SLOADs%20%28ADMIN%20%2B%20IMPL%29%7CBeacon%20Proxy%20%28Multi-Vault%29%3A%3A4%2C900M%20gas%20%2F%201M%20txs%3B%20trades%20%2B2.3k%2Ftx%20for%20O%281%29%20fleet%20upgrade&metrics=ADMIN%20SLOT%3A%3A0xb53127..103%3A%3Akeccak256%28eip1967.proxy.admin%29%20-%201%7CBEACON%20SLOT%3A%3A0xa3f0ad..790%3A%3Akeccak256%28eip1967.proxy.beacon%29%20-%201%7CPROXIABLE%20UUID%3A%3AAnti-Brick%20Check%3A%3AReverts%20if%20newImpl%20lacks%20UUPS%20slot%7CFRONT-RUN%20INIT%3A%3A_data%20!%3D%20%22%22%3A%3AAlways%20initialize%20inside%20deploy%20tx!)

## 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
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 Tx_1 and call proxy.initialize(admin) in Tx_2!
 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](/protocols/eip-2535-diamond-multi-facet-delegatecall-selector-clashes), inheritance storage safety in [EIP-7201 namespaced storage layouts](/protocols/eip-7201-namespaced-storage-layout-audit-upgrade-safety), and governance delays in [TimelockController multisig vetoes](/protocols/timelockcontroller-multisig-quorum-emergency-guardian-veto) inside our [EIP-712, Permit2 & Proxy Security hub](/topics/erc721-erc1155-eip712-permit-security).

## 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.


## Source URLs

- https://eips.ethereum.org/EIPS/eip-1967
- https://eips.ethereum.org/EIPS/eip-1822
- https://docs.openzeppelin.com/contracts/5.x/api/proxy

## Citation

- APA: Dr. Devon Kurosawa, PhD. (2026). 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
- Canonical article: [ERC-1967 Transparent vs EIP-1822 UUPS Proxies: Storage Slots & Uninitialized Logic Exploits](https://nftvenueledger.com/protocols/erc-1967-transparent-vs-eip-1822-uups-proxy-storage-slots)
- Site research index: [NFTVenue Ledger](https://nftvenueledger.com/llms-full.txt)
