A player can endlessly mine eggs without letting new players come in and win eggs.
function searchForEgg() external {
require(gameActive, "Game not active");
require(block.timestamp >= startTime, "Game not started yet");
require(block.timestamp <= endTime, "Game ended");
There is no limit on attempts to find the game's egg. Multiple players mine eggs until the end of the game without letting other players do it and earning all the money.
This could lead to a loss of demand for the game and attracting new players.
You can limit the number of attempts per player's game or prescribe a delay in the search. Also for convenience you can specify the time left until the next attempt or how many attempts are left.
uint256 public constant SEARCH_DELAY = ....
.....
require( block.timestamp >= lastSearchTime[msg.sender] + SEARCH_DELAY, "We have to wait a little longer" );
lastSearchTime[msg.sender] = block.timestamp;
/
/
uint256 public maxSearchAttempts = ...;
require(searchAttempts[msg.sender] < MAX_SEARCH_ATTEMPTS, "Max search attempts reached"); **
searchAttempts[msg.sender] += 1;
Contract lacks any cooldown mechanism, search limits, or costs in the searchForEgg() function
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.