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.
Complex implementation
Section titled “Complex implementation”Ref - ‣
Using the Transparent Proxy pattern
Section titled “Using the Transparent Proxy pattern”$1b- Deploy ImplementationV1
- Deploy StorageProxy and give it the address of
ImplementationV1 - Select ImplementationV1 and change the
At addressfield to the address of the proxy contract - Play with
setNumandnum - Try updating the implementation via the
ProxyAdmincontract
Problems
Section titled “Problems”- Function collissions (across implementation contract and logic contract)
- Storage slot re-ordering
Simple Proxy vs Transparent proxy
Section titled “Simple Proxy vs Transparent proxy”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.