Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Magic numbers in `FestivalPass` should be constants

Magic numbers in FestivalPass should be constants

FestivalPass:buyPass uses magic numbers for the bonus BeatTokens to be given to VIP and BACKSTAGE pass purchases. Using clearly defined constants is a better practice and more clear

Recommended Mitigation

+ // BeatToken Bonuses
+ uint256 constant VIP_PASS_BONUS = 5e18;
+ uint256 constant BACKSTAGE_PASS_BONUS = 15e18;
...
function buyPass(uint256 collectionId) external payable {
...
- uint256 bonus = (collectionId == VIP_PASS) ? 5e18 : (collectionId == BACKSTAGE_PASS) ? 15e18 : 0;
+ uint256 bonus = (collectionId == VIP_PASS) ? VIP_PASS_BONUS : (collectionId == BACKSTAGE_PASS) ? BACKSTAGE_PASS_BONUS : 0;
}
Updates

Lead Judging Commences

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