Updated liquidation

This commit is contained in:
The3D 2020-07-07 17:34:38 +02:00
parent 6b2764f760
commit 395e4aa3a7

View File

@ -214,6 +214,13 @@ contract LendingPoolLiquidationManager is ReentrancyGuard, VersionedInitializabl
}
//TODO Burn debt tokens
if(vars.userVariableDebt >= vars.actualAmountToLiquidate){
IVariableDebtToken(principalReserve.variableDebtTokenAddress).burn(_user, vars.actualAmountToLiquidate);
}
else {
IVariableDebtToken(principalReserve.variableDebtTokenAddress).burn(_user, vars.userVariableDebt);
IStableDebtToken(principalReserve.stableDebtTokenAddress).burn(_user, vars.actualAmountToLiquidate.sub(vars.userVariableDebt));
}
vars.collateralAtoken = AToken(collateralReserve.aTokenAddress);