while liquidating a short via MarginCallPrimaryFacet.liquidate()
, _marginFeeHandler()
gets called to handle margin call fees ( tappFee and callerFee ). The logic is that TAPP should always be able to handle both the fees, however there is an edge case where TAPP will not be able to handle both the fees and the function will brick. This will prevent a short from being liquidated.
According to the docs:
Assuming that, a liquidator call MarginCallPrimaryFacet.liquidate()
to liquidate the short.
TAPP.ethEscrowed should be greater or equal to callerfee for everything to go smoothly.
In case TAPP.ethEscrowed is less than callerFee the function will brick, because of this logic
Short can not be liquidated because TAPP.ethEscrowed will underflow and brick the entire function
Manual review, VsCode
Maybe skip reducing TAPP.ethEscrowed -= m.totalFee; because TAPP do not have these fees to begin with, so substracting totalfee in this case is not important.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.