The bug is isolated to the claimThrone()
function in the Game
contract.
Specifically, it involves the access control logic that restricts who can call claimThrone()
.
No other functions or features appear affected by this issue based on the current code.
The bug affects all game rounds and all players, preventing any new player from claiming the throne once it is held by someone.
It effectively breaks the core gameplay mechanic and flow, halting all intended competitive interactions.
Likelihood:
This bug will occur whenever any player other than the current king attempts to claim the throne, which is the normal expected gameplay flow.
Since the contract enforces that only the current king can call claimThrone()
, all attempts by new players to take the throne will revert, making the bug triggered on every claim attempt after the first king.
Impact:
New players cannot claim the throne, effectively freezing the game and preventing any change in the current king.
The game’s core mechanic—“king of the hill” competition—is broken, making the initial king unbeatable and the pot unreachable by others.
Explanation:
This proof of concept demonstrates the bug in the claimThrone function where the contract incorrectly blocks other players from claiming the throne once the first player is king. The test shows:
Player 1 claims the throne successfully.
Player 1 attempting to claim again correctly reverts.
However, Player 2's attempt to claim the throne fails in the buggy version but succeeds after the fix.
This confirms the bug: the contract mistakenly requires the caller to be the current king, preventing legitimate throne claims by other players.
Explanation:
The mitigation involves correcting the require statement in claimThrone from:
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.