The function MondrianWallet:tokenURI
does not introduce any randomness, it is deterministic based on the value of tokenId.
The randomness of the tokenURI function is directly tied to the randomness of the tokenId values. The output of this function is predictable and not random. This function does not introduce any randomness itself; it is deterministic based on the value of tokenId.
The randomness of the tokenURI function is not compliant with the NFT part annoucement:
You'll see the tokenURI function returns one of 4 random Mondrian art paintings. Each should have equal distribution and be random.
Manual review
Refactor MondrianWallet.sol by integrating Chainlink VRF (Verifiable Random Function) for genuinely random URI selection:
VRFConsumerBase: The contract inherits from VRFConsumerBase, which is part of Chainlink's VRF functionality.
Variables for Chainlink VRF: keyHash, fee, and mappings to store randomness requests and results.
requestNewRandomURI(uint256 tokenId): A function that requests randomness. It requires some LINK token balance to pay for the request.
fulfillRandomness(bytes32 requestId, uint256 randomness): An internal function that Chainlink nodes call to deliver the randomness. It maps the random number to a tokenId.
Updated tokenURI(uint256 tokenId): Now it retrieves the URI based on the stored random result.
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.