From 3ed6487b6968fce0218a530df5f87d61e8c24cc0 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 13 Mar 2024 10:14:22 +0100 Subject: [PATCH 1/8] feat: Update CrossChainController implementation and CCIP adapters --- ...ImplementationAndCCIPAdapters_20240313.sol | 133 ++++++++++ ...plementationAndCCIPAdapters_20240313.t.sol | 113 ++++++++ ...ImplementationAndCCIPAdapters_20240313.sol | 80 ++++++ ...plementationAndCCIPAdapters_20240313.t.sol | 85 ++++++ ...ImplementationAndCCIPAdapters_20240313.sol | 161 +++++++++++ ...plementationAndCCIPAdapters_20240313.t.sol | 168 ++++++++++++ ...ImplementationAndCCIPAdapters_20240313.sol | 130 +++++++++ ...plementationAndCCIPAdapters_20240313.t.sol | 112 ++++++++ .../BaseTest.sol | 249 ++++++++++++++++++ .../UpdateADIImplementationAndCCIPAdapters.md | 22 ++ ...plementationAndCCIPAdapters_20240313.s.sol | 148 +++++++++++ .../config.ts | 18 ++ 12 files changed, 1419 insertions(+) create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..79c9aab43 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; +import {MiscAvalanche} from 'aave-address-book/MiscAvalanche.sol'; +import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; +import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; + +/** + * @title Update a.DI implementation and CCIP adapters + * @author BGD Labs @bgdlabs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 is + IProposalGenericExecutor +{ + address public constant CCIP_ADAPTER_TO_REMOVE = 0x3F006299eC88985c18E6e885EeA29A49eC579882; + address public constant CCIP_NEW_ADAPTER = 0x2b88C83727B0E290B76EB3F6133994fF81B7f355; + address public constant DESTINATION_CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; + address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = + 0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22; + + function execute() external { + // Update CrossChainController implementation + ProxyAdmin(MiscAvalanche.PROXY_ADMIN).upgradeAndCall( + TransparentUpgradeableProxy(payable(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER)), + NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, + abi.encodeWithSignature('initializeRevision()') + ); + + // remove old Receiver bridge adapter + ICrossChainReceiver(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER) + .disallowReceiverBridgeAdapters(_getReceiverBridgeAdaptersToRemove()); + + // remove forwarding adapters + ICrossChainForwarder(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( + _getForwarderBridgeAdaptersToRemove() + ); + + // add receiver adapters + ICrossChainReceiver(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToAllow() + ); + + // add forwarding adapters + ICrossChainForwarder(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( + _getForwarderBridgeAdaptersToEnable() + ); + } + + function _getReceiverBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + // remove old Receiver bridge adapter + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: chainIds + }); + + return bridgeAdaptersToRemove; + } + + function _getForwarderBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainForwarder.BridgeAdapterToDisable[] + memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); + + forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: chainIds + }); + + return forwarderAdaptersToRemove; + } + + function _getReceiverBridgeAdaptersToAllow() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_NEW_ADAPTER, + chainIds: chainIds + }); + + return bridgeAdapterConfig; + } + + function _getForwarderBridgeAdaptersToEnable() + internal + pure + returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + { + ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] + memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( + 1 + ); + + bridgeAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER, + destinationChainId: ChainIds.MAINNET + }); + + return bridgeAdaptersToEnable; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..56eb15392 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; +import {MiscAvalanche} from 'aave-address-book/MiscAvalanche.sol'; +import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import './BaseTest.sol'; + +import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +/** + * @dev Test for AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { + AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; + + constructor() + BaseTest( + GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, + MiscAvalanche.PROXY_ADMIN, + 'avalanche', + 42801819 + ) + {} + + function setUp() public override { + super.setUp(); + payload = new AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313(); + payloadAddress = address(payload); + } + + function _getAdapterNames() internal view override returns (AdapterName[] memory) { + AdapterName[] memory adapterNames = new AdapterName[](1); + adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); + + return adapterNames; + } + + function _checkCorrectPathConfiguration() internal override { + assertEq(ethereumPayload.CCIP_NEW_ADAPTER(), payload.DESTINATION_CCIP_NEW_ADAPTER()); + } + + function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { + TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); + trustedRemotes[0] = TrustedRemote({ + adapter: payload.CCIP_NEW_ADAPTER(), + expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, + remoteChainId: ChainIds.MAINNET + }); + + return trustedRemotes; + } + + function _getForwarderAdaptersByChain( + bool afterExecution + ) internal view override returns (ForwarderAdapters[] memory) { + ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](1); + + ICrossChainForwarder.ChainIdBridgeConfig[] + memory adapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); + adapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + adapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); + adapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER(); + } + forwarderAdapters[0].adapters = adapters; + forwarderAdapters[0].chainId = ChainIds.MAINNET; + + return forwarderAdapters; + } + + function _getReceiverAdaptersByChain( + bool afterExecution + ) internal view override returns (AdaptersByChain[] memory) { + address[] memory adapters = new address[](1); + AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); + + adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + adapters[0] = payload.CCIP_NEW_ADAPTER(); + } + receiverAdaptersByChain[0].adapters = adapters; + receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; + + return receiverAdaptersByChain; + } + + function _getAdapterByChain( + bool afterExecution + ) internal view override returns (AdapterAllowed[] memory) { + AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); + adaptersAllowed[0] = AdapterAllowed({ + adapter: payload.CCIP_ADAPTER_TO_REMOVE(), + chainId: ChainIds.MAINNET, + allowed: true + }); + adaptersAllowed[1] = AdapterAllowed({ + adapter: payload.CCIP_NEW_ADAPTER(), + chainId: ChainIds.MAINNET, + allowed: false + }); + if (afterExecution) { + adaptersAllowed[0].allowed = false; + adaptersAllowed[1].allowed = true; + } + + return adaptersAllowed; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..9f81ee3ea --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; +import {MiscBNB} from 'aave-address-book/MiscBNB.sol'; +import {GovernanceV3BNB} from 'aave-address-book/GovernanceV3BNB.sol'; +import {ICrossChainReceiver} from 'aave-address-book/common/ICrossChainController.sol'; + +/** + * @title Update a.DI implementation and CCIP adapters + * @author BGD Labs @bgdlabs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 is IProposalGenericExecutor { + address public constant CCIP_ADAPTER_TO_REMOVE = 0x746c675dAB49Bcd5BB9Dc85161f2d7Eb435009bf; + address public constant CCIP_NEW_ADAPTER = 0xAE93BEa44dcbE52B625169588574d31e36fb3A67; + address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = + 0xf41193E25408F652AF878c47E4401A01B5E4B682; + + function execute() external { + // Update CrossChainController implementation + ProxyAdmin(MiscBNB.PROXY_ADMIN).upgradeAndCall( + TransparentUpgradeableProxy(payable(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER)), + NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, + abi.encodeWithSignature('initializeRevision()') + ); + + // remove old Receiver bridge adapter + ICrossChainReceiver(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToRemove() + ); + + // add receiver adapters + ICrossChainReceiver(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToAllow() + ); + } + + function _getReceiverBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: chainIds + }); + + return bridgeAdaptersToRemove; + } + + function _getReceiverBridgeAdaptersToAllow() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_NEW_ADAPTER, + chainIds: chainIds + }); + + return bridgeAdapterConfig; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..7e6c0fe1c --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3BNB} from 'aave-address-book/AaveV3BNB.sol'; +import {MiscBNB} from 'aave-address-book/MiscBNB.sol'; +import {GovernanceV3BNB} from 'aave-address-book/GovernanceV3BNB.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import './BaseTest.sol'; + +import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +/** + * @dev Test for AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { + AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; + + constructor() + BaseTest(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER, MiscBNB.PROXY_ADMIN, 'bnb', 36903911) + {} + + function setUp() public override { + super.setUp(); + payload = new AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313(); + payloadAddress = address(payload); + } + + function _getAdapterNames() internal view override returns (AdapterName[] memory) { + AdapterName[] memory adapterNames = new AdapterName[](1); + adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); + + return adapterNames; + } + + function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { + TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); + trustedRemotes[0] = TrustedRemote({ + adapter: payload.CCIP_NEW_ADAPTER(), + expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, + remoteChainId: ChainIds.MAINNET + }); + + return trustedRemotes; + } + + function _getReceiverAdaptersByChain( + bool afterExecution + ) internal view override returns (AdaptersByChain[] memory) { + address[] memory adapters = new address[](1); + AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); + + adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + adapters[0] = payload.CCIP_NEW_ADAPTER(); + } + receiverAdaptersByChain[0].adapters = adapters; + receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; + + return receiverAdaptersByChain; + } + + function _getAdapterByChain( + bool afterExecution + ) internal view override returns (AdapterAllowed[] memory) { + AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); + adaptersAllowed[0] = AdapterAllowed({ + adapter: payload.CCIP_ADAPTER_TO_REMOVE(), + chainId: ChainIds.MAINNET, + allowed: true + }); + adaptersAllowed[1] = AdapterAllowed({ + adapter: payload.CCIP_NEW_ADAPTER(), + chainId: ChainIds.MAINNET, + allowed: false + }); + if (afterExecution) { + adaptersAllowed[0].allowed = false; + adaptersAllowed[5].allowed = true; + } + + return adaptersAllowed; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..c6eb56b3d --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; +import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; + +/** + * @title Update a.DI implementation and CCIP adapters + * @author BGD Labs @bgdlabs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 is + IProposalGenericExecutor +{ + //receiver adapters to remove + address public constant CCIP_ADAPTER_TO_REMOVE = 0xDB8953194810b1942544fA528791278D458719D5; + // forwarder-receiver adapter pairs to add + address public constant CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; + + address public constant DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE = + 0x2b88C83727B0E290B76EB3F6133994fF81B7f355; + address public constant DESTINATION_CCIP_NEW_ADAPTER_POLYGON = + 0xe79757D55a1600eF28D816a893E78E9FCDE2019E; + address public constant DESTINATION_CCIP_NEW_ADAPTER_BNB = + 0xAE93BEa44dcbE52B625169588574d31e36fb3A67; + + address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = + 0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215; + + function execute() external { + // Update CrossChainController implementation + ProxyAdmin(MiscEthereum.PROXY_ADMIN).upgradeAndCall( + TransparentUpgradeableProxy(payable(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER)), + NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, + abi.encodeWithSignature('initializeRevision()') + ); + // add receiver adapters + ICrossChainReceiver(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToAllow() + ); + + // add forwarding adapters + ICrossChainForwarder(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( + _getForwarderBridgeAdaptersToEnable() + ); + + // remove old Receiver bridge adapter + ICrossChainReceiver(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToRemove() + ); + + // remove forwarding adapters + ICrossChainForwarder(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( + _getForwarderBridgeAdaptersToRemove() + ); + } + + function _getReceiverBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory receiverAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[]( + 1 + ); + + uint256[] memory receiverChainIds = new uint256[](1); + receiverChainIds[0] = ChainIds.POLYGON; + receiverChainIds[1] = ChainIds.AVALANCHE; + + receiverAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: receiverChainIds + }); + + return receiverAdaptersToRemove; + } + + function _getForwarderBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) + { + ICrossChainForwarder.BridgeAdapterToDisable[] + memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); + + uint256[] memory forwarderCCIPChainIds = new uint256[](3); + forwarderCCIPChainIds[0] = ChainIds.AVALANCHE; + forwarderCCIPChainIds[1] = ChainIds.POLYGON; + forwarderCCIPChainIds[2] = ChainIds.BNB; + + forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: forwarderCCIPChainIds + }); + + return forwarderAdaptersToRemove; + } + + function _getReceiverBridgeAdaptersToAllow() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory receiverChainIds = new uint256[](2); + receiverChainIds[0] = ChainIds.AVALANCHE; + receiverChainIds[1] = ChainIds.POLYGON; + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory receiverAdaptersToAllow = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[]( + 1 + ); + + receiverAdaptersToAllow[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_NEW_ADAPTER, + chainIds: receiverChainIds + }); + + return receiverAdaptersToAllow; + } + + function _getForwarderBridgeAdaptersToEnable() + internal + pure + returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + { + ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] + memory forwarderAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( + 3 + ); + // avalanche path + forwarderAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE, + destinationChainId: ChainIds.AVALANCHE + }); + + // polygon path + forwarderAdaptersToEnable[1] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_POLYGON, + destinationChainId: ChainIds.POLYGON + }); + + // binance path + forwarderAdaptersToEnable[2] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_BNB, + destinationChainId: ChainIds.BNB + }); + + return forwarderAdaptersToEnable; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..292f4368a --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,168 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; +import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; +import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; +import './BaseTest.sol'; +import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +/** + * @dev Test for AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { + AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; + AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal avalanchePayload; + AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 internal bnbPayload; + AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal polygonPayload; + + constructor() + BaseTest( + GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, + MiscEthereum.PROXY_ADMIN, + 'mainnet', + 19418547 + ) + {} + + function setUp() public override { + super.setUp(); + payload = new AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313(); + avalanchePayload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); + bnbPayload = new AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313(); + polygonPayload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); + payloadAddress = address(payload); + } + + function _getAdapterNames() internal view override returns (AdapterName[] memory) { + AdapterName[] memory adapterNames = new AdapterName[](1); + adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); + + return adapterNames; + } + + function _checkCorrectPathConfiguration() internal override { + assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE(), avalanchePayload.CCIP_NEW_ADAPTER()); + assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_BNB(), bnbPayload.CCIP_NEW_ADAPTER()); + assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_POLYGON(), polygonPayload.CCIP_NEW_ADAPTER()); + } + + function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { + TrustedRemote[] memory trustedRemotes = new TrustedRemote[](2); + trustedRemotes[0] = TrustedRemote({ + adapter: payload.CCIP_NEW_ADAPTER(), + expectedRemote: GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER, + remoteChainId: ChainIds.POLYGON + }); + trustedRemotes[1] = TrustedRemote({ + adapter: payload.CCIP_NEW_ADAPTER(), + expectedRemote: GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, + remoteChainId: ChainIds.AVALANCHE + }); + + return trustedRemotes; + } + + function _getReceiverAdaptersByChain( + bool afterExecution + ) internal view override returns (AdaptersByChain[] memory) { + address[] memory polygonAdapters = new address[](1); + address[] memory avalancheAdapters = new address[](1); + AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](2); + + polygonAdapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); + avalancheAdapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + polygonAdapters[0] = payload.CCIP_NEW_ADAPTER(); + avalancheAdapters[0] = payload.CCIP_NEW_ADAPTER(); + } + receiverAdaptersByChain[0].adapters = polygonAdapters; + receiverAdaptersByChain[0].chainId = ChainIds.POLYGON; + receiverAdaptersByChain[0].adapters = avalancheAdapters; + receiverAdaptersByChain[0].chainId = ChainIds.AVALANCHE; + + return receiverAdaptersByChain; + } + + function _getForwarderAdaptersByChain( + bool afterExecution + ) internal view override returns (ForwarderAdapters[] memory) { + ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](3); + + ICrossChainForwarder.ChainIdBridgeConfig[] + memory polygonAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); + ICrossChainForwarder.ChainIdBridgeConfig[] + memory avalancheAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); + ICrossChainForwarder.ChainIdBridgeConfig[] + memory binanceAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); + + // polygon + polygonAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); + // avalanche + avalancheAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); + // binance + binanceAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + // polygon + polygonAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); + polygonAdapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER_POLYGON(); + // avalanche + avalancheAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); + avalancheAdapters[0].destinationBridgeAdapter = payload + .DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE(); + // binance + binanceAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); + binanceAdapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER_BNB(); + } + forwarderAdapters[0].adapters = polygonAdapters; + forwarderAdapters[0].chainId = ChainIds.POLYGON; + forwarderAdapters[1].adapters = avalancheAdapters; + forwarderAdapters[1].chainId = ChainIds.AVALANCHE; + forwarderAdapters[2].adapters = binanceAdapters; + forwarderAdapters[2].chainId = ChainIds.BNB; + + return forwarderAdapters; + } + + function _getAdapterByChain( + bool afterExecution + ) internal view override returns (AdapterAllowed[] memory) { + AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](4); + adaptersAllowed[0] = AdapterAllowed({ + adapter: payload.CCIP_ADAPTER_TO_REMOVE(), + chainId: ChainIds.POLYGON, + allowed: true + }); + adaptersAllowed[1] = AdapterAllowed({ + adapter: payload.CCIP_ADAPTER_TO_REMOVE(), + chainId: ChainIds.AVALANCHE, + allowed: true + }); + adaptersAllowed[2] = AdapterAllowed({ + adapter: payload.CCIP_NEW_ADAPTER(), + chainId: ChainIds.POLYGON, + allowed: false + }); + adaptersAllowed[3] = AdapterAllowed({ + adapter: payload.CCIP_NEW_ADAPTER(), + chainId: ChainIds.AVALANCHE, + allowed: false + }); + if (afterExecution) { + adaptersAllowed[0].allowed = false; + adaptersAllowed[1].allowed = false; + adaptersAllowed[2].allowed = true; + adaptersAllowed[3].allowed = true; + } + + return adaptersAllowed; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..9847ecbb5 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,130 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; +import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol'; +import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; +import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; + +/** + * @title Update a.DI implementation and CCIP adapters + * @author BGD Labs @bgdlabs + * - Snapshot: TODO + * - Discussion: TODO + */ +contract AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 is IProposalGenericExecutor { + address public constant CCIP_ADAPTER_TO_REMOVE = 0x95Fa2c817169E26956AB8795c84a225b55d7db5B; + address public constant CCIP_NEW_ADAPTER = 0xe79757D55a1600eF28D816a893E78E9FCDE2019E; + address public constant DESTINATION_CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; + address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = + 0x87a95917DE670088d81B9a8B30E3B36704Ba3043; + + function execute() external { + // Update CrossChainController implementation + ProxyAdmin(MiscPolygon.PROXY_ADMIN).upgradeAndCall( + TransparentUpgradeableProxy(payable(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER)), + NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, + abi.encodeWithSignature('initializeRevision()') + ); + + // remove old Receiver bridge adapter + ICrossChainReceiver(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToRemove() + ); + + // remove forwarding adapters + ICrossChainForwarder(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( + _getForwarderBridgeAdaptersToRemove() + ); + + // add receiver adapters + ICrossChainReceiver(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( + _getReceiverBridgeAdaptersToAllow() + ); + + // add forwarding adapters + ICrossChainForwarder(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( + _getForwarderBridgeAdaptersToEnable() + ); + } + + function _getReceiverBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + // remove old Receiver bridge adapter + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: chainIds + }); + + return bridgeAdaptersToRemove; + } + + function _getForwarderBridgeAdaptersToRemove() + internal + pure + returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainForwarder.BridgeAdapterToDisable[] + memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); + + forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: chainIds + }); + + return forwarderAdaptersToRemove; + } + + function _getReceiverBridgeAdaptersToAllow() + internal + pure + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + uint256[] memory chainIds = new uint256[](1); + chainIds[0] = ChainIds.MAINNET; + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_NEW_ADAPTER, + chainIds: chainIds + }); + + return bridgeAdapterConfig; + } + + function _getForwarderBridgeAdaptersToEnable() + internal + pure + returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + { + ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] + memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( + 1 + ); + + bridgeAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER, + destinationChainId: ChainIds.MAINNET + }); + + return bridgeAdaptersToEnable; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..db5fe6fb2 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {AaveV3Polygon} from 'aave-address-book/AaveV3Polygon.sol'; +import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol'; +import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import './BaseTest.sol'; +import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +/** + * @dev Test for AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { + AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; + + constructor() + BaseTest( + GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER, + MiscPolygon.PROXY_ADMIN, + 'polygon', + 54566890 + ) + {} + + function setUp() public override { + super.setUp(); + payload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); + payloadAddress = address(payload); + } + + function _getAdapterNames() internal view override returns (AdapterName[] memory) { + AdapterName[] memory adapterNames = new AdapterName[](1); + adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); + + return adapterNames; + } + + function _checkCorrectPathConfiguration() internal override { + assertEq(ethereumPayload.CCIP_NEW_ADAPTER(), payload.DESTINATION_CCIP_NEW_ADAPTER()); + } + + function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { + TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); + trustedRemotes[0] = TrustedRemote({ + adapter: payload.CCIP_NEW_ADAPTER(), + expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, + remoteChainId: ChainIds.MAINNET + }); + + return trustedRemotes; + } + + function _getForwarderAdaptersByChain( + bool afterExecution + ) internal view override returns (ForwarderAdapters[] memory) { + ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](1); + + ICrossChainForwarder.ChainIdBridgeConfig[] + memory adapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); + adapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + adapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); + adapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER(); + } + forwarderAdapters[0].adapters = adapters; + forwarderAdapters[0].chainId = ChainIds.MAINNET; + + return forwarderAdapters; + } + + function _getReceiverAdaptersByChain( + bool afterExecution + ) internal view override returns (AdaptersByChain[] memory) { + address[] memory adapters = new address[](1); + AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); + + adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); + + if (afterExecution) { + adapters[0] = payload.CCIP_NEW_ADAPTER(); + } + receiverAdaptersByChain[0].adapters = adapters; + receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; + + return receiverAdaptersByChain; + } + + function _getAdapterByChain( + bool afterExecution + ) internal view override returns (AdapterAllowed[] memory) { + AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); + adaptersAllowed[0] = AdapterAllowed({ + adapter: payload.CCIP_ADAPTER_TO_REMOVE(), + chainId: ChainIds.MAINNET, + allowed: true + }); + adaptersAllowed[1] = AdapterAllowed({ + adapter: payload.CCIP_NEW_ADAPTER(), + chainId: ChainIds.MAINNET, + allowed: false + }); + if (afterExecution) { + adaptersAllowed[0].allowed = false; + adaptersAllowed[1].allowed = true; + } + + return adaptersAllowed; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol new file mode 100644 index 000000000..7f840cab5 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; +import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {IBaseAdapter} from 'aave-address-book/common/IBaseAdapter.sol'; +import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +struct AdapterName { + address adapter; + string name; +} + +struct TrustedRemote { + address adapter; + address expectedRemote; + uint256 remoteChainId; +} + +struct AdapterAllowed { + address adapter; + uint256 chainId; + bool allowed; +} + +struct AdaptersByChain { + address[] adapters; + uint256 chainId; +} + +struct ForwarderAdapters { + ICrossChainForwarder.ChainIdBridgeConfig[] adapters; + uint256 chainId; +} + +interface Payload { + function NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION() external returns (address); +} + +abstract contract BaseTest is ProtocolV3TestBase { + address public immutable CROSS_CHAIN_CONTROLLER; + address public immutable PROXY_ADMIN; + + address public payloadAddress; + string public network; + uint256 public blockNumber; + + AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 internal ethereumPayload; + + constructor(address ccc, address proxyAdmin, string memory _network, uint256 _blockNumber) { + CROSS_CHAIN_CONTROLLER = ccc; + PROXY_ADMIN = proxyAdmin; + network = _network; + blockNumber = _blockNumber; + } + + function setUp() public virtual { + vm.createSelectFork(vm.rpcUrl(network), blockNumber); + ethereumPayload = new AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313(); + } + + /** + * @dev executes the generic test suite including e2e and config snapshots + */ + function test_defaultProposalExecution() public { + _checkTrustedRemotes(); + _checkCorrectPathConfiguration(); + _checkCorrectAdapterNames(); + + _checkCurrentReceiversState(false); + _checkAllReceiversAreRepresented(false); + _checkAllForwarderAdaptersAreRepresented(false); + _checkImplementationAddress( + Payload(payloadAddress).NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION(), + false + ); + + executePayload(vm, payloadAddress); + + _checkCurrentReceiversState(true); + _checkAllReceiversAreRepresented(true); + _checkAllForwarderAdaptersAreRepresented(true); + _checkImplementationAddress( + Payload(payloadAddress).NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION(), + true + ); + } + + // -------------- virtual methods -------------------------- + function _checkCorrectPathConfiguration() internal virtual {} + + function _getAdapterNames() internal view virtual returns (AdapterName[] memory); + + function _getTrustedRemotes() internal view virtual returns (TrustedRemote[] memory); + + function _getAdapterByChain( + bool beforeExecution + ) internal view virtual returns (AdapterAllowed[] memory); + + function _getForwarderAdaptersByChain( + bool beforeExecution + ) internal view virtual returns (ForwarderAdapters[] memory) { + ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](0); + return forwarderAdapters; + } + + function _getReceiverAdaptersByChain( + bool beforeExecution + ) internal view virtual returns (AdaptersByChain[] memory); + + // ------------------------ checks ------------- + function _checkAllForwarderAdaptersAreRepresented(bool afterExecution) internal { + ForwarderAdapters[] memory forwarderAdapters = _getForwarderAdaptersByChain(afterExecution); + + for (uint256 i = 0; i < forwarderAdapters.length; i++) { + _testForwarderAdapterCorrectness( + forwarderAdapters[i].chainId, + forwarderAdapters[i].adapters, + afterExecution + ); + } + } + + function _checkAllReceiversAreRepresented(bool afterExecution) internal virtual { + AdaptersByChain[] memory receiverAdaptersByChain = _getReceiverAdaptersByChain(afterExecution); + + for (uint256 i = 0; i < receiverAdaptersByChain.length; i++) { + _testReceiverAdaptersByChain( + receiverAdaptersByChain[i].chainId, + receiverAdaptersByChain[i].adapters + ); + } + } + + function _checkCurrentReceiversState(bool afterExecution) internal { + AdapterAllowed[] memory adaptersByChain = _getAdapterByChain(afterExecution); + + for (uint256 i = 0; i < adaptersByChain.length; i++) { + assertEq( + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( + adaptersByChain[i].adapter, + adaptersByChain[i].chainId + ), + adaptersByChain[i].allowed + ); + } + } + + function _checkCorrectAdapterNames() internal { + AdapterName[] memory adapterNames = _getAdapterNames(); + + for (uint256 i = 0; i < adapterNames.length; i++) { + string memory adapterName = IBaseAdapter(adapterNames[i].adapter).adapterName(); + assertEq(keccak256(abi.encode(adapterName)), keccak256(abi.encode(adapterNames[i].name))); + } + } + + function _checkTrustedRemotes() internal { + TrustedRemote[] memory trustedRemotes = _getTrustedRemotes(); + + for (uint256 i = 0; i < trustedRemotes.length; i++) { + assertEq( + trustedRemotes[i].expectedRemote, + IBaseAdapter(trustedRemotes[i].adapter).getTrustedRemoteByChainId( + trustedRemotes[i].remoteChainId + ) + ); + } + } + + function _checkImplementationAddress(address implementation, bool equal) internal { + address cccImplementation = ProxyAdmin(PROXY_ADMIN).getProxyImplementation( + TransparentUpgradeableProxy(payable(CROSS_CHAIN_CONTROLLER)) + ); + assertEq(cccImplementation == implementation, equal); + } + + //----------------------------------------------------------------- + + function _testForwarderAdapterCorrectness( + uint256 chainId, + ICrossChainForwarder.ChainIdBridgeConfig[] memory adapters, + bool checkDestination + ) internal { + ICrossChainForwarder.ChainIdBridgeConfig[] + memory forwarderBridgeAdapters = ICrossChainForwarder(CROSS_CHAIN_CONTROLLER) + .getForwarderBridgeAdaptersByChain(chainId); + + uint256 adaptersCount; + for (uint256 i = 0; i < forwarderBridgeAdapters.length; i++) { + for (uint256 j = 0; j < adapters.length; j++) { + if ( + forwarderBridgeAdapters[i].currentChainBridgeAdapter == + adapters[j].currentChainBridgeAdapter + ) { + if (checkDestination) { + if ( + forwarderBridgeAdapters[i].destinationBridgeAdapter == + adapters[j].destinationBridgeAdapter + ) { + adaptersCount++; + } + } else { + adaptersCount++; + } + } + } + } + assertEq(adaptersCount, adapters.length); + } + + function _testReceiverAdaptersByChain(uint256 chainId, address[] memory adapters) internal { + address[] memory receiverAdapters = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getReceiverBridgeAdaptersByChain(chainId); + + uint256 adaptersCount; + for (uint256 i = 0; i < receiverAdapters.length; i++) { + for (uint256 j = 0; j < adapters.length; j++) { + if (receiverAdapters[i] == adapters[j]) { + adaptersCount++; + } + } + } + assertEq(adaptersCount, adapters.length); + } + + function _testOnlyUpdatedReceiverAdapterChanges( + address[] memory previousReceivers, + address newAdapter, + address removedAdapter + ) internal { + address[] memory currentReceiverAdapters = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getReceiverBridgeAdaptersByChain(chainId); + + uint256 adaptersCount; + bool removedAdapterFound; + bool newAdapterFound; + for (uint256 i = 0; i < currentReceiverAdapters.length; i++) { + for (uint256 j = 0; j < previousReceivers.length; j++) { + if (currentReceiverAdapters[i] == adapters[j]) { + adaptersCount++; + } + } + } + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md new file mode 100644 index 000000000..68a6a6589 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -0,0 +1,22 @@ +--- +title: "Update a.DI implementation and CCIP adapters" +author: "BGD Labs @bgdlabs" +discussions: "" +--- + +## Simple Summary + +## Motivation + +## Specification + +## References + +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol) +- [Snapshot](TODO) +- [Discussion](TODO) + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol new file mode 100644 index 000000000..5f8270226 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; +import {EthereumScript, PolygonScript, AvalancheScript, BNBScript} from 'aave-helpers/ScriptUtils.sol'; +import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; + +/** + * @dev Deploy Ethereum + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployEthereum chain=mainnet + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/1/run-latest.json + */ +contract DeployEthereum is EthereumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Polygon + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployPolygon chain=polygon + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/137/run-latest.json + */ +contract DeployPolygon is PolygonScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Avalanche + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployAvalanche chain=avalanche + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/43114/run-latest.json + */ +contract DeployAvalanche is AvalancheScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy BNB + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployBNB chain=bnb + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/56/run-latest.json + */ +contract DeployBNB is BNBScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Create Proposal + * command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:CreateProposal chain=mainnet + */ +contract CreateProposal is EthereumScript { + function run() external { + // create payloads + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](4); + + // compose actions for validation + IPayloadsControllerCore.ExecutionAction[] + memory actionsEthereum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsEthereum[0] = GovV3Helpers.buildAction( + type(AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[0] = GovV3Helpers.buildMainnetPayload(vm, actionsEthereum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsPolygon = new IPayloadsControllerCore.ExecutionAction[](1); + actionsPolygon[0] = GovV3Helpers.buildAction( + type(AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[1] = GovV3Helpers.buildPolygonPayload(vm, actionsPolygon); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsAvalanche = new IPayloadsControllerCore.ExecutionAction[](1); + actionsAvalanche[0] = GovV3Helpers.buildAction( + type(AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[2] = GovV3Helpers.buildAvalanchePayload(vm, actionsAvalanche); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsBNB = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBNB[0] = GovV3Helpers.buildAction( + type(AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[3] = GovV3Helpers.buildBNBPayload(vm, actionsBNB); + + // create proposal + vm.startBroadcast(); + GovV3Helpers.createProposal( + vm, + payloads, + GovV3Helpers.ipfsHashFile( + vm, + 'src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md' + ) + ); + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts new file mode 100644 index 000000000..307a94eba --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts @@ -0,0 +1,18 @@ +import {ConfigFile} from '../../generator/types'; +export const config: ConfigFile = { + rootOptions: { + author: 'BGD Labs @bgdlabs', + pools: ['AaveV3Ethereum', 'AaveV3Polygon', 'AaveV3Avalanche', 'AaveV3BNB'], + title: 'Update a.DI implementation and CCIP adapters', + shortName: 'UpdateADIImplementationAndCCIPAdapters', + date: '20240313', + discussion: '', + snapshot: '', + }, + poolOptions: { + AaveV3Ethereum: {configs: {OTHERS: {}}, cache: {blockNumber: 19424932}}, + AaveV3Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 54601669}}, + AaveV3Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 42840161}}, + AaveV3BNB: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + }, +}; From d20ab9dd02845d81a21aaf08888b7a8e7d0226f5 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 13 Mar 2024 10:43:16 +0100 Subject: [PATCH 2/8] fix: added some internal test methods --- .../BaseTest.sol | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol index 7f840cab5..649c2f227 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol @@ -78,8 +78,12 @@ abstract contract BaseTest is ProtocolV3TestBase { false ); + AdaptersByChain[] memory receiversBeforeExecution = _getCurrentReceiverAdaptersByChain(); + executePayload(vm, payloadAddress); + AdaptersByChain[] memory afterBeforeExecution = _getCurrentReceiverAdaptersByChain(); + _checkCurrentReceiversState(true); _checkAllReceiversAreRepresented(true); _checkAllForwarderAdaptersAreRepresented(true); @@ -97,18 +101,18 @@ abstract contract BaseTest is ProtocolV3TestBase { function _getTrustedRemotes() internal view virtual returns (TrustedRemote[] memory); function _getAdapterByChain( - bool beforeExecution + bool afterExecution ) internal view virtual returns (AdapterAllowed[] memory); function _getForwarderAdaptersByChain( - bool beforeExecution + bool afterExecution ) internal view virtual returns (ForwarderAdapters[] memory) { ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](0); return forwarderAdapters; } function _getReceiverAdaptersByChain( - bool beforeExecution + bool afterExecution ) internal view virtual returns (AdaptersByChain[] memory); // ------------------------ checks ------------- @@ -230,20 +234,41 @@ abstract contract BaseTest is ProtocolV3TestBase { function _testOnlyUpdatedReceiverAdapterChanges( address[] memory previousReceivers, address newAdapter, - address removedAdapter + uint256 chainId ) internal { address[] memory currentReceiverAdapters = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) .getReceiverBridgeAdaptersByChain(chainId); uint256 adaptersCount; - bool removedAdapterFound; - bool newAdapterFound; + uint256 newAdapterCount; for (uint256 i = 0; i < currentReceiverAdapters.length; i++) { for (uint256 j = 0; j < previousReceivers.length; j++) { - if (currentReceiverAdapters[i] == adapters[j]) { + if (currentReceiverAdapters[i] == previousReceivers[j]) { adaptersCount++; } + if (currentReceiverAdapters[i] == newAdapter) { + newAdapterCount++; + } } } + + assertEq(previousReceivers.length, currentReceiverAdapters.length); + assertEq(currentReceiverAdapters.length, adaptersCount + newAdapterCount); + } + + function _getCurrentReceiverAdaptersByChain() internal returns (AdaptersByChain[] memory) { + uint256[] memory supportedChains = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getSupportedChains(); + + AdaptersByChain[] memory receiverAdapters = new AdaptersByChain[](supportedChains.length); + + for (uint256 i = 0; i < supportedChains.length; i++) { + address[] memory receivers = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getReceiverBridgeAdaptersByChain(supportedChains[i]); + + receiverAdapters[i] = AdaptersByChain({adapters: receivers, chainId: supportedChains[i]}); + } + + return receiverAdapters; } } From ee8f5ab3a551fe65018039099da8ef227cd36bca Mon Sep 17 00:00:00 2001 From: sendra Date: Mon, 18 Mar 2024 11:45:38 +0100 Subject: [PATCH 3/8] Feat/ccip update templating (#255) * CCIP update templating * fix: added missing chain id * fix compilation issues * fix: fixed compilation error * remove redundant DestinationAdaptersInput path * update readme with implementation and tests * fix: test cleanup * fix: more test cleanup * add BaseCCCImplementationUpdatePayloadTest * change BaseTest * fix: added tests to check that only changed necessary receivers * add getTrustedRemoteByChainId * formatting * fix: added test to check that forwarders are set * fix: update scripts (#248) * fix: added test to check only changes on specified forwarders * fix: update readme * fix: add missing ccc impl address for ethereum * fix: updated base contract to add receivers only if receiving chains exist. Added discussion links --------- Co-authored-by: Andrei Kozlov Co-authored-by: Lukas --- ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + ...ImplementationAndCCIPAdapters_20240313.sol | 137 +----- ...plementationAndCCIPAdapters_20240313.t.sol | 90 +--- ...ImplementationAndCCIPAdapters_20240313.sol | 86 +--- ...plementationAndCCIPAdapters_20240313.t.sol | 73 +-- ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + ...ImplementationAndCCIPAdapters_20240313.sol | 168 ++----- ...plementationAndCCIPAdapters_20240313.t.sol | 141 +----- ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + ...ImplementationAndCCIPAdapters_20240313.sol | 138 ++---- ...plementationAndCCIPAdapters_20240313.t.sol | 89 +--- ...ImplementationAndCCIPAdapters_20240313.sol | 23 + ...plementationAndCCIPAdapters_20240313.t.sol | 23 + .../BaseAdaptersUpdatePayload.sol | 165 +++++++ .../BaseCCCImplementationUpdatePayload.sol | 32 ++ ...BaseCCCImplementationUpdatePayloadTest.sol | 55 +++ .../BaseTest.sol | 416 +++++++++++------- .../UpdateADIImplementationAndCCIPAdapters.md | 46 +- ...plementationAndCCIPAdapters_20240313.s.sol | 184 +++++++- .../config.ts | 19 +- 27 files changed, 1126 insertions(+), 989 deletions(-) create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseAdaptersUpdatePayload.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayload.sol create mode 100644 src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayloadTest.sol diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..a3030e5bd --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol'; +import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Arbitrum.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscArbitrum.PROXY_ADMIN, + newCCCImplementation: 0x6e633269af45F37c44659D98f382dd0DD524E5Df + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..7ad9133b2 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscArbitrum} from 'aave-address-book/MiscArbitrum.sol'; +import {GovernanceV3Arbitrum} from 'aave-address-book/GovernanceV3Arbitrum.sol'; + +import {AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Arbitrum.CROSS_CHAIN_CONTROLLER, + MiscArbitrum.PROXY_ADMIN, + type(AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'arbitrum', + 189596312 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol index 79c9aab43..21c4d67a2 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -1,133 +1,44 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; import {MiscAvalanche} from 'aave-address-book/MiscAvalanche.sol'; import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; -import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; - -import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {BaseAdaptersUpdatePayload} from './BaseAdaptersUpdatePayload.sol'; /** - * @title Update a.DI implementation and CCIP adapters + * @title aDI and bridge adapters update * @author BGD Labs @bgdlabs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 */ contract AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 is - IProposalGenericExecutor + BaseAdaptersUpdatePayload( + BaseAdaptersUpdatePayload.ConstructorInput({ + ccc: GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscAvalanche.PROXY_ADMIN, + newCCCImplementation: 0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22, + ccipNewAdapter: 0x2b88C83727B0E290B76EB3F6133994fF81B7f355, + ccipAdapterToRemove: 0x3F006299eC88985c18E6e885EeA29A49eC579882 + }) + ) { - address public constant CCIP_ADAPTER_TO_REMOVE = 0x3F006299eC88985c18E6e885EeA29A49eC579882; - address public constant CCIP_NEW_ADAPTER = 0x2b88C83727B0E290B76EB3F6133994fF81B7f355; - address public constant DESTINATION_CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; - address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = - 0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22; - - function execute() external { - // Update CrossChainController implementation - ProxyAdmin(MiscAvalanche.PROXY_ADMIN).upgradeAndCall( - TransparentUpgradeableProxy(payable(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER)), - NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, - abi.encodeWithSignature('initializeRevision()') - ); - - // remove old Receiver bridge adapter - ICrossChainReceiver(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER) - .disallowReceiverBridgeAdapters(_getReceiverBridgeAdaptersToRemove()); - - // remove forwarding adapters - ICrossChainForwarder(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( - _getForwarderBridgeAdaptersToRemove() - ); - - // add receiver adapters - ICrossChainReceiver(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToAllow() - ); - - // add forwarding adapters - ICrossChainForwarder(GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( - _getForwarderBridgeAdaptersToEnable() - ); - } - - function _getReceiverBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - // remove old Receiver bridge adapter - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: chainIds - }); - - return bridgeAdaptersToRemove; - } - - function _getForwarderBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainForwarder.BridgeAdapterToDisable[] - memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); - - forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: chainIds - }); - - return forwarderAdaptersToRemove; - } - - function _getReceiverBridgeAdaptersToAllow() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_NEW_ADAPTER, - chainIds: chainIds - }); - - return bridgeAdapterConfig; + function getChainsToReceive() public pure override returns (uint256[] memory) { + uint256[] memory chains = new uint256[](1); + chains[0] = ChainIds.MAINNET; + return chains; } - function _getForwarderBridgeAdaptersToEnable() - internal + function getDestinationAdapters() + public pure - returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + override + returns (DestinationAdaptersInput[] memory) { - ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] - memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( - 1 - ); + DestinationAdaptersInput[] memory destinationAdapters = new DestinationAdaptersInput[](1); - bridgeAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ - currentChainBridgeAdapter: CCIP_NEW_ADAPTER, - destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER, - destinationChainId: ChainIds.MAINNET - }); + destinationAdapters[0].adapter = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; + destinationAdapters[0].chainId = ChainIds.MAINNET; - return bridgeAdaptersToEnable; + return destinationAdapters; } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 56eb15392..8c48f0ea8 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -5,6 +5,7 @@ import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; import {MiscAvalanche} from 'aave-address-book/MiscAvalanche.sol'; import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; + import './BaseTest.sol'; import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; @@ -14,100 +15,13 @@ import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from '. * command: make test-contract filter=AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 */ contract AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { - AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; - constructor() BaseTest( GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, MiscAvalanche.PROXY_ADMIN, + type(AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, 'avalanche', 42801819 ) {} - - function setUp() public override { - super.setUp(); - payload = new AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313(); - payloadAddress = address(payload); - } - - function _getAdapterNames() internal view override returns (AdapterName[] memory) { - AdapterName[] memory adapterNames = new AdapterName[](1); - adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); - - return adapterNames; - } - - function _checkCorrectPathConfiguration() internal override { - assertEq(ethereumPayload.CCIP_NEW_ADAPTER(), payload.DESTINATION_CCIP_NEW_ADAPTER()); - } - - function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { - TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); - trustedRemotes[0] = TrustedRemote({ - adapter: payload.CCIP_NEW_ADAPTER(), - expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, - remoteChainId: ChainIds.MAINNET - }); - - return trustedRemotes; - } - - function _getForwarderAdaptersByChain( - bool afterExecution - ) internal view override returns (ForwarderAdapters[] memory) { - ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](1); - - ICrossChainForwarder.ChainIdBridgeConfig[] - memory adapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); - adapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - adapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); - adapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER(); - } - forwarderAdapters[0].adapters = adapters; - forwarderAdapters[0].chainId = ChainIds.MAINNET; - - return forwarderAdapters; - } - - function _getReceiverAdaptersByChain( - bool afterExecution - ) internal view override returns (AdaptersByChain[] memory) { - address[] memory adapters = new address[](1); - AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); - - adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - adapters[0] = payload.CCIP_NEW_ADAPTER(); - } - receiverAdaptersByChain[0].adapters = adapters; - receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; - - return receiverAdaptersByChain; - } - - function _getAdapterByChain( - bool afterExecution - ) internal view override returns (AdapterAllowed[] memory) { - AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); - adaptersAllowed[0] = AdapterAllowed({ - adapter: payload.CCIP_ADAPTER_TO_REMOVE(), - chainId: ChainIds.MAINNET, - allowed: true - }); - adaptersAllowed[1] = AdapterAllowed({ - adapter: payload.CCIP_NEW_ADAPTER(), - chainId: ChainIds.MAINNET, - allowed: false - }); - if (afterExecution) { - adaptersAllowed[0].allowed = false; - adaptersAllowed[1].allowed = true; - } - - return adaptersAllowed; - } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol index 9f81ee3ea..267c5cda3 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -1,80 +1,30 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; import {MiscBNB} from 'aave-address-book/MiscBNB.sol'; import {GovernanceV3BNB} from 'aave-address-book/GovernanceV3BNB.sol'; -import {ICrossChainReceiver} from 'aave-address-book/common/ICrossChainController.sol'; +import {BaseAdaptersUpdatePayload} from './BaseAdaptersUpdatePayload.sol'; /** - * @title Update a.DI implementation and CCIP adapters + * @title aDI and bridge adapters update * @author BGD Labs @bgdlabs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 */ -contract AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 is IProposalGenericExecutor { - address public constant CCIP_ADAPTER_TO_REMOVE = 0x746c675dAB49Bcd5BB9Dc85161f2d7Eb435009bf; - address public constant CCIP_NEW_ADAPTER = 0xAE93BEa44dcbE52B625169588574d31e36fb3A67; - address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = - 0xf41193E25408F652AF878c47E4401A01B5E4B682; - - function execute() external { - // Update CrossChainController implementation - ProxyAdmin(MiscBNB.PROXY_ADMIN).upgradeAndCall( - TransparentUpgradeableProxy(payable(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER)), - NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, - abi.encodeWithSignature('initializeRevision()') - ); - - // remove old Receiver bridge adapter - ICrossChainReceiver(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToRemove() - ); - - // add receiver adapters - ICrossChainReceiver(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToAllow() - ); - } - - function _getReceiverBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: chainIds - }); - - return bridgeAdaptersToRemove; - } - - function _getReceiverBridgeAdaptersToAllow() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_NEW_ADAPTER, - chainIds: chainIds - }); - - return bridgeAdapterConfig; +contract AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseAdaptersUpdatePayload( + BaseAdaptersUpdatePayload.ConstructorInput({ + ccc: GovernanceV3BNB.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscBNB.PROXY_ADMIN, + newCCCImplementation: 0xf41193E25408F652AF878c47E4401A01B5E4B682, + ccipNewAdapter: 0xAE93BEa44dcbE52B625169588574d31e36fb3A67, + ccipAdapterToRemove: 0x746c675dAB49Bcd5BB9Dc85161f2d7Eb435009bf + }) + ) +{ + function getChainsToReceive() public pure override returns (uint256[] memory) { + uint256[] memory chains = new uint256[](1); + chains[0] = ChainIds.MAINNET; + return chains; } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 7e6c0fe1c..90491cacc 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -14,72 +14,13 @@ import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV * command: make test-contract filter=AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 */ contract AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { - AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; - constructor() - BaseTest(GovernanceV3BNB.CROSS_CHAIN_CONTROLLER, MiscBNB.PROXY_ADMIN, 'bnb', 36903911) + BaseTest( + GovernanceV3BNB.CROSS_CHAIN_CONTROLLER, + MiscBNB.PROXY_ADMIN, + type(AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'bnb', + 37073128 + ) {} - - function setUp() public override { - super.setUp(); - payload = new AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313(); - payloadAddress = address(payload); - } - - function _getAdapterNames() internal view override returns (AdapterName[] memory) { - AdapterName[] memory adapterNames = new AdapterName[](1); - adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); - - return adapterNames; - } - - function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { - TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); - trustedRemotes[0] = TrustedRemote({ - adapter: payload.CCIP_NEW_ADAPTER(), - expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, - remoteChainId: ChainIds.MAINNET - }); - - return trustedRemotes; - } - - function _getReceiverAdaptersByChain( - bool afterExecution - ) internal view override returns (AdaptersByChain[] memory) { - address[] memory adapters = new address[](1); - AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); - - adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - adapters[0] = payload.CCIP_NEW_ADAPTER(); - } - receiverAdaptersByChain[0].adapters = adapters; - receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; - - return receiverAdaptersByChain; - } - - function _getAdapterByChain( - bool afterExecution - ) internal view override returns (AdapterAllowed[] memory) { - AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); - adaptersAllowed[0] = AdapterAllowed({ - adapter: payload.CCIP_ADAPTER_TO_REMOVE(), - chainId: ChainIds.MAINNET, - allowed: true - }); - adaptersAllowed[1] = AdapterAllowed({ - adapter: payload.CCIP_NEW_ADAPTER(), - chainId: ChainIds.MAINNET, - allowed: false - }); - if (afterExecution) { - adaptersAllowed[0].allowed = false; - adaptersAllowed[5].allowed = true; - } - - return adaptersAllowed; - } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..d6ed97266 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscBase} from 'aave-address-book/MiscBase.sol'; +import {GovernanceV3Base} from 'aave-address-book/GovernanceV3Base.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Base.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscBase.PROXY_ADMIN, + newCCCImplementation: 0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..88b0f61f6 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscBase} from 'aave-address-book/MiscBase.sol'; +import {GovernanceV3Base} from 'aave-address-book/GovernanceV3Base.sol'; + +import {AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Base.CROSS_CHAIN_CONTROLLER, + MiscBase.PROXY_ADMIN, + type(AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'base', + 11725901 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol index c6eb56b3d..72b2128e5 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -1,161 +1,51 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; import {MiscEthereum} from 'aave-address-book/MiscEthereum.sol'; import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; -import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; +import {BaseAdaptersUpdatePayload} from './BaseAdaptersUpdatePayload.sol'; /** - * @title Update a.DI implementation and CCIP adapters + * @title aDI and bridge adapters update * @author BGD Labs @bgdlabs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 */ contract AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 is - IProposalGenericExecutor + BaseAdaptersUpdatePayload( + BaseAdaptersUpdatePayload.ConstructorInput({ + ccc: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscEthereum.PROXY_ADMIN, + newCCCImplementation: 0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215, + ccipNewAdapter: 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29, + ccipAdapterToRemove: 0xDB8953194810b1942544fA528791278D458719D5 + }) + ) { - //receiver adapters to remove - address public constant CCIP_ADAPTER_TO_REMOVE = 0xDB8953194810b1942544fA528791278D458719D5; - // forwarder-receiver adapter pairs to add - address public constant CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; - - address public constant DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE = - 0x2b88C83727B0E290B76EB3F6133994fF81B7f355; - address public constant DESTINATION_CCIP_NEW_ADAPTER_POLYGON = - 0xe79757D55a1600eF28D816a893E78E9FCDE2019E; - address public constant DESTINATION_CCIP_NEW_ADAPTER_BNB = - 0xAE93BEa44dcbE52B625169588574d31e36fb3A67; - - address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = - 0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215; - - function execute() external { - // Update CrossChainController implementation - ProxyAdmin(MiscEthereum.PROXY_ADMIN).upgradeAndCall( - TransparentUpgradeableProxy(payable(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER)), - NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, - abi.encodeWithSignature('initializeRevision()') - ); - // add receiver adapters - ICrossChainReceiver(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToAllow() - ); - - // add forwarding adapters - ICrossChainForwarder(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( - _getForwarderBridgeAdaptersToEnable() - ); - - // remove old Receiver bridge adapter - ICrossChainReceiver(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToRemove() - ); - - // remove forwarding adapters - ICrossChainForwarder(GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( - _getForwarderBridgeAdaptersToRemove() - ); - } - - function _getReceiverBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory receiverAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[]( - 1 - ); - - uint256[] memory receiverChainIds = new uint256[](1); - receiverChainIds[0] = ChainIds.POLYGON; - receiverChainIds[1] = ChainIds.AVALANCHE; - - receiverAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: receiverChainIds - }); - - return receiverAdaptersToRemove; + function getChainsToReceive() public pure override returns (uint256[] memory) { + uint256[] memory chains = new uint256[](2); + chains[0] = ChainIds.AVALANCHE; + chains[1] = ChainIds.POLYGON; + return chains; } - function _getForwarderBridgeAdaptersToRemove() - internal + function getDestinationAdapters() + public pure - returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) + override + returns (DestinationAdaptersInput[] memory) { - ICrossChainForwarder.BridgeAdapterToDisable[] - memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); + DestinationAdaptersInput[] memory destinationAdapters = new DestinationAdaptersInput[](3); - uint256[] memory forwarderCCIPChainIds = new uint256[](3); - forwarderCCIPChainIds[0] = ChainIds.AVALANCHE; - forwarderCCIPChainIds[1] = ChainIds.POLYGON; - forwarderCCIPChainIds[2] = ChainIds.BNB; - - forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: forwarderCCIPChainIds - }); - - return forwarderAdaptersToRemove; - } - - function _getReceiverBridgeAdaptersToAllow() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory receiverChainIds = new uint256[](2); - receiverChainIds[0] = ChainIds.AVALANCHE; - receiverChainIds[1] = ChainIds.POLYGON; - - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory receiverAdaptersToAllow = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[]( - 1 - ); - - receiverAdaptersToAllow[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_NEW_ADAPTER, - chainIds: receiverChainIds - }); - - return receiverAdaptersToAllow; - } - - function _getForwarderBridgeAdaptersToEnable() - internal - pure - returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) - { - ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] - memory forwarderAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( - 3 - ); - // avalanche path - forwarderAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ - currentChainBridgeAdapter: CCIP_NEW_ADAPTER, - destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE, - destinationChainId: ChainIds.AVALANCHE - }); + destinationAdapters[0].adapter = 0x2b88C83727B0E290B76EB3F6133994fF81B7f355; + destinationAdapters[0].chainId = ChainIds.AVALANCHE; - // polygon path - forwarderAdaptersToEnable[1] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ - currentChainBridgeAdapter: CCIP_NEW_ADAPTER, - destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_POLYGON, - destinationChainId: ChainIds.POLYGON - }); + destinationAdapters[1].adapter = 0xe79757D55a1600eF28D816a893E78E9FCDE2019E; + destinationAdapters[1].chainId = ChainIds.POLYGON; - // binance path - forwarderAdaptersToEnable[2] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ - currentChainBridgeAdapter: CCIP_NEW_ADAPTER, - destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER_BNB, - destinationChainId: ChainIds.BNB - }); + destinationAdapters[2].adapter = 0xAE93BEa44dcbE52B625169588574d31e36fb3A67; + destinationAdapters[2].chainId = ChainIds.BNB; - return forwarderAdaptersToEnable; + return destinationAdapters; } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 292f4368a..452cfdc2f 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -17,152 +17,13 @@ import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './ * command: make test-contract filter=AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 */ contract AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { - AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; - AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal avalanchePayload; - AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313 internal bnbPayload; - AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal polygonPayload; - constructor() BaseTest( GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, MiscEthereum.PROXY_ADMIN, + type(AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, 'mainnet', 19418547 ) {} - - function setUp() public override { - super.setUp(); - payload = new AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313(); - avalanchePayload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); - bnbPayload = new AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313(); - polygonPayload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); - payloadAddress = address(payload); - } - - function _getAdapterNames() internal view override returns (AdapterName[] memory) { - AdapterName[] memory adapterNames = new AdapterName[](1); - adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); - - return adapterNames; - } - - function _checkCorrectPathConfiguration() internal override { - assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE(), avalanchePayload.CCIP_NEW_ADAPTER()); - assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_BNB(), bnbPayload.CCIP_NEW_ADAPTER()); - assertEq(payload.DESTINATION_CCIP_NEW_ADAPTER_POLYGON(), polygonPayload.CCIP_NEW_ADAPTER()); - } - - function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { - TrustedRemote[] memory trustedRemotes = new TrustedRemote[](2); - trustedRemotes[0] = TrustedRemote({ - adapter: payload.CCIP_NEW_ADAPTER(), - expectedRemote: GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER, - remoteChainId: ChainIds.POLYGON - }); - trustedRemotes[1] = TrustedRemote({ - adapter: payload.CCIP_NEW_ADAPTER(), - expectedRemote: GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER, - remoteChainId: ChainIds.AVALANCHE - }); - - return trustedRemotes; - } - - function _getReceiverAdaptersByChain( - bool afterExecution - ) internal view override returns (AdaptersByChain[] memory) { - address[] memory polygonAdapters = new address[](1); - address[] memory avalancheAdapters = new address[](1); - AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](2); - - polygonAdapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); - avalancheAdapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - polygonAdapters[0] = payload.CCIP_NEW_ADAPTER(); - avalancheAdapters[0] = payload.CCIP_NEW_ADAPTER(); - } - receiverAdaptersByChain[0].adapters = polygonAdapters; - receiverAdaptersByChain[0].chainId = ChainIds.POLYGON; - receiverAdaptersByChain[0].adapters = avalancheAdapters; - receiverAdaptersByChain[0].chainId = ChainIds.AVALANCHE; - - return receiverAdaptersByChain; - } - - function _getForwarderAdaptersByChain( - bool afterExecution - ) internal view override returns (ForwarderAdapters[] memory) { - ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](3); - - ICrossChainForwarder.ChainIdBridgeConfig[] - memory polygonAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); - ICrossChainForwarder.ChainIdBridgeConfig[] - memory avalancheAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); - ICrossChainForwarder.ChainIdBridgeConfig[] - memory binanceAdapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); - - // polygon - polygonAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); - // avalanche - avalancheAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); - // binance - binanceAdapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - // polygon - polygonAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); - polygonAdapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER_POLYGON(); - // avalanche - avalancheAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); - avalancheAdapters[0].destinationBridgeAdapter = payload - .DESTINATION_CCIP_NEW_ADAPTER_AVALANCHE(); - // binance - binanceAdapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); - binanceAdapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER_BNB(); - } - forwarderAdapters[0].adapters = polygonAdapters; - forwarderAdapters[0].chainId = ChainIds.POLYGON; - forwarderAdapters[1].adapters = avalancheAdapters; - forwarderAdapters[1].chainId = ChainIds.AVALANCHE; - forwarderAdapters[2].adapters = binanceAdapters; - forwarderAdapters[2].chainId = ChainIds.BNB; - - return forwarderAdapters; - } - - function _getAdapterByChain( - bool afterExecution - ) internal view override returns (AdapterAllowed[] memory) { - AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](4); - adaptersAllowed[0] = AdapterAllowed({ - adapter: payload.CCIP_ADAPTER_TO_REMOVE(), - chainId: ChainIds.POLYGON, - allowed: true - }); - adaptersAllowed[1] = AdapterAllowed({ - adapter: payload.CCIP_ADAPTER_TO_REMOVE(), - chainId: ChainIds.AVALANCHE, - allowed: true - }); - adaptersAllowed[2] = AdapterAllowed({ - adapter: payload.CCIP_NEW_ADAPTER(), - chainId: ChainIds.POLYGON, - allowed: false - }); - adaptersAllowed[3] = AdapterAllowed({ - adapter: payload.CCIP_NEW_ADAPTER(), - chainId: ChainIds.AVALANCHE, - allowed: false - }); - if (afterExecution) { - adaptersAllowed[0].allowed = false; - adaptersAllowed[1].allowed = false; - adaptersAllowed[2].allowed = true; - adaptersAllowed[3].allowed = true; - } - - return adaptersAllowed; - } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..bc9fa4b51 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscGnosis} from 'aave-address-book/MiscGnosis.sol'; +import {GovernanceV3Gnosis} from 'aave-address-book/GovernanceV3Gnosis.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Gnosis.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscGnosis.PROXY_ADMIN, + newCCCImplementation: 0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922 + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..71b99ecf0 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscGnosis} from 'aave-address-book/MiscGnosis.sol'; +import {GovernanceV3Gnosis} from 'aave-address-book/GovernanceV3Gnosis.sol'; + +import {AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Gnosis.CROSS_CHAIN_CONTROLLER, + MiscGnosis.PROXY_ADMIN, + type(AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'gnosis', + 32990165 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..6913b3d4b --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscMetis} from 'aave-address-book/MiscMetis.sol'; +import {GovernanceV3Metis} from 'aave-address-book/GovernanceV3Metis.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Metis.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscMetis.PROXY_ADMIN, + newCCCImplementation: 0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04 + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..fb7beb526 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscMetis} from 'aave-address-book/MiscMetis.sol'; +import {GovernanceV3Metis} from 'aave-address-book/GovernanceV3Metis.sol'; + +import {AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Metis.CROSS_CHAIN_CONTROLLER, + MiscMetis.PROXY_ADMIN, + type(AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'metis', + 15127085 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..f1288e44b --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscOptimism} from 'aave-address-book/MiscOptimism.sol'; +import {GovernanceV3Optimism} from 'aave-address-book/GovernanceV3Optimism.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Optimism.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscOptimism.PROXY_ADMIN, + newCCCImplementation: 0xa5cc218513305221201f196760E9e64e9D49d98A + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..c9e6534ac --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscOptimism} from 'aave-address-book/MiscOptimism.sol'; +import {GovernanceV3Optimism} from 'aave-address-book/GovernanceV3Optimism.sol'; + +import {AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Optimism.CROSS_CHAIN_CONTROLLER, + MiscOptimism.PROXY_ADMIN, + type(AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'optimism', + 117321235 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol index 9847ecbb5..c04e92853 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -1,130 +1,44 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; -import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; -import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; import {MiscPolygon} from 'aave-address-book/MiscPolygon.sol'; -import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; +import {BaseAdaptersUpdatePayload} from './BaseAdaptersUpdatePayload.sol'; /** - * @title Update a.DI implementation and CCIP adapters + * @title aDI and bridge adapters update * @author BGD Labs @bgdlabs - * - Snapshot: TODO - * - Discussion: TODO + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 */ -contract AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 is IProposalGenericExecutor { - address public constant CCIP_ADAPTER_TO_REMOVE = 0x95Fa2c817169E26956AB8795c84a225b55d7db5B; - address public constant CCIP_NEW_ADAPTER = 0xe79757D55a1600eF28D816a893E78E9FCDE2019E; - address public constant DESTINATION_CCIP_NEW_ADAPTER = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; - address public constant NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = - 0x87a95917DE670088d81B9a8B30E3B36704Ba3043; - - function execute() external { - // Update CrossChainController implementation - ProxyAdmin(MiscPolygon.PROXY_ADMIN).upgradeAndCall( - TransparentUpgradeableProxy(payable(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER)), - NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, - abi.encodeWithSignature('initializeRevision()') - ); - - // remove old Receiver bridge adapter - ICrossChainReceiver(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToRemove() - ); - - // remove forwarding adapters - ICrossChainForwarder(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( - _getForwarderBridgeAdaptersToRemove() - ); - - // add receiver adapters - ICrossChainReceiver(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( - _getReceiverBridgeAdaptersToAllow() - ); - - // add forwarding adapters - ICrossChainForwarder(GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( - _getForwarderBridgeAdaptersToEnable() - ); - } - - function _getReceiverBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - // remove old Receiver bridge adapter - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: chainIds - }); - - return bridgeAdaptersToRemove; - } - - function _getForwarderBridgeAdaptersToRemove() - internal - pure - returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainForwarder.BridgeAdapterToDisable[] - memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); - - forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ - bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, - chainIds: chainIds - }); - - return forwarderAdaptersToRemove; - } - - function _getReceiverBridgeAdaptersToAllow() - internal - pure - returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) - { - uint256[] memory chainIds = new uint256[](1); - chainIds[0] = ChainIds.MAINNET; - - ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] - memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); - - bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ - bridgeAdapter: CCIP_NEW_ADAPTER, - chainIds: chainIds - }); - - return bridgeAdapterConfig; +contract AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseAdaptersUpdatePayload( + BaseAdaptersUpdatePayload.ConstructorInput({ + ccc: GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscPolygon.PROXY_ADMIN, + newCCCImplementation: 0x87a95917DE670088d81B9a8B30E3B36704Ba3043, + ccipNewAdapter: 0xe79757D55a1600eF28D816a893E78E9FCDE2019E, + ccipAdapterToRemove: 0x95Fa2c817169E26956AB8795c84a225b55d7db5B + }) + ) +{ + function getChainsToReceive() public pure override returns (uint256[] memory) { + uint256[] memory chains = new uint256[](1); + chains[0] = ChainIds.MAINNET; + return chains; } - function _getForwarderBridgeAdaptersToEnable() - internal + function getDestinationAdapters() + public pure - returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + override + returns (DestinationAdaptersInput[] memory) { - ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] - memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( - 1 - ); + DestinationAdaptersInput[] memory destinationAdapters = new DestinationAdaptersInput[](1); - bridgeAdaptersToEnable[0] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ - currentChainBridgeAdapter: CCIP_NEW_ADAPTER, - destinationBridgeAdapter: DESTINATION_CCIP_NEW_ADAPTER, - destinationChainId: ChainIds.MAINNET - }); + destinationAdapters[0].adapter = 0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29; + destinationAdapters[0].chainId = ChainIds.MAINNET; - return bridgeAdaptersToEnable; + return destinationAdapters; } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index db5fe6fb2..074f83b52 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -13,100 +13,13 @@ import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './A * command: make test-contract filter=AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 */ contract AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313_Test is BaseTest { - AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313 internal payload; - constructor() BaseTest( GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER, MiscPolygon.PROXY_ADMIN, + type(AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, 'polygon', 54566890 ) {} - - function setUp() public override { - super.setUp(); - payload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); - payloadAddress = address(payload); - } - - function _getAdapterNames() internal view override returns (AdapterName[] memory) { - AdapterName[] memory adapterNames = new AdapterName[](1); - adapterNames[0] = AdapterName({adapter: payload.CCIP_NEW_ADAPTER(), name: 'CCIP adapter'}); - - return adapterNames; - } - - function _checkCorrectPathConfiguration() internal override { - assertEq(ethereumPayload.CCIP_NEW_ADAPTER(), payload.DESTINATION_CCIP_NEW_ADAPTER()); - } - - function _getTrustedRemotes() internal view override returns (TrustedRemote[] memory) { - TrustedRemote[] memory trustedRemotes = new TrustedRemote[](1); - trustedRemotes[0] = TrustedRemote({ - adapter: payload.CCIP_NEW_ADAPTER(), - expectedRemote: GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER, - remoteChainId: ChainIds.MAINNET - }); - - return trustedRemotes; - } - - function _getForwarderAdaptersByChain( - bool afterExecution - ) internal view override returns (ForwarderAdapters[] memory) { - ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](1); - - ICrossChainForwarder.ChainIdBridgeConfig[] - memory adapters = new ICrossChainForwarder.ChainIdBridgeConfig[](1); - adapters[0].currentChainBridgeAdapter = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - adapters[0].currentChainBridgeAdapter = payload.CCIP_NEW_ADAPTER(); - adapters[0].destinationBridgeAdapter = payload.DESTINATION_CCIP_NEW_ADAPTER(); - } - forwarderAdapters[0].adapters = adapters; - forwarderAdapters[0].chainId = ChainIds.MAINNET; - - return forwarderAdapters; - } - - function _getReceiverAdaptersByChain( - bool afterExecution - ) internal view override returns (AdaptersByChain[] memory) { - address[] memory adapters = new address[](1); - AdaptersByChain[] memory receiverAdaptersByChain = new AdaptersByChain[](1); - - adapters[0] = payload.CCIP_ADAPTER_TO_REMOVE(); - - if (afterExecution) { - adapters[0] = payload.CCIP_NEW_ADAPTER(); - } - receiverAdaptersByChain[0].adapters = adapters; - receiverAdaptersByChain[0].chainId = ChainIds.MAINNET; - - return receiverAdaptersByChain; - } - - function _getAdapterByChain( - bool afterExecution - ) internal view override returns (AdapterAllowed[] memory) { - AdapterAllowed[] memory adaptersAllowed = new AdapterAllowed[](2); - adaptersAllowed[0] = AdapterAllowed({ - adapter: payload.CCIP_ADAPTER_TO_REMOVE(), - chainId: ChainIds.MAINNET, - allowed: true - }); - adaptersAllowed[1] = AdapterAllowed({ - adapter: payload.CCIP_NEW_ADAPTER(), - chainId: ChainIds.MAINNET, - allowed: false - }); - if (afterExecution) { - adaptersAllowed[0].allowed = false; - adaptersAllowed[1].allowed = true; - } - - return adaptersAllowed; - } } diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol new file mode 100644 index 000000000..c48042a90 --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import {MiscScroll} from 'aave-address-book/MiscScroll.sol'; +import {GovernanceV3Scroll} from 'aave-address-book/GovernanceV3Scroll.sol'; +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title aDI and bridge adapters update + * @author BGD Labs @bgdlabs + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21 + */ +contract AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313 is + BaseCCCImplementationUpdatePayload( + BaseCCCImplementationUpdatePayload.CCCImplementationUpdateInput({ + ccc: GovernanceV3Scroll.CROSS_CHAIN_CONTROLLER, + proxyAdmin: MiscScroll.PROXY_ADMIN, + newCCCImplementation: 0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922 + }) + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol new file mode 100644 index 000000000..751eee27a --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {MiscScroll} from 'aave-address-book/MiscScroll.sol'; +import {GovernanceV3Scroll} from 'aave-address-book/GovernanceV3Scroll.sol'; + +import {AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; + +/** + * @dev Test for AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313 + * command: make test-contract filter=AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313 + */ +contract AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313_Test is + BaseCCCImplementationUpdatePayloadTest( + GovernanceV3Scroll.CROSS_CHAIN_CONTROLLER, + MiscScroll.PROXY_ADMIN, + type(AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode, + 'scroll', + 4063725 + ) +{ + +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseAdaptersUpdatePayload.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseAdaptersUpdatePayload.sol new file mode 100644 index 000000000..c70ea812e --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseAdaptersUpdatePayload.sol @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; + +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +/** + * @title Base payload aDI and bridge adapters update + * @author BGD Labs @bgdlabs + */ +abstract contract BaseAdaptersUpdatePayload is BaseCCCImplementationUpdatePayload { + struct ConstructorInput { + address proxyAdmin; + address ccc; + address newCCCImplementation; + address ccipAdapterToRemove; + address ccipNewAdapter; + } + struct DestinationAdaptersInput { + address adapter; + uint256 chainId; + } + + address public immutable CCIP_ADAPTER_TO_REMOVE; + address public immutable CCIP_NEW_ADAPTER; + + constructor( + ConstructorInput memory constructorInput + ) + BaseCCCImplementationUpdatePayload( + CCCImplementationUpdateInput({ + proxyAdmin: constructorInput.proxyAdmin, + ccc: constructorInput.ccc, + newCCCImplementation: constructorInput.newCCCImplementation + }) + ) + { + CCIP_ADAPTER_TO_REMOVE = constructorInput.ccipAdapterToRemove; + CCIP_NEW_ADAPTER = constructorInput.ccipNewAdapter; + } + + function execute() public override { + super.execute(); + + // remove old Receiver bridge adapter + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).disallowReceiverBridgeAdapters( + getReceiverBridgeAdaptersToRemove() + ); + + // remove forwarding adapters + ICrossChainForwarder(CROSS_CHAIN_CONTROLLER).disableBridgeAdapters( + getForwarderBridgeAdaptersToRemove() + ); + + uint256[] memory chainsToSend = getChainsToSend(); + uint256[] memory chainsToReceive = getChainsToReceive(); + + if (chainsToReceive.length != 0) { + // add receiver adapters + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).allowReceiverBridgeAdapters( + getReceiverBridgeAdaptersToAllow() + ); + } + + if (chainsToSend.length != 0) { + // add forwarding adapters + ICrossChainForwarder(CROSS_CHAIN_CONTROLLER).enableBridgeAdapters( + getForwarderBridgeAdaptersToEnable() + ); + } + } + + function getDestinationAdapters() + public + pure + virtual + returns (DestinationAdaptersInput[] memory) + { + DestinationAdaptersInput[] memory destinationAdapters; + return destinationAdapters; + } + + function getChainsToReceive() public pure virtual returns (uint256[] memory); + + function getChainsToSend() public pure returns (uint256[] memory) { + DestinationAdaptersInput[] memory destinationAdapters = getDestinationAdapters(); + uint256[] memory chainsToSend = new uint256[](destinationAdapters.length); + for (uint256 i = 0; i < destinationAdapters.length; i++) { + chainsToSend[i] = destinationAdapters[i].chainId; + } + return chainsToSend; + } + + function getReceiverBridgeAdaptersToRemove() + public + view + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + // remove old Receiver bridge adapter + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdaptersToRemove = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdaptersToRemove[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: getChainsToReceive() + }); + + return bridgeAdaptersToRemove; + } + + function getForwarderBridgeAdaptersToRemove() + public + view + returns (ICrossChainForwarder.BridgeAdapterToDisable[] memory) + { + ICrossChainForwarder.BridgeAdapterToDisable[] + memory forwarderAdaptersToRemove = new ICrossChainForwarder.BridgeAdapterToDisable[](1); + + forwarderAdaptersToRemove[0] = ICrossChainForwarder.BridgeAdapterToDisable({ + bridgeAdapter: CCIP_ADAPTER_TO_REMOVE, + chainIds: getChainsToSend() + }); + + return forwarderAdaptersToRemove; + } + + function getReceiverBridgeAdaptersToAllow() + public + view + returns (ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] memory) + { + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory bridgeAdapterConfig = new ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[](1); + + bridgeAdapterConfig[0] = ICrossChainReceiver.ReceiverBridgeAdapterConfigInput({ + bridgeAdapter: CCIP_NEW_ADAPTER, + chainIds: getChainsToReceive() + }); + + return bridgeAdapterConfig; + } + + function getForwarderBridgeAdaptersToEnable() + public + view + returns (ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] memory) + { + DestinationAdaptersInput[] memory destinationAdapters = getDestinationAdapters(); + + ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] + memory bridgeAdaptersToEnable = new ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[]( + destinationAdapters.length + ); + + for (uint256 i = 0; i < destinationAdapters.length; i++) { + bridgeAdaptersToEnable[i] = ICrossChainForwarder.ForwarderBridgeAdapterConfigInput({ + currentChainBridgeAdapter: CCIP_NEW_ADAPTER, + destinationBridgeAdapter: destinationAdapters[i].adapter, + destinationChainId: destinationAdapters[i].chainId + }); + } + + return bridgeAdaptersToEnable; + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayload.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayload.sol new file mode 100644 index 000000000..41d78c09c --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayload.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import {IProposalGenericExecutor} from 'aave-helpers/interfaces/IProposalGenericExecutor.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; + +contract BaseCCCImplementationUpdatePayload is IProposalGenericExecutor { + struct CCCImplementationUpdateInput { + address proxyAdmin; + address ccc; + address newCCCImplementation; + } + + address public immutable CROSS_CHAIN_CONTROLLER_IMPLEMENTATION; + address public immutable CROSS_CHAIN_CONTROLLER; + address public immutable PROXY_ADMIN; + + constructor(CCCImplementationUpdateInput memory updateInput) { + PROXY_ADMIN = updateInput.proxyAdmin; + CROSS_CHAIN_CONTROLLER = updateInput.ccc; + CROSS_CHAIN_CONTROLLER_IMPLEMENTATION = updateInput.newCCCImplementation; + } + + function execute() public virtual { + // Update CrossChainController implementation + ProxyAdmin(PROXY_ADMIN).upgradeAndCall( + TransparentUpgradeableProxy(payable(CROSS_CHAIN_CONTROLLER)), + CROSS_CHAIN_CONTROLLER_IMPLEMENTATION, + abi.encodeWithSignature('initializeRevision()') + ); + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayloadTest.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayloadTest.sol new file mode 100644 index 000000000..14c1c2cdd --- /dev/null +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseCCCImplementationUpdatePayloadTest.sol @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; +import 'aave-helpers/ProtocolV3TestBase.sol'; + +import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; +import {GovV3Helpers} from 'aave-helpers/GovV3Helpers.sol'; +import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; + +import {BaseCCCImplementationUpdatePayload} from './BaseCCCImplementationUpdatePayload.sol'; + +contract BaseCCCImplementationUpdatePayloadTest is ProtocolV3TestBase { + address public immutable CROSS_CHAIN_CONTROLLER; + address public immutable PROXY_ADMIN; + + bytes public payloadCode; + address public payloadAddress; + string public network; + uint256 public blockNumber; + + constructor( + address ccc, + address proxyAdmin, + bytes memory _payloadCode, + string memory _network, + uint256 _blockNumber + ) { + CROSS_CHAIN_CONTROLLER = ccc; + PROXY_ADMIN = proxyAdmin; + network = _network; + blockNumber = _blockNumber; + payloadCode = _payloadCode; + } + + function setUp() public virtual { + vm.createSelectFork(vm.rpcUrl(network), blockNumber); + payloadAddress = GovV3Helpers.deployDeterministic(payloadCode); + } + + function test_implementationOfCCCUpdate() public { + address newImplementation = BaseCCCImplementationUpdatePayload(payloadAddress) + .CROSS_CHAIN_CONTROLLER_IMPLEMENTATION(); + + address cccImplementationBefore = ProxyAdmin(PROXY_ADMIN).getProxyImplementation( + TransparentUpgradeableProxy(payable(CROSS_CHAIN_CONTROLLER)) + ); + assertTrue(cccImplementationBefore != newImplementation); + + executePayload(vm, payloadAddress); + + address cccImplementationAfter = ProxyAdmin(PROXY_ADMIN).getProxyImplementation( + TransparentUpgradeableProxy(payable(CROSS_CHAIN_CONTROLLER)) + ); + assertTrue(cccImplementationAfter == newImplementation); + } +} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol index 649c2f227..ef059f78b 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/BaseTest.sol @@ -1,13 +1,25 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; +import 'forge-std/console.sol'; + import {ProtocolV3TestBase} from 'aave-helpers/ProtocolV3TestBase.sol'; import {ICrossChainReceiver, ICrossChainForwarder} from 'aave-address-book/common/ICrossChainController.sol'; import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; import {ProxyAdmin} from 'solidity-utils/contracts/transparent-proxy/ProxyAdmin.sol'; import {IBaseAdapter} from 'aave-address-book/common/IBaseAdapter.sol'; + +import {GovernanceV3Ethereum} from 'aave-address-book/GovernanceV3Ethereum.sol'; +import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; +import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; + import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseAdaptersUpdatePayload} from './BaseAdaptersUpdatePayload.sol'; +import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {BaseCCCImplementationUpdatePayloadTest} from './BaseCCCImplementationUpdatePayloadTest.sol'; struct AdapterName { address adapter; @@ -37,223 +49,293 @@ struct ForwarderAdapters { } interface Payload { - function NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION() external returns (address); + function CROSS_CHAIN_CONTROLLER_IMPLEMENTATION() external returns (address); } -abstract contract BaseTest is ProtocolV3TestBase { - address public immutable CROSS_CHAIN_CONTROLLER; - address public immutable PROXY_ADMIN; +abstract contract BaseTest is BaseCCCImplementationUpdatePayloadTest { + BaseAdaptersUpdatePayload internal ethereumPayload; + BaseAdaptersUpdatePayload internal polygonPayload; + BaseAdaptersUpdatePayload internal avalanchePayload; + BaseAdaptersUpdatePayload internal binancePayload; - address public payloadAddress; - string public network; - uint256 public blockNumber; + constructor( + address ccc, + address proxyAdmin, + bytes memory _payloadCode, + string memory _network, + uint256 _blockNumber + ) BaseCCCImplementationUpdatePayloadTest(ccc, proxyAdmin, _payloadCode, _network, _blockNumber) {} - AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313 internal ethereumPayload; - - constructor(address ccc, address proxyAdmin, string memory _network, uint256 _blockNumber) { - CROSS_CHAIN_CONTROLLER = ccc; - PROXY_ADMIN = proxyAdmin; - network = _network; - blockNumber = _blockNumber; - } + function setUp() public override { + super.setUp(); - function setUp() public virtual { - vm.createSelectFork(vm.rpcUrl(network), blockNumber); ethereumPayload = new AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313(); + polygonPayload = new AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313(); + avalanchePayload = new AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313(); + binancePayload = new AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313(); } - /** - * @dev executes the generic test suite including e2e and config snapshots - */ - function test_defaultProposalExecution() public { - _checkTrustedRemotes(); - _checkCorrectPathConfiguration(); - _checkCorrectAdapterNames(); - - _checkCurrentReceiversState(false); - _checkAllReceiversAreRepresented(false); - _checkAllForwarderAdaptersAreRepresented(false); - _checkImplementationAddress( - Payload(payloadAddress).NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION(), - false - ); - - AdaptersByChain[] memory receiversBeforeExecution = _getCurrentReceiverAdaptersByChain(); - - executePayload(vm, payloadAddress); - - AdaptersByChain[] memory afterBeforeExecution = _getCurrentReceiverAdaptersByChain(); - - _checkCurrentReceiversState(true); - _checkAllReceiversAreRepresented(true); - _checkAllForwarderAdaptersAreRepresented(true); - _checkImplementationAddress( - Payload(payloadAddress).NEW_CROSS_CHAIN_CONTROLLER_IMPLEMENTATION(), - true - ); - } - - // -------------- virtual methods -------------------------- - function _checkCorrectPathConfiguration() internal virtual {} - - function _getAdapterNames() internal view virtual returns (AdapterName[] memory); - - function _getTrustedRemotes() internal view virtual returns (TrustedRemote[] memory); - - function _getAdapterByChain( - bool afterExecution - ) internal view virtual returns (AdapterAllowed[] memory); - - function _getForwarderAdaptersByChain( - bool afterExecution - ) internal view virtual returns (ForwarderAdapters[] memory) { - ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](0); - return forwarderAdapters; + function getPayloadByChainId(uint256 chainId) public view returns (BaseAdaptersUpdatePayload) { + if (chainId == ChainIds.MAINNET) { + return ethereumPayload; + } else if (chainId == ChainIds.POLYGON) { + return polygonPayload; + } else if (chainId == ChainIds.BNB) { + return binancePayload; + } else if (chainId == ChainIds.AVALANCHE) { + return avalanchePayload; + } + revert(); } - function _getReceiverAdaptersByChain( - bool afterExecution - ) internal view virtual returns (AdaptersByChain[] memory); - - // ------------------------ checks ------------- - function _checkAllForwarderAdaptersAreRepresented(bool afterExecution) internal { - ForwarderAdapters[] memory forwarderAdapters = _getForwarderAdaptersByChain(afterExecution); - - for (uint256 i = 0; i < forwarderAdapters.length; i++) { - _testForwarderAdapterCorrectness( - forwarderAdapters[i].chainId, - forwarderAdapters[i].adapters, - afterExecution - ); + function getTrustedRemoteByChainId(uint256 chainId) public view returns (address) { + if (chainId == ChainIds.MAINNET) { + return GovernanceV3Ethereum.CROSS_CHAIN_CONTROLLER; + } else if (chainId == ChainIds.POLYGON) { + return GovernanceV3Polygon.CROSS_CHAIN_CONTROLLER; + } else if (chainId == ChainIds.AVALANCHE) { + return GovernanceV3Avalanche.CROSS_CHAIN_CONTROLLER; } + revert(); } - function _checkAllReceiversAreRepresented(bool afterExecution) internal virtual { - AdaptersByChain[] memory receiverAdaptersByChain = _getReceiverAdaptersByChain(afterExecution); - - for (uint256 i = 0; i < receiverAdaptersByChain.length; i++) { - _testReceiverAdaptersByChain( - receiverAdaptersByChain[i].chainId, - receiverAdaptersByChain[i].adapters - ); + function test_trustedRemotes() public { + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory receivers = BaseAdaptersUpdatePayload(payloadAddress) + .getReceiverBridgeAdaptersToAllow(); + + for (uint256 i = 0; i < receivers.length; i++) { + for (uint256 j = 0; j < receivers[i].chainIds.length; j++) { + assertEq( + getTrustedRemoteByChainId(receivers[i].chainIds[j]), + IBaseAdapter(receivers[i].bridgeAdapter).getTrustedRemoteByChainId( + receivers[i].chainIds[j] + ) + ); + } } } - function _checkCurrentReceiversState(bool afterExecution) internal { - AdapterAllowed[] memory adaptersByChain = _getAdapterByChain(afterExecution); + function test_correctPathConfiguration() public { + BaseAdaptersUpdatePayload.DestinationAdaptersInput[] + memory destinationConfigs = BaseAdaptersUpdatePayload(payloadAddress) + .getDestinationAdapters(); - for (uint256 i = 0; i < adaptersByChain.length; i++) { + for (uint256 i = 0; i < destinationConfigs.length; i++) { assertEq( - ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( - adaptersByChain[i].adapter, - adaptersByChain[i].chainId - ), - adaptersByChain[i].allowed + getPayloadByChainId(destinationConfigs[i].chainId).CCIP_NEW_ADAPTER(), + destinationConfigs[i].adapter ); } } - function _checkCorrectAdapterNames() internal { - AdapterName[] memory adapterNames = _getAdapterNames(); + function test_correctAdapterNames() public { + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory receivers = BaseAdaptersUpdatePayload(payloadAddress) + .getReceiverBridgeAdaptersToAllow(); - for (uint256 i = 0; i < adapterNames.length; i++) { - string memory adapterName = IBaseAdapter(adapterNames[i].adapter).adapterName(); - assertEq(keccak256(abi.encode(adapterName)), keccak256(abi.encode(adapterNames[i].name))); + for (uint256 i = 0; i < receivers.length; i++) { + string memory adapterName = IBaseAdapter(receivers[i].bridgeAdapter).adapterName(); + assertEq(keccak256(abi.encode(adapterName)), keccak256(abi.encode('CCIP adapter'))); } } - function _checkTrustedRemotes() internal { - TrustedRemote[] memory trustedRemotes = _getTrustedRemotes(); + function test_receiversAreCorrectlySetAfterExecution() public { + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory beforeReceivers = BaseAdaptersUpdatePayload(payloadAddress) + .getReceiverBridgeAdaptersToAllow(); + + for (uint256 i = 0; i < beforeReceivers.length; i++) { + for (uint256 j = 0; j < beforeReceivers[i].chainIds.length; j++) { + assertEq( + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( + beforeReceivers[i].bridgeAdapter, + beforeReceivers[i].chainIds[j] + ), + false + ); + } + } - for (uint256 i = 0; i < trustedRemotes.length; i++) { - assertEq( - trustedRemotes[i].expectedRemote, - IBaseAdapter(trustedRemotes[i].adapter).getTrustedRemoteByChainId( - trustedRemotes[i].remoteChainId - ) - ); + executePayload(vm, payloadAddress); + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory receivers = BaseAdaptersUpdatePayload(payloadAddress) + .getReceiverBridgeAdaptersToAllow(); + + for (uint256 i = 0; i < receivers.length; i++) { + for (uint256 j = 0; j < receivers[i].chainIds.length; j++) { + assertEq( + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( + receivers[i].bridgeAdapter, + receivers[i].chainIds[j] + ), + true + ); + } } } - function _checkImplementationAddress(address implementation, bool equal) internal { - address cccImplementation = ProxyAdmin(PROXY_ADMIN).getProxyImplementation( - TransparentUpgradeableProxy(payable(CROSS_CHAIN_CONTROLLER)) - ); - assertEq(cccImplementation == implementation, equal); - } + function test_onlyUpdatedNeededAdapter() public { + uint256[] memory supportedChainsBefore = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getSupportedChains(); + AdaptersByChain[] memory adaptersBefore = _getCurrentReceiverAdaptersByChain(); - //----------------------------------------------------------------- + executePayload(vm, payloadAddress); - function _testForwarderAdapterCorrectness( - uint256 chainId, - ICrossChainForwarder.ChainIdBridgeConfig[] memory adapters, - bool checkDestination - ) internal { - ICrossChainForwarder.ChainIdBridgeConfig[] - memory forwarderBridgeAdapters = ICrossChainForwarder(CROSS_CHAIN_CONTROLLER) - .getForwarderBridgeAdaptersByChain(chainId); + uint256[] memory supportedChainsAfter = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) + .getSupportedChains(); - uint256 adaptersCount; - for (uint256 i = 0; i < forwarderBridgeAdapters.length; i++) { - for (uint256 j = 0; j < adapters.length; j++) { - if ( - forwarderBridgeAdapters[i].currentChainBridgeAdapter == - adapters[j].currentChainBridgeAdapter - ) { - if (checkDestination) { - if ( - forwarderBridgeAdapters[i].destinationBridgeAdapter == - adapters[j].destinationBridgeAdapter - ) { - adaptersCount++; + assertEq(supportedChainsBefore, supportedChainsAfter); + for (uint256 i = 0; i < supportedChainsBefore.length; i++) { + assertEq(supportedChainsAfter[i], supportedChainsBefore[i]); + } + + ICrossChainReceiver.ReceiverBridgeAdapterConfigInput[] + memory adaptersToRemove = BaseAdaptersUpdatePayload(payloadAddress) + .getReceiverBridgeAdaptersToRemove(); + + for (uint256 i = 0; i < adaptersBefore.length; i++) { + for (uint256 j = 0; j < adaptersToRemove.length; j++) { + for (uint256 x = 0; x < adaptersToRemove[j].chainIds.length; x++) { + if (adaptersToRemove[j].chainIds[x] == adaptersBefore[i].chainId) { + for (uint256 k = 0; k < adaptersBefore[i].adapters.length; k++) { + if (adaptersBefore[i].adapters[k] == adaptersToRemove[j].bridgeAdapter) { + assertEq( + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( + adaptersToRemove[j].bridgeAdapter, + adaptersBefore[i].chainId + ), + false + ); + } else { + assertEq( + ICrossChainReceiver(CROSS_CHAIN_CONTROLLER).isReceiverBridgeAdapterAllowed( + adaptersBefore[i].adapters[k], + adaptersBefore[i].chainId + ), + true + ); + } } - } else { - adaptersCount++; } } } } - assertEq(adaptersCount, adapters.length); } - function _testReceiverAdaptersByChain(uint256 chainId, address[] memory adapters) internal { - address[] memory receiverAdapters = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) - .getReceiverBridgeAdaptersByChain(chainId); + function test_forwarderAdaptersAreSet() public { + executePayload(vm, payloadAddress); + + ICrossChainForwarder.ForwarderBridgeAdapterConfigInput[] + memory forwarders = BaseAdaptersUpdatePayload(payloadAddress) + .getForwarderBridgeAdaptersToEnable(); - uint256 adaptersCount; - for (uint256 i = 0; i < receiverAdapters.length; i++) { - for (uint256 j = 0; j < adapters.length; j++) { - if (receiverAdapters[i] == adapters[j]) { - adaptersCount++; + for (uint256 i = 0; i < forwarders.length; i++) { + ICrossChainForwarder.ChainIdBridgeConfig[] + memory forwardersBridgeAdaptersByChain = ICrossChainForwarder(CROSS_CHAIN_CONTROLLER) + .getForwarderBridgeAdaptersByChain(forwarders[i].destinationChainId); + bool newAdapterFound; + for (uint256 j = 0; j < forwardersBridgeAdaptersByChain.length; j++) { + if ( + forwardersBridgeAdaptersByChain[j].destinationBridgeAdapter == + forwarders[i].destinationBridgeAdapter && + forwardersBridgeAdaptersByChain[j].currentChainBridgeAdapter == + forwarders[i].currentChainBridgeAdapter + ) { + newAdapterFound = true; } } + assertEq(newAdapterFound, true); } - assertEq(adaptersCount, adapters.length); } - function _testOnlyUpdatedReceiverAdapterChanges( - address[] memory previousReceivers, - address newAdapter, - uint256 chainId - ) internal { - address[] memory currentReceiverAdapters = ICrossChainReceiver(CROSS_CHAIN_CONTROLLER) - .getReceiverBridgeAdaptersByChain(chainId); - - uint256 adaptersCount; - uint256 newAdapterCount; - for (uint256 i = 0; i < currentReceiverAdapters.length; i++) { - for (uint256 j = 0; j < previousReceivers.length; j++) { - if (currentReceiverAdapters[i] == previousReceivers[j]) { - adaptersCount++; - } - if (currentReceiverAdapters[i] == newAdapter) { - newAdapterCount++; + function test_onlyChangedNeededForwarders() public { + ForwarderAdapters[] + memory forwardersBridgeAdaptersByChainBefore = _getCurrentForwarderAdaptersByChain(); + + ICrossChainForwarder.BridgeAdapterToDisable[] + memory adaptersToRemove = BaseAdaptersUpdatePayload(payloadAddress) + .getForwarderBridgeAdaptersToRemove(); + + executePayload(vm, payloadAddress); + + ForwarderAdapters[] + memory forwardersBridgeAdaptersByChainAfter = _getCurrentForwarderAdaptersByChain(); + + assertEq( + forwardersBridgeAdaptersByChainAfter.length, + forwardersBridgeAdaptersByChainBefore.length + ); + + for (uint256 l = 0; l < forwardersBridgeAdaptersByChainBefore.length; l++) { + for (uint256 j = 0; j < forwardersBridgeAdaptersByChainAfter.length; j++) { + if ( + forwardersBridgeAdaptersByChainBefore[l].chainId == + forwardersBridgeAdaptersByChainAfter[j].chainId + ) { + for (uint256 i = 0; i < forwardersBridgeAdaptersByChainBefore[l].adapters.length; i++) { + bool forwarderFound; + for (uint256 m = 0; m < forwardersBridgeAdaptersByChainAfter[j].adapters.length; m++) { + if ( + forwardersBridgeAdaptersByChainBefore[l].adapters[i].destinationBridgeAdapter == + forwardersBridgeAdaptersByChainAfter[j].adapters[m].destinationBridgeAdapter && + forwardersBridgeAdaptersByChainBefore[l].adapters[i].currentChainBridgeAdapter == + forwardersBridgeAdaptersByChainAfter[j].adapters[m].currentChainBridgeAdapter + ) { + forwarderFound = true; + break; + } + } + if (!forwarderFound) { + bool isAdapterToBeRemoved; + for (uint256 k = 0; k < adaptersToRemove.length; k++) { + if ( + forwardersBridgeAdaptersByChainBefore[l].adapters[i].currentChainBridgeAdapter == + adaptersToRemove[k].bridgeAdapter + ) { + for (uint256 n = 0; n < adaptersToRemove[k].chainIds.length; n++) { + if ( + forwardersBridgeAdaptersByChainBefore[l].chainId == + adaptersToRemove[k].chainIds[n] + ) { + isAdapterToBeRemoved = true; + break; + } + } + } + } + assertEq(isAdapterToBeRemoved, true); + } + } } } } + } + + function _getCurrentForwarderAdaptersByChain() internal returns (ForwarderAdapters[] memory) { + uint256[] memory supportedChains = new uint256[](10); + supportedChains[0] = ChainIds.POLYGON; + supportedChains[1] = ChainIds.AVALANCHE; + supportedChains[2] = ChainIds.BNB; + supportedChains[3] = ChainIds.GNOSIS; + supportedChains[4] = ChainIds.ARBITRUM; + supportedChains[5] = ChainIds.OPTIMISM; + supportedChains[6] = ChainIds.METIS; + supportedChains[7] = ChainIds.BASE; + supportedChains[8] = ChainIds.SCROLL; + supportedChains[9] = ChainIds.MAINNET; + + ForwarderAdapters[] memory forwarderAdapters = new ForwarderAdapters[](supportedChains.length); - assertEq(previousReceivers.length, currentReceiverAdapters.length); - assertEq(currentReceiverAdapters.length, adaptersCount + newAdapterCount); + for (uint256 i = 0; i < supportedChains.length; i++) { + ICrossChainForwarder.ChainIdBridgeConfig[] memory forwarders = ICrossChainForwarder( + CROSS_CHAIN_CONTROLLER + ).getForwarderBridgeAdaptersByChain(supportedChains[i]); + + forwarderAdapters[i] = ForwarderAdapters({adapters: forwarders, chainId: supportedChains[i]}); + } + return forwarderAdapters; } function _getCurrentReceiverAdaptersByChain() internal returns (AdaptersByChain[] memory) { diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md index 68a6a6589..be2080ef5 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -1,21 +1,57 @@ --- title: "Update a.DI implementation and CCIP adapters" author: "BGD Labs @bgdlabs" -discussions: "" +discussions: "https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21" --- ## Simple Summary +This proposal includes the update of the CrossChainController on all supported networks to Revision 2. +It also updates all the CCIP Bridge Adapters to version 1.2.0 on the supported networks. + ## Motivation +The main motivation of this proposal is to bring the CCIP Bridge Adapters up to date with the latest bridge provider specifications, +and updating the logic to ease and standardize off chain tracking of a.DI contracts and events. + ## Specification +- Update CCIP to v1.2.0 +- Added Adaper Name to the contracts to make it easy to track off chain. + +On the CrossChainController implementation we have updated the logic so that all bridged messages will be treated the same +even if required confirmation have already been reached. (Previously these messages where ignored) + +Updates the implementation of CrossChainController on aDI on all supported networks: + +| Network | CrossChainController Impl | +| --------- | ------------------------------------------------------------------------------------------------------------------------------------ | +| Ethereum | [0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215](https://etherscan.io/address/0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215) | +| Polygon | [0x87a95917DE670088d81B9a8B30E3B36704Ba3043](https://polygonscan.com/address/0x87a95917DE670088d81B9a8B30E3B36704Ba3043) | +| Avalanche | [0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22](https://snowscan.xyz/address/0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22) | +| Binance | [0xf41193E25408F652AF878c47E4401A01B5E4B682](https://bscscan.com/address/0xf41193E25408F652AF878c47E4401A01B5E4B682) | +| Gnosis | [0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922](https://gnosisscan.io/address/0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922) | +| Arbitrum | [0x6e633269af45F37c44659D98f382dd0DD524E5Df](https://arbiscan.io/address/0x6e633269af45F37c44659D98f382dd0DD524E5Df) | +| Optimism | [0xa5cc218513305221201f196760E9e64e9D49d98A](https://optimistic.etherscan.io/address/0xa5cc218513305221201f196760E9e64e9D49d98A) | +| Metis | [0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04](https://andromeda-explorer.metis.io/address/0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04) | +| Base | [0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F](https://basescan.org/address/0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F) | +| Scroll | [0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922](https://scrollscan.com/address/0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922) | + +Updates the bridge adapters used to connect between networks + +| Network | CCIP | +| --------- | ------------------------------------------------------------------------------------------------------------------------ | +| Ethereum | [0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29](https://etherscan.io/address/0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29) | +| Polygon | [0xe79757D55a1600eF28D816a893E78E9FCDE2019E](https://polygonscan.com/address/0xe79757D55a1600eF28D816a893E78E9FCDE2019E) | +| Avalanche | [0x2b88C83727B0E290B76EB3F6133994fF81B7f355](https://snowscan.xyz/address/0x2b88C83727B0E290B76EB3F6133994fF81B7f355) | +| Binance | [0xAE93BEa44dcbE52B625169588574d31e36fb3A67](https://bscscan.com/address/0xAE93BEa44dcbE52B625169588574d31e36fb3A67) | + ## References -- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol) -- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol) -- [Snapshot](TODO) -- [Discussion](TODO) +- Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol) +- Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol) +- +- [Discussion](https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21) ## Copyright diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol index 5f8270226..79bc186af 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol @@ -2,11 +2,17 @@ pragma solidity ^0.8.0; import {GovV3Helpers, IPayloadsControllerCore, PayloadsControllerUtils} from 'aave-helpers/GovV3Helpers.sol'; -import {EthereumScript, PolygonScript, AvalancheScript, BNBScript} from 'aave-helpers/ScriptUtils.sol'; +import {EthereumScript, PolygonScript, AvalancheScript, BNBScript, BaseScript, GnosisScript, OptimismScript, ArbitrumScript, MetisScript, ScrollScript} from 'aave-helpers/ScriptUtils.sol'; import {AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; import {AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; import {AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; import {AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; +import {AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313} from './AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol'; /** * @dev Deploy Ethereum @@ -96,6 +102,138 @@ contract DeployBNB is BNBScript { } } +/** + * @dev Deploy Base + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployBase chain=base + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/8453/run-latest.json + */ +contract DeployBase is BaseScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Gnosis + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployGnosis chain=gnosis + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/100/run-latest.json + */ +contract DeployGnosis is GnosisScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Optimism + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployOptimism chain=optimism + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/10/run-latest.json + */ +contract DeployOptimism is OptimismScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Arbitrum + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployArbitrum chain=arbitrum + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/42161/run-latest.json + */ +contract DeployArbitrum is ArbitrumScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Metis + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployMetis chain=metis + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/1088/run-latest.json + */ +contract DeployMetis is MetisScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + +/** + * @dev Deploy Scroll + * deploy-command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:DeployScroll chain=scroll + * verify-command: npx catapulta-verify -b broadcast/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol/534352/run-latest.json + */ +contract DeployScroll is ScrollScript { + function run() external broadcast { + // deploy payloads + address payload0 = GovV3Helpers.deployDeterministic( + type(AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + + // compose action + IPayloadsControllerCore.ExecutionAction[] + memory actions = new IPayloadsControllerCore.ExecutionAction[](1); + actions[0] = GovV3Helpers.buildAction(payload0); + + // register action at payloadsController + GovV3Helpers.createPayload(actions); + } +} + /** * @dev Create Proposal * command: make deploy-ledger contract=src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters_20240313.s.sol:CreateProposal chain=mainnet @@ -103,7 +241,7 @@ contract DeployBNB is BNBScript { contract CreateProposal is EthereumScript { function run() external { // create payloads - PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](4); + PayloadsControllerUtils.Payload[] memory payloads = new PayloadsControllerUtils.Payload[](10); // compose actions for validation IPayloadsControllerCore.ExecutionAction[] @@ -134,6 +272,48 @@ contract CreateProposal is EthereumScript { ); payloads[3] = GovV3Helpers.buildBNBPayload(vm, actionsBNB); + IPayloadsControllerCore.ExecutionAction[] + memory actionsBase = new IPayloadsControllerCore.ExecutionAction[](1); + actionsBase[0] = GovV3Helpers.buildAction( + type(AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[4] = GovV3Helpers.buildBasePayload(vm, actionsBase); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsGnosis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsGnosis[0] = GovV3Helpers.buildAction( + type(AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[5] = GovV3Helpers.buildGnosisPayload(vm, actionsGnosis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsOptimism = new IPayloadsControllerCore.ExecutionAction[](1); + actionsOptimism[0] = GovV3Helpers.buildAction( + type(AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[6] = GovV3Helpers.buildOptimismPayload(vm, actionsOptimism); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsArbitrum = new IPayloadsControllerCore.ExecutionAction[](1); + actionsArbitrum[0] = GovV3Helpers.buildAction( + type(AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[7] = GovV3Helpers.buildArbitrumPayload(vm, actionsArbitrum); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsMetis = new IPayloadsControllerCore.ExecutionAction[](1); + actionsMetis[0] = GovV3Helpers.buildAction( + type(AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[8] = GovV3Helpers.buildMetisPayload(vm, actionsMetis); + + IPayloadsControllerCore.ExecutionAction[] + memory actionsScroll = new IPayloadsControllerCore.ExecutionAction[](1); + actionsScroll[0] = GovV3Helpers.buildAction( + type(AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313).creationCode + ); + payloads[9] = GovV3Helpers.buildScrollPayload(vm, actionsScroll); + // create proposal vm.startBroadcast(); GovV3Helpers.createProposal( diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts index 307a94eba..95f74c7f3 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/config.ts @@ -2,7 +2,18 @@ import {ConfigFile} from '../../generator/types'; export const config: ConfigFile = { rootOptions: { author: 'BGD Labs @bgdlabs', - pools: ['AaveV3Ethereum', 'AaveV3Polygon', 'AaveV3Avalanche', 'AaveV3BNB'], + pools: [ + 'AaveV3Ethereum', + 'AaveV3Polygon', + 'AaveV3Avalanche', + 'AaveV3BNB', + 'AaveV3Base', + 'AaveV3Gnosis', + 'AaveV3Optimism', + 'AaveV3Arbitrum', + 'AaveV3Metis', + 'AaveV3Scroll', + ], title: 'Update a.DI implementation and CCIP adapters', shortName: 'UpdateADIImplementationAndCCIPAdapters', date: '20240313', @@ -14,5 +25,11 @@ export const config: ConfigFile = { AaveV3Polygon: {configs: {OTHERS: {}}, cache: {blockNumber: 54601669}}, AaveV3Avalanche: {configs: {OTHERS: {}}, cache: {blockNumber: 42840161}}, AaveV3BNB: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Base: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Gnosis: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Optimism: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Arbitrum: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Metis: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, + AaveV3Scroll: {configs: {OTHERS: {}}, cache: {blockNumber: 36928161}}, }, }; From 3e460477f2a4906c2178473cee63e12b706fb768 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 20 Mar 2024 09:40:08 +0100 Subject: [PATCH 4/8] Update src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md Co-authored-by: Harsh Pandey --- .../UpdateADIImplementationAndCCIPAdapters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md index be2080ef5..8fe1e20c8 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -17,7 +17,7 @@ and updating the logic to ease and standardize off chain tracking of a.DI contra ## Specification - Update CCIP to v1.2.0 -- Added Adaper Name to the contracts to make it easy to track off chain. +- Added Adapter Name to the contracts to make it easy to track off chain. On the CrossChainController implementation we have updated the logic so that all bridged messages will be treated the same even if required confirmation have already been reached. (Previously these messages where ignored) From 5f86a740f790ca2a696db7ffd61fa86112cfce78 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 20 Mar 2024 09:41:11 +0100 Subject: [PATCH 5/8] Update src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md Co-authored-by: Harsh Pandey --- .../UpdateADIImplementationAndCCIPAdapters.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md index 8fe1e20c8..c3bf57dc1 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -50,7 +50,6 @@ Updates the bridge adapters used to connect between networks - Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol) - Tests: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol) -- - [Discussion](https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/21) ## Copyright From 59241ee5848ebdfeb03e24de36b7c1399f4012fc Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 21 Mar 2024 15:45:38 +0100 Subject: [PATCH 6/8] fix: added reference to code diffs --- .../UpdateADIImplementationAndCCIPAdapters.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md index c3bf57dc1..22e01be28 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -46,6 +46,11 @@ Updates the bridge adapters used to connect between networks | Avalanche | [0x2b88C83727B0E290B76EB3F6133994fF81B7f355](https://snowscan.xyz/address/0x2b88C83727B0E290B76EB3F6133994fF81B7f355) | | Binance | [0xAE93BEa44dcbE52B625169588574d31e36fb3A67](https://bscscan.com/address/0xAE93BEa44dcbE52B625169588574d31e36fb3A67) | +Code diffs for the different networks can be checked on a.DI diff repository for [revision 2](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2). + +- Adapter diffs: [CCIPAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccip), [BaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/base_adapter), [IBaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/i_base_adapter) +- CCC Diffs: [Forwarder](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccc_impl), [Errors](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/errors) + ## References - Implementation: [AaveV3Ethereum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Ethereum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Polygon](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Polygon_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Avalanche](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Avalanche_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Optimism](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Arbitrum](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Metis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Base](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Gnosis](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3Scroll](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol), [AaveV3BNB](https://github.com/bgd-labs/aave-proposals-v3/blob/main/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3BNB_UpdateADIImplementationAndCCIPAdapters_20240313.sol) From 2e2797428ba51594b9fe43ddb47a04dc2736d31d Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 21 Mar 2024 15:50:10 +0100 Subject: [PATCH 7/8] fix: linting --- .../UpdateADIImplementationAndCCIPAdapters.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md index 22e01be28..247bae65b 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/UpdateADIImplementationAndCCIPAdapters.md @@ -47,9 +47,8 @@ Updates the bridge adapters used to connect between networks | Binance | [0xAE93BEa44dcbE52B625169588574d31e36fb3A67](https://bscscan.com/address/0xAE93BEa44dcbE52B625169588574d31e36fb3A67) | Code diffs for the different networks can be checked on a.DI diff repository for [revision 2](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2). - -- Adapter diffs: [CCIPAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccip), [BaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/base_adapter), [IBaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/i_base_adapter) -- CCC Diffs: [Forwarder](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccc_impl), [Errors](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/errors) +Adapter diffs: [CCIPAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccip), [BaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/base_adapter), [IBaseAdapter](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/i_base_adapter) +CCC Diffs: [Forwarder](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/ccc_impl), [Errors](https://github.com/bgd-labs/aDI-diffs/tree/main/diffs/rev2/errors) ## References From f6925ac2a8468e85c977810b9c604439c6449cdf Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 21 Mar 2024 16:04:40 +0100 Subject: [PATCH 8/8] fix: ran lint fix --- lib/aave-helpers | 2 +- ...bitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...trum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- ...V3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- ...Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...osis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- ...3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...etis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- ...timism_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...mism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- ...Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol | 4 +--- ...roll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol | 4 +--- 13 files changed, 13 insertions(+), 37 deletions(-) diff --git a/lib/aave-helpers b/lib/aave-helpers index e716f3291..5446518a5 160000 --- a/lib/aave-helpers +++ b/lib/aave-helpers @@ -1 +1 @@ -Subproject commit e716f32915a2fc1e3b7bf6ccdf913efb8b8ace96 +Subproject commit 5446518a5e5a22a0d649305f8dd05d099c1aea55 diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol index a3030e5bd..da9f23131 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0x6e633269af45F37c44659D98f382dd0DD524E5Df }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 7ad9133b2..c64ea61fe 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Arbitrum_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'arbitrum', 189596312 ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol index d6ed97266..90e975b89 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 88b0f61f6..4bc7cc4af 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Base_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'base', 11725901 ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol index bc9fa4b51..d07749aea 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922 }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 71b99ecf0..c68702fb7 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Gnosis_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'gnosis', 32990165 ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol index 6913b3d4b..28b627c48 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04 }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index fb7beb526..2b45e7c5b 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Metis_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'metis', 15127085 ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol index f1288e44b..b78cab479 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0xa5cc218513305221201f196760E9e64e9D49d98A }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index c9e6534ac..d6717230d 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Optimism_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'optimism', 117321235 ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol index c48042a90..e32cd1d8a 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.sol @@ -18,6 +18,4 @@ contract AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313 is newCCCImplementation: 0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922 }) ) -{ - -} +{} diff --git a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol index 751eee27a..4b6b34610 100644 --- a/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol +++ b/src/20240313_Multi_UpdateADIImplementationAndCCIPAdapters/AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313.t.sol @@ -18,6 +18,4 @@ contract AaveV3Scroll_UpdateADIImplementationAndCCIPAdapters_20240313_Test is 'scroll', 4063725 ) -{ - -} +{}