A bad randomness vulnerability occurs when a smart contract relies on a source of randomness that is not truly random or can be predicted by an attacker. This can allow an attacker to manipulate the outcome of a transaction or gain an unfair advantage over other users.
A player can create a smart contract that checks if they win before calling increaseValuesOfParticipants(uint256 tokenIdOfChallenger, uint256 tokenIdOfAnyParticipant). If the result is successful, increaseValuesOfParticipants is executed; if the result is not favorable, the user can choose not to call increaseValuesOfParticipants, so nobody can win except him.
A challenger can always win the bet and never lose, which is unfair to the other participants.
This code should be added to the smart contract Dussehra.sol#CounterTest:
Result
The user is selected as Ram.
Manual review.
Use Chainlink or an Oracle. Chainlink VRF (Verifiable Random Function) is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability.
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.