Skip to content

Transparent proxy

Course: Upgradable contracts - chapter 17

A transparent proxy in Ethereum (ETH) refers to a specific type of proxy contract that acts as an intermediary between a user and the actual logic or functionality of a smart contract, while remaining “transparent” in the sense that users or other contracts are unaware that they are interacting with a proxy instead of the underlying contract directly.

Ref - ‣

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/transparent/TransparentUpgradeableProxy.sol

$1b
  1. Deploy ImplementationV1
  2. Deploy StorageProxy and give it the address of ImplementationV1
  3. Select ImplementationV1 and change the At address field to the address of the proxy contract
  4. Play with setNum and num
  5. Try updating the implementation via the ProxyAdmin contract
  1. Function collissions (across implementation contract and logic contract)
  2. Storage slot re-ordering

A simple proxy (often called a basic proxy) typically uses delegatecall to forward calls to another contract (implementation). However, it doesn’t have the protections or additional features that come with the transparent proxy pattern:

  • Lack of transparency: If the user interacts with a basic proxy, they may have more visibility into the proxy behavior, or the proxy could expose implementation-specific details.
  • Admin visibility: In some proxies, the admin can interact with the contract through the same functions as the user, potentially making it more difficult to distinguish between admin-level functionality and regular contract behavior.