The normal behavior of claimThrone()
should allow a new player (different from the current king) to claim the throne by paying the required fee, thereby updating the currentKing
and the game state.
However, due to a logic error in the require
statement, the function currently only allows the current king to call claimThrone()
. Since the initial currentKing
is address(0)
and no one controls it, no user can successfully call this function. This results in a permanent denial of service for the game.
Likelihood:
Occurs every time claimThrone()
is called by any player, because no one can ever satisfy msg.sender == currentKing
unless they are already the king.
The initial currentKing
is address(0)
(nobody), so the first claim will always fail.
Impact:
The core feature of the game (claiming the throne) is broken.
Players cannot participate, and all deposited ETH (if any) is stuck forever because no claims or game progression can occur.
Expected: Player becomes king.
Actual: Reverts every time because msg.sender can never equal address(0)
.
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.