Sablier

Sablier
DeFiFoundry
53,440 USDC
View results
Submission Details
Severity: low
Invalid

`public` functions not used internally could be marked `external`

Summary

This report evaluates the optimization potential of marking unused public functions as external if they are not utilized internally within the smart contract code. The aim is to optimize clarity in the contract code, ensure appropriate function scoping, and potentially optimize gas costs.

Vulnerability Details

The vulnerability lies in the potential inefficiency and lack of clarity caused by having unused public functions that could be marked as external. By default, Solidity functions are public, meaning they can be accessed internally within the contract and externally by other contracts. However, if a function is not used internally within the contract, it may be more appropriate to mark it as external to clarify its intended usage and potentially save gas costs.

Impact

The impact of not marking unused public functions as external includes:

  • Gas Inefficiency: Unused public functions that remain public may incur unnecessary gas costs when deployed, as they are callable externally even if they are not intended to be.

  • Code Clarity: Leaving unused functions as public may lead to confusion for developers reviewing the contract code, as it may not be clear whether the function is meant to be externally callable.

Tools Used

Manual code review

Recommendations

Evaluate unused public functions and consider marking them as external if they are not utilized internally within the contract code.

Updates

Lead Judging Commences

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

Info/Gas/Invalid as per Docs

https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity

Support

FAQs

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