From fc078b36e52bc57f9bef88fcdb31aa90d8fc7f10 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 20 Jun 2024 15:48:49 +0900 Subject: [PATCH 01/22] fix: Added initial structure to deploy shuffle payload --- .gitmodules | 2 +- lib/aave-delivery-infrastructure | 2 +- scripts/payloads/ccc/shuffle/Ethereum.s.sol | 10 +++++++ .../Ethereum_Deploy_Shuffle_Update.s.sol | 24 +++++++++++++++ .../shuffle/ShuffleCCCUpdatePayload.sol | 30 +++++++++++++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 scripts/payloads/ccc/shuffle/Ethereum.s.sol create mode 100644 scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol create mode 100644 src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol diff --git a/.gitmodules b/.gitmodules index 8ce273f..3c78fb9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "lib/aave-delivery-infrastructure"] path = lib/aave-delivery-infrastructure url = https://github.com/bgd-labs/aave-delivery-infrastructure - branch = feat/bridge-shuffle + branch = fix/aave-helpers-deploy-ccc diff --git a/lib/aave-delivery-infrastructure b/lib/aave-delivery-infrastructure index be3f0b9..7f212af 160000 --- a/lib/aave-delivery-infrastructure +++ b/lib/aave-delivery-infrastructure @@ -1 +1 @@ -Subproject commit be3f0b98880204c90d7c336353fcdaff947b6881 +Subproject commit 7f212afbb846a075f0341dd8ea88930cf4d5c064 diff --git a/scripts/payloads/ccc/shuffle/Ethereum.s.sol b/scripts/payloads/ccc/shuffle/Ethereum.s.sol new file mode 100644 index 0000000..9782815 --- /dev/null +++ b/scripts/payloads/ccc/shuffle/Ethereum.s.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import './Ethereum_Deploy_Shuffle_Update.s.sol'; + +contract Ethereum is Base_Deploy_Add_Shuffle_to_CCC_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.ETHEREUM; + } +} diff --git a/scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol new file mode 100644 index 0000000..6923e07 --- /dev/null +++ b/scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import '../BaseDeployerScript.sol'; +import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; +import 'adi-scripts/CCC/DeployCrossChainController.sol'; + +/** + * @title Ethereum payload to update ccc with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + * - Snapshot: + */ +abstract contract Base_Deploy_Add_Shuffle_to_CCC_Payload is BaseDeployerScript, BaseCCCDeploy { + function _execute(Addresses memory addresses) internal virtual override { + addresses.crossChainControllerImpl = _deployCCCImpl(); + + new Add_Shuffle_to_CCC_Payload( + addresses.crossChainController, + addresses.proxyAdmin, + addresses.crossChainControllerImpl + ); + } +} diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol new file mode 100644 index 0000000..7eb4798 --- /dev/null +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'aave-helpers/adi/BaseCCCUpdate.sol'; + +/** + * @title Ethereum payload to update ccc with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + * - Snapshot: + */ +contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor( + address crossChainController, + address proxyAdmin, + address newCCCImpl + ) + BaseCCCUpdate( + CCCUpdateArgs({ + crossChainController: crossChainController, + proxyAdmin: proxyAdmin, + newCCCImpl: newCCCImpl + }) + ) + {} + + function getInitializeSignature() public pure override returns (bytes memory) { + return abi.encodeWithSignature('initializeRevision()'); + } +} From e31f57d6882112d5da5d5ede74dd0ce0418a9d0b Mon Sep 17 00:00:00 2001 From: sendra Date: Fri, 21 Jun 2024 10:45:53 +0900 Subject: [PATCH 02/22] fix: added base tests --- remappings.txt | 1 + ...s.sol => Base_Deploy_Shuffle_Update.s.sol} | 13 +- scripts/payloads/ccc/shuffle/Ethereum.s.sol | 10 -- .../ccc/shuffle/Network_Deployments.s.sol | 162 ++++++++++++++++++ tests/ccc/shuffle/ShufflePayloadTests.t.sol | 27 +++ 5 files changed, 201 insertions(+), 12 deletions(-) rename scripts/payloads/ccc/shuffle/{Ethereum_Deploy_Shuffle_Update.s.sol => Base_Deploy_Shuffle_Update.s.sol} (61%) delete mode 100644 scripts/payloads/ccc/shuffle/Ethereum.s.sol create mode 100644 scripts/payloads/ccc/shuffle/Network_Deployments.s.sol create mode 100644 tests/ccc/shuffle/ShufflePayloadTests.t.sol diff --git a/remappings.txt b/remappings.txt index ff8d265..9e9fca2 100644 --- a/remappings.txt +++ b/remappings.txt @@ -6,5 +6,6 @@ aave-helpers/=lib/aave-delivery-infrastructure/lib/aave-helpers/src/ aave-address-book/=lib/aave-delivery-infrastructure/lib/aave-helpers/lib/aave-address-book/src/ adi/=lib/aave-delivery-infrastructure/src/contracts/ adi-scripts/=lib/aave-delivery-infrastructure/scripts/ +adi-tests/=lib/aave-delivery-infrastructure/tests/ diff --git a/scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol similarity index 61% rename from scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol rename to scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index 6923e07..0a7db89 100644 --- a/scripts/payloads/ccc/shuffle/Ethereum_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -11,11 +11,20 @@ import 'adi-scripts/CCC/DeployCrossChainController.sol'; * - Discussion: * - Snapshot: */ -abstract contract Base_Deploy_Add_Shuffle_to_CCC_Payload is BaseDeployerScript, BaseCCCDeploy { +abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, BaseCCCDeploy { + function _deployPayload( + address crossChainController, + address proxyAdmin, + address crossChainControllerImpl + ) internal returns (address) { + return + new Add_Shuffle_to_CCC_Payload(crossChainController, proxyAdmin, crossChainControllerImpl); + } + function _execute(Addresses memory addresses) internal virtual override { addresses.crossChainControllerImpl = _deployCCCImpl(); - new Add_Shuffle_to_CCC_Payload( + _deployPayload( addresses.crossChainController, addresses.proxyAdmin, addresses.crossChainControllerImpl diff --git a/scripts/payloads/ccc/shuffle/Ethereum.s.sol b/scripts/payloads/ccc/shuffle/Ethereum.s.sol deleted file mode 100644 index 9782815..0000000 --- a/scripts/payloads/ccc/shuffle/Ethereum.s.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -import './Ethereum_Deploy_Shuffle_Update.s.sol'; - -contract Ethereum is Base_Deploy_Add_Shuffle_to_CCC_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return ChainIds.ETHEREUM; - } -} diff --git a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol new file mode 100644 index 0000000..a5afd6c --- /dev/null +++ b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol @@ -0,0 +1,162 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import './Base_Deploy_Shuffle_Update.s.sol'; + +contract Ethereum is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.ETHEREUM; + } +} + +contract Polygon is Base_Deploy_Shuffle_Update_Payload { + function CL_EMERGENCY_ORACLE() internal pure override returns (address) { + return 0xDAFA1989A504c48Ee20a582f2891eeB25E2fA23F; + } + + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.POLYGON; + } +} + +contract Avalanche is Base_Deploy_Shuffle_Update_Payload { + function CL_EMERGENCY_ORACLE() internal pure override returns (address) { + return 0x41185495Bc8297a65DC46f94001DC7233775EbEe; + } + + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.AVALANCHE; + } +} + +contract Arbitrum is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.ARBITRUM; + } +} + +contract Optimism is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.OPTIMISM; + } +} + +contract Metis is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.METIS; + } +} + +contract Binance is Base_Deploy_Shuffle_Update_Payload { + function CL_EMERGENCY_ORACLE() internal pure override returns (address) { + return 0xcabb46FfB38c93348Df16558DF156e9f68F9F7F1; + } + + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.BNB; + } +} + +contract Base is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.BASE; + } +} + +contract Gnosis is Base_Deploy_Shuffle_Update_Payload { + function CL_EMERGENCY_ORACLE() internal pure override returns (address) { + return 0xF937ffAeA1363e4Fa260760bDFA2aA8Fc911F84D; + } + + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.GNOSIS; + } +} + +contract Zkevm is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.POLYGON_ZK_EVM; + } +} + +contract Scroll is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.SCROLL; + } +} + +contract Celo is Base_Deploy_Shuffle_Update_Payload { + function CL_EMERGENCY_ORACLE() internal pure override returns (address) { + return 0x91b21900E91CD302EBeD05E45D8f270ddAED944d; + } + + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return ChainIds.CELO; + } +} + +contract Ethereum_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.ETHEREUM_SEPOLIA; + } +} + +contract Polygon_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.POLYGON_AMOY; + } +} + +contract Avalanche_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.AVALANCHE_FUJI; + } +} + +contract Arbitrum_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.ARBITRUM_SEPOLIA; + } +} + +contract Optimism_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.OPTIMISM_SEPOLIA; + } +} + +contract Metis_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.METIS_TESTNET; + } +} + +contract Binance_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.BNB_TESTNET; + } +} + +contract Base_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.BASE_SEPOLIA; + } +} + +contract Gnosis_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.GNOSIS_CHIADO; + } +} + +contract Scroll_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.SCROLL_SEPOLIA; + } +} + +contract Celo_testnet is Base_Deploy_Shuffle_Update_Payload { + function TRANSACTION_NETWORK() internal pure override returns (uint256) { + return TestNetChainIds.CELO_ALFAJORES; + } +} diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol new file mode 100644 index 0000000..1881a9d --- /dev/null +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import 'adi-tests/BaseTest.sol'; +import '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; +import {Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; + +contract BaseShufflePayloadTest is BaseTest { + Add_Shuffle_to_CCC_Payload internal payload; + + string internal immutable NETWORK; + uint256 internal immutable BLOCK_NUMBER; + + constructor(string memory network, uint256 blockNumber) { + NETWORK = network; + BLOCK_NUMBER = blockNumber; + } + + function _getPayload() internal virtual returns (address); + + function setUp() public { + vm.createSelectFork(vm.rpcUrl(NETWORK), BLOCK_NUMBER); + payload = _getPayload(); + } +} + +contract EthereumShufflePayloadTest is BaseShufflePayloadTest, Ethereum {} From 7e8dc548f63da0715ce74529ddcabc4425926ad6 Mon Sep 17 00:00:00 2001 From: sendra Date: Mon, 24 Jun 2024 18:51:26 +0900 Subject: [PATCH 03/22] fix: added payload to test --- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 2 +- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index 0a7db89..b42a85d 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import '../BaseDeployerScript.sol'; +import '../../../BaseDeployerScript.sol'; import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import 'adi-scripts/CCC/DeployCrossChainController.sol'; diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 1881a9d..42baf1e 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -1,12 +1,13 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import 'adi-tests/BaseTest.sol'; import '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import {Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; +import 'aave-helpers/adi/test/ADITestBase.sol'; -contract BaseShufflePayloadTest is BaseTest { +contract BaseShufflePayloadTest is ADITestBase { Add_Shuffle_to_CCC_Payload internal payload; + address internal crossChainController; string internal immutable NETWORK; uint256 internal immutable BLOCK_NUMBER; @@ -16,12 +17,24 @@ contract BaseShufflePayloadTest is BaseTest { BLOCK_NUMBER = blockNumber; } - function _getPayload() internal virtual returns (address); + function _getPayload() internal virtual returns (Add_Shuffle_to_CCC_Payload); function setUp() public { vm.createSelectFork(vm.rpcUrl(NETWORK), BLOCK_NUMBER); + payload = _getPayload(); } + + function test_defaultTest() public { + defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), true); + } } -contract EthereumShufflePayloadTest is BaseShufflePayloadTest, Ethereum {} +contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('mainnet', 20160400) { + function _getPayload() internal view override returns (Add_Shuffle_to_CCC_Payload) { + Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); + address cccImpl = _deployCCCImpl(); + crossChainController = addresses.crossChainController; + return new Add_Shuffle_to_CCC_Payload(crossChainController, addresses.proxyAdmin, cccImpl); + } +} From 495f2d3ef666679ab2fe6b1b33e87254de588dcf Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 25 Jun 2024 21:07:00 +0900 Subject: [PATCH 04/22] fix: solved some problems --- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 42baf1e..3aaf10a 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -2,14 +2,14 @@ pragma solidity ^0.8.0; import '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; -import {Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; +import {Addresses, Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; import 'aave-helpers/adi/test/ADITestBase.sol'; -contract BaseShufflePayloadTest is ADITestBase { +abstract contract BaseShufflePayloadTest is ADITestBase { Add_Shuffle_to_CCC_Payload internal payload; address internal crossChainController; - string internal immutable NETWORK; + string internal NETWORK; uint256 internal immutable BLOCK_NUMBER; constructor(string memory network, uint256 blockNumber) { From 1b8c727159e34a87568863e7339d0badeaf5e7cc Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 25 Jun 2024 21:18:30 +0900 Subject: [PATCH 05/22] fix: compiling --- reports/adi_add_shuffle_to_ccc_before.json | 68 +++++++++++++++++++ .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 2 +- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 6 +- 3 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 reports/adi_add_shuffle_to_ccc_before.json diff --git a/reports/adi_add_shuffle_to_ccc_before.json b/reports/adi_add_shuffle_to_ccc_before.json new file mode 100644 index 0000000..61ad539 --- /dev/null +++ b/reports/adi_add_shuffle_to_ccc_before.json @@ -0,0 +1,68 @@ +{ + "chainId": 1, + "crossChainControllerImpl": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", + "forwarderAdaptersByChain": { + "1": { + "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" + }, + "10": { + "0x0e24524778fdc67f53eEf144b8cbf50261E930B3": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" + }, + "100": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9", + "0x7238d75fD75bb936E83b75854c653F104Ce9c9d8": "0x3C06dce358add17aAf230f2234bCCC4afd50d090", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F" + }, + "1088": { + "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14": "0xf41193E25408F652AF878c47E4401A01B5E4B682" + }, + "137": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3e72665008dC237bdd91C04C10782Ed1987a4019", + "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": "0x853649f897383f89d8441346Cf26a9ed02720B02", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x7FAE7765abB4c8f778d57337bB720d0BC53057e3", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xe79757D55a1600eF28D816a893E78E9FCDE2019E" + }, + "42161": { + "0x88d6D01e08d3e64513b15fD46528dBbA7d755883": "0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d" + }, + "43114": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x617332a777780F546261247F621051d0b98975Eb", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x10f02995a399C0dC0FaF29914220E9C1bCdE8640", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0x2b88C83727B0E290B76EB3F6133994fF81B7f355" + }, + "534352": { + "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA": "0x3C06dce358add17aAf230f2234bCCC4afd50d090" + }, + "56": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3F006299eC88985c18E6e885EeA29A49eC579882", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0xa5cc218513305221201f196760E9e64e9D49d98A", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" + }, + "8453": { + "0xa5948b0ac79f72966dFFC5C13E44f6dfDD3D58A0": "0x7120b1f8e5b73c0C0DC99C6e52Fe4937E7EA11e0" + } + }, + "receiverAdaptersByChain": { + "137": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, + "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": true, + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true + }, + "43114": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true + } + }, + "receiverConfigs": { + "137": { + "requiredConfirmations": 3, + "validityTimestamp": 0 + }, + "43114": { + "requiredConfirmations": 2, + "validityTimestamp": 0 + } + } +} \ No newline at end of file diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index b42a85d..d8238da 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -16,7 +16,7 @@ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, Base address crossChainController, address proxyAdmin, address crossChainControllerImpl - ) internal returns (address) { + ) internal returns (Add_Shuffle_to_CCC_Payload) { return new Add_Shuffle_to_CCC_Payload(crossChainController, proxyAdmin, crossChainControllerImpl); } diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 3aaf10a..80faa44 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -30,11 +30,11 @@ abstract contract BaseShufflePayloadTest is ADITestBase { } } -contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('mainnet', 20160400) { - function _getPayload() internal view override returns (Add_Shuffle_to_CCC_Payload) { +contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160400) { + function _getPayload() internal override returns (Add_Shuffle_to_CCC_Payload) { Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); address cccImpl = _deployCCCImpl(); crossChainController = addresses.crossChainController; - return new Add_Shuffle_to_CCC_Payload(crossChainController, addresses.proxyAdmin, cccImpl); + return _deployPayload(crossChainController, addresses.proxyAdmin, cccImpl); } } From 7de9e26f3aebf064ad1a37996fbe22743ece09de Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 25 Jun 2024 21:49:43 +0900 Subject: [PATCH 06/22] fix: initialization call failing --- scripts/ccc/DeployCCC.s.sol | 2 +- src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol | 8 +++++++- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/ccc/DeployCCC.s.sol b/scripts/ccc/DeployCCC.s.sol index 905065e..7574c32 100644 --- a/scripts/ccc/DeployCCC.s.sol +++ b/scripts/ccc/DeployCCC.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity ^0.8.0; -import {BaseDeployerScript, Addresses} from '../BaseDeployerScript.sol'; +import '../BaseDeployerScript.sol'; import {TransparentUpgradeableProxy} from 'solidity-utils/contracts/transparent-proxy/TransparentUpgradeableProxy.sol'; import {TransparentProxyFactory} from 'solidity-utils/contracts/transparent-proxy/TransparentProxyFactory.sol'; import 'adi-scripts/CCC/DeployCrossChainController.sol'; diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 7eb4798..fe30309 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -2,6 +2,8 @@ pragma solidity ^0.8.0; import 'aave-helpers/adi/BaseCCCUpdate.sol'; +import {IReinitialize} from 'adi/revisions/update_to_rev_3/IReinitialize.sol'; +import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; /** * @title Ethereum payload to update ccc with new shuffle mechanism @@ -25,6 +27,10 @@ contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { {} function getInitializeSignature() public pure override returns (bytes memory) { - return abi.encodeWithSignature('initializeRevision()'); + return + abi.encodeWithSelector( + IReinitialize.initializeRevision.selector, + new ICrossChainForwarder.OptimalBandwidthByChain[](0) // TODO: this provably needs to be passed as param, as will depend on the network + ); } } diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 80faa44..43bb488 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; +import {Add_Shuffle_to_CCC_Payload} from '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import {Addresses, Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; import 'aave-helpers/adi/test/ADITestBase.sol'; From 373699540d5ab478d4a32ba6d5d4936a3280b11e Mon Sep 17 00:00:00 2001 From: sendra Date: Mon, 1 Jul 2024 11:38:10 +0900 Subject: [PATCH 07/22] fix: updated how payload gets optimal bandwidth. Still failing at test --- lib/aave-delivery-infrastructure | 2 +- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 39 ++++++++++++++++++- .../ccc/shuffle/Network_Deployments.s.sol | 2 + .../shuffle/ShuffleCCCUpdatePayload.sol | 19 +++++---- 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/lib/aave-delivery-infrastructure b/lib/aave-delivery-infrastructure index 7f212af..66ee010 160000 --- a/lib/aave-delivery-infrastructure +++ b/lib/aave-delivery-infrastructure @@ -1 +1 @@ -Subproject commit 7f212afbb846a075f0341dd8ea88930cf4d5c064 +Subproject commit 66ee010312c9112a73f194689e64c1a2022fae25 diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index d8238da..57be4ea 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -4,6 +4,22 @@ pragma solidity ^0.8.0; import '../../../BaseDeployerScript.sol'; import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import 'adi-scripts/CCC/DeployCrossChainController.sol'; +import {CrossChainController} from 'adi/revisions/update_to_rev_3/CrossChainController.sol'; +import {CrossChainControllerWithEmergencyMode} from 'adi/revisions/update_to_rev_3/CrossChainControllerWithEmergencyMode.sol'; + +// Library to get the code of ccc revision 3 (shuffle) +library CCCUpdateDeploymentHelper { + function getCCCImplCode(address emergencyOracle) internal pure returns (bytes memory) { + bytes memory cccImplCode = emergencyOracle == address(0) + ? abi.encodePacked(type(CrossChainController).creationCode, abi.encode()) + : abi.encodePacked( + type(CrossChainControllerWithEmergencyMode).creationCode, + abi.encode(emergencyOracle) + ); + + return cccImplCode; + } +} /** * @title Ethereum payload to update ccc with new shuffle mechanism @@ -12,13 +28,34 @@ import 'adi-scripts/CCC/DeployCrossChainController.sol'; * - Snapshot: */ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, BaseCCCDeploy { + function _getOptimalBandwidths() + internal + pure + virtual + returns (ICrossChainForwarder.OptimalBandwidthByChain[] memory) + { + return new ICrossChainForwarder.OptimalBandwidthByChain[](0); + } + function _deployPayload( address crossChainController, address proxyAdmin, address crossChainControllerImpl ) internal returns (Add_Shuffle_to_CCC_Payload) { + // TODO: provably makes sense to also deploy with create2 here return - new Add_Shuffle_to_CCC_Payload(crossChainController, proxyAdmin, crossChainControllerImpl); + new Add_Shuffle_to_CCC_Payload( + crossChainController, + proxyAdmin, + crossChainControllerImpl, + _getOptimalBandwidths() + ); + } + + function _deployCCCImpl() internal virtual override returns (address) { + bytes memory cccCode = CCCUpdateDeploymentHelper.getCCCImplCode(CL_EMERGENCY_ORACLE()); + + return _deployByteCode(cccCode, SALT()); } function _execute(Addresses memory addresses) internal virtual override { diff --git a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol index a5afd6c..14198bb 100644 --- a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol +++ b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol @@ -3,6 +3,8 @@ pragma solidity ^0.8.0; import './Base_Deploy_Shuffle_Update.s.sol'; +// TODO: add optimal bandwidth to the networks + contract Ethereum is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.ETHEREUM; diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index fe30309..0d770e9 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -12,10 +12,13 @@ import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; * - Snapshot: */ contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + ICrossChainForwarder.OptimalBandwidthByChain[] public optimalBandwidths; + constructor( address crossChainController, address proxyAdmin, - address newCCCImpl + address newCCCImpl, + ICrossChainForwarder.OptimalBandwidthByChain[] memory _optimalBandwidths ) BaseCCCUpdate( CCCUpdateArgs({ @@ -24,13 +27,13 @@ contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { newCCCImpl: newCCCImpl }) ) - {} + { + for (uint256 i = 0; i < _optimalBandwidths.length; i++) { + optimalBandwidths[i] = _optimalBandwidths[i]; + } + } - function getInitializeSignature() public pure override returns (bytes memory) { - return - abi.encodeWithSelector( - IReinitialize.initializeRevision.selector, - new ICrossChainForwarder.OptimalBandwidthByChain[](0) // TODO: this provably needs to be passed as param, as will depend on the network - ); + function getInitializeSignature() public view override returns (bytes memory) { + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); } } From 5d1ed788e26ae95dd1b00ad3704be14b7835b903 Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 2 Jul 2024 19:41:07 +0900 Subject: [PATCH 08/22] fix: fixed array usage --- ...ccc_before_adi_add_shuffle_to_ccc_after.md | 5 ++ reports/adi_add_shuffle_to_ccc_after.json | 68 +++++++++++++++++++ .../shuffle/ShuffleCCCUpdatePayload.sol | 19 +++--- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 6 +- tests/payloads/ArbAdapterPayload.t.sol | 4 +- 5 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md create mode 100644 reports/adi_add_shuffle_to_ccc_after.json diff --git a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md new file mode 100644 index 0000000..c15d3e2 --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md @@ -0,0 +1,5 @@ +## Raw diff + +```json +{} +``` \ No newline at end of file diff --git a/reports/adi_add_shuffle_to_ccc_after.json b/reports/adi_add_shuffle_to_ccc_after.json new file mode 100644 index 0000000..61ad539 --- /dev/null +++ b/reports/adi_add_shuffle_to_ccc_after.json @@ -0,0 +1,68 @@ +{ + "chainId": 1, + "crossChainControllerImpl": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", + "forwarderAdaptersByChain": { + "1": { + "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" + }, + "10": { + "0x0e24524778fdc67f53eEf144b8cbf50261E930B3": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" + }, + "100": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9", + "0x7238d75fD75bb936E83b75854c653F104Ce9c9d8": "0x3C06dce358add17aAf230f2234bCCC4afd50d090", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F" + }, + "1088": { + "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14": "0xf41193E25408F652AF878c47E4401A01B5E4B682" + }, + "137": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3e72665008dC237bdd91C04C10782Ed1987a4019", + "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": "0x853649f897383f89d8441346Cf26a9ed02720B02", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x7FAE7765abB4c8f778d57337bB720d0BC53057e3", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xe79757D55a1600eF28D816a893E78E9FCDE2019E" + }, + "42161": { + "0x88d6D01e08d3e64513b15fD46528dBbA7d755883": "0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d" + }, + "43114": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x617332a777780F546261247F621051d0b98975Eb", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x10f02995a399C0dC0FaF29914220E9C1bCdE8640", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0x2b88C83727B0E290B76EB3F6133994fF81B7f355" + }, + "534352": { + "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA": "0x3C06dce358add17aAf230f2234bCCC4afd50d090" + }, + "56": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3F006299eC88985c18E6e885EeA29A49eC579882", + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0xa5cc218513305221201f196760E9e64e9D49d98A", + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" + }, + "8453": { + "0xa5948b0ac79f72966dFFC5C13E44f6dfDD3D58A0": "0x7120b1f8e5b73c0C0DC99C6e52Fe4937E7EA11e0" + } + }, + "receiverAdaptersByChain": { + "137": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, + "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": true, + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true + }, + "43114": { + "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, + "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, + "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true + } + }, + "receiverConfigs": { + "137": { + "requiredConfirmations": 3, + "validityTimestamp": 0 + }, + "43114": { + "requiredConfirmations": 2, + "validityTimestamp": 0 + } + } +} \ No newline at end of file diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 0d770e9..850809e 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -4,6 +4,7 @@ pragma solidity ^0.8.0; import 'aave-helpers/adi/BaseCCCUpdate.sol'; import {IReinitialize} from 'adi/revisions/update_to_rev_3/IReinitialize.sol'; import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; +import 'forge-std/console.sol'; /** * @title Ethereum payload to update ccc with new shuffle mechanism @@ -12,13 +13,11 @@ import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; * - Snapshot: */ contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { - ICrossChainForwarder.OptimalBandwidthByChain[] public optimalBandwidths; - constructor( address crossChainController, address proxyAdmin, address newCCCImpl, - ICrossChainForwarder.OptimalBandwidthByChain[] memory _optimalBandwidths + ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths ) BaseCCCUpdate( CCCUpdateArgs({ @@ -28,12 +27,12 @@ contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { }) ) { - for (uint256 i = 0; i < _optimalBandwidths.length; i++) { - optimalBandwidths[i] = _optimalBandwidths[i]; - } - } - - function getInitializeSignature() public view override returns (bytes memory) { - return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + console.log('------', optimalBandwidths.length); + initializeSignature = abi.encodeWithSelector( + IReinitialize.initializeRevision.selector, + optimalBandwidths + ); + console.log('-----asdfasdfaf'); + console.logBytes(initializeSignature); } } diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 43bb488..d3eb44d 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -26,15 +26,17 @@ abstract contract BaseShufflePayloadTest is ADITestBase { } function test_defaultTest() public { - defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), true); + console.log('----------------------', address(payload)); + defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), true, vm); } } -contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160400) { +contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160500) { function _getPayload() internal override returns (Add_Shuffle_to_CCC_Payload) { Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); address cccImpl = _deployCCCImpl(); crossChainController = addresses.crossChainController; + console.log('impl', cccImpl); return _deployPayload(crossChainController, addresses.proxyAdmin, cccImpl); } } diff --git a/tests/payloads/ArbAdapterPayload.t.sol b/tests/payloads/ArbAdapterPayload.t.sol index 76b8eed..7f70614 100644 --- a/tests/payloads/ArbAdapterPayload.t.sol +++ b/tests/payloads/ArbAdapterPayload.t.sol @@ -19,13 +19,13 @@ contract ArbAdapterUpdatePayloadTest is ADITestBase, DeployArbitrumPayload { payload = new AaveV3Arbitrum_New_Adapter_Payload(crossChainController, newAdapter); } - function test_defaultTest() public { defaultTest( 'test_adi_diffs', GovernanceV3Arbitrum.CROSS_CHAIN_CONTROLLER, address(payload), - true + true, + vm ); } } From 2763b0d1827ba0ba7801fd5b059290718c9e1d8e Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 3 Jul 2024 11:12:05 +0900 Subject: [PATCH 09/22] fix: compiling --- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 33 ++-- .../ccc/shuffle/Network_Deployments.s.sol | 111 +++++------ .../shuffle/ShuffleCCCUpdatePayload.sol | 172 +++++++++++++++--- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 9 +- 4 files changed, 209 insertions(+), 116 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index 57be4ea..85dc52c 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.0; import '../../../BaseDeployerScript.sol'; -import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import 'adi-scripts/CCC/DeployCrossChainController.sol'; import {CrossChainController} from 'adi/revisions/update_to_rev_3/CrossChainController.sol'; import {CrossChainControllerWithEmergencyMode} from 'adi/revisions/update_to_rev_3/CrossChainControllerWithEmergencyMode.sol'; +import {CCCUpdateArgs} from 'aave-helpers/adi/BaseCCCUpdate.sol'; // Library to get the code of ccc revision 3 (shuffle) library CCCUpdateDeploymentHelper { @@ -28,28 +28,25 @@ library CCCUpdateDeploymentHelper { * - Snapshot: */ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, BaseCCCDeploy { - function _getOptimalBandwidths() - internal - pure - virtual - returns (ICrossChainForwarder.OptimalBandwidthByChain[] memory) - { - return new ICrossChainForwarder.OptimalBandwidthByChain[](0); - } + function _getShufflePayloadByteCode() internal virtual returns (bytes memory); function _deployPayload( address crossChainController, address proxyAdmin, address crossChainControllerImpl - ) internal returns (Add_Shuffle_to_CCC_Payload) { - // TODO: provably makes sense to also deploy with create2 here - return - new Add_Shuffle_to_CCC_Payload( - crossChainController, - proxyAdmin, - crossChainControllerImpl, - _getOptimalBandwidths() - ); + ) internal returns (address) { + bytes memory adapterCode = abi.encodePacked( + _getShufflePayloadByteCode(), + abi.encode( + CCCUpdateArgs({ + crossChainController: crossChainController, + proxyAdmin: proxyAdmin, + crossChainControllerImpl: crossChainControllerImpl + }) + ) + ); + + return _deployByteCode(adapterCode, 'CCC Shuffle Update Payload'); } function _deployCCCImpl() internal virtual override returns (address) { diff --git a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol index 14198bb..58b6d2f 100644 --- a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol +++ b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol @@ -2,13 +2,16 @@ pragma solidity ^0.8.0; import './Base_Deploy_Shuffle_Update.s.sol'; - -// TODO: add optimal bandwidth to the networks +import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; contract Ethereum is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.ETHEREUM; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Ethereum_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Polygon is Base_Deploy_Shuffle_Update_Payload { @@ -19,6 +22,10 @@ contract Polygon is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.POLYGON; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Polygon_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Avalanche is Base_Deploy_Shuffle_Update_Payload { @@ -29,24 +36,40 @@ contract Avalanche is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.AVALANCHE; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Avalanche_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Arbitrum is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.ARBITRUM; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Arbitrum_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Optimism is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.OPTIMISM; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Optimism_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Metis is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.METIS; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Metis_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Binance is Base_Deploy_Shuffle_Update_Payload { @@ -57,12 +80,20 @@ contract Binance is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.BNB; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Binance_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Base is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.BASE; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Base_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Gnosis is Base_Deploy_Shuffle_Update_Payload { @@ -73,11 +104,9 @@ contract Gnosis is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.GNOSIS; } -} -contract Zkevm is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return ChainIds.POLYGON_ZK_EVM; + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Gnosis_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -85,6 +114,10 @@ contract Scroll is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.SCROLL; } + + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Scroll_Add_Shuffle_to_CCC_Payload).creationCode; + } } contract Celo is Base_Deploy_Shuffle_Update_Payload { @@ -95,70 +128,8 @@ contract Celo is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { return ChainIds.CELO; } -} - -contract Ethereum_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.ETHEREUM_SEPOLIA; - } -} - -contract Polygon_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.POLYGON_AMOY; - } -} -contract Avalanche_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.AVALANCHE_FUJI; - } -} - -contract Arbitrum_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.ARBITRUM_SEPOLIA; - } -} - -contract Optimism_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.OPTIMISM_SEPOLIA; - } -} - -contract Metis_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.METIS_TESTNET; - } -} - -contract Binance_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.BNB_TESTNET; - } -} - -contract Base_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.BASE_SEPOLIA; - } -} - -contract Gnosis_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.GNOSIS_CHIADO; - } -} - -contract Scroll_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.SCROLL_SEPOLIA; - } -} - -contract Celo_testnet is Base_Deploy_Shuffle_Update_Payload { - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return TestNetChainIds.CELO_ALFAJORES; + function _getShufflePayloadByteCode() internal override returns (bytes memory) { + return type(Celo_Add_Shuffle_to_CCC_Payload).creationCode; } } diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 850809e..5536c96 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import 'aave-helpers/adi/BaseCCCUpdate.sol'; import {IReinitialize} from 'adi/revisions/update_to_rev_3/IReinitialize.sol'; import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; -import 'forge-std/console.sol'; +import {ChainIds} from 'aave-helpers/ChainIds.sol'; /** * @title Ethereum payload to update ccc with new shuffle mechanism @@ -12,27 +12,153 @@ import 'forge-std/console.sol'; * - Discussion: * - Snapshot: */ -contract Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { - constructor( - address crossChainController, - address proxyAdmin, - address newCCCImpl, - ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths - ) - BaseCCCUpdate( - CCCUpdateArgs({ - crossChainController: crossChainController, - proxyAdmin: proxyAdmin, - newCCCImpl: newCCCImpl - }) - ) - { - console.log('------', optimalBandwidths.length); - initializeSignature = abi.encodeWithSelector( - IReinitialize.initializeRevision.selector, - optimalBandwidths - ); - console.log('-----asdfasdfaf'); - console.logBytes(initializeSignature); +contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](5); + + optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.POLYGON, + optimalBandwidth: 3 // remember the problem with polygon native??? + }); + optimalBandwidths[1] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.AVALANCHE, + optimalBandwidth: 2 + }); + optimalBandwidths[2] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.BNB, + optimalBandwidth: 2 + }); + optimalBandwidths[3] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.GNOSIS, + optimalBandwidth: 2 + }); + // not yet connected but we can set it up?? + optimalBandwidths[4] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.CELO, + optimalBandwidth: 2 + }); + + // no need to set up all other networks as they are rollups so 0 = all bridges = 1 bridge + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](1); + optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.ETHEREUM, + optimalBandwidth: 3 // remember the problem with polygon native??? + }); + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](1); + optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ + chainId: ChainIds.ETHEREUM, + optimalBandwidth: 2 + }); + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); + } +} + +contract Celo_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { + constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} + + function getInitializeSignature() public override returns (bytes memory) { + ICrossChainForwarder.OptimalBandwidthByChain[] + memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); + + return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); } } diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index d3eb44d..84dcd9f 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {Add_Shuffle_to_CCC_Payload} from '../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; import {Addresses, Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; import 'aave-helpers/adi/test/ADITestBase.sol'; +import 'forge-std/console.sol'; abstract contract BaseShufflePayloadTest is ADITestBase { - Add_Shuffle_to_CCC_Payload internal payload; + address internal payload; address internal crossChainController; string internal NETWORK; @@ -17,7 +17,7 @@ abstract contract BaseShufflePayloadTest is ADITestBase { BLOCK_NUMBER = blockNumber; } - function _getPayload() internal virtual returns (Add_Shuffle_to_CCC_Payload); + function _getPayload() internal virtual returns (address); function setUp() public { vm.createSelectFork(vm.rpcUrl(NETWORK), BLOCK_NUMBER); @@ -32,11 +32,10 @@ abstract contract BaseShufflePayloadTest is ADITestBase { } contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160500) { - function _getPayload() internal override returns (Add_Shuffle_to_CCC_Payload) { + function _getPayload() internal override returns (address) { Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); address cccImpl = _deployCCCImpl(); crossChainController = addresses.crossChainController; - console.log('impl', cccImpl); return _deployPayload(crossChainController, addresses.proxyAdmin, cccImpl); } } From 898d0f4a087416a813d41799a873e6c272d028f5 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 3 Jul 2024 11:22:30 +0900 Subject: [PATCH 10/22] fix: updated helpers lib --- lib/aave-delivery-infrastructure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/aave-delivery-infrastructure b/lib/aave-delivery-infrastructure index 66ee010..99095f1 160000 --- a/lib/aave-delivery-infrastructure +++ b/lib/aave-delivery-infrastructure @@ -1 +1 @@ -Subproject commit 66ee010312c9112a73f194689e64c1a2022fae25 +Subproject commit 99095f180455a3bf3932b9a501a7af8396747794 From 17bb30afa3232141f93934c7b174daa970be026f Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 3 Jul 2024 11:48:31 +0900 Subject: [PATCH 11/22] fix: added pure --- .../ccc/shuffle/Network_Deployments.s.sol | 22 +++++++++---------- .../shuffle/ShuffleCCCUpdatePayload.sol | 22 +++++++++---------- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 1 - 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol index 58b6d2f..c8d4f18 100644 --- a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol +++ b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol @@ -9,7 +9,7 @@ contract Ethereum is Base_Deploy_Shuffle_Update_Payload { return ChainIds.ETHEREUM; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Ethereum_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -23,7 +23,7 @@ contract Polygon is Base_Deploy_Shuffle_Update_Payload { return ChainIds.POLYGON; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Polygon_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -37,7 +37,7 @@ contract Avalanche is Base_Deploy_Shuffle_Update_Payload { return ChainIds.AVALANCHE; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Avalanche_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -47,7 +47,7 @@ contract Arbitrum is Base_Deploy_Shuffle_Update_Payload { return ChainIds.ARBITRUM; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Arbitrum_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -57,7 +57,7 @@ contract Optimism is Base_Deploy_Shuffle_Update_Payload { return ChainIds.OPTIMISM; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Optimism_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -67,7 +67,7 @@ contract Metis is Base_Deploy_Shuffle_Update_Payload { return ChainIds.METIS; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Metis_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -81,7 +81,7 @@ contract Binance is Base_Deploy_Shuffle_Update_Payload { return ChainIds.BNB; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Binance_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -91,7 +91,7 @@ contract Base is Base_Deploy_Shuffle_Update_Payload { return ChainIds.BASE; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Base_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -105,7 +105,7 @@ contract Gnosis is Base_Deploy_Shuffle_Update_Payload { return ChainIds.GNOSIS; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Gnosis_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -115,7 +115,7 @@ contract Scroll is Base_Deploy_Shuffle_Update_Payload { return ChainIds.SCROLL; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Scroll_Add_Shuffle_to_CCC_Payload).creationCode; } } @@ -129,7 +129,7 @@ contract Celo is Base_Deploy_Shuffle_Update_Payload { return ChainIds.CELO; } - function _getShufflePayloadByteCode() internal override returns (bytes memory) { + function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { return type(Celo_Add_Shuffle_to_CCC_Payload).creationCode; } } diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 5536c96..6ca8b45 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -15,7 +15,7 @@ import {ChainIds} from 'aave-helpers/ChainIds.sol'; contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](5); @@ -50,7 +50,7 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](1); optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ @@ -64,7 +64,7 @@ contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](1); optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ @@ -78,7 +78,7 @@ contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -89,7 +89,7 @@ contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -100,7 +100,7 @@ contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -111,7 +111,7 @@ contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -122,7 +122,7 @@ contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -133,7 +133,7 @@ contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -144,7 +144,7 @@ contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); @@ -155,7 +155,7 @@ contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { contract Celo_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - function getInitializeSignature() public override returns (bytes memory) { + function getInitializeSignature() public pure override returns (bytes memory) { ICrossChainForwarder.OptimalBandwidthByChain[] memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 84dcd9f..55337b2 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -26,7 +26,6 @@ abstract contract BaseShufflePayloadTest is ADITestBase { } function test_defaultTest() public { - console.log('----------------------', address(payload)); defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), true, vm); } } From 783a8a38982458630be1577a3399dcb2b1fcec4a Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 3 Jul 2024 11:55:15 +0900 Subject: [PATCH 12/22] fix --- ..._shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md | 7 ++++++- reports/adi_add_shuffle_to_ccc_after.json | 2 +- .../payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol | 8 ++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md index c15d3e2..0249f5f 100644 --- a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md +++ b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md @@ -1,5 +1,10 @@ ## Raw diff ```json -{} +{ + "crossChainControllerImpl": { + "from": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", + "to": "0x8B471FdD45F993092263BE5D51afb3D052324bCD" + } +} ``` \ No newline at end of file diff --git a/reports/adi_add_shuffle_to_ccc_after.json b/reports/adi_add_shuffle_to_ccc_after.json index 61ad539..1cfac50 100644 --- a/reports/adi_add_shuffle_to_ccc_after.json +++ b/reports/adi_add_shuffle_to_ccc_after.json @@ -1,6 +1,6 @@ { "chainId": 1, - "crossChainControllerImpl": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", + "crossChainControllerImpl": "0x8B471FdD45F993092263BE5D51afb3D052324bCD", "forwarderAdaptersByChain": { "1": { "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index 85dc52c..b797c11 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -3,17 +3,17 @@ pragma solidity ^0.8.0; import '../../../BaseDeployerScript.sol'; import 'adi-scripts/CCC/DeployCrossChainController.sol'; -import {CrossChainController} from 'adi/revisions/update_to_rev_3/CrossChainController.sol'; -import {CrossChainControllerWithEmergencyMode} from 'adi/revisions/update_to_rev_3/CrossChainControllerWithEmergencyMode.sol'; +import {CrossChainControllerUpgradeRev3} from 'adi/revisions/update_to_rev_3/CrossChainController.sol'; +import {CrossChainControllerWithEmergencyModeUpgradeRev3} from 'adi/revisions/update_to_rev_3/CrossChainControllerWithEmergencyMode.sol'; import {CCCUpdateArgs} from 'aave-helpers/adi/BaseCCCUpdate.sol'; // Library to get the code of ccc revision 3 (shuffle) library CCCUpdateDeploymentHelper { function getCCCImplCode(address emergencyOracle) internal pure returns (bytes memory) { bytes memory cccImplCode = emergencyOracle == address(0) - ? abi.encodePacked(type(CrossChainController).creationCode, abi.encode()) + ? abi.encodePacked(type(CrossChainControllerUpgradeRev3).creationCode, abi.encode()) : abi.encodePacked( - type(CrossChainControllerWithEmergencyMode).creationCode, + type(CrossChainControllerWithEmergencyModeUpgradeRev3).creationCode, abi.encode(emergencyOracle) ); From ba87f46b2a2bbd4fb42d6e63d363014e653a3d1a Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 3 Jul 2024 11:57:50 +0900 Subject: [PATCH 13/22] fix: disallow e2e tests for impl upgrade --- ...di_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md | 2 +- reports/adi_add_shuffle_to_ccc_after.json | 2 +- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md index 0249f5f..52a6626 100644 --- a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md +++ b/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md @@ -4,7 +4,7 @@ { "crossChainControllerImpl": { "from": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", - "to": "0x8B471FdD45F993092263BE5D51afb3D052324bCD" + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" } } ``` \ No newline at end of file diff --git a/reports/adi_add_shuffle_to_ccc_after.json b/reports/adi_add_shuffle_to_ccc_after.json index 1cfac50..47be345 100644 --- a/reports/adi_add_shuffle_to_ccc_after.json +++ b/reports/adi_add_shuffle_to_ccc_after.json @@ -1,6 +1,6 @@ { "chainId": 1, - "crossChainControllerImpl": "0x8B471FdD45F993092263BE5D51afb3D052324bCD", + "crossChainControllerImpl": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d", "forwarderAdaptersByChain": { "1": { "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 55337b2..dc94af2 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -26,7 +26,7 @@ abstract contract BaseShufflePayloadTest is ADITestBase { } function test_defaultTest() public { - defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), true, vm); + defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), false, vm); } } From 6a9a740f54450fdc11f3b3a258b67cdc6dc9b35d Mon Sep 17 00:00:00 2001 From: sendra Date: Tue, 9 Jul 2024 11:31:34 +0200 Subject: [PATCH 14/22] fix: removed unnecessary inheritance --- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 28 +++++++++++++------ tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index b797c11..dfa2c06 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.0; import '../../../BaseDeployerScript.sol'; -import 'adi-scripts/CCC/DeployCrossChainController.sol'; import {CrossChainControllerUpgradeRev3} from 'adi/revisions/update_to_rev_3/CrossChainController.sol'; import {CrossChainControllerWithEmergencyModeUpgradeRev3} from 'adi/revisions/update_to_rev_3/CrossChainControllerWithEmergencyMode.sol'; import {CCCUpdateArgs} from 'aave-helpers/adi/BaseCCCUpdate.sol'; @@ -27,15 +26,27 @@ library CCCUpdateDeploymentHelper { * - Discussion: * - Snapshot: */ -abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, BaseCCCDeploy { +abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript { function _getShufflePayloadByteCode() internal virtual returns (bytes memory); + function CL_EMERGENCY_ORACLE() internal view virtual returns (address) { + return address(0); + } + + function SALT() internal pure virtual returns (string memory) { + return 'a.DI CrossChainController'; + } + + function PAYLOAD_SALT() internal pure virtual returns (string memory) { + return 'CrossChainController Shuffle Update Payload'; + } + function _deployPayload( address crossChainController, address proxyAdmin, address crossChainControllerImpl ) internal returns (address) { - bytes memory adapterCode = abi.encodePacked( + bytes memory payloadCode = abi.encodePacked( _getShufflePayloadByteCode(), abi.encode( CCCUpdateArgs({ @@ -46,18 +57,17 @@ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript, Base ) ); - return _deployByteCode(adapterCode, 'CCC Shuffle Update Payload'); + return _deployByteCode(payloadCode, PAYLOAD_SALT()); } - function _deployCCCImpl() internal virtual override returns (address) { - bytes memory cccCode = CCCUpdateDeploymentHelper.getCCCImplCode(CL_EMERGENCY_ORACLE()); + function _deployCrossChainControllerImpl() internal returns (address) { + bytes memory cccImplCode = CCCUpdateDeploymentHelper.getCCCImplCode(CL_EMERGENCY_ORACLE()); - return _deployByteCode(cccCode, SALT()); + return _deployByteCode(cccImplCode, SALT()); } function _execute(Addresses memory addresses) internal virtual override { - addresses.crossChainControllerImpl = _deployCCCImpl(); - + addresses.crossChainControllerImpl = _deployCrossChainControllerImpl(); _deployPayload( addresses.crossChainController, addresses.proxyAdmin, diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index dc94af2..c1acc17 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -33,7 +33,7 @@ abstract contract BaseShufflePayloadTest is ADITestBase { contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160500) { function _getPayload() internal override returns (address) { Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); - address cccImpl = _deployCCCImpl(); + address cccImpl = _deployCrossChainControllerImpl(); crossChainController = addresses.crossChainController; return _deployPayload(crossChainController, addresses.proxyAdmin, cccImpl); } From 1d64853cd35644482fdb1ca64648dc5271957002 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 10 Jul 2024 10:48:04 +0200 Subject: [PATCH 15/22] fix: added network name to diffs. Added all network tests --- .gitignore | 1 + ...e_adi_add_shuffle_to_ccc_arbitrum_after.md | 10 ++ ..._adi_add_shuffle_to_ccc_ethereum_after.md} | 0 ...i_diffs_before_adi_test_adi_diffs_after.md | 2 +- reports/adi_add_shuffle_to_ccc_after.json | 68 ------- reports/adi_add_shuffle_to_ccc_before.json | 68 ------- reports/adi_test_adi_diffs_after.json | 16 -- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 19 +- .../shuffle/ShuffleCCCUpdatePayload.sol | 5 +- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 168 +++++++++++++++++- 10 files changed, 180 insertions(+), 177 deletions(-) create mode 100644 diffs/adi_add_shuffle_to_ccc_arbitrum_before_adi_add_shuffle_to_ccc_arbitrum_after.md rename diffs/{adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md => adi_add_shuffle_to_ccc_ethereum_before_adi_add_shuffle_to_ccc_ethereum_after.md} (100%) delete mode 100644 reports/adi_add_shuffle_to_ccc_after.json delete mode 100644 reports/adi_add_shuffle_to_ccc_before.json delete mode 100644 reports/adi_test_adi_diffs_after.json diff --git a/.gitignore b/.gitignore index 3a383e6..032ab2f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ node_modules # ignore foundry deploy artifacts broadcast/ +reports/ input.json diff --git a/diffs/adi_add_shuffle_to_ccc_arbitrum_before_adi_add_shuffle_to_ccc_arbitrum_after.md b/diffs/adi_add_shuffle_to_ccc_arbitrum_before_adi_add_shuffle_to_ccc_arbitrum_after.md new file mode 100644 index 0000000..f77bf7c --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_arbitrum_before_adi_add_shuffle_to_ccc_arbitrum_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x6e633269af45F37c44659D98f382dd0DD524E5Df", + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md b/diffs/adi_add_shuffle_to_ccc_ethereum_before_adi_add_shuffle_to_ccc_ethereum_after.md similarity index 100% rename from diffs/adi_add_shuffle_to_ccc_before_adi_add_shuffle_to_ccc_after.md rename to diffs/adi_add_shuffle_to_ccc_ethereum_before_adi_add_shuffle_to_ccc_ethereum_after.md diff --git a/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md b/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md index 55202af..cfaf391 100644 --- a/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md +++ b/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md @@ -4,7 +4,7 @@ { "receiverAdaptersByChain": { "1": { - "0x1Cfe182fa075EF185adFD605806241e2d181ffC2": { + "0xA83F1E89EB2E904983dEEDc50517Fd7bDD5946c6": { "from": null, "to": true } diff --git a/reports/adi_add_shuffle_to_ccc_after.json b/reports/adi_add_shuffle_to_ccc_after.json deleted file mode 100644 index 47be345..0000000 --- a/reports/adi_add_shuffle_to_ccc_after.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "chainId": 1, - "crossChainControllerImpl": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d", - "forwarderAdaptersByChain": { - "1": { - "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" - }, - "10": { - "0x0e24524778fdc67f53eEf144b8cbf50261E930B3": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" - }, - "100": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9", - "0x7238d75fD75bb936E83b75854c653F104Ce9c9d8": "0x3C06dce358add17aAf230f2234bCCC4afd50d090", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F" - }, - "1088": { - "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14": "0xf41193E25408F652AF878c47E4401A01B5E4B682" - }, - "137": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3e72665008dC237bdd91C04C10782Ed1987a4019", - "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": "0x853649f897383f89d8441346Cf26a9ed02720B02", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x7FAE7765abB4c8f778d57337bB720d0BC53057e3", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xe79757D55a1600eF28D816a893E78E9FCDE2019E" - }, - "42161": { - "0x88d6D01e08d3e64513b15fD46528dBbA7d755883": "0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d" - }, - "43114": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x617332a777780F546261247F621051d0b98975Eb", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x10f02995a399C0dC0FaF29914220E9C1bCdE8640", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0x2b88C83727B0E290B76EB3F6133994fF81B7f355" - }, - "534352": { - "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA": "0x3C06dce358add17aAf230f2234bCCC4afd50d090" - }, - "56": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3F006299eC88985c18E6e885EeA29A49eC579882", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0xa5cc218513305221201f196760E9e64e9D49d98A", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" - }, - "8453": { - "0xa5948b0ac79f72966dFFC5C13E44f6dfDD3D58A0": "0x7120b1f8e5b73c0C0DC99C6e52Fe4937E7EA11e0" - } - }, - "receiverAdaptersByChain": { - "137": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, - "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": true, - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true - }, - "43114": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true - } - }, - "receiverConfigs": { - "137": { - "requiredConfirmations": 3, - "validityTimestamp": 0 - }, - "43114": { - "requiredConfirmations": 2, - "validityTimestamp": 0 - } - } -} \ No newline at end of file diff --git a/reports/adi_add_shuffle_to_ccc_before.json b/reports/adi_add_shuffle_to_ccc_before.json deleted file mode 100644 index 61ad539..0000000 --- a/reports/adi_add_shuffle_to_ccc_before.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "chainId": 1, - "crossChainControllerImpl": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", - "forwarderAdaptersByChain": { - "1": { - "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf": "0x6cfbd2aA4691fc18B9C209bDd43DC3943C228FCf" - }, - "10": { - "0x0e24524778fdc67f53eEf144b8cbf50261E930B3": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" - }, - "100": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9", - "0x7238d75fD75bb936E83b75854c653F104Ce9c9d8": "0x3C06dce358add17aAf230f2234bCCC4afd50d090", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F" - }, - "1088": { - "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14": "0xf41193E25408F652AF878c47E4401A01B5E4B682" - }, - "137": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3e72665008dC237bdd91C04C10782Ed1987a4019", - "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": "0x853649f897383f89d8441346Cf26a9ed02720B02", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x7FAE7765abB4c8f778d57337bB720d0BC53057e3", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xe79757D55a1600eF28D816a893E78E9FCDE2019E" - }, - "42161": { - "0x88d6D01e08d3e64513b15fD46528dBbA7d755883": "0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d" - }, - "43114": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x617332a777780F546261247F621051d0b98975Eb", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0x10f02995a399C0dC0FaF29914220E9C1bCdE8640", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0x2b88C83727B0E290B76EB3F6133994fF81B7f355" - }, - "534352": { - "0xA4dC3F123e1c601A19B3DC8382BB9311F678cafA": "0x3C06dce358add17aAf230f2234bCCC4afd50d090" - }, - "56": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": "0x3F006299eC88985c18E6e885EeA29A49eC579882", - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": "0xa5cc218513305221201f196760E9e64e9D49d98A", - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": "0xAE93BEa44dcbE52B625169588574d31e36fb3A67" - }, - "8453": { - "0xa5948b0ac79f72966dFFC5C13E44f6dfDD3D58A0": "0x7120b1f8e5b73c0C0DC99C6e52Fe4937E7EA11e0" - } - }, - "receiverAdaptersByChain": { - "137": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, - "0x1562F1b2487F892BBA8Ef325aF054Fd157510a71": true, - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true - }, - "43114": { - "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1": true, - "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC": true, - "0xB7a6618df58626C3a122ABAFD6Ee63Af63f3Ef29": true - } - }, - "receiverConfigs": { - "137": { - "requiredConfirmations": 3, - "validityTimestamp": 0 - }, - "43114": { - "requiredConfirmations": 2, - "validityTimestamp": 0 - } - } -} \ No newline at end of file diff --git a/reports/adi_test_adi_diffs_after.json b/reports/adi_test_adi_diffs_after.json deleted file mode 100644 index f214e58..0000000 --- a/reports/adi_test_adi_diffs_after.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "chainId": 42161, - "forwarderAdaptersByChain": {}, - "receiverAdaptersByChain": { - "1": { - "0x1Cfe182fa075EF185adFD605806241e2d181ffC2": true, - "0xc8a2ADC4261c6b669CdFf69E717E77C9cFeB420d": true - } - }, - "receiverConfigs": { - "1": { - "requiredConfirmations": 1, - "validityTimestamp": 0 - } - } -} \ No newline at end of file diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index dfa2c06..5f215d2 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -43,9 +43,11 @@ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript { function _deployPayload( address crossChainController, - address proxyAdmin, - address crossChainControllerImpl + address proxyAdmin ) internal returns (address) { + bytes memory cccImplCode = CCCUpdateDeploymentHelper.getCCCImplCode(CL_EMERGENCY_ORACLE()); + address crossChainControllerImpl = _deployByteCode(cccImplCode, SALT()); + bytes memory payloadCode = abi.encodePacked( _getShufflePayloadByteCode(), abi.encode( @@ -60,18 +62,7 @@ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript { return _deployByteCode(payloadCode, PAYLOAD_SALT()); } - function _deployCrossChainControllerImpl() internal returns (address) { - bytes memory cccImplCode = CCCUpdateDeploymentHelper.getCCCImplCode(CL_EMERGENCY_ORACLE()); - - return _deployByteCode(cccImplCode, SALT()); - } - function _execute(Addresses memory addresses) internal virtual override { - addresses.crossChainControllerImpl = _deployCrossChainControllerImpl(); - _deployPayload( - addresses.crossChainController, - addresses.proxyAdmin, - addresses.crossChainControllerImpl - ); + _deployPayload(addresses.crossChainController, addresses.proxyAdmin); } } diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 6ca8b45..5847caa 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -47,6 +47,9 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +// Use all currently registered bridges to account for the manual trigger of the native polygon bridge. This way we ensure +// that with current configuration it can reach consensus on destination network (ethereum). On a future AIP this can be lowered +// once the manual trigger of polygon native bridge is solved contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -55,7 +58,7 @@ contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](1); optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ chainId: ChainIds.ETHEREUM, - optimalBandwidth: 3 // remember the problem with polygon native??? + optimalBandwidth: 4 }); return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); } diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index c1acc17..6534807 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -1,13 +1,14 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; -import {Addresses, Ethereum} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; +import {Addresses, Ethereum, Polygon, Avalanche, Arbitrum, Optimism, Metis, Binance, Base, Gnosis, Scroll} from '../../../scripts/payloads/ccc/shuffle/Network_Deployments.s.sol'; import 'aave-helpers/adi/test/ADITestBase.sol'; import 'forge-std/console.sol'; abstract contract BaseShufflePayloadTest is ADITestBase { - address internal payload; - address internal crossChainController; + address internal _payload; + address internal _crossChainController; + address internal _proxyAdmin; string internal NETWORK; uint256 internal immutable BLOCK_NUMBER; @@ -17,24 +18,173 @@ abstract contract BaseShufflePayloadTest is ADITestBase { BLOCK_NUMBER = blockNumber; } + // function _getDeployedPayload() internal virtual returns (address); + function _getPayload() internal virtual returns (address); + function _getCurrentNetworkAddresses() internal virtual returns (Addresses memory); + function setUp() public { vm.createSelectFork(vm.rpcUrl(NETWORK), BLOCK_NUMBER); - payload = _getPayload(); + Addresses memory addresses = _getCurrentNetworkAddresses(); + _crossChainController = addresses.crossChainController; + _proxyAdmin = addresses.proxyAdmin; + + _payload = _getPayload(); } function test_defaultTest() public { - defaultTest('add_shuffle_to_ccc', crossChainController, address(payload), false, vm); + defaultTest( + string.concat('add_shuffle_to_ccc_', NETWORK), + _crossChainController, + address(_payload), + false, + vm + ); } + + // function test_samePayloadAddress() public { + // assertEq(_payload, _getDeployedPayload()); + // } } contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160500) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract PolygonShufflePayloadTest is Polygon, BaseShufflePayloadTest('polygon', 59181700) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract AvalancheShufflePayloadTest is Avalanche, BaseShufflePayloadTest('avalanche', 47783432) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract ArbitrumShufflePayloadTest is Arbitrum, BaseShufflePayloadTest('arbitrum', 230678009) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract OptimismShufflePayloadTest is Optimism, BaseShufflePayloadTest('arbitrum', 122500476) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614221) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40345866) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract CBaseShufflePayloadTest is Base, BaseShufflePayloadTest('base', 16905250) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract GnosisShufflePayloadTest is Gnosis, BaseShufflePayloadTest('gnosis', 34891878) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + + function _getPayload() internal override returns (address) { + return _deployPayload(_crossChainController, _proxyAdmin); + } +} + +contract ScrollShufflePayloadTest is Scroll, BaseShufflePayloadTest('scroll', 7298668) { + // function _getDeployedPayload() internal pure override returns (address) { + // return address(0); + // } + + function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { + return _getAddresses(TRANSACTION_NETWORK()); + } + function _getPayload() internal override returns (address) { - Addresses memory addresses = _getAddresses(TRANSACTION_NETWORK()); - address cccImpl = _deployCrossChainControllerImpl(); - crossChainController = addresses.crossChainController; - return _deployPayload(crossChainController, addresses.proxyAdmin, cccImpl); + return _deployPayload(_crossChainController, _proxyAdmin); } } From 284056f89e55198e6a6034dfb0dc9896d079c90d Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 10 Jul 2024 11:19:44 +0200 Subject: [PATCH 16/22] fix: diffs for all networks --- .gitignore | 1 - ...he_before_adi_add_shuffle_to_ccc_avalanche_after.md | 10 ++++++++++ ...cc_base_before_adi_add_shuffle_to_ccc_base_after.md | 10 ++++++++++ ...ance_before_adi_add_shuffle_to_ccc_binance_after.md | 10 ++++++++++ ...nosis_before_adi_add_shuffle_to_ccc_gnosis_after.md | 10 ++++++++++ ..._metis_before_adi_add_shuffle_to_ccc_metis_after.md | 10 ++++++++++ ...ism_before_adi_add_shuffle_to_ccc_optimism_after.md | 10 ++++++++++ ...ygon_before_adi_add_shuffle_to_ccc_polygon_after.md | 10 ++++++++++ ...croll_before_adi_add_shuffle_to_ccc_scroll_after.md | 10 ++++++++++ lib/aave-delivery-infrastructure | 2 +- reports/.gitignore | 5 +++++ tests/ccc/shuffle/ShufflePayloadTests.t.sol | 4 ++-- 12 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 diffs/adi_add_shuffle_to_ccc_avalanche_before_adi_add_shuffle_to_ccc_avalanche_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_base_before_adi_add_shuffle_to_ccc_base_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_binance_before_adi_add_shuffle_to_ccc_binance_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_gnosis_before_adi_add_shuffle_to_ccc_gnosis_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_metis_before_adi_add_shuffle_to_ccc_metis_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_optimism_before_adi_add_shuffle_to_ccc_optimism_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_polygon_before_adi_add_shuffle_to_ccc_polygon_after.md create mode 100644 diffs/adi_add_shuffle_to_ccc_scroll_before_adi_add_shuffle_to_ccc_scroll_after.md create mode 100644 reports/.gitignore diff --git a/.gitignore b/.gitignore index 032ab2f..3a383e6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,4 @@ node_modules # ignore foundry deploy artifacts broadcast/ -reports/ input.json diff --git a/diffs/adi_add_shuffle_to_ccc_avalanche_before_adi_add_shuffle_to_ccc_avalanche_after.md b/diffs/adi_add_shuffle_to_ccc_avalanche_before_adi_add_shuffle_to_ccc_avalanche_after.md new file mode 100644 index 0000000..618b477 --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_avalanche_before_adi_add_shuffle_to_ccc_avalanche_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22", + "to": "0x23F5150ace7382C7160a2192c3F9f77444F420D9" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_base_before_adi_add_shuffle_to_ccc_base_after.md b/diffs/adi_add_shuffle_to_ccc_base_before_adi_add_shuffle_to_ccc_base_after.md new file mode 100644 index 0000000..89c50f2 --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_base_before_adi_add_shuffle_to_ccc_base_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F", + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_binance_before_adi_add_shuffle_to_ccc_binance_after.md b/diffs/adi_add_shuffle_to_ccc_binance_before_adi_add_shuffle_to_ccc_binance_after.md new file mode 100644 index 0000000..e8a2c4f --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_binance_before_adi_add_shuffle_to_ccc_binance_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0xf41193E25408F652AF878c47E4401A01B5E4B682", + "to": "0xdA81fb369942E43D4797E79F2C4CBeF9Fe58B90a" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_gnosis_before_adi_add_shuffle_to_ccc_gnosis_after.md b/diffs/adi_add_shuffle_to_ccc_gnosis_before_adi_add_shuffle_to_ccc_gnosis_after.md new file mode 100644 index 0000000..08d6eed --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_gnosis_before_adi_add_shuffle_to_ccc_gnosis_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922", + "to": "0x88e9f8E208BA5ae72b56861D63cBF70Fd2320F5c" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_metis_before_adi_add_shuffle_to_ccc_metis_after.md b/diffs/adi_add_shuffle_to_ccc_metis_before_adi_add_shuffle_to_ccc_metis_after.md new file mode 100644 index 0000000..6b850c2 --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_metis_before_adi_add_shuffle_to_ccc_metis_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04", + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_optimism_before_adi_add_shuffle_to_ccc_optimism_after.md b/diffs/adi_add_shuffle_to_ccc_optimism_before_adi_add_shuffle_to_ccc_optimism_after.md new file mode 100644 index 0000000..5b1b8b8 --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_optimism_before_adi_add_shuffle_to_ccc_optimism_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0xa5cc218513305221201f196760E9e64e9D49d98A", + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_polygon_before_adi_add_shuffle_to_ccc_polygon_after.md b/diffs/adi_add_shuffle_to_ccc_polygon_before_adi_add_shuffle_to_ccc_polygon_after.md new file mode 100644 index 0000000..69cce5f --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_polygon_before_adi_add_shuffle_to_ccc_polygon_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x87a95917DE670088d81B9a8B30E3B36704Ba3043", + "to": "0x191f2bd27F1cE4318f9A0c6b82688C66CD7aD3ba" + } +} +``` \ No newline at end of file diff --git a/diffs/adi_add_shuffle_to_ccc_scroll_before_adi_add_shuffle_to_ccc_scroll_after.md b/diffs/adi_add_shuffle_to_ccc_scroll_before_adi_add_shuffle_to_ccc_scroll_after.md new file mode 100644 index 0000000..161b17e --- /dev/null +++ b/diffs/adi_add_shuffle_to_ccc_scroll_before_adi_add_shuffle_to_ccc_scroll_after.md @@ -0,0 +1,10 @@ +## Raw diff + +```json +{ + "crossChainControllerImpl": { + "from": "0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922", + "to": "0x92F4736b72D131D836B3e4d4C3C23fE53150Ce4d" + } +} +``` \ No newline at end of file diff --git a/lib/aave-delivery-infrastructure b/lib/aave-delivery-infrastructure index 73e6be6..f36f856 160000 --- a/lib/aave-delivery-infrastructure +++ b/lib/aave-delivery-infrastructure @@ -1 +1 @@ -Subproject commit 73e6be6e73a6ba99338e15cfe7556533abbf2117 +Subproject commit f36f856fbf48d232478f50dd9d1fbdf62c468e47 diff --git a/reports/.gitignore b/reports/.gitignore new file mode 100644 index 0000000..e073e4a --- /dev/null +++ b/reports/.gitignore @@ -0,0 +1,5 @@ +# File: .cache/.gitignore +# Ignore everything in this directory +* +# Except for this file +!.gitignore diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 6534807..d69ec56 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -105,7 +105,7 @@ contract ArbitrumShufflePayloadTest is Arbitrum, BaseShufflePayloadTest('arbitru } } -contract OptimismShufflePayloadTest is Optimism, BaseShufflePayloadTest('arbitrum', 122500476) { +contract OptimismShufflePayloadTest is Optimism, BaseShufflePayloadTest('optimism', 122500476) { // function _getDeployedPayload() internal pure override returns (address) { // return address(0); // } @@ -133,7 +133,7 @@ contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614 } } -contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40345866) { +contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40346927) { // function _getDeployedPayload() internal pure override returns (address) { // return address(0); // } From a42954145e730a0ee1aaa6394cf7995bad444c08 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 10 Jul 2024 11:30:56 +0200 Subject: [PATCH 17/22] fix: use same rpc name as github secrets --- foundry.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foundry.toml b/foundry.toml index 841e29f..6f6ec18 100644 --- a/foundry.toml +++ b/foundry.toml @@ -26,8 +26,8 @@ optimism="${RPC_OPTIMISM}" optimism-testnet="${RPC_OPTIMISM_TESTNET}" fantom="${RPC_FANTOM}" fantom-testnet="${RPC_FANTOM_TESTNET}" -binance="${RPC_BINANCE}" -binance-testnet="${RPC_BINANCE_TESTNET}" +binance="${RPC_BNB}" +binance-testnet="${RPC_BNB_TESTNET}" base="${RPC_BASE}" base-testnet="${RPC_BASE_TESTNET}" gnosis="${RPC_GNOSIS}" @@ -54,8 +54,8 @@ metis={ key="any", chain=1088, url='https://andromeda-explorer.metis.io/' } metis-testnet={ key="any", chain=599, url='https://goerli.explorer.metisdevops.link/' } fantom={key="${ETHERSCAN_API_KEY_FANTOM}",chain=250} fantom-testnet={key="${ETHERSCAN_API_KEY_FANTOM}",chain=250} -binance={key="${ETHERSCAN_API_KEY_BINANCE}",chain=56} -binance-testnet={key="${ETHERSCAN_API_KEY_BINANCE}",chain=97} +binance={key="${ETHERSCAN_API_KEY_BNB}",chain=56} +binance-testnet={key="${ETHERSCAN_API_KEY_BNB}",chain=97} base={key="${ETHERSCAN_API_KEY_BASE}",chain=8453, url='https://developer-access-mainnet.base.org'} base-testnet={key="${ETHERSCAN_API_KEY_BASE}",chain=8453, url='https://developer-access-mainnet.base.org'} gnosis={key="${ETHERSCAN_API_KEY_GNOSIS}",chain=100} From 1a4c2c3dadb255db19c311d49c48d406eb196c58 Mon Sep 17 00:00:00 2001 From: sendra Date: Wed, 10 Jul 2024 15:33:41 +0200 Subject: [PATCH 18/22] fix: updated bnb block --- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index d69ec56..58c84cd 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -133,7 +133,7 @@ contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614 } } -contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40346927) { +contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40352032) { // function _getDeployedPayload() internal pure override returns (address) { // return address(0); // } From b8d2a9c70845f05feda0dce31265c60ab4084089 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 11 Jul 2024 10:10:20 +0200 Subject: [PATCH 19/22] fix: removed not needed comments. Added payloads natspec --- .../shuffle/Base_Deploy_Shuffle_Update.s.sol | 6 -- .../shuffle/ShuffleCCCUpdatePayload.sol | 65 ++++++++++++++----- 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol index 5f215d2..11bfcb6 100644 --- a/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol +++ b/scripts/payloads/ccc/shuffle/Base_Deploy_Shuffle_Update.s.sol @@ -20,12 +20,6 @@ library CCCUpdateDeploymentHelper { } } -/** - * @title Ethereum payload to update ccc with new shuffle mechanism - * @author BGD Labs @bgdlabs - * - Discussion: - * - Snapshot: - */ abstract contract Base_Deploy_Shuffle_Update_Payload is BaseDeployerScript { function _getShufflePayloadByteCode() internal virtual returns (bytes memory); diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index 5847caa..b81c308 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -7,10 +7,9 @@ import {ICrossChainForwarder} from 'adi/interfaces/ICrossChainForwarder.sol'; import {ChainIds} from 'aave-helpers/ChainIds.sol'; /** - * @title Ethereum payload to update ccc with new shuffle mechanism + * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs * - Discussion: - * - Snapshot: */ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -21,7 +20,7 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { optimalBandwidths[0] = ICrossChainForwarder.OptimalBandwidthByChain({ chainId: ChainIds.POLYGON, - optimalBandwidth: 3 // remember the problem with polygon native??? + optimalBandwidth: 3 }); optimalBandwidths[1] = ICrossChainForwarder.OptimalBandwidthByChain({ chainId: ChainIds.AVALANCHE, @@ -35,7 +34,7 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { chainId: ChainIds.GNOSIS, optimalBandwidth: 2 }); - // not yet connected but we can set it up?? + // not yet connected but we can set it up optimalBandwidths[4] = ICrossChainForwarder.OptimalBandwidthByChain({ chainId: ChainIds.CELO, optimalBandwidth: 2 @@ -47,7 +46,12 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } -// Use all currently registered bridges to account for the manual trigger of the native polygon bridge. This way we ensure +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ +/// @dev Use all currently registered bridges to account for the manual trigger of the native polygon bridge. This way we ensure // that with current configuration it can reach consensus on destination network (ethereum). On a future AIP this can be lowered // once the manual trigger of polygon native bridge is solved contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { @@ -64,6 +68,11 @@ contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -78,6 +87,11 @@ contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -89,6 +103,11 @@ contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -100,6 +119,11 @@ contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -111,6 +135,11 @@ contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -122,6 +151,11 @@ contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -133,6 +167,11 @@ contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -144,6 +183,11 @@ contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { } } +/** + * @title Ethereum payload to update CrossChainController with new shuffle mechanism + * @author BGD Labs @bgdlabs + * - Discussion: + */ contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -154,14 +198,3 @@ contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); } } - -contract Celo_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { - constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} - - function getInitializeSignature() public pure override returns (bytes memory) { - ICrossChainForwarder.OptimalBandwidthByChain[] - memory optimalBandwidths = new ICrossChainForwarder.OptimalBandwidthByChain[](0); - - return abi.encodeWithSelector(IReinitialize.initializeRevision.selector, optimalBandwidths); - } -} From 4f91a2aa0157f4058f2bab03b96098391c5f7fd1 Mon Sep 17 00:00:00 2001 From: sendra Date: Thu, 11 Jul 2024 13:11:58 +0200 Subject: [PATCH 20/22] fix: use cl emergency oracle from address book --- .../ccc/shuffle/Network_Deployments.s.sol | 26 ++++++------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol index c8d4f18..8dc2220 100644 --- a/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol +++ b/scripts/payloads/ccc/shuffle/Network_Deployments.s.sol @@ -3,6 +3,10 @@ pragma solidity ^0.8.0; import './Base_Deploy_Shuffle_Update.s.sol'; import '../../../../src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol'; +import {GovernanceV3Polygon} from 'aave-address-book/GovernanceV3Polygon.sol'; +import {GovernanceV3Avalanche} from 'aave-address-book/GovernanceV3Avalanche.sol'; +import {GovernanceV3BNB} from 'aave-address-book/GovernanceV3BNB.sol'; +import {GovernanceV3Gnosis} from 'aave-address-book/GovernanceV3Gnosis.sol'; contract Ethereum is Base_Deploy_Shuffle_Update_Payload { function TRANSACTION_NETWORK() internal pure override returns (uint256) { @@ -16,7 +20,7 @@ contract Ethereum is Base_Deploy_Shuffle_Update_Payload { contract Polygon is Base_Deploy_Shuffle_Update_Payload { function CL_EMERGENCY_ORACLE() internal pure override returns (address) { - return 0xDAFA1989A504c48Ee20a582f2891eeB25E2fA23F; + return GovernanceV3Polygon.CL_EMERGENCY_ORACLE; } function TRANSACTION_NETWORK() internal pure override returns (uint256) { @@ -30,7 +34,7 @@ contract Polygon is Base_Deploy_Shuffle_Update_Payload { contract Avalanche is Base_Deploy_Shuffle_Update_Payload { function CL_EMERGENCY_ORACLE() internal pure override returns (address) { - return 0x41185495Bc8297a65DC46f94001DC7233775EbEe; + return GovernanceV3Avalanche.CL_EMERGENCY_ORACLE; } function TRANSACTION_NETWORK() internal pure override returns (uint256) { @@ -74,7 +78,7 @@ contract Metis is Base_Deploy_Shuffle_Update_Payload { contract Binance is Base_Deploy_Shuffle_Update_Payload { function CL_EMERGENCY_ORACLE() internal pure override returns (address) { - return 0xcabb46FfB38c93348Df16558DF156e9f68F9F7F1; + return GovernanceV3BNB.CL_EMERGENCY_ORACLE; } function TRANSACTION_NETWORK() internal pure override returns (uint256) { @@ -98,7 +102,7 @@ contract Base is Base_Deploy_Shuffle_Update_Payload { contract Gnosis is Base_Deploy_Shuffle_Update_Payload { function CL_EMERGENCY_ORACLE() internal pure override returns (address) { - return 0xF937ffAeA1363e4Fa260760bDFA2aA8Fc911F84D; + return GovernanceV3Gnosis.CL_EMERGENCY_ORACLE; } function TRANSACTION_NETWORK() internal pure override returns (uint256) { @@ -119,17 +123,3 @@ contract Scroll is Base_Deploy_Shuffle_Update_Payload { return type(Scroll_Add_Shuffle_to_CCC_Payload).creationCode; } } - -contract Celo is Base_Deploy_Shuffle_Update_Payload { - function CL_EMERGENCY_ORACLE() internal pure override returns (address) { - return 0x91b21900E91CD302EBeD05E45D8f270ddAED944d; - } - - function TRANSACTION_NETWORK() internal pure override returns (uint256) { - return ChainIds.CELO; - } - - function _getShufflePayloadByteCode() internal pure override returns (bytes memory) { - return type(Celo_Add_Shuffle_to_CCC_Payload).creationCode; - } -} From e2d7d1085eb9d445e19ff24d5d43c8ad902ceb28 Mon Sep 17 00:00:00 2001 From: sendra Date: Fri, 12 Jul 2024 08:45:30 +0200 Subject: [PATCH 21/22] fix: new shuffle ccc impl deployment --- .gitignore | 2 + Makefile | 43 ++++++------ deployments/arbitrum.json | 4 +- deployments/avalanche.json | 4 +- deployments/base.json | 4 +- deployments/binance.json | 4 +- deployments/ethereum.json | 4 +- deployments/gnosis.json | 4 +- deployments/metis.json | 4 +- deployments/optimism.json | 4 +- deployments/polygon.json | 4 +- deployments/scroll.json | 4 +- ...i_diffs_before_adi_test_adi_diffs_after.md | 4 +- .../shuffle/ShuffleCCCUpdatePayload.sol | 20 +++--- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 68 +++++++++---------- 15 files changed, 91 insertions(+), 86 deletions(-) diff --git a/.gitignore b/.gitignore index 3a383e6..60c655e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ node_modules # ignore foundry deploy artifacts broadcast/ input.json + +run-latest.json diff --git a/Makefile b/Makefile index 603a3da..de53e90 100644 --- a/Makefile +++ b/Makefile @@ -12,17 +12,17 @@ test :; forge test -vvv # ---------------------------------------------- BASE SCRIPT CONFIGURATION --------------------------------------------- -BASE_LEDGER = --legacy --mnemonics foo --ledger --mnemonic-indexes $(MNEMONIC_INDEX) --sender $(LEDGER_SENDER) +BASE_LEDGER = --legacy --ledger --mnemonic-indexes $(MNEMONIC_INDEX) --sender $(LEDGER_SENDER) BASE_KEY = --private-key ${PRIVATE_KEY} -custom_ethereum := --with-gas-price 45000000000 # 53 gwei -custom_polygon := --with-gas-price 190000000000 # 560 gwei -custom_avalanche := --with-gas-price 27000000000 # 27 gwei -custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/ -custom_metis := --verifier-url https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan -custom_scroll-testnet := --legacy --with-gas-price 1000000000 # 1 gwei +#custom_ethereum := --with-gas-price 2000000000 # 53 gwei +#custom_polygon := --with-gas-price 190000000000 # 560 gwei +#custom_avalanche := --with-gas-price 27000000000 # 27 gwei +#custom_metis-testnet := --legacy --verifier-url https://goerli.explorer.metisdevops.link/api/ +#custom_metis := --verifier-url https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan +#custom_scroll-testnet := --legacy --with-gas-price 1000000000 # 1 gwei # params: # 1 - path/file_name @@ -31,25 +31,25 @@ custom_scroll-testnet := --legacy --with-gas-price 1000000000 # 1 gwei # to define custom params per network add vars custom_network-name # to use ledger, set LEDGER=true to env # default to testnet deployment, to run production, set PROD=true to env -define deploy_single_fn -forge script \ - scripts/$(1).s.sol:$(if $(3),$(if $(PROD),$(3),$(3)_testnet),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \ - --rpc-url $(if $(PROD),$(2),$(2)-testnet) --broadcast --verify -vvvv \ - $(if $(LEDGER),$(BASE_LEDGER),$(BASE_KEY)) \ - $(custom_$(if $(PROD),$(2),$(2)-testnet)) - -endef - -# catapulta #define deploy_single_fn -#npx catapulta@0.3.14 script \ -# scripts/$(1).s.sol:$(if $(3),$(3),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \ -# --network $(2) --slow --skip-git \ +#forge script \ +# scripts/$(1).s.sol:$(if $(3),$(if $(PROD),$(3),$(3)_testnet),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \ +# --rpc-url $(if $(PROD),$(2),$(2)-testnet) --broadcast --verify -vvvv \ # $(if $(LEDGER),$(BASE_LEDGER),$(BASE_KEY)) \ # $(custom_$(if $(PROD),$(2),$(2)-testnet)) # #endef +# catapulta +define deploy_single_fn +npx catapulta@latest script \ + scripts/$(1).s.sol:$(if $(3),$(3),$(shell UP=$(if $(PROD),$(2),$(2)_testnet); echo $${UP} | perl -nE 'say ucfirst')) \ + --network $(2) --slow --skip-git \ + $(if $(LEDGER),$(BASE_LEDGER),$(BASE_KEY)) \ + $(custom_$(if $(PROD),$(2),$(2)-testnet)) + +endef + define deploy_fn $(foreach network,$(2),$(call deploy_single_fn,$(1),$(network),$(3))) endef @@ -260,3 +260,6 @@ deploy-ccc-revision-and-update: deploy-ccc-update-payload: $(call deploy_fn,helpers/UpdateCCCImpl_Payload,celo) + +deploy-ccc-shuffle-payload: + $(call deploy_fn,payloads/ccc/shuffle/Network_Deployments,metis) diff --git a/deployments/arbitrum.json b/deployments/arbitrum.json index f2d93f6..9f3ec81 100644 --- a/deployments/arbitrum.json +++ b/deployments/arbitrum.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x6e633269af45F37c44659D98f382dd0DD524E5Df", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x0000000000000000000000000000000000000000", "lzAdapter": "0x0000000000000000000000000000000000000000", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/avalanche.json b/deployments/avalanche.json index 709df48..450869e 100644 --- a/deployments/avalanche.json +++ b/deployments/avalanche.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x5Ef80c5eB6CF65Dab8cD1C0ee258a6D2bD38Bd22", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x617332a777780F546261247F621051d0b98975Eb", "lzAdapter": "0x10f02995a399C0dC0FaF29914220E9C1bCdE8640", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/base.json b/deployments/base.json index 9660ae3..bac038e 100644 --- a/deployments/base.json +++ b/deployments/base.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x0000000000000000000000000000000000000000", "lzAdapter": "0x0000000000000000000000000000000000000000", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/binance.json b/deployments/binance.json index fe66bed..ee2096b 100644 --- a/deployments/binance.json +++ b/deployments/binance.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0xf41193E25408F652AF878c47E4401A01B5E4B682", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x3F006299eC88985c18E6e885EeA29A49eC579882", "lzAdapter": "0xa5cc218513305221201f196760E9e64e9D49d98A", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/ethereum.json b/deployments/ethereum.json index f10cb6d..8a70e96 100644 --- a/deployments/ethereum.json +++ b/deployments/ethereum.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x28559c2F4B038b1E836fA419DCcDe7454d8Fe215", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x7238d75fD75bb936E83b75854c653F104Ce9c9d8", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x01dcb90Cf13b82Cde4A0BAcC655585a83Af3cCC1", "lzAdapter": "0x8410d9BD353b420ebA8C48ff1B0518426C280FCC", "metisAdapter": "0x6B3Dc800E7c813Db3fe8D0F30fDCaE636935dC14", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x42206271373675661500F8a4d6A6CE2FDc6b5De5", "zkevmAdapter": "0xe0a6Eee6d0c883734A7a7e7B378BD09fffb89EB6", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/gnosis.json b/deployments/gnosis.json index 62ccf00..356c2aa 100644 --- a/deployments/gnosis.json +++ b/deployments/gnosis.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x3C06dce358add17aAf230f2234bCCC4afd50d090", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0xA806DA549FcB2B4912a7dFFE4c1aA7A1ed0Bd5C9", "lzAdapter": "0x9b6f5ef589A3DD08670Dd146C11C4Fb33E04494F", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/metis.json b/deployments/metis.json index 0853737..9d64015 100644 --- a/deployments/metis.json +++ b/deployments/metis.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0xa198Fac58E02A5C5F8F7e877895d50cFa9ad1E04", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x0000000000000000000000000000000000000000", "lzAdapter": "0x0000000000000000000000000000000000000000", "metisAdapter": "0xf41193E25408F652AF878c47E4401A01B5E4B682", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/optimism.json b/deployments/optimism.json index 9720bd1..7f0fafa 100644 --- a/deployments/optimism.json +++ b/deployments/optimism.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0xa5cc218513305221201f196760E9e64e9D49d98A", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x0000000000000000000000000000000000000000", "lzAdapter": "0x0000000000000000000000000000000000000000", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/polygon.json b/deployments/polygon.json index b4c83d8..5e118f9 100644 --- a/deployments/polygon.json +++ b/deployments/polygon.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x87a95917DE670088d81B9a8B30E3B36704Ba3043", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x3e72665008dC237bdd91C04C10782Ed1987a4019", "lzAdapter": "0x7FAE7765abB4c8f778d57337bB720d0BC53057e3", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/deployments/scroll.json b/deployments/scroll.json index 44674a6..d50fa54 100644 --- a/deployments/scroll.json +++ b/deployments/scroll.json @@ -9,8 +9,8 @@ "crossChainControllerImpl": "0x5e06b10B3b9c3E1c0996D2544A35B9839Be02922", "emergencyRegistry": "0x0000000000000000000000000000000000000000", "gnosisAdapter": "0x0000000000000000000000000000000000000000", - "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "granularCCCGuardian": "0x0000000000000000000000000000000000000000", + "guardian": "0xEAF6183bAb3eFD3bF856Ac5C058431C8592394d6", "hlAdapter": "0x0000000000000000000000000000000000000000", "lzAdapter": "0x0000000000000000000000000000000000000000", "metisAdapter": "0x0000000000000000000000000000000000000000", @@ -25,4 +25,4 @@ "wormholeAdapter": "0x0000000000000000000000000000000000000000", "zkevmAdapter": "0x0000000000000000000000000000000000000000", "zksyncAdapter": "0x0000000000000000000000000000000000000000" -} +} \ No newline at end of file diff --git a/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md b/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md index cfaf391..656e5ec 100644 --- a/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md +++ b/diffs/adi_test_adi_diffs_before_adi_test_adi_diffs_after.md @@ -4,9 +4,9 @@ { "receiverAdaptersByChain": { "1": { - "0xA83F1E89EB2E904983dEEDc50517Fd7bDD5946c6": { + "0xa8a778DB196AE2A5997c30d2081C2B48c3532bC2": { "from": null, - "to": true + "to": "true" } } } diff --git a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol index b81c308..d54ab80 100644 --- a/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol +++ b/src/ccc_payloads/shuffle/ShuffleCCCUpdatePayload.sol @@ -9,7 +9,7 @@ import {ChainIds} from 'aave-helpers/ChainIds.sol'; /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -49,7 +49,7 @@ contract Ethereum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ /// @dev Use all currently registered bridges to account for the manual trigger of the native polygon bridge. This way we ensure // that with current configuration it can reach consensus on destination network (ethereum). On a future AIP this can be lowered @@ -71,7 +71,7 @@ contract Polygon_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -90,7 +90,7 @@ contract Avalanche_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -106,7 +106,7 @@ contract Arbitrum_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -122,7 +122,7 @@ contract Optimism_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -138,7 +138,7 @@ contract Metis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -154,7 +154,7 @@ contract Binance_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -170,7 +170,7 @@ contract Base_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} @@ -186,7 +186,7 @@ contract Gnosis_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { /** * @title Ethereum payload to update CrossChainController with new shuffle mechanism * @author BGD Labs @bgdlabs - * - Discussion: + * - Discussion: https://governance.aave.com/t/bgd-technical-maintenance-proposals/15274/39 */ contract Scroll_Add_Shuffle_to_CCC_Payload is BaseCCCUpdate { constructor(CCCUpdateArgs memory cccUpdateArgs) BaseCCCUpdate(cccUpdateArgs) {} diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 58c84cd..3e63cf3 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -18,7 +18,7 @@ abstract contract BaseShufflePayloadTest is ADITestBase { BLOCK_NUMBER = blockNumber; } - // function _getDeployedPayload() internal virtual returns (address); + function _getDeployedPayload() internal virtual returns (address); function _getPayload() internal virtual returns (address); @@ -44,15 +44,15 @@ abstract contract BaseShufflePayloadTest is ADITestBase { ); } - // function test_samePayloadAddress() public { - // assertEq(_payload, _getDeployedPayload()); - // } + function test_samePayloadAddress() public { + assertEq(_payload, _getDeployedPayload()); + } } contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereum', 20160500) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0xf50a100F8F60C3dC01a98a15231218accB3150C1; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -64,9 +64,9 @@ contract EthereumShufflePayloadTest is Ethereum, BaseShufflePayloadTest('ethereu } contract PolygonShufflePayloadTest is Polygon, BaseShufflePayloadTest('polygon', 59181700) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x5056B08129D788344F0BDbA4652E936c24229D9a; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -78,9 +78,9 @@ contract PolygonShufflePayloadTest is Polygon, BaseShufflePayloadTest('polygon', } contract AvalancheShufflePayloadTest is Avalanche, BaseShufflePayloadTest('avalanche', 47783432) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0xFAb9E283d3bf91Cb7732C869F31D97C9A7D1AEAB; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -92,9 +92,9 @@ contract AvalancheShufflePayloadTest is Avalanche, BaseShufflePayloadTest('avala } contract ArbitrumShufflePayloadTest is Arbitrum, BaseShufflePayloadTest('arbitrum', 230678009) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x7ED073d35d8a1c6561102d75FA7aF0752a5ddC6e; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -106,9 +106,9 @@ contract ArbitrumShufflePayloadTest is Arbitrum, BaseShufflePayloadTest('arbitru } contract OptimismShufflePayloadTest is Optimism, BaseShufflePayloadTest('optimism', 122500476) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x896607f9757B68A5432b8B8f2D79abdC2325d91C; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -120,9 +120,9 @@ contract OptimismShufflePayloadTest is Optimism, BaseShufflePayloadTest('optimis } contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614221) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x82E898b0CDC997b44C704E42574906136E7B5fAd; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -134,9 +134,9 @@ contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614 } contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40352032) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x0853e4272f8AE9b8Be9439490df8Fb5A5c82DBF0; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -148,9 +148,9 @@ contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', } contract CBaseShufflePayloadTest is Base, BaseShufflePayloadTest('base', 16905250) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0xc45BB75DB1bF012F9E06192aeA7D338FBe3271D8; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -162,9 +162,9 @@ contract CBaseShufflePayloadTest is Base, BaseShufflePayloadTest('base', 1690525 } contract GnosisShufflePayloadTest is Gnosis, BaseShufflePayloadTest('gnosis', 34891878) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x050bE7317a8D015E558E68A99e894375B00Bd723; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); @@ -176,9 +176,9 @@ contract GnosisShufflePayloadTest is Gnosis, BaseShufflePayloadTest('gnosis', 34 } contract ScrollShufflePayloadTest is Scroll, BaseShufflePayloadTest('scroll', 7298668) { - // function _getDeployedPayload() internal pure override returns (address) { - // return address(0); - // } + function _getDeployedPayload() internal pure override returns (address) { + return 0x97d2bBBe4F87783D33FCabf56481c925C6c897e6; + } function _getCurrentNetworkAddresses() internal view override returns (Addresses memory) { return _getAddresses(TRANSACTION_NETWORK()); From dc81d19a4961ca8420ca74d9afe9c559b172378f Mon Sep 17 00:00:00 2001 From: sendra Date: Fri, 12 Jul 2024 10:18:34 +0200 Subject: [PATCH 22/22] fix: added new block for bsc --- tests/ccc/shuffle/ShufflePayloadTests.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ccc/shuffle/ShufflePayloadTests.t.sol b/tests/ccc/shuffle/ShufflePayloadTests.t.sol index 3e63cf3..757fe7a 100644 --- a/tests/ccc/shuffle/ShufflePayloadTests.t.sol +++ b/tests/ccc/shuffle/ShufflePayloadTests.t.sol @@ -133,7 +133,7 @@ contract MetisShufflePayloadTest is Metis, BaseShufflePayloadTest('metis', 17614 } } -contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40352032) { +contract BinanceShufflePayloadTest is Binance, BaseShufflePayloadTest('binance', 40403127) { function _getDeployedPayload() internal pure override returns (address) { return 0x0853e4272f8AE9b8Be9439490df8Fb5A5c82DBF0; }