gas

Misleading comment in DSCEngine._healthFactor

Reward

Total

24.49 USDC

Selected
24.49 USDC
Selected Submission

Misleading comment in DSCEngine._healthFactor

Severity

Low Risk

Summary

The _healthFactor method of DSCEngine contract is preceeded by the following comment:

/*
* Returns how close to liquidation a user is
* If a user goes below 1, then they can get liquidated
*/
function _healthFactor(address user) private view returns (uint256) {
    (uint256 totalDscMinted, uint256 collateralValueInUsd) = _getAccountInformation(user);
    return _calculateHealthFactor(totalDscMinted, collateralValueInUsd);
}

The comment implies that the minimal acceptable health factor for the user is equal to 1. This is not true - the MIN_HEALTH_FACTOR constant is equal to 1e18. Therefore this comment is misleading and in contradiction to the actual contract's logic.

Vulnerability Details

n/a

Impact

n/a

Tools Used

Manual review

Recommendations

Change the value in the comment to 1e18