The logic mistakenly inverts the intended check.
Expected Behavior | Actual Behavior |
---|---|
Prevent current king from re-claiming | Prevents everyone except current king |
Allow new players to claim the throne | Allows only the current king to proceed |
Thus, new users attempting to claim kingship with a valid fee will always revert, breaking the competitive flow of the game.
The claimThrone
function contains a require
statement intended to prevent the current king (0x00) from reclaiming the throne. However, the logic is implemented incorrectly and unintentionally blocks all other users from participating:
erroneously permits only the current king (0x00) to proceed, while reverting all new participants. This defeats the core purpose of the "king-of-the-hill" gameplay mechanic.
Likelihood: High
The bug is in a commonly used function (claimThrone()
), meaning it will be hit early during contract use.
Any player not already the king will instantly encounter this bug.
Impact:High
The throne can never be claimed by any address other than the initial currentKing
.
The game becomes locked in a static state, halting all further interaction.
Platform revenue from claim fees is frozen.
Critical game functionality is entirely disabled.
Even though player1
is not the current king, the transaction reverts due to faulty logic.
Update the require
condition to correctly reject only the current king from reclaiming, and allow new participants:
Corrected logic:
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.