After a player claims the throne, there should be a grace period. If no one else claims within this time, the current king can call declareWinner()
and win the pot.
Every new claim resets the grace period timer. This means someone can keep claiming the throne just before the grace period ends, over and over again, making it impossible for anyone to ever declare a winner.
Likelihood:
This happens every time players continue to claim the throne before the grace period timer ends.
It's easy to exploit, even with just two players alternating throne claims.
Impact:
The game can never end naturally.
Funds may be permanently stuck in the contract.
Every time someone claims the throne, the grace period resets.
Because of this, declareWinner()
can never be called and the game never ends since the timer keeps extending with each new claim.
Track a fixed gameStartTime
when the game starts or resets.
Use this timestamp to check grace period expiry, so players can’t keep resetting the timer by claiming.
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.