Description:
The claimThrone function does not verify whether the previous grace period has already expired before accepting a new claim. As a result, if nobody calls declareWinner after the grace period elapses, a late claimant can still call claimThrone, resetting the grace timer and stealing the pot meant for the rightful winner.
Impact:
Winner Theft: The true winner—who should be able to call declareWinner after the grace period—can be preempted by a malicious actor, diverting the entire prize pot.
Game Fairness Broken: Undermines the core mechanic of the game, as the grace period guarantee can be bypassed.
Loss of Trust: Players may lose confidence in the protocol’s integrity.
Proof of Concept: Add the following test to the 'Game.t.sol':
Mitigation:
Introduce a check at the start of claimThrone to ensure the grace period has not yet expired:
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.