What is a transparent proxy in smart contracts?
A transparent proxy is an upgradeable proxy that decides where a call goes by who sent it: calls from the admin reach only the upgrade logic in the proxy, and calls from anyone else are always forwarded to the implementation. The rule exists so that a function in the implementation can never be shadowed by a proxy function with the same selector.
What problem does it solve?
A proxy with its own functions, such as an upgrade function, shares one 4-byte selector space with the implementation it forwards to, so a call from a user could hit the proxy instead. OpenZeppelin described this clash in 2018 and answered it with two rules: if the admin calls, the proxy never delegates, and if anyone else calls, it always does (OpenZeppelin).
| Caller | Upgrade call | Any other call |
|---|---|---|
| Admin | Handled by the proxy | Fails |
| Anyone else | Forwarded to the implementation | Forwarded to the implementation |
The routing has a cost, since every call compares the sender with the admin before anything else, and OpenZeppelin notes that a transparent proxy is more expensive to deploy than a UUPS proxy (OpenZeppelin). In return, the implementation carries no upgrade code, so a bad implementation can't remove the way to upgrade again.
What does the routing look like in code?
Routing by sender, with no public functions on the proxy (illustrative, not audited code) TransparentRouting.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
contract TransparentRouting {
bytes32 internal constant IMPL_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
address internal immutable admin;
constructor(address admin_, address impl) {
admin = admin_;
assembly { sstore(IMPL_SLOT, impl) }
}
fallback() external payable { _route(); }
receive() external payable { _route(); }
function _route() internal {
if (msg.sender == admin) {
require(msg.sig == bytes4(keccak256("upgradeTo(address)")), "admin can only upgrade");
address newImpl = abi.decode(msg.data[4:], (address));
assembly { sstore(IMPL_SLOT, newImpl) }
return;
}
assembly {
calldatacopy(0, 0, calldatasize())
let ok := delegatecall(gas(), sload(IMPL_SLOT), 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch ok
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
}
What should you check on a transparent proxy?
- In OpenZeppelin 5.x the proxy deploys its own ProxyAdmin and accepts upgrades only through it (OpenZeppelin), so check who owns that ProxyAdmin.
- The admin is never an account that also uses the protocol, since its calls can't reach the implementation.
- The implementation locks its initializer, and the proxy is initialized in its deployment transaction.
- Each new implementation keeps the old storage layout.
Sources
- The transparent proxy pattern, OpenZeppelin checked 3 December 2026
- Proxies API, OpenZeppelin docs checked 3 December 2026