Game::gameNotEnded
modifier allows claims after Game::gracePeriod
has expiredThe protocol enforces a grace period after which no new players should be allowed to participate in the current game round.
The Game::gameNotEnded
modifier only checks whether gameEnded
is true
, but does not update the state based on the current block timestamp. If the Game::gracePeriod
has already expired and gameEnded
has not yet been updated (typically set during a call to Game::declareWinner
), new players can still claim the throne. This oversight permits continued participation beyond the intended end of the game round.
Likelihood:
Any time a new player calls the Game::claimThrone
function, they can successfully claim the throne even after the gracePeriod
has expired, unless someone has explicitly called Game::declareWinner
to update the gameEnded
flag.
The Game::declareWinner
function is a manual action. If not triggered promptly, it leaves the game open for unintended claims.
Impact:
Players can continue to claim the throne after the grace period has ended.
This breaks the core protocol logic that restricts claims to within the grace period, undermining fairness and the intended game mechanics.
The following test demonstrates that a new player can successfully claim the throne after the grace period has elapsed. Add this function to your existing test suite and execute it:
Update the Game::gameNotEnded
modifier to also check and update the game state based on the current timestamp. This ensures the gameEnded
flag is accurate at every relevant call site.
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.