feat: Added borrowCap to enableBorrowing Configurato

This commit is contained in:
Hadrien Charlanes 2021-04-27 19:08:49 +02:00
parent 9a8eb294a0
commit 6054fa0bd5
2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,7 @@ contract ATokensAndRatesHelper is Ownable {
uint256 liquidationThreshold; uint256 liquidationThreshold;
uint256 liquidationBonus; uint256 liquidationBonus;
uint256 reserveFactor; uint256 reserveFactor;
uint256 borrowCap;
bool stableBorrowingEnabled; bool stableBorrowingEnabled;
} }
@ -75,6 +76,7 @@ contract ATokensAndRatesHelper is Ownable {
configurator.enableBorrowingOnReserve( configurator.enableBorrowingOnReserve(
inputParams[i].asset, inputParams[i].asset,
inputParams[i].borrowCap,
inputParams[i].stableBorrowingEnabled inputParams[i].stableBorrowingEnabled
); );
configurator.setReserveFactor(inputParams[i].asset, inputParams[i].reserveFactor); configurator.setReserveFactor(inputParams[i].asset, inputParams[i].reserveFactor);

View File

@ -248,13 +248,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
* @param asset The address of the underlying asset of the reserve * @param asset The address of the underlying asset of the reserve
* @param stableBorrowRateEnabled True if stable borrow rate needs to be enabled by default on this reserve * @param stableBorrowRateEnabled True if stable borrow rate needs to be enabled by default on this reserve
**/ **/
function enableBorrowingOnReserve(address asset, bool stableBorrowRateEnabled) function enableBorrowingOnReserve(address asset, uint256 borrowCap, bool stableBorrowRateEnabled)
external external
onlyPoolAdmin onlyPoolAdmin
{ {
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset); DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
currentConfig.setBorrowingEnabled(true); currentConfig.setBorrowingEnabled(true);
currentConfig.setBorrowCap(borrowCap);
currentConfig.setStableRateBorrowingEnabled(stableBorrowRateEnabled); currentConfig.setStableRateBorrowingEnabled(stableBorrowRateEnabled);
pool.setConfiguration(asset, currentConfig.data); pool.setConfiguration(asset, currentConfig.data);