TwentyOne

First Flight #29
Beginner FriendlyGameFiFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Public Functions Not Used Internally Could Be Marked `external`

Root Cause

Several functions are declared as public but are not called internally within the contract:

function startGame() public payable returns (uint256) { ... }
function hit() public { ... }
function call() public { ... }
function getPlayerCards(address player) public view returns (uint256[] memory) { ... }
function getDealerCards(address player) public view returns (uint256[] memory) { ... }

Impact

Using public visibility for functions that are not called internally consumes more gas when they are called externally due to the additional code generated to support internal calls.

Recommendations

  • Change Visibility to external: Mark functions as external if they are not called within the contract to optimize gas usage.

  • Review Function Calls: Ensure that none of the functions are intended for internal use before changing their visibility.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 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.