NFTs of different rarity have the same chance of getting minted due to a bad logic implementation:
rarity: uint256 = random_words[0] % 3
from this line of code: rarity: uint256 = random_words[0] % 3
We can deduce that the chances of getting each of the 3 types of NFTs are equal (33.333...% each), unlike what the documentation stated:
70% of chance of getting a common NFT
25% of chance of getting a rare NFT
5% of chance of getting a legendary NFT
The winner will have equal chances of getting these NFTs
The protocol will have to mint more rare and ledengary NFTs than they expected, and less common NFTs.
Manual Analysis
Make the following changes:
rarity: uint256 = random_words[0] % 3
percentage: uint256 = random_words[0] % 100
rarity: uint256 = 0
if percentage < LEGEND_RARITY:
rarity = 2
elif percentage < RARE_RARITY:
rarity = 1
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.