15,000 USDC
View results
Submission Details
Severity: gas
Valid

Public function not called by the contract should be declared external instead

Summary

[G-10] Public function not called by the contract should be declared external instead

Contracts are allowed to override their parents' functions and change the visibility from external to public and can save gas by doing so.

file: /src/libraries/OracleLib.sol
21 function staleCheckLatestRoundData(AggregatorV3Interface priceFeed)
public
view
24 returns (uint80, int256, uint256, uint256, uint80)

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/libraries/OracleLib.sol#L21-L24

file: /src/libraries/OracleLib.sol
35 function getTimeout(AggregatorV3Interface /* chainlinkFeed */ ) public pure returns (uint256) {

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/main/src/libraries/OracleLib.sol#L35

Support

FAQs

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