Submitted by gpersoon
In function calculateSlippage of LibLiquidation.sol, the value of amountToReturn is calculated by subtracting to numbers. Later on it is checked to see if this value is negative. However, amountToReturn is an unsigned integer so it can never be negative. If a negative number would be attempted to be assigned, the code will revert, because solidity 0.8 checks for this. See LibLiquidation.sol L106.
Recommend double checking if amountToReturn could be negative. If this is the case, change the type of amountToReturn to int256 and add the appropriate type casts.
raymogg (Tracer) confirmed:
cemozerr (Judge) commented:
