Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

burnDSC - Optimization/Informational #1149

Open codehawks-bot opened 1 year ago

codehawks-bot commented 1 year ago

burnDSC - Optimization/Informational

Severity

Gas Optimization / Informational

Summary

the _revertIfHealthFactorIsBroken(msg.sender) in burnDSC function is redundant since it is used to burn user's minted DSC to improve user's health factor. So, we dont need this check because we are burning not minting.

Vulnerability Details

Impact

No potential impact

Tools Used

Manual Review

Recommendations

Remove _revertIfHealthFactorIsBroken(msg.sender) and maybe be return updated health factor after burning DSC. So, the user would know if their health factor is good or broken.