Pseudo randomness in ChoosingRam::selectRamIfNotSelected
gives the power of the organizer, not to choose a particular user, if they decide so.
In blockchain randomness similar to that in the above function is predetermined
uint256 random = uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao))) % ramNFT.tokenCounter();= uint256(keccak256(abi.encodePacked(block.timestamp, block.prevrandao, msg.sender)))
, so the organizer can know the "random number"
beforehand. For randomness to be generated in a blockchain something like Chainlink VRF is required.
The organizer can pre-run the code locally with the arguments that return the random number, see if the winning user is someone, that the organizer would like to win, and then decide if they should call ChoosingRam::selectRamIfNotSelected
or wait for the random user to be changed. That leads to an unfair advantage for the user.
Manual Review
Replace the pseudo-randomness with Chainlink VRF.
The organizer is trusted, but the function `ChoosingRam::selectRamIfNotSelected` uses a way to generate a random number that is not completely random.
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.