diff --git a/diffs/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_before_AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_after.md b/diffs/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_before_AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_after.md new file mode 100644 index 000000000..c15d3e2bc --- /dev/null +++ b/diffs/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_before_AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol new file mode 100644 index 000000000..2e370ba1a --- /dev/null +++ b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IProposalGenericExecutor} from 'aave-helpers/src/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title Audit cost reimbursement + * @author BGD labs + * - Discussion: https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/4#p-48735-activation-stage-3 + */ +contract AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924 is IProposalGenericExecutor { + address public constant BGD_RECEIVER = 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF; + + function execute() external { + AaveV3Ethereum.COLLECTOR.transfer( + AaveV3EthereumAssets.GHO_UNDERLYING, + BGD_RECEIVER, + 76_000 ether + ); + } +} diff --git a/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.t.sol b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.t.sol new file mode 100644 index 000000000..404253373 --- /dev/null +++ b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.t.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum, AaveV3EthereumAssets} from 'aave-address-book/AaveV3Ethereum.sol'; +import {IERC20} from 'solidity-utils/contracts/oz-common/interfaces/IERC20.sol'; +import {ProtocolV3TestBase, ReserveConfig} from 'aave-helpers/src/ProtocolV3TestBase.sol'; +import {AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924} from './AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol'; + +/** + * @dev Test for AaveV3Ethereum_GHOBorrowRateUpdate_20240814 + * command: FOUNDRY_PROFILE=mainnet forge test --match-path=src/20240924_Multi_UpgradeAllAaveInstancesTo32/AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.t.sol -vv + */ +contract AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924_Test is ProtocolV3TestBase { + address public constant BGD_RECEIVER = 0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF; + uint256 public constant AUDIT_COST = 76_000 ether; + AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924 internal proposal; + + function setUp() public { + vm.createSelectFork(vm.rpcUrl('mainnet'), 20872348); + proposal = new AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + uint256 collectorBalanceBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + uint256 bgdBalanceBefore = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(BGD_RECEIVER); + defaultTest( + 'AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924', + AaveV3Ethereum.POOL, + address(proposal) + ); + uint256 collectorBalanceAfter = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf( + address(AaveV3Ethereum.COLLECTOR) + ); + uint256 bgdBalanceAfter = IERC20(AaveV3EthereumAssets.GHO_UNDERLYING).balanceOf(BGD_RECEIVER); + assertEq(collectorBalanceBefore - AUDIT_COST, collectorBalanceAfter); + assertEq(bgdBalanceBefore + AUDIT_COST, bgdBalanceAfter); + } +} diff --git a/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32.md b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32.md new file mode 100644 index 000000000..4b55d0008 --- /dev/null +++ b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32.md @@ -0,0 +1,70 @@ +--- +title: "Upgrade all Aave instances to 3.2" +author: "BGD Labs @bgdlabs" +discussions: "https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/3" +snapshot: "https://snapshot.org/#/aave.eth/proposal/0x68ce69b5e71df1d77c2ad814a5d41162a40be54473576ff590d0b1bb5afde4a7" +--- + +## Simple Summary + +Upgrades all active Aave instances to Aave 3.2 which debuts "Liquid eModes" and fully deprecated stable borrowing. + +## Motivation + +EModes have been a powerful feature since the inception of Aave v3. +Liquid eModes builds on this success by increase the flexibility in configuring eModes. With Liquid eModes it is now possible, to have a single asset be listed in multiple eModes. +At the same time, it's possible to granularly control which assets are collateral and borrowable inside an eMode. + +Stable debt has been off-boarded from Aave v3 for quite some time. What was remaining on the protocol code were merely artifacts that increased gas consumption and code size. +Therefore the 3.2 release removes these artifacts in a backwards compatible way. + +_In addition to the upgrade itself, the proposal payload includes reimbursement of $76’000 denominated in GHO, to cover the cost of extra external security procedures incurred._ + +## Specification + +Aave 3.2 focuses on two main areas of the aave protocol: + +- The final deprecation of stable borrowing +- Improvements on the eModes, introducing "Liquid eModes" + +The proposal will execute to following operations on each active Aave v3 pool: + +- Upgrade the Pool/L2Pool implementation to 3.2, which will internally set the stableDebtToken address to `address(0)` on all assets +- Upgrade the PoolConfigurator implementation to 3.2 +- Deploy new ProtocolDataProvider compatible with v3.2, and set it on the addresses provider contract +- Migrate all assets currently in eMode to be both borrowable & collateral in eMode +- Migrate the InterestRateStrategy to a new version without stable rate calculations + +An additional payload will transfer `76,000.00` GHO to the BGD-controlled address `0xb812d0944f8F581DfAA3a93Dda0d22EcEf51A9CF`. + +## Security procedures + +In addition to unit tests & integration test suites, the changes have been audited in 5 audits by 4 independent auditors: + +### Stable Rate and Liquid eModes + +- [Certora](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-10_Certora_Aave-v3.2_Stable_Rate_Removal.pdf) +- [Enigma Dark](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-30_Enigma_Aave-v3.2.pdf) + +### Liquid eModes + +- [Certora](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-19_Certora_Aave-v3.2_Liquid_eModes.pdf) +- [Oxorio](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-12_Oxorio_Aav3-v3.2.pdf) +- [Pashov](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/audits/2024-09-15_Pashov_Aave-v3.2.pdf) + +## References + +- [Payload Implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/UpgradePayload.sol) +- [New initialization logic of Pool](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/CustomInitialize.sol) +- [New L1 pool implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/PoolInstance.sol) +- [New L2 pool implementation](https://github.com/bgd-labs/protocol-v3.2-upgrade/blob/main/src/contracts/L2PoolInstance.sol) +- [Payload Tests](https://github.com/bgd-labs/protocol-v3.2-upgrade/tree/main/tests) +- [Live-code and post execution state diffs](https://github.com/bgd-labs/protocol-v3.2-upgrade/tree/main/diffs) +- [PoolDiff](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/3.1_3.2_L2PoolDiff.md), [PoolConfiguratorDiff](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/3.1-3.2_PoolConfiguratorDiff.md) +- [Snapshot](https://snapshot.org/#/aave.eth/proposal/0x68ce69b5e71df1d77c2ad814a5d41162a40be54473576ff590d0b1bb5afde4a7) +- [Discussion](https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/3) +- [Migration guide](https://github.com/aave-dao/aave-v3-origin/blob/v3.2.0/docs/3.2/Aave-3.2-features.md) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol new file mode 100644 index 000000000..94e3491b6 --- /dev/null +++ b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/src/GovV3Helpers.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {GovernanceV3ZkSync} from 'aave-address-book/GovernanceV3ZkSync.sol'; +import {EthereumScript, PolygonScript, AvalancheScript, OptimismScript, ArbitrumScript, MetisScript, BaseScript, GnosisScript, ScrollScript, BNBScript, ChainIds} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924} from './AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924.sol'; + +library Payloads { + address internal constant POLYGON = 0x78DFB8b12bbCc65f415284f3C1ffA412678a725d; + address internal constant GNOSIS = 0xe427FCbD54169136391cfEDf68E96abB13dA87A0; + address internal constant OPTIMISM = 0x09B5429d2c70b31379dAfAdC3F0fa015306a8d04; + address internal constant ARBITRUM = 0xAdDb96Fb6A795faf042DD25BD4710267C41D1F74; + address internal constant AVALANCHE = 0x09262648Fce84992B68AbF216BfC47731F154462; + address internal constant BASE = 0x84B08568906ee891de1c23175E5B92d7Df7DDCc4; + address internal constant SCROLL = 0x89654c66A6abd7174b525D05C2f4c442a615cee8; + address internal constant BNB = 0xe88fb4EAf67Ea87BB458e24C94BEf0EB02b5F449; + address internal constant PROTO = 0xb08c48659d6035698B0f1a61deA9C14a59f89622; + address internal constant ZKSYNC = 0x9c0429dC6a8aA591B4d8bA0f3724987F5fB118E6; + address internal constant METIS = 0x84B08568906ee891de1c23175E5B92d7Df7DDCc4; + address internal constant LIDO = 0xf519083f06D2cD0Aa6dd780f0D06b2987a77F290; + address internal constant ETHERFI = 0x4E48C38a08388c29d9b71c657367e0D0cEf3A790; +} + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployEthereum chain=mainnet + * verify-command: FOUNDRY_PROFILE=mainnet npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + address payload4 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](4); + actions[0] = GovV3Helpers.buildAction(Payloads.PROTO); + actions[1] = GovV3Helpers.buildAction(Payloads.LIDO); + actions[2] = GovV3Helpers.buildAction(Payloads.ETHERFI); + actions[3] = GovV3Helpers.buildAction(payload4); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Polygon + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployPolygon chain=polygon + * verify-command: FOUNDRY_PROFILE=polygon npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/137/run-latest.json + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.POLYGON); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Avalanche + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployAvalanche chain=avalanche + * verify-command: FOUNDRY_PROFILE=avalanche npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/43114/run-latest.json + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.AVALANCHE); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Optimism + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployOptimism chain=optimism + * verify-command: FOUNDRY_PROFILE=optimism npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/10/run-latest.json + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.OPTIMISM); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Arbitrum + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployArbitrum chain=arbitrum + * verify-command: FOUNDRY_PROFILE=arbitrum npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/42161/run-latest.json + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.ARBITRUM); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Metis + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployMetis chain=metis + * verify-command: FOUNDRY_PROFILE=metis npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/1088/run-latest.json + */ +contract DeployMetis is MetisScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.METIS); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Base + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployBase chain=base + * verify-command: FOUNDRY_PROFILE=base npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/8453/run-latest.json + */ +contract DeployBase is BaseScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.BASE); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Gnosis + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployGnosis chain=gnosis + * verify-command: FOUNDRY_PROFILE=gnosis npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/100/run-latest.json + */ +contract DeployGnosis is GnosisScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.GNOSIS); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Scroll + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployScroll chain=scroll + * verify-command: FOUNDRY_PROFILE=scroll npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/534352/run-latest.json + */ +contract DeployScroll is ScrollScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.SCROLL); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy BNB + * deploy-command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployBNB chain=bnb + * verify-command: FOUNDRY_PROFILE=bnb npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/56/run-latest.json + */ +contract DeployBNB is BNBScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.BNB); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](11); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](4); + actionsEthereum[0] = GovV3Helpers.buildAction(Payloads.PROTO); + actionsEthereum[1] = GovV3Helpers.buildAction(Payloads.LIDO); + actionsEthereum[2] = GovV3Helpers.buildAction(Payloads.ETHERFI); + actionsEthereum[3] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_UpgradeAllAaveInstancesTo32_20240924).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1); + actionsPolygon[0] = GovV3Helpers.buildAction(Payloads.POLYGON); + payloads[1] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsAvalanche = new IPayloadsControllerCore.ExecutionAction[](1); + actionsAvalanche[0] = GovV3Helpers.buildAction(Payloads.AVALANCHE); + payloads[2] = GovV3Helpers.buildAvalanchePayload(vm, actionsAvalanche); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); + actionsOptimism[0] = GovV3Helpers.buildAction(Payloads.OPTIMISM); + payloads[3] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsArbitrum[0] = GovV3Helpers.buildAction(Payloads.ARBITRUM); + payloads[4] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsMetis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsMetis[0] = GovV3Helpers.buildAction(Payloads.METIS); + payloads[5] = GovV3Helpers.buildMetisPayload(vm, actionsMetis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBase = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBase[0] = GovV3Helpers.buildAction(Payloads.BASE); + payloads[6] = GovV3Helpers.buildBasePayload(vm, actionsBase); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsGnosis[0] = GovV3Helpers.buildAction(Payloads.GNOSIS); + payloads[7] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1); + actionsScroll[0] = GovV3Helpers.buildAction(Payloads.SCROLL); + payloads[8] = GovV3Helpers.buildScrollPayload(vm, actionsScroll); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBNB = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBNB[0] = GovV3Helpers.buildAction(Payloads.BNB); + payloads[9] = GovV3Helpers.buildBNBPayload(vm, actionsBNB); + + payloads[10] = PayloadsControllerUtils.Payload({ + chain: ChainIds.ZKSYNC, + accessLevel: PayloadsControllerUtils.AccessControl.Level_1, + payloadsController: address(GovernanceV3ZkSync.PAYLOADS_CONTROLLER), + payloadId: 6 + }); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovernanceV3Ethereum.VOTING_PORTAL_ETH_POL, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32.md' + ) + ); + } +} diff --git a/src/20240924_Multi_UpgradeAllAaveInstancesTo32/config.ts b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/config.ts new file mode 100644 index 000000000..5ff06b646 --- /dev/null +++ b/src/20240924_Multi_UpgradeAllAaveInstancesTo32/config.ts @@ -0,0 +1,41 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + author: 'BGD Labs @bgdlabs', + pools: [ + 'AaveV3Ethereum', + 'AaveV3EthereumLido', + 'AaveV3Polygon', + 'AaveV3Avalanche', + 'AaveV3Optimism', + 'AaveV3Arbitrum', + 'AaveV3Metis', + 'AaveV3Base', + 'AaveV3Gnosis', + 'AaveV3Scroll', + 'AaveV3BNB', + 'AaveV3ZkSync', + ], + title: 'Upgrade all Aave instances to 3.2', + shortName: 'UpgradeAllAaveInstancesTo32', + date: '20240924', + discussion: 'https://governance.aave.com/t/bgd-aave-v3-2-liquid-emodes/19037/3', + snapshot: + 'https://snapshot.org/#/aave.eth/proposal/0x68ce69b5e71df1d77c2ad814a5d41162a40be54473576ff590d0b1bb5afde4a7', + votingNetwork: 'POLYGON', + }, + poolOptions: { + AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 20820879}}, + AaveV3EthereumLido: {configs: {OTHERS: {}}, cache: {blockNumber: 20820880}}, + AaveV3Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 62219908}}, + AaveV3Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 50938881}}, + AaveV3Optimism: {configs: {OTHERS: {}}, cache: {blockNumber: 125793616}}, + AaveV3Arbitrum: {configs: {OTHERS: {}}, cache: {blockNumber: 256879313}}, + AaveV3Metis: {configs: {OTHERS: {}}, cache: {blockNumber: 18557401}}, + AaveV3Base: {configs: {OTHERS: {}}, cache: {blockNumber: 20198333}}, + AaveV3Gnosis: {configs: {OTHERS: {}}, cache: {blockNumber: 36166047}}, + AaveV3Scroll: {configs: {OTHERS: {}}, cache: {blockNumber: 9573514}}, + AaveV3BNB: {configs: {OTHERS: {}}, cache: {blockNumber: 42535536}}, + AaveV3ZkSync: {configs: {OTHERS: {}}, cache: {blockNumber: 45002749}}, + }, +}; diff --git a/zksync/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol b/zksync/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol new file mode 100644 index 000000000..a9c132b8a --- /dev/null +++ b/zksync/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore} from 'aave-helpers/src/GovV3Helpers.sol'; +import {ZkSyncScript} from 'solidity-utils/contracts/utils/ScriptUtils.sol'; +import {Payloads} from '../../../src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol'; + +/** + * @dev Deploy ZkSync + * deploy-command: make deploy-ledger contract=zksync/src/20240924_Multi_UpgradeAllAaveInstancesTo32/UpgradeAllAaveInstancesTo32_20240924.s.sol:DeployZkSync chain=zksync + * verify-command: FOUNDRY_PROFILE=zksync npx catapulta-verify -b broadcast/UpgradeAllAaveInstancesTo32_20240924.s.sol/324/run-latest.json + */ +contract DeployZkSync is ZkSyncScript { + function run() external broadcast { + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(Payloads.ZKSYNC); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +}