Function for search eggs use weak random mechanism, which could be manipulated and sometimes could use constant values on some blockchains.
Function searchForEgg use for getting random number weak mechanism.
This code has some disadvantages:
block.timestamp - could be manupulated by miner/validator
block.prevrandao - on linea, this function return always the same value - 2 https://docs.linea.build/get-started/build/ethereum-differences#:~:text=Returns a fixed number%3A
if user sent more than 1 tx and they in one block, and if first random number is not less, than eggFindThreshold value, eggCounter will not increase and all next tx from this user in this block will not give eggs to user. Because random number will be the same during the block, because eggCounter does not increase previously.
Random number could be manipulated by miners/validators and using for receive egg in the game.
Manual review
Use chainlink vrf for getting random numbers.
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.