Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 5cc92e8

Browse files
authored
Merge pull request #24 from aave/fix/uiPoolDataProvider-order
fix: fix order of fields
2 parents 4cf6f3a + 58534d3 commit 5cc92e8

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

contracts/misc/UiPoolDataProvider.sol

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
107107
//address of the interest rate strategy
108108
reserveData.interestRateStrategyAddress = baseData.interestRateStrategyAddress;
109109
reserveData.priceInMarketReferenceCurrency = oracle.getAssetPrice(reserveData.underlyingAsset);
110-
reserveData.unbacked = baseData.unbacked;
111-
reserveData.isolationModeTotalDebt = baseData.isolationModeTotalDebt;
112-
reserveData.accruedToTreasury = baseData.accruedToTreasury;
113110

114111
reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf(
115112
reserveData.aTokenAddress
@@ -131,21 +128,8 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
131128
reserveData.symbol = IERC20Detailed(reserveData.underlyingAsset).symbol();
132129
}
133130

134-
(
135-
reserveData.variableRateSlope1,
136-
reserveData.variableRateSlope2,
137-
reserveData.stableRateSlope1,
138-
reserveData.stableRateSlope2
139-
) = getInterestRateStrategySlopes(
140-
DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress)
141-
);
142-
143131
//stores the reserve configuration
144132
DataTypes.ReserveConfigurationMap memory reserveConfigurationMap = baseData.configuration;
145-
reserveData.debtCeiling = reserveConfigurationMap.getDebtCeiling();
146-
reserveData.debtCeilingDecimals = poolDataProvider.getDebtCeilingDecimals();
147-
(reserveData.borrowCap, reserveData.supplyCap) = reserveConfigurationMap.getCaps();
148-
149133
uint256 eModeCategoryId;
150134
(
151135
reserveData.baseLTVasCollateral,
@@ -155,17 +139,37 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
155139
reserveData.reserveFactor,
156140
eModeCategoryId
157141
) = reserveConfigurationMap.getParams();
158-
reserveData.eModeCategoryId = uint8(eModeCategoryId);
159142
reserveData.usageAsCollateralEnabled = reserveData.baseLTVasCollateral != 0;
160143

144+
bool isPaused;
161145
(
162146
reserveData.isActive,
163147
reserveData.isFrozen,
164148
reserveData.borrowingEnabled,
165149
reserveData.stableBorrowRateEnabled,
166-
reserveData.isPaused
150+
isPaused
167151
) = reserveConfigurationMap.getFlags();
168-
152+
153+
(
154+
reserveData.variableRateSlope1,
155+
reserveData.variableRateSlope2,
156+
reserveData.stableRateSlope1,
157+
reserveData.stableRateSlope2
158+
) = getInterestRateStrategySlopes(
159+
DefaultReserveInterestRateStrategy(reserveData.interestRateStrategyAddress)
160+
);
161+
162+
// v3 only
163+
reserveData.eModeCategoryId = uint8(eModeCategoryId);
164+
reserveData.debtCeiling = reserveConfigurationMap.getDebtCeiling();
165+
reserveData.debtCeilingDecimals = poolDataProvider.getDebtCeilingDecimals();
166+
(reserveData.borrowCap, reserveData.supplyCap) = reserveConfigurationMap.getCaps();
167+
168+
reserveData.isPaused = isPaused;
169+
reserveData.unbacked = baseData.unbacked;
170+
reserveData.isolationModeTotalDebt = baseData.isolationModeTotalDebt;
171+
reserveData.accruedToTreasury = baseData.accruedToTreasury;
172+
169173
DataTypes.EModeCategory memory categoryData = pool.getEModeCategoryData(reserveData.eModeCategoryId);
170174
reserveData.eModeLtv = categoryData.ltv;
171175
reserveData.eModeLiquidationThreshold = categoryData.liquidationThreshold;

contracts/misc/interfaces/IUiPoolDataProvider.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ interface IUiPoolDataProvider {
1919
bool stableBorrowRateEnabled;
2020
bool isActive;
2121
bool isFrozen;
22-
bool isPaused;
2322
// base data
2423
uint128 liquidityIndex;
2524
uint128 variableBorrowIndex;
@@ -38,12 +37,12 @@ interface IUiPoolDataProvider {
3837
uint256 stableDebtLastUpdateTimestamp;
3938
uint256 totalScaledVariableDebt;
4039
uint256 priceInMarketReferenceCurrency;
41-
//
4240
uint256 variableRateSlope1;
4341
uint256 variableRateSlope2;
4442
uint256 stableRateSlope1;
4543
uint256 stableRateSlope2;
46-
//
44+
// v3 only
45+
bool isPaused;
4746
uint128 accruedToTreasury;
4847
uint128 unbacked;
4948
uint128 isolationModeTotalDebt;

0 commit comments

Comments
 (0)