Beatland Festival

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

Parameter naming inconsistency

Description:

The buyPass() function uses the parameter name collectionId to identify pass types, while the related configurePass() function uses passId for the same purpose. This naming inconsistency is misleading because the term "collectionId" is used elsewhere in the contract to refer to memorabilia collections (which have IDs starting from 100), while pass purchases deal with pass type IDs (1, 2, 3). The inconsistent naming conventions create confusion about the parameter's purpose and make the codebase harder to maintain and understand.

Recommended Mitigation:

Rename the parameter in buyPass() to match the naming convention used in configurePass():

function buyPass(uint256 passId) external payable {
// Must be valid pass ID (1 or 2 or 3)
require(
passId == GENERAL_PASS || passId == VIP_PASS || passId == BACKSTAGE_PASS,
"Invalid pass ID"
);
// Check payment and supply
require(msg.value == passPrice[passId], "Incorrect payment amount");
require(passSupply[passId] < passMaxSupply[passId], "Max supply reached");
// Mint 1 pass to buyer
_mint(msg.sender, passId, 1, "");
++passSupply[passId];
// ... rest of function logic
}

This change creates consistency across all pass-related functions and eliminates confusion with memorabilia collection terminology.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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