Both block.prevrandao and block.timestamp are not reliably source of randomness
In the
https://github.com/CodeHawks-Contests/2025-04-eggstravaganza/blob/main/src/EggHuntGame.sol#L65-L81
the code use block.prevrandao and block.timestamp as source of randoness to determine who is lucky to win the egg.
However, both op code are not good source of randonness.
https://eips.ethereum.org/EIPS/eip-4399
Security Considerations
The PREVRANDAO (0x44) opcode in PoS Ethereum (based on the beacon chain RANDAO implementation) is a source of randomness with different properties to the randomness supplied by BLOCKHASH (0x40) or DIFFICULTY (0x44) opcodes in the PoW network.
Biasability
The beacon chain RANDAO implementation gives every block proposer 1 bit of influence power per slot. Proposer may deliberately refuse to propose a block on the opportunity cost of proposer and transaction fees to prevent beacon chain randomness (a RANDAO mix) from being updated in a particular slot.
Miner can manipulate the block.prevrandao and block.timestamp to let specific address win the raffle
change randon generate method (can use chainlink VRF, etc...)
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.