diff --git a/src/contracts/misc/GhoStewardV2.sol b/src/contracts/misc/GhoStewardV2.sol index 55f41945..cde0cd80 100644 --- a/src/contracts/misc/GhoStewardV2.sol +++ b/src/contracts/misc/GhoStewardV2.sol @@ -237,12 +237,12 @@ contract GhoStewardV2 is Ownable, IGhoStewardV2 { } /// @inheritdoc IGhoStewardV2 - function setBridgeLimit(uint256 newBridgeLimit) external onlyRiskCouncil { + function updateBridgeLimit(uint256 newBridgeLimit) external onlyRiskCouncil { UpgradeableLockReleaseTokenPool(GHO_TOKEN_POOL).setBridgeLimit(newBridgeLimit); } /// @inheritdoc IGhoStewardV2 - function setRateLimit( + function updateRateLimit( uint64 remoteChainSelector, RateLimiter.Config calldata outboundConfig, RateLimiter.Config calldata inboundConfig diff --git a/src/contracts/misc/interfaces/IGhoStewardV2.sol b/src/contracts/misc/interfaces/IGhoStewardV2.sol index 2032064a..bed0b822 100644 --- a/src/contracts/misc/interfaces/IGhoStewardV2.sol +++ b/src/contracts/misc/interfaces/IGhoStewardV2.sol @@ -75,7 +75,7 @@ interface IGhoStewardV2 { * @dev Only callable by Risk Council * @param newBridgeLimit The new desired bridge limit */ - function setBridgeLimit(uint256 newBridgeLimit) external; + function updateBridgeLimit(uint256 newBridgeLimit) external; /** * @notice Updates the CCIP rate limit config @@ -84,7 +84,7 @@ interface IGhoStewardV2 { * @param outboundConfig The new outbound rate limiter config. * @param inboundConfig The new inbound rate limiter config. */ - function setRateLimit( + function updateRateLimit( uint64 remoteChainSelector, RateLimiter.Config calldata outboundConfig, RateLimiter.Config calldata inboundConfig diff --git a/src/test/TestGhoBase.t.sol b/src/test/TestGhoBase.t.sol index 0e753a62..3c2f9fa0 100644 --- a/src/test/TestGhoBase.t.sol +++ b/src/test/TestGhoBase.t.sol @@ -343,6 +343,11 @@ contract TestGhoBase is Test, Constants, Events { controlledFacilitators[1] = address(GHO_GSM); vm.prank(SHORT_EXECUTOR); GHO_STEWARD_V2.setControlledFacilitator(controlledFacilitators, true); + // Grant roles to steward + vm.startPrank(OWNER); + GHO_TOKEN_POOL.setBridgeLimitAdmin(address(GHO_STEWARD_V2)); + GHO_TOKEN_POOL.setRateLimitAdmin(address(GHO_STEWARD_V2)); + vm.stopPrank(); } function ghoFaucet(address to, uint256 amount) public { diff --git a/src/test/TestGhoStewardV2.t.sol b/src/test/TestGhoStewardV2.t.sol index e6cd24a9..09ee77c2 100644 --- a/src/test/TestGhoStewardV2.t.sol +++ b/src/test/TestGhoStewardV2.t.sol @@ -835,6 +835,23 @@ contract TestGhoStewardV2 is TestGhoBase { GHO_STEWARD_V2.updateGsmBuySellFees(address(GHO_GSM), buyFee + 1, sellFee + 1); } + function testUpdateBridgeLimit() public { + uint256 oldBridgeLimit = GHO_TOKEN_POOL.getBridgeLimit(); + uint256 newBridgeLimit = oldBridgeLimit + 1; + vm.prank(RISK_COUNCIL); + GHO_STEWARD_V2.updateBridgeLimit(newBridgeLimit); + uint256 currentBridgeLimit = GHO_TOKEN_POOL.getBridgeLimit(); + assertEq(currentBridgeLimit, newBridgeLimit); + } + + function testRevertUpdateBridgeLimitIfUnauthorized() public { + uint256 oldBridgeLimit = GHO_TOKEN_POOL.getBridgeLimit(); + uint256 newBridgeLimit = oldBridgeLimit + 1; + vm.prank(ALICE); + vm.expectRevert('INVALID_CALLER'); + GHO_STEWARD_V2.updateBridgeLimit(newBridgeLimit); + } + function testSetControlledFacilitatorAdd() public { address[] memory oldControlledFacilitators = GHO_STEWARD_V2.getControlledFacilitators(); address[] memory newGsmList = new address[](1);