Skip to content

Commit b8fc853

Browse files
authored
feat: USTB supply cap update (#11)
1 parent 21267b9 commit b8fc853

2 files changed

Lines changed: 123 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Reserve changes
2+
3+
### Reserves altered
4+
5+
#### USTB ([0x43415eB6ff9DB7E26A15b704e7A3eDCe97d31C4e](https://etherscan.io/address/0x43415eB6ff9DB7E26A15b704e7A3eDCe97d31C4e))
6+
7+
| description | value before | value after |
8+
| --- | --- | --- |
9+
| supplyCap | 6,000,000 USTB | 8,000,000 USTB |
10+
11+
12+
## Raw diff
13+
14+
```json
15+
{
16+
"reserves": {
17+
"0x43415eB6ff9DB7E26A15b704e7A3eDCe97d31C4e": {
18+
"supplyCap": {
19+
"from": 6000000,
20+
"to": 8000000
21+
}
22+
}
23+
},
24+
"raw": {
25+
"0xae05cd22df81871bc7cc2a04becfb516bfe332c8": {
26+
"label": null,
27+
"contract": "lib/aave-umbrella/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy",
28+
"balanceDiff": null,
29+
"nonceDiff": null,
30+
"stateDiff": {
31+
"0x11567aab4cd72d4842d11c42514ff879ac1d304b8bb2969ce8bddb1f43474e61": {
32+
"previousValue": "0x100000000000000000000000000005b8d8000000000000000106283c23282260",
33+
"newValue": "0x100000000000000000000000000007a120000000000000000106283c23282260"
34+
}
35+
}
36+
},
37+
"0xe6ec1f0ae6cd023bd0a9b4d0253bdc755103253c": {
38+
"label": null,
39+
"contract": null,
40+
"balanceDiff": null,
41+
"nonceDiff": null,
42+
"stateDiff": {
43+
"0x0000000000000000000000000000000000000000000000000000000000000005": {
44+
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000031",
45+
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000032"
46+
}
47+
}
48+
}
49+
}
50+
}
51+
```
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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

Comments
 (0)