Skip to content

Commit 8db1af1

Browse files
authored
fix: Add new code of GHO IR (#15)
* fix: Updates GHO code * fix: Update fork block number to account for stkaave upgrade
1 parent f1b1abb commit 8db1af1

File tree

3 files changed

+9
-28
lines changed

3 files changed

+9
-28
lines changed

scripts/Helpers.sol

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ library Helpers {
6666
'GHO_VARIABLE_DEBT_TOKEN_IMPL',
6767
'0x0'
6868
);
69-
GhoInterestRateStrategy ghoInterestRateStrategy = new GhoInterestRateStrategy(ghoInterestRate);
69+
GhoInterestRateStrategy ghoInterestRateStrategy = new GhoInterestRateStrategy(
70+
address(IPool(pool).ADDRESSES_PROVIDER()),
71+
ghoInterestRate
72+
);
7073
GhoDiscountRateStrategy ghoDiscountRateStrategy = new GhoDiscountRateStrategy();
7174

7275
return

tests/GhoListingTest.t.sol

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ contract GhoListingTest is ProtocolV3TestBase {
3535
address constant AAVE = 0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9;
3636
address public constant STKAAVE = 0x4da27a545c0c5B758a6BA100e3a049001de870f5;
3737

38-
address public constant STKAAVE_UPGRADE_PAYLOAD = 0xe427FCbD54169136391cfEDf68E96abB13dA87A0; // AIP#124
39-
uint256 public constant STKAAVE_UPGRADE_BLOCK_NUMBER = 17138206;
38+
uint256 public constant FORK_BLOCK_NUMBER = 17334690;
4039

4140
address public GHO_TOKEN;
4241
address public GHO_FLASHMINTER;
4342

4443
function testListingComplete() public {
45-
vm.createSelectFork(vm.rpcUrl('mainnet'), STKAAVE_UPGRADE_BLOCK_NUMBER);
44+
vm.createSelectFork(vm.rpcUrl('mainnet'), FORK_BLOCK_NUMBER);
4645

4746
Helpers.AaveFacilitatorData memory aaveData = Helpers.deployAaveFacilitator(
4847
address(AaveV3Ethereum.POOL),
@@ -60,30 +59,16 @@ contract GhoListingTest is ProtocolV3TestBase {
6059
GHO_TOKEN = payload.precomputeGhoTokenAddress();
6160
GHO_FLASHMINTER = payload.precomputeGhoFlashMinterAddress();
6261

63-
// Simulate stkAave upgrade
64-
uint256 upgradeProposalId = _passProposal(
65-
AaveGovernanceV2.LONG_EXECUTOR,
66-
STKAAVE_UPGRADE_PAYLOAD
67-
);
68-
GovHelper._execute(upgradeProposalId);
69-
7062
// Simulate GOV action
7163
uint256 listingProposalId = _passProposal(AaveGovernanceV2.SHORT_EXECUTOR, address(payload));
7264

7365
_testListing(address(payload), listingProposalId);
7466
}
7567

7668
function _testListingWithPayload() public {
77-
vm.createSelectFork(vm.rpcUrl('mainnet'), STKAAVE_UPGRADE_BLOCK_NUMBER);
69+
vm.createSelectFork(vm.rpcUrl('mainnet'), FORK_BLOCK_NUMBER);
7870
address GHO_AIP = address(0); // TODO
7971

80-
// Simulate stkAave upgrade
81-
uint256 upgradeProposalId = _passProposal(
82-
AaveGovernanceV2.LONG_EXECUTOR,
83-
STKAAVE_UPGRADE_PAYLOAD
84-
);
85-
GovHelper._execute(upgradeProposalId);
86-
8772
// Simulate GOV action
8873
uint256 listingProposalId = _passProposal(AaveGovernanceV2.SHORT_EXECUTOR, GHO_AIP);
8974

@@ -95,7 +80,7 @@ contract GhoListingTest is ProtocolV3TestBase {
9580
* This is possible due to the permissionless create2 singleton factory
9681
*/
9782
function testPayloadExecutionWithContractsAlreadyDeployed() public {
98-
vm.createSelectFork(vm.rpcUrl('mainnet'), STKAAVE_UPGRADE_BLOCK_NUMBER);
83+
vm.createSelectFork(vm.rpcUrl('mainnet'), FORK_BLOCK_NUMBER);
9984

10085
Helpers.AaveFacilitatorData memory aaveData = Helpers.deployAaveFacilitator(
10186
address(AaveV3Ethereum.POOL),
@@ -113,13 +98,6 @@ contract GhoListingTest is ProtocolV3TestBase {
11398
GHO_TOKEN = payload.precomputeGhoTokenAddress();
11499
GHO_FLASHMINTER = payload.precomputeGhoFlashMinterAddress();
115100

116-
// Simulate stkAave upgrade
117-
uint256 upgradeProposalId = _passProposal(
118-
AaveGovernanceV2.LONG_EXECUTOR,
119-
STKAAVE_UPGRADE_PAYLOAD
120-
);
121-
GovHelper._execute(upgradeProposalId);
122-
123101
// Simulate GOV action
124102
uint256 listingProposalId = _passProposal(AaveGovernanceV2.SHORT_EXECUTOR, address(payload));
125103

0 commit comments

Comments
 (0)