Normal behavior:
In the game, players compete to become the King by paying an ETH claim fee. Once someone becomes the King, they are expected to hold the throne for a certain duration (gracePeriod
) to win. The claimThrone()
function is supposed to prevent the current King from reclaiming the throne unnecessarily, as they already control it.
Issue:
The logic intended to block the current king from reclaiming is flawed. Instead, it currently only allows the current king to call claimThrone()
, and rejects all others, making the game unplayable once someone becomes King.
The intention (based on the error message) was to block msg.sender == currentKing
.
Instead, the condition does the opposite, allowing only the current king to claim, and rejecting everyone else.
Likelihood:
Always occurs after the first player claims the throne.
The contract will then reject all future throne claims from other users.
Impact:
Effectively bricks the game after the first claim.
No one else can participate.
The pot stops growing.
The game ends only after the grace period, with zero competition.
Severely damages gameplay, engagement, and trust.
Correct the logic to block the current king from reclaiming, but allow all others:
This change ensures that only non-kings can claim the throne, as originally intended.
Alternatively, if you want to allow the king to reclaim (to reset their timer strategically), you could remove the line entirely.
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.