MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Using inadequate syntax when writing code can be confusing for someone reviewing the code, whether during integration or similar processes.

Summary

In the Pot.sol contract, the i_ prefix is incorrectly used for variables that are not immutable. This misuse can lead to confusion during code review and maintenance, as it contradicts established naming conventions.

Vulnerability Details

The following variables in the Pot.sol contract have been identified with the inappropriate use of the i_ prefix:

address[] private i_players;
uint256[] private i_rewards;

The i_ prefix is conventionally used to denote immutable variables — those that are set during deployment and cannot be changed afterward.

Impact

The use of the i_ prefix on mutable variables can mislead developers into thinking these variables are immutable. This misunderstanding can lead to potential errors in logic or improper assumptions during code integration, audits, or future development, thereby increasing the risk of introducing bugs.

Tools Used

  • Manual code review

  • Solidity development best practices

Recommendations

  1. Rename the Variables: Update the variable names to remove the i_ prefix from any non-immutable variables. For example:

    address[] private players;
    uint256[] private rewards;
  2. Follow Naming Conventions: Ensure that the i_ prefix is only used for immutable variables to maintain clarity and consistency in the codebase.

  3. Code Review: Perform a thorough code review to identify any other instances where naming conventions may have been incorrectly applied.

Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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