Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Wrong in determining `rarity`

Summary

Wrong in determining the rarity

Vulnerability Details

else if (rarity <= COMMON_RARITY + RARE_RARITY) to calculate the rare rarity is wrong
This else if statement to calculate rare rarity is not true because it makes the rare rarity likely to happen more than the COMMON_RARITY

Impact

Causes the RARE_RARITY' happens more than COMMON_RARITYmakes raffle become very easy to draw aRARE_RARITY=> causes a lot of money for paying that kind of rarity` to the user.

Tools Used

Manual
Foundry

Recommendations

if (rarity <= COMMON_RARITY) {
tokenIdToRarity[tokenId] = COMMON_RARITY;
- } else if (rarity <= COMMON_RARITY + RARE_RARITY) {
+ else if ( COMMON_RARITY<rarity<=COMMON_RARITY + RARE_RARITY) {
//BUG COMMON_RARITY<rarity<=COMMON_RARITY + RARE_RARITY
tokenIdToRarity[tokenId] = RARE_RARITY;
} else {
tokenIdToRarity[tokenId] = LEGENDARY_RARITY;
}
Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

wrong nft rarity

71% 25% 4%

Support

FAQs

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