|
| 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 | + |
| 8 | +/** |
| 9 | + * @dev Test for GHO caps update via multisig transaction. |
| 10 | + * command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_MultiSupplyCaps_20260330 -vv |
| 11 | + */ |
| 12 | +contract AaveV3Horizon_MultiSupplyCaps_20260330 is ProtocolV3HorizonTestBase { |
| 13 | + address internal constant OPS_TARGET = 0x9641d764fc13c8B624c04430C7356C1C7C8102e2; |
| 14 | + bytes internal constant OPS_DATA = |
| 15 | + hex'8d80ff0a000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000002640083cb1b4af26eef6463ac20afbac9c0e2e017202f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044571f03e500000000000000000000000014d60e7fdc0d71d8611742720e4c50e7a974020c0000000000000000000000000000000000000000000000000000000000e4e1c00083cb1b4af26eef6463ac20afbac9c0e2e017202f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044571f03e500000000000000000000000040d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f0000000000000000000000000000000000000000000000000000000002160ec00083cb1b4af26eef6463ac20afbac9c0e2e017202f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044571f03e500000000000000000000000043415eb6ff9db7e26a15b704e7a3edce97d31c4e000000000000000000000000000000000000000000000000000000000036ee800083cb1b4af26eef6463ac20afbac9c0e2e017202f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044571f03e50000000000000000000000005a0f93d040de44e78f251b03c43be9cf317dcf64000000000000000000000000000000000000000000000000000000000098968000000000000000000000000000000000000000000000000000000000'; |
| 16 | + uint256 internal constant OPS_NONCE = 44; |
| 17 | + |
| 18 | + function setUp() public { |
| 19 | + vm.createSelectFork(vm.rpcUrl('mainnet'), 24770689); |
| 20 | + } |
| 21 | + |
| 22 | + function _executeMultiSupplyCapsUpdate() internal { |
| 23 | + _executeOpsMultisigTx({to: OPS_TARGET, data: OPS_DATA, operation: 1, nonce: OPS_NONCE}); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * @dev Full test suite: snapshots, state diff, validations, e2e. |
| 28 | + */ |
| 29 | + function test_defaultProposalExecution() public { |
| 30 | + defaultTest_v3_3( |
| 31 | + 'AaveV3Horizon_MultiSupplyCaps_20260330', |
| 32 | + _pool(), |
| 33 | + _executeMultiSupplyCapsUpdate |
| 34 | + ); |
| 35 | + } |
| 36 | + |
| 37 | + /** |
| 38 | + * @dev Custom before/after assertions for the GHO caps change. |
| 39 | + */ |
| 40 | + function test_GhoSupplyCapsChange() public { |
| 41 | + (, uint256 supplyCapBefore) = ( |
| 42 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 43 | + AaveV3EthereumHorizonAssets.GHO_UNDERLYING |
| 44 | + ) |
| 45 | + ); |
| 46 | + assertEq(supplyCapBefore, 45_000_000, 'Supply cap before'); |
| 47 | + _executeMultiSupplyCapsUpdate(); |
| 48 | + |
| 49 | + (, uint256 supplyCapAfter) = ( |
| 50 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 51 | + AaveV3EthereumHorizonAssets.GHO_UNDERLYING |
| 52 | + ) |
| 53 | + ); |
| 54 | + assertEq(supplyCapAfter, 35_000_000, 'Supply cap after'); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * @dev Custom before/after assertions for the JAAA caps change. |
| 59 | + */ |
| 60 | + function test_JAAASupplyCapsChange() public { |
| 61 | + (, uint256 supplyCapBefore) = ( |
| 62 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 63 | + AaveV3EthereumHorizonAssets.JAAA_UNDERLYING |
| 64 | + ) |
| 65 | + ); |
| 66 | + assertEq(supplyCapBefore, 40_000_000, 'Supply cap before'); |
| 67 | + _executeMultiSupplyCapsUpdate(); |
| 68 | + |
| 69 | + (, uint256 supplyCapAfter) = ( |
| 70 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 71 | + AaveV3EthereumHorizonAssets.JAAA_UNDERLYING |
| 72 | + ) |
| 73 | + ); |
| 74 | + assertEq(supplyCapAfter, 10_000_000, 'Supply cap after'); |
| 75 | + } |
| 76 | + |
| 77 | + /** |
| 78 | + * @dev Custom before/after assertions for the USCC caps change. |
| 79 | + */ |
| 80 | + function test_USCCSupplyCapsChange() public { |
| 81 | + (, uint256 supplyCapBefore) = ( |
| 82 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 83 | + AaveV3EthereumHorizonAssets.USCC_UNDERLYING |
| 84 | + ) |
| 85 | + ); |
| 86 | + assertEq(supplyCapBefore, 29_000_000, 'Supply cap before'); |
| 87 | + _executeMultiSupplyCapsUpdate(); |
| 88 | + |
| 89 | + (, uint256 supplyCapAfter) = ( |
| 90 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 91 | + AaveV3EthereumHorizonAssets.USCC_UNDERLYING |
| 92 | + ) |
| 93 | + ); |
| 94 | + assertEq(supplyCapAfter, 15_000_000, 'Supply cap after'); |
| 95 | + } |
| 96 | + |
| 97 | + /** |
| 98 | + * @dev Custom before/after assertions for the USTB caps change. |
| 99 | + */ |
| 100 | + function test_USTBSupplyCapsChange() public { |
| 101 | + (, uint256 supplyCapBefore) = ( |
| 102 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 103 | + AaveV3EthereumHorizonAssets.USTB_UNDERLYING |
| 104 | + ) |
| 105 | + ); |
| 106 | + assertEq(supplyCapBefore, 1_800_000, 'Supply cap before'); |
| 107 | + _executeMultiSupplyCapsUpdate(); |
| 108 | + |
| 109 | + (, uint256 supplyCapAfter) = ( |
| 110 | + IPoolDataProvider(AaveV3EthereumHorizon.AAVE_PROTOCOL_DATA_PROVIDER).getReserveCaps( |
| 111 | + AaveV3EthereumHorizonAssets.USTB_UNDERLYING |
| 112 | + ) |
| 113 | + ); |
| 114 | + assertEq(supplyCapAfter, 3_600_000, 'Supply cap after'); |
| 115 | + } |
| 116 | +} |
0 commit comments