The claimThrone()
function lacks a check to ensure the grace period has not expired, allowing users to continue claiming the throne after the game should have ended.
According to the game’s rules, once the grace period has expired without a new king, the last king should be declared the winner. However, claimThrone()
does not verify whether the grace period has elapsed, allowing players to continue claiming the throne even after the deadline, leading to inconsistent game state and broken reward logic.
Likelihood:
Any player can claim the throne after the grace period as long as no one calls declareWinner()
to end the game.
Impact:
The game cannot end properly, preventing the rightful winner from claiming the pot and degrading the user experience.
Potentially allows continuous throne claims, making the game unplayable or unfair.
The test shows that after the grace period ends, a new player can still claim the throne and become king, which should not be allowed according to the game rules.
Add a grace period validation check at the beginning of claimThrone()
:
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.