Description
The MondrainWallet is also an NFT and the protocol states:
You'll see the tokenURI function returns one of 4 random Mondrian art paintings. Each should have equal distribution and be random.
This invariant is broken due to the implementation of the MondrianWallet::tokenURI
function.
The random artwork is chosen based on: tokenId modulus 10
which is not random.
The tokenId
is user controlled and therefore the artwork for the NFT is predictable.
The distribution is not equal as the result of modulus operation favours the ART_FOUR
NFT.
Impact
Core invariant does not hold true and a user may be able to mint and choose whichever NFT artwork they like.
Recommended mitigation
Use a purpose built, trusted and well-tested library for generating random numbers.
Tools Used
Manual Review
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.