Skip to content

Commit 02bef90

Browse files
committed
test: post-exec fork tests; pr comments; rwa borrow test
1 parent 0e6c80d commit 02bef90

10 files changed

Lines changed: 254 additions & 96 deletions

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Verifier URL for contract verification
22
VERIFIER_URL=
3+
DRY=
4+
ACCOUNT=
5+
CHAIN=
36

47
# Test rpc_endpoints
58
# To generate RPCs based on you api keys, you can use

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ test :; forge test -vvv
1111

1212
test-contract :; forge test --match-contract ${filter} -vv
1313

14-
# Deploys payload to list ACRED asset. `make deploy-acred dry=false CHAIN=mainnet ACCOUNT=<account>`
14+
# Deploys payload to list ACRED asset. `make deploy-acred`
1515
deploy-acred :;
1616
FOUNDRY_PROFILE=${CHAIN} forge script src/AaveV3Horizon_ACREDListing_20260217/ACREDListing_20260217.s.sol:DeployEthereum \
1717
--rpc-url ${CHAIN} --account ${ACCOUNT} --slow --gas-estimate-multiplier 150 \
1818
--chain ${CHAIN} --verifier-url ${VERIFIER_URL} \
1919
--sig "run()" \
20-
$(if ${dry},, --broadcast --verify) \
20+
$(if ${DRY},, --broadcast --verify) \
2121

2222
# Utilities
2323
download :; cast etherscan-source --chain ${chain} -d src/etherscan/${chain}_${address} ${address}

diffs/AaveV3Horizon_ACREDListing_20260217_before_AaveV3Horizon_ACREDListing_20260217_after.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| decimals | 6 |
1010
| isActive | true |
1111
| isFrozen | false |
12-
| supplyCap | 32,000 ACRED |
12+
| supplyCap | 30,000 ACRED |
1313
| borrowCap | 0 ACRED |
1414
| debtCeiling | 0 $ [0] |
1515
| isSiloed | false |
@@ -55,24 +55,24 @@
5555

5656

5757

58-
### EMode: (id: 3)
58+
### EMode: ACRED GHO(id: 3)
5959

60+
| description | value before | value after |
61+
| --- | --- | --- |
62+
| eMode.label | - | ACRED GHO |
63+
| eMode.ltv | 72 % | 68 % |
64+
| eMode.liquidationThreshold | 79 % | 78 % |
65+
| eMode.liquidationBonus | 7.5 % | 9 % |
66+
| eMode.borrowableBitmap | | GHO |
67+
| eMode.collateralBitmap | | ACRED |
6068

6169

6270
### EMode: USCC GHO(id: 4)
6371

6472

6573

66-
### EMode: ACRED GHO(id: 5)
74+
### EMode: (id: 5)
6775

68-
| description | value before | value after |
69-
| --- | --- | --- |
70-
| eMode.label | - | ACRED GHO |
71-
| eMode.ltv | 85 % | 90 % |
72-
| eMode.liquidationThreshold | 89 % | 92 % |
73-
| eMode.liquidationBonus | 3.1 % | 3 % |
74-
| eMode.borrowableBitmap | | GHO |
75-
| eMode.collateralBitmap | | ACRED |
7676

7777

