Skip to content

Commit

Permalink
fix: remove unused strategy factory
Browse files Browse the repository at this point in the history
  • Loading branch information
CheyenneAtapour committed Aug 7, 2024
1 parent 3ad1f7e commit 66c7510
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 36 deletions.
12 changes: 2 additions & 10 deletions src/contracts/misc/GhoAaveSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {IPool} from '@aave/core-v3/contracts/interfaces/IPool.sol';
import {DataTypes} from '@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol';
import {ReserveConfiguration} from '@aave/core-v3/contracts/protocol/libraries/configuration/ReserveConfiguration.sol';
import {GhoInterestRateStrategy} from '../facilitators/aave/interestStrategy/GhoInterestRateStrategy.sol';
import {IFixedRateStrategyFactory} from '../facilitators/aave/interestStrategy/interfaces/IFixedRateStrategyFactory.sol';
import {IDefaultInterestRateStrategyV2} from './deps/Dependencies.sol';
import {IGhoAaveSteward} from './interfaces/IGhoAaveSteward.sol';
import {RiskCouncilControlled} from './RiskCouncilControlled.sol';
Expand All @@ -32,6 +31,8 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward {
/// @inheritdoc IGhoAaveSteward
uint256 public constant GHO_BORROW_RATE_MAX = 0.25e4; // 25.00%

uint256 internal constant BPS_MAX = 100_00;

/// @inheritdoc IGhoAaveSteward
address public immutable CONFIG_ENGINE;

Expand All @@ -47,11 +48,6 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward {
/// @inheritdoc IGhoAaveSteward
address public immutable GHO_TOKEN;

/// @inheritdoc IGhoAaveSteward
address public immutable FIXED_RATE_STRATEGY_FACTORY;

uint256 internal constant BPS_MAX = 100_00;

Config internal _riskConfig;

GhoDebounce internal _ghoTimelocks;
Expand All @@ -70,7 +66,6 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward {
* @param poolDataProvider The pool data provider of the pool to be controlled by the steward
* @param engine the address of the config engine to be used by the steward
* @param ghoToken The address of the GhoToken
* @param fixedRateStrategyFactory The address of the FixedRateStrategyFactory
* @param riskCouncil The address of the risk council
* @param riskConfig The initial risk configuration for the Gho reserve
*/
Expand All @@ -79,21 +74,18 @@ contract GhoAaveSteward is RiskCouncilControlled, IGhoAaveSteward {
address poolDataProvider,
address engine,
address ghoToken,
address fixedRateStrategyFactory,
address riskCouncil,
Config memory riskConfig
) RiskCouncilControlled(riskCouncil) {
require(addressesProvider != address(0), 'INVALID_ADDRESSES_PROVIDER');
require(poolDataProvider != address(0), 'INVALID_DATA_PROVIDER');
require(engine != address(0), 'INVALID_CONFIG_ENGINE');
require(ghoToken != address(0), 'INVALID_GHO_TOKEN');
require(fixedRateStrategyFactory != address(0), 'INVALID_FIXED_RATE_STRATEGY_FACTORY');

POOL_ADDRESSES_PROVIDER = addressesProvider;
POOL_DATA_PROVIDER = poolDataProvider;
CONFIG_ENGINE = engine;
GHO_TOKEN = ghoToken;
FIXED_RATE_STRATEGY_FACTORY = fixedRateStrategyFactory;
_riskConfig = riskConfig;
}

Expand Down
6 changes: 0 additions & 6 deletions src/contracts/misc/interfaces/IGhoAaveSteward.sol
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ interface IGhoAaveSteward {
*/
function GHO_TOKEN() external view returns (address);

/**
* @notice Returns the address of the fixed rate strategy factory
* @return The address of the FixedRateStrategyFactory
*/
function FIXED_RATE_STRATEGY_FACTORY() external view returns (address);

/**
* @notice Returns the address of the risk council
* @return The address of the RiskCouncil
Expand Down
20 changes: 0 additions & 20 deletions src/test/TestGhoAaveSteward.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(MOCK_POOL_DATA_PROVIDER),
address(engine),
address(GHO_TOKEN),
address(FIXED_RATE_STRATEGY_FACTORY),
RISK_COUNCIL,
riskConfig
);
Expand All @@ -70,7 +69,6 @@ contract TestGhoAaveSteward is TestGhoBase {
assertEq(GHO_AAVE_STEWARD.POOL_ADDRESSES_PROVIDER(), address(PROVIDER));
assertEq(GHO_AAVE_STEWARD.POOL_DATA_PROVIDER(), address(MOCK_POOL_DATA_PROVIDER));
assertEq(GHO_AAVE_STEWARD.GHO_TOKEN(), address(GHO_TOKEN));
assertEq(GHO_AAVE_STEWARD.FIXED_RATE_STRATEGY_FACTORY(), address(FIXED_RATE_STRATEGY_FACTORY));
assertEq(GHO_AAVE_STEWARD.RISK_COUNCIL(), RISK_COUNCIL);

IGhoAaveSteward.GhoDebounce memory ghoTimelocks = GHO_AAVE_STEWARD.getGhoTimelocks();
Expand All @@ -85,7 +83,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(0x003),
address(0x004),
address(0x005),
address(0x006),
riskConfig
);
}
Expand All @@ -98,7 +95,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(0x003),
address(0x004),
address(0x005),
address(0x006),
riskConfig
);
}
Expand All @@ -111,7 +107,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(0),
address(0x004),
address(0x005),
address(0x006),
riskConfig
);
}
Expand All @@ -124,20 +119,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(0x003),
address(0),
address(0x005),
address(0x006),
riskConfig
);
}

function testRevertConstructorInvalidFixedRateStrategyFactory() public {
vm.expectRevert('INVALID_FIXED_RATE_STRATEGY_FACTORY');
new GhoAaveSteward(
address(0x001),
address(0x002),
address(0x003),
address(0x004),
address(0),
address(0x006),
riskConfig
);
}
Expand All @@ -149,7 +130,6 @@ contract TestGhoAaveSteward is TestGhoBase {
address(0x002),
address(0x003),
address(0x004),
address(0x005),
address(0),
riskConfig
);
Expand Down

0 comments on commit 66c7510

Please sign in to comment.