feat: Added setBorrowCap in lendingpoolconfigurator

This commit is contained in:
Hadrien Charlanes 2021-04-29 09:51:37 +02:00
parent 32cfe739c7
commit a9fce4dd4b
2 changed files with 22 additions and 0 deletions

View File

@ -127,6 +127,13 @@ interface ILendingPoolConfigurator {
**/
event ReserveFactorChanged(address indexed asset, uint256 factor);
/**
* @dev Emitted when the borrow cap of a reserve is updated
* @param asset The address of the underlying asset of the reserve
* @param borrowCap The new borrow cap
**/
event BorrowCapChanged(address indexed asset, uint256 borrowCap);
/**
* @dev Emitted when the reserve decimals are updated
* @param asset The address of the underlying asset of the reserve

View File

@ -431,6 +431,21 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
emit ReserveFactorChanged(asset, reserveFactor);
}
/**
* @dev Updates the borrow cap of a reserve
* @param asset The address of the underlying asset of the reserve
* @param borrowCap The new borrow of the reserve
**/
function setBorrowCap(address asset, uint256 borrowCap) external onlyPoolAdmin {
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
currentConfig.setBorrowCap(borrowCap);
pool.setConfiguration(asset, currentConfig.data);
emit BorrowCapChanged(asset, borrowCap);
}
/**
* @dev Sets the interest rate strategy of a reserve
* @param asset The address of the underlying asset of the reserve