At the very end of liquidate
method, DSCEngine reverts if the msg.sender
's health factor is broken.
However, the state modifications inside liquidate
method do not affect the health factor of msg.sender
at all. The collateral amount is subtracted from user
's balance, as is s_DSCMinted
. Therefore the only effect this call has is that it prevents the users whose health factor was already broken from liquidating other users. If this is intended, please consider moving that line of code to the top of the method for gas optimization and strict CEI pattern following. If that was not intented, please consider removing the statement from the method.
n/a
Users with broken health factors can't liquidate other users, unnecessary gas consumption
Manual review
Depending on the intented business logic, consider moving the _revertIfHealthFactorIsBroken
call to the top of the method or removing it.
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.