TwentyOne

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

Single-Use Internal Functions Increase Gas Costs and Complexity

Root Cause

Some internal functions, such as addCardForDealer and initializeDeck, are only called once in the contract:

function initializeDeck(address player) internal { ... }

Impact

Having internal functions that are called only once adds unnecessary function call overhead, slightly increasing gas consumption and adding complexity to the contract's structure.

Recommendations

  • Inline Single-Use Functions: Incorporate the logic of these functions directly into the place where they are called to optimize gas usage and simplify the code.

  • Code Clarity: Ensure that inlining the functions does not negatively impact the readability of the code.

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.