Beginner FriendlyFoundryDeFiOracle
100 EXP
View results
Submission Details
Severity: low
Invalid

Unused Function in OracleUpgradeable.sol

Summary

During a manual review of the OracleUpgradeable.sol contract, it was identified that the external function getPrice() is not utilized by other contracts within the protocol. This function merely calls the getPriceInWeth() function, which is publicly accessible and actively employed throughout the protocol. Consequently, the getPrice() function's presence serves no purpose, resulting in unnecessary gas consumption during contract deployment and a potential source of confusion for both users and developers.

Vulnerability Details

This issue constitutes a low-priority concern related to code efficiency and redundancy. The getPrice() function in OracleUpgradeable.sol is redundant and results in wasted gas during deployment without contributing to the protocol's functionality. The function could be removed without any adverse impact on the system.

Here is the relevant code:

function getPrice(address token) external view returns (uint256) {
return getPriceInWeth(token);
}

Impact

The impact of this issue is assessed as low. While it doesn't pose any immediate security risks, the unnecessary function consumes additional gas during contract deployment. Removing the redundant function would enhance the efficiency of the protocol and make the codebase more readable.

Tools Used

Manual Review

Recommendations

It is recommended to remove the redundant getPrice() function from OracleUpgradeable.sol. This action will not only save gas during deployment but also improve the contract's clarity and ease of use for both developers and users.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Gas optimizations

Support

FAQs

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