From 7a8ed009091901322b1590ff070336037e916d1f Mon Sep 17 00:00:00 2001 From: pol <> Date: Mon, 2 Nov 2020 11:54:21 +0100 Subject: [PATCH] principal and stable to total --- contracts/misc/IUiPoolDataProvider.sol | 6 +++--- contracts/misc/UiPoolDataProvider.sol | 17 ++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/contracts/misc/IUiPoolDataProvider.sol b/contracts/misc/IUiPoolDataProvider.sol index b668bd00..08e2731d 100644 --- a/contracts/misc/IUiPoolDataProvider.sol +++ b/contracts/misc/IUiPoolDataProvider.sol @@ -19,11 +19,11 @@ interface IUiPoolDataProvider { bool borrowingEnabled; bool stableBorrowRateEnabled; bool isActive; - bool isFreezed; + bool isFrozen; ReserveLogic.ReserveData baseData; uint256 availableLiquidity; - uint256 totalPrincipalStableDebt; - uint256 totalScaledVariableDebt; + uint256 totalStableDebt; + uint256 totalVariableDebt; uint256 utilizationRate; uint256 priceInEth; uint256 variableRateSlope1; diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index d41edae4..2f7ccf57 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -72,20 +72,11 @@ contract UiPoolDataProvider is IUiPoolDataProvider { reserveData.availableLiquidity = IERC20Detailed(reserveData.underlyingAsset).balanceOf( reserveData.baseData.aTokenAddress ); - reserveData.totalPrincipalStableDebt = IERC20Detailed( - reserveData - .baseData - .stableDebtTokenAddress - ) + reserveData.totalStableDebt = IERC20Detailed(reserveData.baseData.stableDebtTokenAddress) .totalSupply(); - reserveData.totalScaledVariableDebt = IERC20Detailed( - reserveData - .baseData - .variableDebtTokenAddress - ) + reserveData.totalVariableDebt = IERC20Detailed(reserveData.baseData.variableDebtTokenAddress) .totalSupply(); - uint256 totalBorrows = reserveData.totalPrincipalStableDebt + - reserveData.totalScaledVariableDebt; + uint256 totalBorrows = reserveData.totalStableDebt + reserveData.totalVariableDebt; reserveData.utilizationRate = totalBorrows == 0 ? 0 : totalBorrows.rayDiv(totalBorrows + reserveData.availableLiquidity); @@ -105,7 +96,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider { ) = reserveData.baseData.configuration.getParamsMemory(); ( reserveData.isActive, - reserveData.isFreezed, + reserveData.isFrozen, reserveData.borrowingEnabled, reserveData.stableBorrowRateEnabled ) = reserveData.baseData.configuration.getFlagsMemory();