Game::claimThrone Prevents Throne ClaimsAs per the protocol, anyone should be able to claim the throne as long as they meet the requiments.
The require statement in the Game::claimThrone function contains an incorrect condition that prevents any player from claiming the throne. This directly breaks the core functionality of the protocol, which states that anyone can claim the throne provided they send a sufficient amount of ETH and the game round is still active.
Likelihood:
This will occur as soon as any user (other than the current king) tries to call Game::claimThrone, even with the correct fee and during an active game round.
The error will always trigger for every eligible player, making the function unusable under expected game conditions.
Impact:
No new player will be able to claim the throne.
The game becomes non-functional, breaking its core purpose and economic flow.
The following test demonstrates that a player is unable to claim the throne, even when sending the correct amount of ETH. The test sets up the scenario, attempts to claim the throne, and expects a revert with the incorrect error message. This confirms the bug in the require condition.
The second require condition should be inverted. Currently, it only allows the current king to proceed, which contradicts the intended logic. By changing the condition to msg.sender != currentKing, the function will correctly block the current king from re-claiming the throne, while allowing all other players to participate.
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.