|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.0; |
| 3 | + |
| 4 | +import {IDefaultInterestRateStrategyV2} from 'aave-v3-origin/contracts/interfaces/IDefaultInterestRateStrategyV2.sol'; |
| 5 | +import {ProtocolV3HorizonTestBase} from 'tests/utils/ProtocolV3HorizonTestBase.sol'; |
| 6 | +import {AaveV3EthereumHorizonAssets} from 'aave-address-book-latest/AaveV3EthereumHorizon.sol'; |
| 7 | + |
| 8 | +/** |
| 9 | + * @dev Test for GHO interest rate update via multisig transaction. |
| 10 | + * command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_GHO_IR_20260318_Test -vv |
| 11 | + */ |
| 12 | +contract AaveV3Horizon_GHO_IR_20260318_Test is ProtocolV3HorizonTestBase { |
| 13 | + address internal constant OPS_TARGET = 0x83Cb1B4af26EEf6463aC20AFbAC9c0e2E017202F; |
| 14 | + bytes internal constant OPS_DATA = |
| 15 | + hex'6aabe21d00000000000000000000000040d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000026ac000000000000000000000000000000000000000000000000000000000000011300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'; |
| 16 | + uint256 internal constant OPS_NONCE = 43; |
| 17 | + uint8 internal constant OPS_OPERATION = 0; |
| 18 | + |
| 19 | + function setUp() public { |
| 20 | + vm.createSelectFork(vm.rpcUrl('mainnet'), 24684516); |
| 21 | + } |
| 22 | + |
| 23 | + function _executeGHOIRUpdate() internal { |
| 24 | + _executeOpsMultisigTx({ |
| 25 | + to: OPS_TARGET, |
| 26 | + data: OPS_DATA, |
| 27 | + operation: OPS_OPERATION, |
| 28 | + nonce: OPS_NONCE |
| 29 | + }); |
| 30 | + } |
| 31 | + |
| 32 | + /** |
| 33 | + * @dev Full test suite: snapshots, state diff, validations, e2e. |
| 34 | + */ |
| 35 | + function test_defaultProposalExecution() public { |
| 36 | + defaultTest_v3_3('AaveV3Horizon_GHO_IR_20260318', _pool(), _executeGHOIRUpdate); |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * @dev Custom before/after assertions for the GHO IR update. |
| 41 | + */ |
| 42 | + function test_ghoIRUpdate() public { |
| 43 | + IDefaultInterestRateStrategyV2.InterestRateData memory interestRateDataBefore = ( |
| 44 | + IDefaultInterestRateStrategyV2(AaveV3EthereumHorizonAssets.GHO_INTEREST_RATE_STRATEGY) |
| 45 | + .getInterestRateDataBps(AaveV3EthereumHorizonAssets.GHO_UNDERLYING) |
| 46 | + ); |
| 47 | + |
| 48 | + assertEq(interestRateDataBefore.optimalUsageRatio, 99_00, 'Optimal usage ratio before'); |
| 49 | + assertEq( |
| 50 | + interestRateDataBefore.baseVariableBorrowRate, |
| 51 | + 3_25, |
| 52 | + 'Base variable borrow rate before' |
| 53 | + ); |
| 54 | + assertEq(interestRateDataBefore.variableRateSlope1, 0, 'Variable rate slope 1 before'); |
| 55 | + assertEq(interestRateDataBefore.variableRateSlope2, 0, 'Variable rate slope 2 before'); |
| 56 | + |
| 57 | + _executeGHOIRUpdate(); |
| 58 | + |
| 59 | + IDefaultInterestRateStrategyV2.InterestRateData memory interestRateDataAfter = ( |
| 60 | + IDefaultInterestRateStrategyV2(AaveV3EthereumHorizonAssets.GHO_INTEREST_RATE_STRATEGY) |
| 61 | + .getInterestRateDataBps(AaveV3EthereumHorizonAssets.GHO_UNDERLYING) |
| 62 | + ); |
| 63 | + |
| 64 | + assertEq(interestRateDataAfter.optimalUsageRatio, 99_00, 'Optimal usage ratio after'); |
| 65 | + assertEq(interestRateDataAfter.baseVariableBorrowRate, 2_75, 'Base variable borrow rate after'); |
| 66 | + assertEq(interestRateDataAfter.variableRateSlope1, 0, 'Variable rate slope 1 after'); |
| 67 | + assertEq(interestRateDataAfter.variableRateSlope2, 0, 'Variable rate slope 2 after'); |
| 68 | + } |
| 69 | +} |
0 commit comments