claimThrone() Makes Game Completely UnplayableThe claimThrone() function should allow any player except the current king to claim the throne, creating a competitive "King of the Hill" game where players can overthrow each other by paying the required fee.
The function contains an inverted logic check that only allows the current king to claim the throne again, which completely breaks the game mechanics. Since currentKing starts as address(0) and no real address can equal address(0), no player can ever make the first claim, rendering the entire game permanently unplayable.
Likelihood:
Every single attempt to call claimThrone() will fail due to the inverted logic check
The issue occurs immediately upon contract deployment when any player tries to make the first claim
Impact:
Complete game failure - no player can ever claim the throne or participate in the game
All ETH sent with claimThrone() calls will be reverted, but gas costs are still incurred by users
Contract becomes entirely non-functional despite successful deployment
Misleading error messages confuse users ("You are already the king" when they're not the king)
The fix is simple but critical - change the equality operator from == to !=:
Explanation of the fix:
Before fix: msg.sender == currentKing means "only the current king can claim"
Initially: only address(0) can claim (impossible)
After first claim: only the current king can claim again (wrong game logic)
After fix: msg.sender != currentKing means "anyone except the current king can claim"
Initially: any real address can claim (correct - allows first player to start the game)
After first claim: any player except the current king can claim (correct - enables competition)
Game flow with fix:
Player1 claims → becomes king (Player1 != address(0) = TRUE)
Player2 can claim from Player1 → becomes king (Player2 != Player1 = TRUE)
Player1 cannot immediately re-claim (Player1 == Player1 = FALSE)
Player3 can claim from Player2 → becomes king (Player3 != Player2 = TRUE)
This single character change transforms the contract from completely broken to fully functional, enabling the intended "King of the Hill" competitive gameplay.
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.