Using block.number
, block.prevrandao
and msg.sender
as a source of randomness is commonly advised against, as the outcome can be manipulated by calling contracts.
While prevrandao provides a form of randomness in Ethereum, its predictability and the potential for bias make it less suitable for applications requiring high levels of security and unpredictability.
The attack basically consists of repeatedly calculating random number with data that is known and output that is wished for until the results match and only then continuing to calling the contract.
An attack path for rerolling the result of bad randomness might look roughly like this:
This undermines the fairness of the battle outcome, leading to potential losses for honest participants and questioning the integrity of the contract.
Manual Review
Consider using a decentralized oracle for the generation of random numbers, such as Chainlinks 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.