This document outlines the technical process for upgrading the Aave V3 protocol from version 3.4 to version 3.5 across various networks.
The upgrade is executed via specialized UpgradePayload contracts deployed on each network. A specific version, UpgradePayloadMainnetCore, handles additional steps required for the Ethereum Mainnet to manage the custom functionalities of GHO and AAVE tokens.
- New Implementations: New implementations for the
Pool,AToken, andVariableDebtTokencontracts are deployed. These incorporate the v3.5 features and optimizations. - Upgrade Payloads:
UpgradePayload(for most networks) andUpgradePayloadMainnetCore(for Ethereum Mainnet) contain the sequenced steps to orchestrate the upgrade. - Deployment Scripts: Forge scripts (
Deploy.s.sol) are used to deterministically deploy all necessary new implementation contracts and the corresponding upgrade payload contract for each network.
The Aave v3.5 upgrade is primarily a logic upgrade. Unlike the v3.4 transition, it does not involve complex data migrations or storage slot cleanups. The core changes, such as improved rounding and accounting, are encapsulated within the new contract implementations. The payload's main responsibility is to switch the implementation pointers for the Pool and the associated tokens for each reserve.
This sequence applies to most networks (Polygon, Optimism, Arbitrum, etc.).
- Upgrade Pool Implementation: The
Poolcontract proxy is updated to point to the new v3.5Poolimplementation (POOL_IMPL). - Update AToken/VariableDebtToken Implementations: The payload iterates through all reserves listed in the
Pool:- For each reserve, it calls
POOL_CONFIGURATOR.updateATokento upgrade the reserve's AToken proxy to the new standardATokenInstanceimplementation (A_TOKEN_IMPL). - It then calls
POOL_CONFIGURATOR.updateVariableDebtTokento upgrade the reserve's VariableDebtToken proxy to the new standardVariableDebtTokenInstanceimplementation (V_TOKEN_IMPL).
- For each reserve, it calls
This sequence includes the general steps plus specific handling for the AAVE and GHO tokens, executed by the UpgradePayloadMainnetCore contract.
- Execute Default Upgrade: The
_defaultUpgrade()function is called, performing the steps from the "General Upgrade Sequence" above. This process is configured to skip theaAAVEandvGHOtokens, which require special handling. - Upgrade vGHO Implementation:
POOL_CONFIGURATOR.updateVariableDebtTokenis called for the GHO reserve, setting its implementation to the customV_TOKEN_GHO_IMPL. This implementation ensures continued compatibility with the GHO discount rate strategy. - Upgrade aAAVE Implementation:
POOL_CONFIGURATOR.updateATokenis called for the AAVE reserve, setting its implementation to theA_TOKEN_WITH_DELEGATION_IMPL. This preserves the vote delegation functionality unique to the AAVE token.