mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added getter for userconfiguration
This commit is contained in:
parent
645ea913b0
commit
b450a04642
|
@ -3,6 +3,7 @@ pragma solidity ^0.6.8;
|
||||||
|
|
||||||
import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol';
|
import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol';
|
||||||
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
|
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
|
||||||
|
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
|
||||||
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
|
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
|
||||||
|
|
||||||
pragma experimental ABIEncoderV2;
|
pragma experimental ABIEncoderV2;
|
||||||
|
@ -359,6 +360,8 @@ interface ILendingPool {
|
||||||
view
|
view
|
||||||
returns (ReserveConfiguration.Map memory);
|
returns (ReserveConfiguration.Map memory);
|
||||||
|
|
||||||
|
function getUserConfiguration(address user) external view returns (UserConfiguration.Map memory);
|
||||||
|
|
||||||
function getReserveNormalizedIncome(address reserve) external view returns (uint256);
|
function getReserveNormalizedIncome(address reserve) external view returns (uint256);
|
||||||
|
|
||||||
function getReserveNormalizedVariableDebt(address reserve) external view returns (uint256);
|
function getReserveNormalizedVariableDebt(address reserve) external view returns (uint256);
|
||||||
|
|
|
@ -720,6 +720,20 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
return _reserves[asset].configuration;
|
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
|
* @dev returns the normalized income per unit of asset
|
||||||
* @param asset the address of the reserve
|
* @param asset the address of the reserve
|
||||||
|
@ -969,5 +983,4 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
_reservesCount++;
|
_reservesCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ library GenericLogic {
|
||||||
|
|
||||||
balanceDecreaseAllowedLocalVars memory vars;
|
balanceDecreaseAllowedLocalVars memory vars;
|
||||||
|
|
||||||
(, vars.liquidationThreshold, , vars.decimals) = reservesData[asset].configuration.getParams();
|
(, vars.liquidationThreshold, , vars.decimals, ) = reservesData[asset].configuration.getParams();
|
||||||
|
|
||||||
if (vars.liquidationThreshold == 0) {
|
if (vars.liquidationThreshold == 0) {
|
||||||
return true; //if reserve is not used as collateral, no reasons to block the transfer
|
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];
|
vars.currentReserveAddress = reserves[vars.i];
|
||||||
ReserveLogic.ReserveData storage currentReserve = reservesData[vars.currentReserveAddress];
|
ReserveLogic.ReserveData storage currentReserve = reservesData[vars.currentReserveAddress];
|
||||||
|
|
||||||
(vars.ltv, vars.liquidationThreshold, , vars.decimals) = currentReserve
|
(vars.ltv, vars.liquidationThreshold, , vars.decimals, ) = currentReserve
|
||||||
.configuration
|
.configuration
|
||||||
.getParams();
|
.getParams();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user