From be370f60c1c7d1bd3a5246f3a67799bfa339253c Mon Sep 17 00:00:00 2001 From: DhairyaSethi <55102840+DhairyaSethi@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:41:31 +0530 Subject: [PATCH] doc: add comment for fetching all offramps, use RISK_COUNCIL for clarity --- .../AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.t.sol | 3 ++- .../AaveV3E2E_GHOCCIP150Upgrade_20241021.t.sol | 4 +++- .../AaveV3Ethereum_GHOCCIP150Upgrade_20241021.t.sol | 3 ++- src/interfaces/IGhoCcipSteward.sol | 6 ++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.t.sol b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.t.sol index 33f526aae..1fe9faffa 100644 --- a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.t.sol +++ b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Arbitrum_GHOCCIP150Upgrade_20241021.t.sol @@ -324,7 +324,7 @@ contract AaveV3Arbitrum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase { vm.prank(ghoTokenPool.owner()); ghoTokenPool.setRateLimitAdmin(address(GHO_CCIP_STEWARD)); - vm.prank(_readRiskAdmin()); + vm.prank(GHO_CCIP_STEWARD.RISK_COUNCIL()); GHO_CCIP_STEWARD.updateRateLimit(ETH_CHAIN_SELECTOR, false, 0, 0, false, 0, 0); assertEq( @@ -463,6 +463,7 @@ contract AaveV3Arbitrum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase { assertEq(GHO_CCIP_STEWARD.GHO_TOKEN(), ARB_GHO_TOKEN); assertEq(GHO_CCIP_STEWARD.GHO_TOKEN_POOL(), address(ghoTokenPool)); + assertEq(GHO_CCIP_STEWARD.RISK_COUNCIL(), _readRiskAdmin()); } function _getOutboundRefillTime(uint256 amount) private view returns (uint256) { diff --git a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3E2E_GHOCCIP150Upgrade_20241021.t.sol b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3E2E_GHOCCIP150Upgrade_20241021.t.sol index 8f905e84f..e62080247 100644 --- a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3E2E_GHOCCIP150Upgrade_20241021.t.sol +++ b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3E2E_GHOCCIP150Upgrade_20241021.t.sol @@ -161,6 +161,7 @@ contract AaveV3E2E_GHOCCIP150Upgrade_20241021_Base is ProtocolV3TestBase { assertTrue(l1.c.router.isOffRamp(l2.c.chainSelector, address(l1.c.EVM2EVMOffRamp1_2))); assertTrue(l1.c.router.isOffRamp(l2.c.chainSelector, address(l1.c.EVM2EVMOffRamp1_5))); + // ensure only 1.2 & 1.5 offRamps are configured IRouter.OffRamp[] memory offRamps = l1.c.router.getOffRamps(); for (uint256 i; i < offRamps.length; ++i) { if (offRamps[i].sourceChainSelector == l2.c.chainSelector) { @@ -203,6 +204,7 @@ contract AaveV3E2E_GHOCCIP150Upgrade_20241021_Base is ProtocolV3TestBase { assertTrue(l2.c.router.isOffRamp(l1.c.chainSelector, address(l2.c.EVM2EVMOffRamp1_2))); assertTrue(l2.c.router.isOffRamp(l1.c.chainSelector, address(l2.c.EVM2EVMOffRamp1_5))); + // ensure only 1.2 & 1.5 offRamps are configured offRamps = l2.c.router.getOffRamps(); for (uint256 i; i < offRamps.length; ++i) { if (offRamps[i].sourceChainSelector == l1.c.chainSelector) { @@ -762,7 +764,7 @@ contract AaveV3E2E_GHOCCIP150Upgrade_20241021_InFlightCCIPMigration is // wait for the rate limiter to refill skip(amount / uint256(inBoundRate) + 1); // rate is non zero - // reverts with 1.5 off ramp + // reverts with 1.5 off ramp because eventArg is in CCIP 1.4 message format vm.expectRevert(); vm.prank(address(l2.c.EVM2EVMOffRamp1_5)); l2.c.EVM2EVMOffRamp1_5.executeSingleMessage( diff --git a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Ethereum_GHOCCIP150Upgrade_20241021.t.sol b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Ethereum_GHOCCIP150Upgrade_20241021.t.sol index 36def8a96..9e3f47ebd 100644 --- a/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Ethereum_GHOCCIP150Upgrade_20241021.t.sol +++ b/src/20241021_Multi_GHOCCIP150Upgrade/AaveV3Ethereum_GHOCCIP150Upgrade_20241021.t.sol @@ -312,7 +312,7 @@ contract AaveV3Ethereum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase { vm.prank(ghoTokenPool.owner()); ghoTokenPool.setRateLimitAdmin(address(GHO_CCIP_STEWARD)); - vm.prank(_readRiskAdmin()); + vm.prank(GHO_CCIP_STEWARD.RISK_COUNCIL()); GHO_CCIP_STEWARD.updateRateLimit(ARB_CHAIN_SELECTOR, false, 0, 0, false, 0, 0); assertEq( @@ -456,6 +456,7 @@ contract AaveV3Ethereum_GHOCCIP150Upgrade_20241021_Test is ProtocolV3TestBase { assertEq(GHO_CCIP_STEWARD.GHO_TOKEN(), MiscEthereum.GHO_TOKEN); assertEq(GHO_CCIP_STEWARD.GHO_TOKEN_POOL(), address(ghoTokenPool)); + assertEq(GHO_CCIP_STEWARD.RISK_COUNCIL(), _readRiskAdmin()); } function _getOutboundRefillTime(uint256 amount) private view returns (uint256) { diff --git a/src/interfaces/IGhoCcipSteward.sol b/src/interfaces/IGhoCcipSteward.sol index f3dfec74f..b3166cd73 100644 --- a/src/interfaces/IGhoCcipSteward.sol +++ b/src/interfaces/IGhoCcipSteward.sol @@ -48,4 +48,10 @@ interface IGhoCcipSteward { * @return The address of the Gho CCIP Token Pool */ function GHO_TOKEN_POOL() external view returns (address); + + /** + * @notice Returns the address of the Risk Council + * @return The address of the Risk Council + */ + function RISK_COUNCIL() external view returns (address); }