mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
fix: update behavior of finalizeTransfer() to proper emit the ReserveUsedAsCollateralDisabled event
This commit is contained in:
parent
9d12200b8c
commit
49db36726b
|
@ -725,7 +725,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
if (from != to) {
|
if (from != to) {
|
||||||
DataTypes.UserConfigurationMap storage fromConfig = _usersConfig[from];
|
DataTypes.UserConfigurationMap storage fromConfig = _usersConfig[from];
|
||||||
|
|
||||||
if (fromConfig.isUsingAsCollateral(reserveId) && fromConfig.isBorrowingAny()) {
|
if (fromConfig.isUsingAsCollateral(reserveId)) {
|
||||||
|
if (fromConfig.isBorrowingAny()) {
|
||||||
ValidationLogic.validateHealthFactor(
|
ValidationLogic.validateHealthFactor(
|
||||||
from,
|
from,
|
||||||
_reserves,
|
_reserves,
|
||||||
|
@ -735,11 +736,11 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
_addressesProvider.getPriceOracle()
|
_addressesProvider.getPriceOracle()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (balanceFromBefore.sub(amount) == 0) {
|
if (balanceFromBefore.sub(amount) == 0) {
|
||||||
fromConfig.setUsingAsCollateral(reserveId, false);
|
fromConfig.setUsingAsCollateral(reserveId, false);
|
||||||
emit ReserveUsedAsCollateralDisabled(asset, from);
|
emit ReserveUsedAsCollateralDisabled(asset, from);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (balanceToBefore == 0 && amount != 0) {
|
if (balanceToBefore == 0 && amount != 0) {
|
||||||
DataTypes.UserConfigurationMap storage toConfig = _usersConfig[to];
|
DataTypes.UserConfigurationMap storage toConfig = _usersConfig[to];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user