From 010ca6fc9a2fddf16b80b30c16928d2658316e5e Mon Sep 17 00:00:00 2001 From: CheyenneAtapour Date: Thu, 25 Jul 2024 19:56:08 -0700 Subject: [PATCH] fix: risk council --- src/contracts/misc/BucketCapacityManager.sol | 6 ++++-- src/contracts/misc/GhoAaveSteward.sol | 6 +++--- src/contracts/misc/GhoCcipSteward.sol | 6 ++++-- src/contracts/misc/GhoGsmSteward.sol | 8 ++++---- src/contracts/misc/RiskCouncilControlled.sol | 9 +++++++++ 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/contracts/misc/BucketCapacityManager.sol b/src/contracts/misc/BucketCapacityManager.sol index f31b618f..3d5ca83f 100644 --- a/src/contracts/misc/BucketCapacityManager.sol +++ b/src/contracts/misc/BucketCapacityManager.sol @@ -23,7 +23,9 @@ contract BucketCapacityManager is Ownable, RiskCouncilControlled, IBucketCapacit address public immutable GHO_TOKEN; /// @inheritdoc IBucketCapacityManager - address public immutable RISK_COUNCIL; + function RISK_COUNCIL() public view override returns (address) { + return COUNCIL; + } mapping(address => uint40) _facilitatorsBucketCapacityTimelocks; @@ -41,6 +43,7 @@ contract BucketCapacityManager is Ownable, RiskCouncilControlled, IBucketCapacit /** * @dev Constructor * @param owner The address of the owner of the contract + * @param ghoToken The address of the GhoToken * @param riskCouncil The address of the risk council */ constructor( @@ -51,7 +54,6 @@ contract BucketCapacityManager is Ownable, RiskCouncilControlled, IBucketCapacit require(owner != address(0), 'INVALID_OWNER'); require(ghoToken != address(0), 'INVALID_GHO_TOKEN'); - RISK_COUNCIL = riskCouncil; GHO_TOKEN = ghoToken; _transferOwnership(owner); diff --git a/src/contracts/misc/GhoAaveSteward.sol b/src/contracts/misc/GhoAaveSteward.sol index 2b6947b8..af10f52b 100644 --- a/src/contracts/misc/GhoAaveSteward.sol +++ b/src/contracts/misc/GhoAaveSteward.sol @@ -34,7 +34,9 @@ contract GhoAaveSteward is Ownable, RiskCouncilControlled, IGhoAaveSteward { address public immutable FIXED_RATE_STRATEGY_FACTORY; /// @inheritdoc IGhoAaveSteward - address public immutable RISK_COUNCIL; + function RISK_COUNCIL() public view override returns (address) { + return COUNCIL; + } GhoDebounce internal _ghoTimelocks; @@ -65,12 +67,10 @@ contract GhoAaveSteward is Ownable, RiskCouncilControlled, IGhoAaveSteward { require(addressesProvider != address(0), 'INVALID_ADDRESSES_PROVIDER'); require(ghoToken != address(0), 'INVALID_GHO_TOKEN'); require(fixedRateStrategyFactory != address(0), 'INVALID_FIXED_RATE_STRATEGY_FACTORY'); - require(riskCouncil != address(0), 'INVALID_RISK_COUNCIL'); POOL_ADDRESSES_PROVIDER = addressesProvider; GHO_TOKEN = ghoToken; FIXED_RATE_STRATEGY_FACTORY = fixedRateStrategyFactory; - RISK_COUNCIL = riskCouncil; _transferOwnership(owner); } diff --git a/src/contracts/misc/GhoCcipSteward.sol b/src/contracts/misc/GhoCcipSteward.sol index 6e14991b..06eb4440 100644 --- a/src/contracts/misc/GhoCcipSteward.sol +++ b/src/contracts/misc/GhoCcipSteward.sol @@ -27,7 +27,9 @@ contract GhoCcipSteward is Ownable, RiskCouncilControlled, IGhoCcipSteward { address public immutable GHO_TOKEN_POOL; /// @inheritdoc IGhoCcipSteward - address public immutable RISK_COUNCIL; + function RISK_COUNCIL() public view override returns (address) { + return COUNCIL; + } /** * @dev Only methods that are not timelocked can be called if marked by this modifier. @@ -40,6 +42,7 @@ contract GhoCcipSteward is Ownable, RiskCouncilControlled, IGhoCcipSteward { /** * @dev Constructor * @param owner The address of the owner of the contract + * @param ghoToken The address of the GhoToken * @param ghoTokenPool The address of the Gho CCIP Token Pool * @param riskCouncil The address of the risk council */ @@ -55,7 +58,6 @@ contract GhoCcipSteward is Ownable, RiskCouncilControlled, IGhoCcipSteward { GHO_TOKEN = ghoToken; GHO_TOKEN_POOL = ghoTokenPool; - RISK_COUNCIL = riskCouncil; _transferOwnership(owner); } diff --git a/src/contracts/misc/GhoGsmSteward.sol b/src/contracts/misc/GhoGsmSteward.sol index c869b6f1..93e9a7a3 100644 --- a/src/contracts/misc/GhoGsmSteward.sol +++ b/src/contracts/misc/GhoGsmSteward.sol @@ -25,7 +25,9 @@ contract GhoGsmSteward is Ownable, RiskCouncilControlled, IGhoGsmSteward { uint256 public constant MINIMUM_DELAY = 2 days; /// @inheritdoc IGhoGsmSteward - address public immutable RISK_COUNCIL; + function RISK_COUNCIL() public view override returns (address) { + return COUNCIL; + } mapping(address => GsmDebounce) internal _gsmTimelocksByAddress; @@ -42,13 +44,11 @@ contract GhoGsmSteward is Ownable, RiskCouncilControlled, IGhoGsmSteward { /** * @dev Constructor + * @param owner The address of the owner of the contract * @param riskCouncil The address of the risk council */ constructor(address owner, address riskCouncil) RiskCouncilControlled(riskCouncil) { require(owner != address(0), 'INVALID_OWNER'); - require(riskCouncil != address(0), 'INVALID_RISK_COUNCIL'); - - RISK_COUNCIL = riskCouncil; _transferOwnership(owner); } diff --git a/src/contracts/misc/RiskCouncilControlled.sol b/src/contracts/misc/RiskCouncilControlled.sol index 4af7957b..29570513 100644 --- a/src/contracts/misc/RiskCouncilControlled.sol +++ b/src/contracts/misc/RiskCouncilControlled.sol @@ -1,9 +1,18 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.10; +/** + * @title RiskCouncilControlled + * @author Aave Labs + * @notice Helper contract for controlling access to Steward and other functions restricted to Risk Council + */ contract RiskCouncilControlled { address public immutable COUNCIL; + /** + * @dev Constructor + * @param riskCouncil The address of the risk council + */ constructor(address riskCouncil) { require(riskCouncil != address(0), 'INVALID_RISK_COUNCIL'); COUNCIL = riskCouncil;