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 liquidationThreshold,
|
||||||
uint256 liquidationBonus,
|
uint256 liquidationBonus,
|
||||||
uint256 reserveFactor,
|
uint256 reserveFactor,
|
||||||
uint256 borrowCap,
|
|
||||||
bool usageAsCollateralEnabled,
|
bool usageAsCollateralEnabled,
|
||||||
bool borrowingEnabled,
|
bool borrowingEnabled,
|
||||||
bool stableBorrowRateEnabled,
|
bool stableBorrowRateEnabled,
|
||||||
|
@ -81,19 +80,28 @@ contract AaveProtocolDataProvider {
|
||||||
bool isFrozen
|
bool isFrozen
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
DataTypes.ReserveConfigurationMap memory configuration =
|
||||||
|
ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getConfiguration(asset);
|
||||||
|
|
||||||
(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor, ) =
|
(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor, ) =
|
||||||
ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
configuration.getParamsMemory();
|
||||||
.getConfiguration(asset)
|
|
||||||
.getParamsMemory();
|
|
||||||
|
|
||||||
(isActive, isFrozen, borrowingEnabled, stableBorrowRateEnabled) =
|
(isActive, isFrozen, borrowingEnabled, stableBorrowRateEnabled) =
|
||||||
ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
configuration.getFlagsMemory();
|
||||||
.getConfiguration(asset)
|
|
||||||
.getFlagsMemory();
|
|
||||||
|
|
||||||
usageAsCollateralEnabled = liquidationThreshold > 0;
|
usageAsCollateralEnabled = liquidationThreshold > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getReserveBorrowCap(address asset)
|
||||||
|
external
|
||||||
|
view
|
||||||
|
returns (uint256 borrowCap) {
|
||||||
|
|
||||||
|
(, , , , , borrowCap) = ILendingPool(ADDRESSES_PROVIDER.getLendingPool())
|
||||||
|
.getConfiguration(asset)
|
||||||
|
.getParamsMemory();
|
||||||
|
}
|
||||||
|
|
||||||
function getReserveData(address asset)
|
function getReserveData(address asset)
|
||||||
external
|
external
|
||||||
view
|
view
|
||||||
|
|
Loading…
Reference in New Issue
Block a user