Raisebox Faucet

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

[L-3] Public Function Should Be External

[L-3] Public Function Should Be External

Description

  • Normal behavior: Functions that are not called internally can be declared external to save gas.

  • Specific issue: several public view/non-mutating functions and owner-only functions are never used internally.

@> function mintFaucetTokens(address to, uint256 amount) public onlyOwner { ... }
@> function getBalance(address user) public view returns (uint256) { ... }
//.etc

Risk

Likelihood:High

  • Developer oversight leaves functions public during development.

  • No runtime exploitation, only gas inefficiency.

Impact:Low

  • Slightly higher gas costs when calls are made externally.

Proof of Concept

// Change visibility to external and measure gas for external calls.

Recommended Mitigation

- function getBalance(address user) public view returns (uint256) {
+ function getBalance(address user) external view returns (uint256) {
...
//.etc
Updates

Lead Judging Commences

inallhonesty Lead Judge 6 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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