DeFiFoundry
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Public Functions Not Used Internally Could Be Marked External

Summary

Public functions that are not used internally should be marked as external. For instance we see in file path: 2024-08-fjord/src/FjordStaking.sol Line: 339

Vulnerability Details

Visibility of functions affects how and where they can be accessed.

e.g.

Public functions can be called both internally (from within the same contract) and externally (from outside the contract).

External functions can only be called from outside the contract. They cannot be accessed internally unless called using the this keyword.

Impact

  1. Gas Efficiency: Public functions are more gas-expensive when called from outside the contract.

  2. Clarity and Intent: Using external clearly indicates that the function is intended to be called from outside the contract.

  3. Security: By marking functions as public, there is a risk of unintended internal calls.

Tools Used

Aderyn

Recommendations

Consider marking a function as external instead of public if it is not used internally.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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