DeFiHardhat
12,000 USDC
View results
Submission Details
Severity: low
Invalid

public functions not used internally could be marked external

Summary

The function can only be called from outside the contract. It cannot be called internally or via another contract. Also external functions have a cheaper gas cost for calling as compared to public functions. This is because calling an external function involves a jump to a different context (i.e., the called contract), whereas calling a public function can be done within the same context.

Vulnerability Details

Please see "Proof of code" in GitHub file.

Impact

Marking public functions that are not used internally as "external" in Solidity can have several impacts, both in terms of code clarity and gas optimization

Tools Used

Aderyn

Recommendations

For public functions that are not used internally but are part of the contract's external interface, update their visibility modifiers from "public" to "external". This change clearly defines the contract's boundaries and optimizes gas usage.

Updates

Lead Judging Commences

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

Informational/Invalid

Support

FAQs

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