mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
refactor: created separate function to get Reserve Borrow cap, so interface for getReserveConfiguration remains identical
This commit is contained in:
parent
4ce1bfcb8c
commit
a869be648b
|
@ -73,7 +73,6 @@ contract AaveProtocolDataProvider {
|
|||
uint256 liquidationThreshold,
|
||||
uint256 liquidationBonus,
|
||||
uint256 reserveFactor,
|
||||
uint256 borrowCap,
|
||||
bool usageAsCollateralEnabled,
|
||||
bool borrowingEnabled,
|
||||
bool stableBorrowRateEnabled,
|
||||
|
@ -81,19 +80,28 @@ contract AaveProtocolDataProvider {
|
|||
bool isFrozen
|
||||
)
|
||||
{
|
||||
DataTypes.ReserveConfigurationMap memory configuration =
|
||||
ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getConfiguration(asset);
|
||||
|
||||
(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor, ) =
|
||||
ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
||||
.getConfiguration(asset)
|
||||
.getParamsMemory();
|
||||
configuration.getParamsMemory();
|
||||
|
||||
(isActive, isFrozen, borrowingEnabled, stableBorrowRateEnabled) =
|
||||
ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
||||
.getConfiguration(asset)
|
||||
.getFlagsMemory();
|
||||
configuration.getFlagsMemory();
|
||||
|
||||
usageAsCollateralEnabled = liquidationThreshold > 0;
|
||||
}
|
||||
|
||||
function getReserveBorrowCap(address asset)
|
||||
external
|
||||
view
|
||||
returns (uint256 borrowCap) {
|
||||
|
||||
(, , , , , borrowCap) = ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
||||
.getConfiguration(asset)
|
||||
.getParamsMemory();
|
||||
}
|
||||
|
||||
function getReserveData(address asset)
|
||||
external
|
||||
view
|
||||
|
|
Loading…
Reference in New Issue
Block a user