A logic error in the claimThrone
function incorrectly prevents any user other than the current king from claiming the throne, breaking the core gameplay mechanic and halting the entire game flow
Normally, a player who is not the current king should be able to send the claimFee
and take the throne, becoming the new king
However, the claimThrone()
function currently checks that the caller must be the current king, which is backwards, so only the current king could “claim” again (which makes no sense). This blocks all new players from claiming the throne and breaks the main game loop
Likelihood:
Any time a player tries to claim the throne while not being the current king, the transaction will revert with Game: You are already the king
— which makes no sense and halts the game for everyone except the current king
This condition will always occur for the first claim too, since currentKing
is address(0)
— so the deployer can never claim either if they aren’t the currentKing
Impact:
The main claimThrone
mechanic becomes impossible to use
The pot never grows, no one can compete, and the game is permanently stuck
Deployer deploys contract with initialClaimFee = 1 ether
player1 calls claimThrone() with 1 ether:
currentKing = address(0)
require(msg.sender == currentKing) fails
Transaction reverts
The Output:
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.