Incentives Proxy

This proxy follows the EIP-1967 pattern with an immutable admin. It:

  • Delegates calls to an implementation contract.

  • Lets the admin upgrade the implementation.

  • Provides an optional initializer for first setup.

Essentially, this is the upgradeable backbone used by the protocol components.

Constructor

  • constructor(address admin) Sets the immutable proxy admin. This admin controls future upgrades.


Functions

  • admin() → address Returns the address of the proxy admin. ⚠️ Only callable by the admin; otherwise, the call is delegated.

  • implementation() → address Returns the current implementation address behind the proxy. ⚠️ Also restricted to the admin.

  • initialize(address _logic, bytes _data) (payable) Initializes the proxy with an implementation (_logic) and optionally executes a call (_data) on it. Used at deployment to bootstrap the proxied contract.

  • upgradeTo(address newImplementation) Upgrades the proxy to a new implementation contract. Admin-only.

  • upgradeToAndCall(address newImplementation, bytes data) (payable) Upgrades the proxy to a new implementation and executes a function on it with the provided calldata. Commonly used to both upgrade and initialize new logic in one transaction.


Fallback

  • fallback() payable Delegates any unknown function calls to the current implementation.


Events

  • Upgraded(address implementation) Emitted when the proxy is upgraded to a new implementation contract.

Last updated

Was this helpful?