15,000 USDC
View results
Submission Details
Severity: low
Valid

Health Factor check can be removed in DSCEngine::burnDsc

Summary

In DSCEngine::burnDsc function, the line in the link above checks and reverts if the burning of certain amount of DSC causes the health Factor to go below the MIN_HEALTH_FACTOR. However, this check seems unnecessary as when a user burns a certain amount of their DSC, the DSCEngine::_burnDsc private function reduces the Dsc balance of the user by that amount(see link #2) and in the formula that calculates the Health Factor(link #3), the dsc balance of the user is in the denominator. It means that when the collateral amount of user is divided by the reduced dsc balance, the value of health factor will only increase and improve it.

Recommendations

Remove the _revertIfHealthFactorIsBroken(msg.sender) line in DSCEngine::burnDsc to save a lot of gas by avoiding the unnecessary check

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.