Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

[Informational / Gas optimization] Function Visibility – Change public to external

In Solidity, functions marked as public can be called both internally and externally. However, if a function is never called internally, marking it as external can slightly reduce gas usage and improve semantic clarity.

Affected Functions

The following functions are only meant to be called externally and should be marked external instead of public:

addTeacher()
removeTeacher()
expel()
startSession()
giveReview()
graduateAndUpgrade()

Recommendation
Change function visibility from public to external for the listed functions:

function addTeacher(...) external { ... }

This small change improves gas efficiency during contract interactions and clarifies that these functions are not intended for internal calls.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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