The searchForEgg() function in EggHuntGame uses a predictable pseudo-random number generation method, which can be manipulated by miners or users.
The random number is generated using:
block.timestamp and block.prevrandao are public and can be influenced by miners.
An attacker can front-run transactions or replay attempts to exploit predictable outcomes.
Players (or miners) can predict or manipulate the outcome of searchForEgg() to guarantee egg findings, breaking game fairness.
Manual review, knowledge of blockchain randomness pitfalls.
Use a commit-reveal scheme with a trusted oracle (e.g., Chainlink VRF) for true randomness.
If on-chain randomness is necessary, combine multiple inputs (like blockhash(block.number - 1)) and delay resolution.
Insecure methods to generate pseudo-random numbers
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.