However, a critical logic error in the access control condition prevents any new player from claiming the throne. Instead, it incorrectly allows only the current king to call the function, which defeats the purpose of the game.
The condition msg.sender == currentKing reverts the transaction for anyone who is not the current king, meaning only the existing king can pass this check. But since the king already holds the throne, they have no reason to re-claim it. The subsequent state update currentKing = msg.sender is therefore unreachable for any challenger.
Likelihood:
Every time a user attempts to claim the throne as a challenger, the transaction will revert due to the incorrect equality check.
The function can only succeed if the current king calls it again, leading to redundant claims with no change in state.
Impact:
The throne becomes permanently unchallengeable after the first claim, freezing the game state.
The core gameplay loop is broken, rendering the contract non-functional for its intended purpose.
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.