|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.0; |
| 3 | + |
| 4 | +import {IPoolDataProvider} from 'aave-v3-origin/contracts/interfaces/IPoolDataProvider.sol'; |
| 5 | +import {ProtocolV3HorizonTestBase, ReserveConfig} from 'tests/utils/ProtocolV3HorizonTestBase.sol'; |
| 6 | +import {AaveV3EthereumHorizon} from 'aave-address-book-latest/AaveV3EthereumHorizon.sol'; |
| 7 | +import {AaveV3EthereumHorizonCustom} from 'src/utils/AaveV3EthereumHorizonCustom.sol'; |
| 8 | + |
| 9 | +/** |
| 10 | + * @dev Test for GHO caps update via multisig transaction. |
| 11 | + * command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_ACREDSupplyCap_20260401 -vv |
| 12 | + */ |
| 13 | +contract AaveV3Horizon_ACREDSupplyCap_20260401 is ProtocolV3HorizonTestBase { |
| 14 | + address internal constant OPS_TARGET = 0x83Cb1B4af26EEf6463aC20AFbAC9c0e2E017202F; |
| 15 | + bytes internal constant OPS_DATA = |
| 16 | + hex'571f03e500000000000000000000000017418038ecf73ba4026c4f428547bf099706f27b0000000000000000000000000000000000000000000000000000000000000001'; |
| 17 | + uint256 internal constant OPS_NONCE = 45; |
| 18 | + uint8 internal constant OPS_OPERATION = 0; |
| 19 | + |
| 20 | + function setUp() public { |
| 21 | + vm.createSelectFork(vm.rpcUrl('mainnet'), 24786649); |
| 22 | + } |
| 23 | + |
| 24 | + function _executeACREDSupplyCapUpdate() internal { |
| 25 | + _executeOpsMultisigTx({ |
| 26 | + to: OPS_TARGET, |
| 27 | + data: OPS_DATA, |
| 28 | + operation: OPS_OPERATION, |
| 29 | + nonce: OPS_NONCE |
| 30 | + }); |
| 31 | + } |
| 32 | + |
| 33 | + /** |
| 34 | + * @dev Full test suite: snapshots, state diff, validations, e2e. |
| 35 | + */ |
| 36 | + function test_defaultProposalExecution() public { |
| 37 | + defaultTest_v3_3( |
| 38 | + 'AaveV3Horizon_ACREDSupplyCap_20260401', |
| 39 | + _pool(), |
| 40 | + _executeACREDSupplyCapUpdate |
| 41 | + ); |
| 42 | + } |
| 43 | + |
| 44 | + /** |
| 45 | + * @dev Custom before/after assertions for the ACRED supply cap change. |
| 46 | + */ |
| 47 | + function test_ACREDSupplyCapsChange() public { |
| 48 | + (, uint256 supplyCapBefore) = ( |
| 49 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 50 | + AaveV3EthereumHorizonCustom.ACRED_UNDERLYING |
| 51 | + ) |
| 52 | + ); |
| 53 | + assertEq(supplyCapBefore, 30_000, 'Supply cap before'); |
| 54 | + _executeACREDSupplyCapUpdate(); |
| 55 | + |
| 56 | + (, uint256 supplyCapAfter) = ( |
| 57 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 58 | + AaveV3EthereumHorizonCustom.ACRED_UNDERLYING |
| 59 | + ) |
| 60 | + ); |
| 61 | + assertEq(supplyCapAfter, 1, 'Supply cap after'); |
| 62 | + } |
| 63 | +} |
0 commit comments