The ChoosingRam::selectRamIfNotSelected function uses a modulo operation for randomness, which can lead to unfairness where certain tokens may have a lower probability of being selected.
The function uses the following line to generate a random token ID:
This modulo operation (% ramNFT.tokenCounter()) can introduce bias if the token counter is not a power of two. For example, if ramNFT.tokenCounter() is not a power of two, some token IDs may have a slightly higher probability of being selected than others.
Certain tokens may have a lower probability of being selected, leading to an unfair selection process.
Manual review
Use a more uniform method for random selection to ensure all tokens have an equal chance of being selected. One approach is to use a secure randomness source like ChainLink VRF.
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.