Skip to content

Commit 094fc35

Browse files
authored
feat: ACRED supply cap (#7)
1 parent ac09f4b commit 094fc35

2 files changed

Lines changed: 114 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+
#### ACRED ([0x17418038ecF73BA4026c4f428547BF099706F27B](https://etherscan.io/address/0x17418038ecF73BA4026c4f428547BF099706F27B))
6+
7+
| description | value before | value after |
8+
| --- | --- | --- |
9+
| supplyCap | 30,000 ACRED | 1 ACRED |
10+
11+
12+
## Raw diff
13+
14+
```json
15+
{
16+
"reserves": {
17+
"0x17418038ecF73BA4026c4f428547BF099706F27B": {
18+
"supplyCap": {
19+
"from": 30000,
20+
"to": 1
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+
"0xe7569c1de36b7b382c11b8838312b8b7a0397157bf8b3c82731f39ca7162a47e": {
32+
"previousValue": "0x10000000000000000000000000000007530000000000000001062a941db019c8",
33+
"newValue": "0x10000000000000000000000000000000001000000000000001062a941db019c8"
34+
}
35+
}
36+
},
37+
"0xe6ec1f0ae6cd023bd0a9b4d0253bdc755103253c": {
38+
"label": null,
39+
"contract": null,
40+
"balanceDiff": null,
41+
"nonceDiff": null,
42+
"stateDiff": {
43+
"0x0000000000000000000000000000000000000000000000000000000000000005": {
44+
"previousValue": "0x000000000000000000000000000000000000000000000000000000000000002d",
45+
"newValue": "0x000000000000000000000000000000000000000000000000000000000000002e"
46+
}
47+
}
48+
}
49+
}
50+
}
51+
```
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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

Comments
 (0)