mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: Added setBorrowCap in lendingpoolconfigurator
This commit is contained in:
parent
32cfe739c7
commit
a9fce4dd4b
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user