7878
### EMode: USYC GHO(id: 6)
@@ -100,7 +100,7 @@
100100
```json
101101
{
102102
"eModes": {
103-
"5": {
103+
"3": {
104104
"borrowableBitmap": {
105105
"from": "0",
106106
"to": "1"
@@ -114,16 +114,16 @@
114114
"to": "ACRED GHO"
115115
},
116116
"liquidationBonus": {
117-
"from": 10310,
118-
"to": 10300
117+
"from": 10750,
118+
"to": 10900
119119
},
120120
"liquidationThreshold": {
121-
"from": 8900,
122-
"to": 9200
121+
"from": 7900,
122+
"to": 7800
123123
},
124124
"ltv": {
125-
"from": 8500,
126-
"to": 9000
125+
"from": 7200,
126+
"to": 6800
127127
}
128128
}
129129
},
@@ -156,7 +156,7 @@
156156
"oracleDescription": "ACRED NAV - Aave LlamaGuard",
157157
"oracleLatestAnswer": "109713972400",
158158
"reserveFactor": 0,
159-
"supplyCap": 32000,
159+
"supplyCap": 30000,
160160
"symbol": "ACRED",
161161
"underlying": "0x17418038ecF73BA4026c4f428547BF099706F27B",
162162
"usageAsCollateralEnabled": true,
@@ -297,25 +297,25 @@
297297
"previousValue": "0x0000000000000000000000000000000000000000000000090000000000000000",
298298
"newValue": "0x00000000000000000000000000000000000000000000000a0000000000000000"
299299
},
300-
"0x50039cf134a124858bd88bbc9225ec3c537b89a0e9237ce39fe1813e6edf8257": {
301-
"previousValue": "0x0000000000000000000000000000000000000000000000000000284622c42134",
302-
"newValue": "0x0000000000000000000000000000000000000000000000000200283c23f02328"
300+
"0x748ad6d0c5a24a04515706b6da6a7b0cb9e1a9408b9f3a5672a42f933d02d13e": {
301+
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
302+
"newValue": "0x00000000000000000000000017418038ecf73ba4026c4f428547bf099706f27b"
303+
},
304+
"0x81d0999fde243adcc41b7fa1be5cea14f789e3a6065b815ac58f4bc0838c3155": {
305+
"previousValue": "0x000000000000000000000000000000000000000000000000000029fe1edc1c20",
306+
"newValue": "0x00000000000000000000000000000000000000000000000002002a941e781a90"
303307
},
304-
"0x50039cf134a124858bd88bbc9225ec3c537b89a0e9237ce39fe1813e6edf8258": {
308+
"0x81d0999fde243adcc41b7fa1be5cea14f789e3a6065b815ac58f4bc0838c3156": {
305309
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
306310
"newValue": "0x41435245442047484f0000000000000000000000000000000000000000000012"
307311
},
308-
"0x50039cf134a124858bd88bbc9225ec3c537b89a0e9237ce39fe1813e6edf8259": {
312+
"0x81d0999fde243adcc41b7fa1be5cea14f789e3a6065b815ac58f4bc0838c3157": {
309313
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
310314
"newValue": "0x0000000000000000000000000000000000000000000000000000000000000001"
311315
},
312-
"0x748ad6d0c5a24a04515706b6da6a7b0cb9e1a9408b9f3a5672a42f933d02d13e": {
313-
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
314-
"newValue": "0x00000000000000000000000017418038ecf73ba4026c4f428547bf099706f27b"
315-
},
316316
"0xe7569c1de36b7b382c11b8838312b8b7a0397157bf8b3c82731f39ca7162a47e": {
317317
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",
318-
"newValue": "0x10000000000000000000000000000007d00000000000000001062a941db019c8"
318+
"newValue": "0x10000000000000000000000000000007530000000000000001062a941db019c8"
319319
},
320320
"0xe7569c1de36b7b382c11b8838312b8b7a0397157bf8b3c82731f39ca7162a47f": {
321321
"previousValue": "0x0000000000000000000000000000000000000000000000000000000000000000",

foundry.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ out = 'out/prague'
2222
evm_version = 'prague'
2323
cache_path = 'cache/prague'
2424

25-
[profile.mainnet]
26-
evm_version = 'shanghai'
27-
cache_path = 'cache/shanghai'
28-
2925
[profile.deploy]
3026
out = 'out/shanghai'
3127
evm_version = 'shanghai'

src/AaveV3Horizon_ACREDListing_20260217/AaveV3Horizon_ACREDListing_20260217.sol

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4-
import {AaveV3HorizonEthereum} from '../utils/AaveV3HorizonEthereum.sol';
5-
import {AaveV3PayloadHorizonEthereum} from '../utils/AaveV3PayloadHorizonEthereum.sol';
4+
import {AaveV3HorizonEthereum} from 'src/utils/AaveV3HorizonEthereum.sol';
5+
import {AaveV3PayloadHorizonEthereum} from 'src/utils/AaveV3PayloadHorizonEthereum.sol';
66
import {IAaveV3ConfigEngine as IEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol';
77
import {EngineFlags} from 'aave-v3-origin/contracts/extensions/v3-config-engine/EngineFlags.sol';
88

@@ -15,7 +15,7 @@ import {EngineFlags} from 'aave-v3-origin/contracts/extensions/v3-config-engine/
1515
contract AaveV3Horizon_ACREDListing_20260217 is AaveV3PayloadHorizonEthereum {
1616
address public constant ACRED = 0x17418038ecF73BA4026c4f428547BF099706F27B;
1717
address public constant ACRED_PRICE_FEED = 0x60AEd7d20AC6328f7BA771aD58931c996aff30E8;
18-
uint8 public constant ACRED_EMODE_CATEGORY = 5;
18+
uint8 public constant ACRED_EMODE_CATEGORY = 3;
1919

2020
function newListingsCustom()
2121
public
@@ -30,12 +30,7 @@ contract AaveV3Horizon_ACREDListing_20260217 is AaveV3PayloadHorizonEthereum {
3030
asset: ACRED,
3131
assetSymbol: 'ACRED',
3232
priceFeed: ACRED_PRICE_FEED,
33-
rateStrategyParams: IEngine.InterestRateInputData({
34-
optimalUsageRatio: 99_00,
35-
baseVariableBorrowRate: 0,
36-
variableRateSlope1: 0,
37-
variableRateSlope2: 0
38-
}),
33+
rateStrategyParams: AaveV3HorizonEthereum.defaultRwaInterestRateInputData(),
3934
enabledToBorrow: EngineFlags.DISABLED,
4035
borrowableInIsolation: EngineFlags.DISABLED,
4136
withSiloedBorrowing: EngineFlags.DISABLED,
@@ -44,7 +39,7 @@ contract AaveV3Horizon_ACREDListing_20260217 is AaveV3PayloadHorizonEthereum {
4439
liqThreshold: 76_00,
4540
liqBonus: 9_00,
4641
reserveFactor: EngineFlags.KEEP_CURRENT,
47-
supplyCap: 32_000,
42+
supplyCap: 30_000,
4843
borrowCap: 0,
4944
debtCeiling: 0,
5045
liqProtocolFee: 0
@@ -91,9 +86,9 @@ contract AaveV3Horizon_ACREDListing_20260217 is AaveV3PayloadHorizonEthereum {
9186
// ACRED GHO
9287
eModeCategories[0] = IEngine.EModeCategoryUpdate({
9388
eModeCategory: ACRED_EMODE_CATEGORY,
94-
ltv: 90_00,
95-
liqThreshold: 92_00,
96-
liqBonus: 3_00,
89+
ltv: 68_00,
90+
liqThreshold: 78_00,
91+
liqBonus: 9_00,
9792
label: 'ACRED GHO'
9893
});
9994

src/AaveV3Horizon_ACREDListing_20260217/AaveV3Horizon_ACREDListing_20260217.t.sol

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
pragma solidity ^0.8.0;
33

44
import {IPool} from 'aave-v3-origin/contracts/interfaces/IPool.sol';
5+
import {IDefaultInterestRateStrategyV2} from 'aave-v3-origin/contracts/interfaces/IDefaultInterestRateStrategyV2.sol';
56
import {AaveV3HorizonEthereum} from 'src/utils/AaveV3HorizonEthereum.sol';
6-
import {ProtocolV3HorizonTestBase, ReserveConfig} from 'src/utils/ProtocolV3HorizonTestBase.sol';
7-
import {HorizonConfigAssertionHelper} from 'src/utils/HorizonConfigAssertionHelper.sol';
7+
import {ProtocolV3HorizonTestBase, ReserveConfig} from 'tests/utils/ProtocolV3HorizonTestBase.sol';
8+
import {HorizonConfigAssertionHelper} from 'tests/utils/HorizonConfigAssertionHelper.sol';
89
import {AaveV3Horizon_ACREDListing_20260217} from 'src/AaveV3Horizon_ACREDListing_20260217/AaveV3Horizon_ACREDListing_20260217.sol';
910

1011
/**
@@ -27,7 +28,7 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
2728
/**
2829
* @dev executes the generic test suite including e2e and config snapshots
2930
*/
30-
function test_defaultProposalExecution() public {
31+
function test_defaultProposalExecution() public virtual {
3132
defaultTest_v3_3(
3233
'AaveV3Horizon_ACREDListing_20260217',
3334
IPool(AaveV3HorizonEthereum.POOL),
@@ -41,14 +42,14 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
4142
function test_acredConfig() public {
4243
IPool pool = IPool(AaveV3HorizonEthereum.POOL);
4344

44-
// check eMode 5 before execution (pool default values, no label/assets)
45+
// check eMode 3 before execution (has config values but no assets assigned)
4546
_assertEModeConfig(
4647
pool,
4748
ExpectedEModeConfig({
48-
eModeCategory: 5,
49-
ltv: 85_00,
50-
liquidationThreshold: 89_00,
51-
liquidationBonus: 100_00 + 3_10,
49+
eModeCategory: 3,
50+
ltv: 72_00,
51+
liquidationThreshold: 79_00,
52+
liquidationBonus: 100_00 + 7_50,
5253
label: '',
5354
collateralAssets: new address[](0),
5455
borrowableAssets: new address[](0)
@@ -61,7 +62,7 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
6162
// verify ACRED asset config
6263
_assertAssetConfig(pool, expectedAssetConfig);
6364

64-
// verify eMode 5 = ACRED GHO after execution
65+
// verify eMode 3 = ACRED GHO after execution
6566
_assertEModeConfig(pool, expectedEModeConfig);
6667
}
6768

@@ -74,7 +75,7 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
7475
aTokenSymbol: 'aHorRwaACRED',
7576
variableDebtTokenName: 'Aave Horizon RWA Variable Debt ACRED',
7677
variableDebtTokenSymbol: 'variableDebtHorRwaACRED',
77-
supplyCap: 32_000,
78+
supplyCap: 30_000,
7879
borrowCap: 0,
7980
reserveFactor: 0,
8081
borrowingEnabled: false,
@@ -84,16 +85,18 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
8485
liquidationBonus: 100_00 + 9_00,
8586
debtCeiling: 0,
8687
liqProtocolFee: 0,
87-
optimalUsageRatio: 99_00,
88-
baseVariableBorrowRate: 0,
89-
variableRateSlope1: 0,
90-
variableRateSlope2: 0
88+
rateData: IDefaultInterestRateStrategyV2.InterestRateData({
89+
optimalUsageRatio: 99_00,
90+
baseVariableBorrowRate: 0,
91+
variableRateSlope1: 0,
92+
variableRateSlope2: 0
93+
})
9194
});
9295
expectedEModeConfig = ExpectedEModeConfig({
93-
eModeCategory: 5,
94-
ltv: 90_00,
95-
liquidationThreshold: 92_00,
96-
liquidationBonus: 100_00 + 3_00,
96+
eModeCategory: 3,
97+
ltv: 68_00,
98+
liquidationThreshold: 78_00,
99+
liquidationBonus: 100_00 + 9_00,
97100
label: 'ACRED GHO',
98101
collateralAssets: _toAddressArray(AaveV3HorizonEthereum.ACRED_UNDERLYING),
99102
borrowableAssets: _toAddressArray(AaveV3HorizonEthereum.GHO_UNDERLYING)
@@ -103,7 +106,7 @@ contract AaveV3Horizon_ACREDListing_20260217_Test is ProtocolV3HorizonTestBase {
103106

104107
/**
105108
* @dev Post-execution fork test. Run after the payload has been executed on mainnet
106-
* to validate the live state matches expected config.
109+
* to validate the live state matches expected config and run full E2E.
107110
* command: FOUNDRY_PROFILE=test forge test --match-contract AaveV3Horizon_ACREDListing_20260217_PostExecution_Test -vv
108111
*/
109112
contract AaveV3Horizon_ACREDListing_20260217_PostExecution_Test is
@@ -116,9 +119,16 @@ contract AaveV3Horizon_ACREDListing_20260217_PostExecution_Test is
116119
vm.createSelectFork(vm.rpcUrl('mainnet'));
117120
}
118121

122+
function test_defaultPostExecution() public {
123+
defaultTest_v3_3_postExecution(IPool(AaveV3HorizonEthereum.POOL));
124+
}
125+
119126
function test_acredConfigPostExecution() public {
120127
IPool pool = IPool(AaveV3HorizonEthereum.POOL);
121128
_assertAssetConfig(pool, expectedAssetConfig);
122129
_assertEModeConfig(pool, expectedEModeConfig);
123130
}
131+
132+
// no payload to execute post-deployment
133+
function test_defaultProposalExecution() public override {}
124134
}

src/utils/AaveV3HorizonEthereum.sol

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.0;
33

4+
import {IAaveV3ConfigEngine as IEngine} from 'aave-v3-origin/contracts/extensions/v3-config-engine/IAaveV3ConfigEngine.sol';
5+
46
library AaveV3HorizonEthereum {
7+
function defaultRwaInterestRateInputData()
8+
internal
9+
pure
10+
returns (IEngine.InterestRateInputData memory)
11+
{
12+
return
13+
IEngine.InterestRateInputData({
14+
optimalUsageRatio: 99_00,
15+
baseVariableBorrowRate: 0,
16+
variableRateSlope1: 0,
17+
variableRateSlope2: 0
18+
});
19+
}
20+
521
// executor roles
622
address public constant HORIZON_OPS = 0xE6ec1f0Ae6Cd023bd0a9B4d0253BDC755103253c;
723
address public constant HORIZON_EMERGENCY = 0x13B57382c36BAB566E75C72303622AF29E27e1d3;

0 commit comments

Comments
 (0)