Proxy Contract
Smart contract that delegates function calls to another contract, enabling upgradeable logic.
Last Updated
2026-03-19
Related Concepts
What is Proxy Contract?
A proxy contract is a smart contract that acts as an intermediary, forwarding user requests to a separate "logic" contract where the actual code is executed. This architectural pattern allows developers to upgrade the functionality of a protocol while maintaining a constant address and preserving all existing user data.
How does Proxy Contract work?
- The proxy contract is deployed with its own storage space, but it does not contain the core business logic of the application.
- A second contract, known as the "implementation" or "logic" contract, is deployed with the actual functions and rules.
- The proxy stores the address of the current implementation contract in its own internal configuration.
- When a user calls a function on the proxy, it uses a special instruction called
delegatecallto execute the code from the logic contract. - Crucially, the code is executed using the proxy's storage, so balances and settings are updated on the proxy itself.
- To upgrade the protocol, the developer simply deploys a new logic contract and updates the address stored within the proxy.
Why does Proxy Contract matter?
Proxy contracts are essential for building production-grade decentralized applications that can be improved or patched after their initial deployment. By separating the logic from the data, they provide a path for developers to fix critical bugs and add new features without forcing users to migrate their funds to a completely new address.
Key features of Proxy Contract
- Separation of smart contract logic from persistent data storage
- Enablement of protocol upgrades without changing the user-facing address
- Utilization of
delegatecallto execute external code in a local context - Maintenance of user balances and state across multiple code versions
- Requirement for careful storage management to avoid memory collisions
- Standardized patterns like Transparent and UUPS proxies for security
Examples of Proxy Contract
Most major DeFi protocols, such as Aave and Compound, use proxy contracts to manage their frequent upgrades and optimizations. The USDC stablecoin uses a proxy to allow its issuer to add new features or comply with regulatory changes without reissuing all tokens.
A developer might spend 2 to 3 days
testing a new implementation before updating the proxy's address. This pattern ensures that 1 single address remains the source of truth for the entire community.
