Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

tokenURI does not follow an equal distribution

Summary

The tokenURI function in the MondrianWallet smart contract does not adhere to the specified requirement of returning one of four random Mondrian art paintings with equal distribution.

Vulnerability Details

ART_ONE, ART_TWO, and ART_THREE are each returned only when the modulus operation results in 0, 1, and 2 respectively (each ~10% of the time), while ART_FOUR is returned for the remaining 70% of tokens.

Impact

HIGH - The NFT associated with ART_FOUR will be the most common while ART_ONE, ART_TWO, and ART_THREE will be equally scarce. As no rarity is assigned to each NFT. The impact is high, however, as no rarity is assigned to each NFTs there is minimal economic risk associated with this flaw in business logic.

Tools Used

Manual Review

Recommendations

Implement a secure method of generating random numbers within the smart contract to decide the art URI independently of the token ID. Consider using Chainlink VRF.

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

NFT's should have equal distribution

Support

FAQs

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