Skip to content

Commit

Permalink
fix: risk council
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Jul 26, 2024
1 parent 835e347 commit 010ca6f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/contracts/misc/BucketCapacityManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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(
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/misc/GhoAaveSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 4 additions & 2 deletions src/contracts/misc/GhoCcipSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
*/
Expand All @@ -55,7 +58,6 @@ contract GhoCcipSteward is Ownable, RiskCouncilControlled, IGhoCcipSteward {

GHO_TOKEN = ghoToken;
GHO_TOKEN_POOL = ghoTokenPool;
RISK_COUNCIL = riskCouncil;

_transferOwnership(owner);
}
Expand Down
8 changes: 4 additions & 4 deletions src/contracts/misc/GhoGsmSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
Expand Down
9 changes: 9 additions & 0 deletions src/contracts/misc/RiskCouncilControlled.sol
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 010ca6f

Please sign in to comment.