15,000 USDC
View results
Submission Details
Severity: gas

Private and Internal Functions

Summary

Some functions used internally are marked as private whereas others are marked as internal

Vulnerability Details

Functions _revertIfHealthFactorIsBroken(address user) and _calculateHealthFactor(uint256 totalDscMinted, uint256 collateralValueInUsd) are marked as internal whereas,
Functions _healthFactor(address user), _getAccountInformation(address user), _redeemCollateral(...)., etc are marked as private.
However there is no justification to differentiate these functions

Impact

Informational: These functions are consumed in the contract and there is no indication they will be useful for any contract that may derive from DSCEngine.sol. It is recommended that function visibility be as strict as possible unless if there is need for otherwise. This allows for better code quality, readability and maintainability.

Tools Used

Manual Analysis

Recommendations

It is recommended to make these internal functions as strict as possible "private" in this case

Support

FAQs

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