The generated randomness is not random as it can be predicted, hence giving a huge edge to an attacker as they would be able to know the expected outcome.
When computing the winning index and rarity, the following variables are used:
msg.sender
block.timestamp
block.difficulty
After PoS, block.difficulty
is constantly 0
. So it can be removed from the equation.
block.timestamp
changes at every block, but can easily be predicted based on the average block time of the chain.
msg.sender
can be any address, so a contract can be created to an expected address with create2
and use to invoke selectWinner
with an address that gives a favorable outcome.
The winner can be pre-computed, so the game would be considered to be rigged and not provably fair.
Root cause: bad RNG Impact: manipulate winner
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.