The tokenURI function does not meet the requirements for equal distribution.
The Documentation reports:
The tokenURI
method MondrianWallet.sol#L161-L175 can return one of the four Mondrian Paintings but not uniformly.
The code of the function is:
The computation of the painting to be returned is made upon the use of modulus operator, where the second operand is 10.
However to guarantee an equal distribution on the returned value, the function should match uniformly all the possibile remainders returned by the modulus operator, and that's not the case because the mapping beetween the input value and the output value is:
modNumber | tokenURI |
---|---|
0 | ART_ONE |
1 | ART_TWO |
2 | ART_THREE |
3 | ART_FOUR |
4 | ART_FOUR |
5 | ART_FOUR |
6 | ART_FOUR |
7 | ART_FOUR |
8 | ART_FOUR |
9 | ART_FOUR |
The output distribution is: ART_ONE=10%, ART_TWO=10%, ART_THREE=10%, ART_FOUR=70%, definetly not uniform as the expectation.
Missing the equal distribution for the paintings could have an impact for the secondary market of MondianWallet NFT, leading to the disruption of the market equilibrium.
The code has been visual inspected
Let the second operand of the modulus be 4, to match uniformly all the available paintings. The function code should be (diff included):
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.