function _emitLiquidationSummaryEvent(LocalVariables_OuterLiquidationFunction memory vars) internal {
TokenAmount[] memory liquidatedColl = new TokenAmount[](vars.priceCache.collPrices.length);
for (uint i = 0; i < vars.priceCache.collPrices.length; i++) {
liquidatedColl[i] = TokenAmount(
vars.priceCache.collPrices[i].tokenAddress,
vars.tokensToRedistribute[i].amount // works because of the initialisation of the array (first debts, then colls) /// @audit Wrong comment
);
}
The comment looks wrong since the array fills in collaterals first and then debts
Impact
_emitLiquidationSummaryEvent
has the following comment https://github.com/blkswnStudio/ap/blob/8fab2b32b4f55efd92819bd1d0da9bed4b339e87/packages/contracts/contracts/LiquidationOperations.sol#L447-L455The comment looks wrong since the array fills in collaterals first and then debts
Mitigation
Check the comments and fix them