|
| 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, AaveV3EthereumHorizonAssets} from 'aave-address-book-latest/AaveV3EthereumHorizon.sol'; |
| 7 | +import {AaveHorizonGovV3Helpers} from 'src/utils/AaveHorizonGovV3Helpers.sol'; |
| 8 | + |
| 9 | +/** |
| 10 | + * @dev Test for GHO caps update via multisig transaction. |
| 11 | + * command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_USTBSupplyCap_20260514 -vv |
| 12 | + */ |
| 13 | +contract AaveV3Horizon_USTBSupplyCap_20260514 is ProtocolV3HorizonTestBase { |
| 14 | + address internal constant OPS_TARGET = 0x83Cb1B4af26EEf6463aC20AFbAC9c0e2E017202F; |
| 15 | + // from Safe UI |
| 16 | + bytes internal constant OPS_DATA = |
| 17 | + hex'571f03e500000000000000000000000043415eb6ff9db7e26a15b704e7a3edce97d31c4e00000000000000000000000000000000000000000000000000000000007a1200'; |
| 18 | + uint256 internal constant OPS_NONCE = 49; |
| 19 | + |
| 20 | + function setUp() public { |
| 21 | + vm.createSelectFork(vm.rpcUrl('mainnet'), 25095755); |
| 22 | + } |
| 23 | + |
| 24 | + /** |
| 25 | + * @dev Full test suite: snapshots, state diff, validations, e2e. |
| 26 | + */ |
| 27 | + function test_defaultProposalExecution() public { |
| 28 | + defaultTest_v3_3('AaveV3Horizon_USTBSupplyCap_20260514', _pool(), _executeUSTBSupplyCapUpdate); |
| 29 | + } |
| 30 | + |
| 31 | + /** |
| 32 | + * @dev Custom before/after assertions for the USTB supply cap change. |
| 33 | + */ |
| 34 | + function test_ustbSupplyCapChange() public { |
| 35 | + (, uint256 supplyCapBefore) = ( |
| 36 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 37 | + AaveV3EthereumHorizonAssets.USTB_UNDERLYING |
| 38 | + ) |
| 39 | + ); |
| 40 | + |
| 41 | + assertEq(supplyCapBefore, 6_000_000, 'Supply cap before'); |
| 42 | + |
| 43 | + _executeUSTBSupplyCapUpdate(); |
| 44 | + |
| 45 | + (, uint256 supplyCapAfter) = ( |
| 46 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 47 | + AaveV3EthereumHorizonAssets.USTB_UNDERLYING |
| 48 | + ) |
| 49 | + ); |
| 50 | + |
| 51 | + assertEq(supplyCapAfter, 8_000_000, 'Supply cap after'); |
| 52 | + } |
| 53 | + |
| 54 | + function test_calldata() public pure { |
| 55 | + AaveHorizonGovV3Helpers.Action memory action = AaveHorizonGovV3Helpers.Action({ |
| 56 | + to: address(AaveV3EthereumHorizon.POOL_CONFIGURATOR), |
| 57 | + data: abi.encodeCall( |
| 58 | + AaveV3EthereumHorizon.POOL_CONFIGURATOR.setSupplyCap, |
| 59 | + (AaveV3EthereumHorizonAssets.USTB_UNDERLYING, 8_000_000) |
| 60 | + ) |
| 61 | + }); |
| 62 | + (address to, bytes memory data, uint8 operation) = AaveHorizonGovV3Helpers |
| 63 | + .createOpsMultisigCalldata(action); |
| 64 | + assertEq(to, OPS_TARGET, 'ops target mismatch'); |
| 65 | + assertEq(data, OPS_DATA, 'ops calldata mismatch'); |
| 66 | + assertEq(operation, 0, 'ops operation mismatch'); |
| 67 | + } |
| 68 | + |
| 69 | + function _executeUSTBSupplyCapUpdate() internal { |
| 70 | + _executeOpsMultisigTx({to: OPS_TARGET, data: OPS_DATA, operation: 0, nonce: OPS_NONCE}); |
| 71 | + } |
| 72 | +} |
0 commit comments