mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix: configurator: added event borrowCapChanged in enableBorrowingOnReserve function
This commit is contained in:
parent
3656bee3a1
commit
56bf996885
|
@ -151,7 +151,8 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
|
||||
(, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParamsMemory();
|
||||
|
||||
bytes memory encodedCall = abi.encodeWithSelector(
|
||||
bytes memory encodedCall =
|
||||
abi.encodeWithSelector(
|
||||
IInitializableAToken.initialize.selector,
|
||||
cachedPool,
|
||||
input.treasury,
|
||||
|
@ -163,11 +164,7 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
input.params
|
||||
);
|
||||
|
||||
_upgradeTokenImplementation(
|
||||
reserveData.aTokenAddress,
|
||||
input.implementation,
|
||||
encodedCall
|
||||
);
|
||||
_upgradeTokenImplementation(reserveData.aTokenAddress, input.implementation, encodedCall);
|
||||
|
||||
emit ATokenUpgraded(input.asset, reserveData.aTokenAddress, input.implementation);
|
||||
}
|
||||
|
@ -179,10 +176,11 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
ILendingPool cachedPool = pool;
|
||||
|
||||
DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(input.asset);
|
||||
|
||||
|
||||
(, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParamsMemory();
|
||||
|
||||
bytes memory encodedCall = abi.encodeWithSelector(
|
||||
bytes memory encodedCall =
|
||||
abi.encodeWithSelector(
|
||||
IInitializableDebtToken.initialize.selector,
|
||||
cachedPool,
|
||||
input.asset,
|
||||
|
@ -209,17 +207,15 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
/**
|
||||
* @dev Updates the variable debt token implementation for the asset
|
||||
**/
|
||||
function updateVariableDebtToken(UpdateDebtTokenInput calldata input)
|
||||
external
|
||||
onlyPoolAdmin
|
||||
{
|
||||
function updateVariableDebtToken(UpdateDebtTokenInput calldata input) external onlyPoolAdmin {
|
||||
ILendingPool cachedPool = pool;
|
||||
|
||||
DataTypes.ReserveData memory reserveData = cachedPool.getReserveData(input.asset);
|
||||
|
||||
(, , , uint256 decimals, ) = cachedPool.getConfiguration(input.asset).getParamsMemory();
|
||||
|
||||
bytes memory encodedCall = abi.encodeWithSelector(
|
||||
bytes memory encodedCall =
|
||||
abi.encodeWithSelector(
|
||||
IInitializableDebtToken.initialize.selector,
|
||||
cachedPool,
|
||||
input.asset,
|
||||
|
@ -248,10 +244,11 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
* @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
|
||||
**/
|
||||
function enableBorrowingOnReserve(address asset, uint256 borrowCap, bool stableBorrowRateEnabled)
|
||||
external
|
||||
onlyPoolAdmin
|
||||
{
|
||||
function enableBorrowingOnReserve(
|
||||
address asset,
|
||||
uint256 borrowCap,
|
||||
bool stableBorrowRateEnabled
|
||||
) external onlyPoolAdmin {
|
||||
DataTypes.ReserveConfigurationMap memory currentConfig = pool.getConfiguration(asset);
|
||||
|
||||
currentConfig.setBorrowingEnabled(true);
|
||||
|
@ -260,6 +257,7 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
|
||||
pool.setConfiguration(asset, currentConfig.data);
|
||||
|
||||
emit BorrowCapChanged(asset, borrowCap);
|
||||
emit BorrowingEnabledOnReserve(asset, stableBorrowRateEnabled);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user