From 498a5b5e1fdcdb2f22248a9300e65bc68913689e Mon Sep 17 00:00:00 2001 From: pol <> Date: Mon, 2 Nov 2020 10:37:24 +0100 Subject: [PATCH] Renaming --- contracts/misc/IUiPoolDataProvider.sol | 10 +++++----- contracts/misc/UiPoolDataProvider.sol | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/contracts/misc/IUiPoolDataProvider.sol b/contracts/misc/IUiPoolDataProvider.sol index a09f210a..b668bd00 100644 --- a/contracts/misc/IUiPoolDataProvider.sol +++ b/contracts/misc/IUiPoolDataProvider.sol @@ -22,8 +22,8 @@ interface IUiPoolDataProvider { bool isFreezed; ReserveLogic.ReserveData baseData; uint256 availableLiquidity; - uint256 totalBorrowsStable; - uint256 totalBorrowsVariable; + uint256 totalPrincipalStableDebt; + uint256 totalScaledVariableDebt; uint256 utilizationRate; uint256 priceInEth; uint256 variableRateSlope1; @@ -39,11 +39,11 @@ interface IUiPoolDataProvider { struct UserReserveData { address underlyingAsset; - uint256 principalATokenBalance; + uint256 scaledATokenBalance; bool usageAsCollateralEnabledOnUser; uint256 stableBorrowRate; - uint256 principalVariableBorrows; - uint256 principalStableBorrows; + uint256 scaledVariableDebt; + uint256 principalStableDebt; uint256 stableBorrowLastUpdateTimestamp; } diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index 74a5bb34..d41edae4 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -72,15 +72,20 @@ contract UiPoolDataProvider is IUiPoolDataProvider { reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf( reserveData.baseData.aTokenAddress ); - reserveData.totalBorrowsStable = IERC20Detailed(reserveData.baseData.stableDebtTokenAddress) + reserveData.totalPrincipalStableDebt = IERC20Detailed( + reserveData + .baseData + .stableDebtTokenAddress + ) .totalSupply(); - reserveData.totalBorrowsVariable = IERC20Detailed( + reserveData.totalScaledVariableDebt = IERC20Detailed( reserveData .baseData .variableDebtTokenAddress ) .totalSupply(); - uint256 totalBorrows = reserveData.totalBorrowsStable + reserveData.totalBorrowsVariable; + uint256 totalBorrows = reserveData.totalPrincipalStableDebt + + reserveData.totalScaledVariableDebt; reserveData.utilizationRate = totalBorrows == 0 ? 0 : totalBorrows.rayDiv(totalBorrows + reserveData.availableLiquidity); @@ -117,24 +122,24 @@ contract UiPoolDataProvider is IUiPoolDataProvider { if (user != address(0)) { // user reserve data userReservesData[i].underlyingAsset = reserveData.underlyingAsset; - userReservesData[i].principalATokenBalance = IAToken(reserveData.baseData.aTokenAddress) + userReservesData[i].scaledATokenBalance = IAToken(reserveData.baseData.aTokenAddress) .scaledBalanceOf(user); userReservesData[i].usageAsCollateralEnabledOnUser = userConfig.isUsingAsCollateral(i); if (userConfig.isBorrowing(i)) { - userReservesData[i].principalVariableBorrows = IVariableDebtToken( + userReservesData[i].scaledVariableDebt = IVariableDebtToken( reserveData .baseData .variableDebtTokenAddress ) .scaledBalanceOf(user); - userReservesData[i].principalStableBorrows = IStableDebtToken( + userReservesData[i].principalStableDebt = IStableDebtToken( reserveData .baseData .stableDebtTokenAddress ) .principalBalanceOf(user); - if (userReservesData[i].principalStableBorrows != 0) { + if (userReservesData[i].principalStableDebt != 0) { userReservesData[i].stableBorrowRate = IStableDebtToken( reserveData .baseData