15,000 USDC
View results
Submission Details
Severity: gas

Inconsistency usage named return variables

Summary

Some functions that return values make use of named return variables and others do not

Vulnerability Details

OracleLib.sol does not use named return variables
DSCEngine.sol line 300 uses a named return variables -> returns (uint256 totalDscMinted, uint256 collateralValueInUsd)
DSCEngine.sol line 350 uses a named return variables -> returns (uint256 totalCollateralValueInUsd)
DSCEngine.sol line 372 uses a named return variables -> returns (uint256 totalDscMinted, uint256 collateralValueInUsd)
DSCEngine.sol remaining functions does not use named return variables
DecentralizedStableCoin.sol does not use named return variables
There is no consistency, sound basis or explanation as to why the functions that make use of named return variables do so.

Impact

Informational: This leads to code quality issues, readability and maintainability issues. Consider case where functions have named return variables but a return is still used ignoring the return variables because developer expected all functions in code don't use named return variables etc

Tools Used

Manual Analysis

Recommendations

It is recommended

  1. To be consistent with use of named return variables and apply to all functions or not apply at all

  2. If applied to some functions it may be necessary to document why e.g all getter functions use named return variables etc

Support

FAQs

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