MyCut

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

Inconsistent Naming Convention For Constant Variable

Summary

The variable managerCutPercent is defined as a constant but is not written in uppercase as per Solidity's style guide recommendations.

Vulnerability Details

Affected code - https://github.com/Cyfrin/2024-08-MyCut/blob/946231db0fe717039429a11706717be568d03b54/src/Pot.sol#L20

In the Solidity code, the constant variable managerCutPercent is defined as:

uint256 private constant managerCutPercent = 10;

According to the Solidity style guide, constant variables should be named using uppercase letters with underscores separating words. This ensures clarity and consistency in the code, making it easier for developers to identify constants at a glance.

Impact

This issue does not pose a direct security threat but affects code readability and maintainability. Failing to adhere to naming conventions can lead to confusion among developers, especially in larger projects where consistent naming is crucial for understanding and managing the codebase.

Tools Used

Manual Review

Recommendations

To resolve this issue, rename the constant variable managerCutPercent to follow the recommended naming convention. The revised code should look like this:

uint256 private constant MANAGER_CUT_PERCENT = 10;

This change will align the code with the Solidity style guide and improve the overall readability and maintainability of the smart contract. See the Solidity Naming Convensions for more info.

Updates

Lead Judging Commences

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

Appeal created

Hoover Submitter
about 1 year ago
equious Lead Judge
about 1 year ago
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.