In the EggHuntGame
There are variables startTime
and endTime
which is set by the admin and defines the time range for the egg hunt game to be active. These are intended to provide boundaries within which players can find eggs.
However, the contract allows the admin to call endGame()
and terminate the game before the endTime
deadline is reached, regardless of whether the players still have valid time left. This may undermine the trust and expectations of participants who rely on the inputted end time.
The endGame()
function lacks a check to ensure that the current block timestamp has passed the endTime
:
This allows the owner to end the game before the scheduled endTime
even if the game is actively running.
This logic can cause confusion, unexpected outcomes for players and may be viewed as unfair, especially in a competitive game where timing is crucial or where rewards are distributed based on player activity within the designated period.
Unfair Termination: Players expect the game to run until endTime
might miss out on opportunities if the game ends early.
Trust Issues: Participants might lose trust in the fairness of the game if the admin can prematurely cut it short.
Inconsistency: The presence of endTime
implies a commitment to a time window, but that commitment is unenforced.
Manual review
Foundry
Enforce endTime
in endGame()
Logic
Add a requirement to ensure the game cannot be ended before the official time:
This allows the game to only end when the end time is reached
Owner is trusted and is not expected to interact in ways that would compromise security
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.