diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 3a774e1f..373c4214 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -3,6 +3,7 @@ pragma solidity ^0.6.8; import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; +import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; pragma experimental ABIEncoderV2; @@ -359,6 +360,8 @@ interface ILendingPool { view returns (ReserveConfiguration.Map memory); + function getUserConfiguration(address user) external view returns (UserConfiguration.Map memory); + function getReserveNormalizedIncome(address reserve) external view returns (uint256); function getReserveNormalizedVariableDebt(address reserve) external view returns (uint256); diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 7aed331c..948df2c9 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -720,6 +720,20 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage return _reserves[asset].configuration; } + /** + * @dev returns the configuration of the user for the specific reserve + * @param user the user + * @return the configuration of the user + **/ + function getUserConfiguration(address user) + external + override + view + returns (UserConfiguration.Map memory) + { + return _usersConfig[user]; + } + /** * @dev returns the normalized income per unit of asset * @param asset the address of the reserve @@ -969,5 +983,4 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage _reservesCount++; } } - } diff --git a/contracts/libraries/logic/GenericLogic.sol b/contracts/libraries/logic/GenericLogic.sol index 5c7dc3dc..e5135fc7 100644 --- a/contracts/libraries/logic/GenericLogic.sol +++ b/contracts/libraries/logic/GenericLogic.sol @@ -68,7 +68,7 @@ library GenericLogic { balanceDecreaseAllowedLocalVars memory vars; - (, vars.liquidationThreshold, , vars.decimals) = reservesData[asset].configuration.getParams(); + (, vars.liquidationThreshold, , vars.decimals, ) = reservesData[asset].configuration.getParams(); if (vars.liquidationThreshold == 0) { return true; //if reserve is not used as collateral, no reasons to block the transfer @@ -177,7 +177,7 @@ library GenericLogic { vars.currentReserveAddress = reserves[vars.i]; ReserveLogic.ReserveData storage currentReserve = reservesData[vars.currentReserveAddress]; - (vars.ltv, vars.liquidationThreshold, , vars.decimals) = currentReserve + (vars.ltv, vars.liquidationThreshold, , vars.decimals, ) = currentReserve .configuration .getParams();