require
condition that mistakenly permits only the current king to call claimThrone()
. As a result, all new claim attempts revert, effectively preventing any player from participating and blocking game progression.The claimThrone()
function should allow any new player (who is not the current king) to claim the throne by sending the required ETH fee, updating the game state with the new king and adjusting the pot and claim fee accordingly.
Instead of blocking reclaims by the current king, the function contains an inverted require
condition that mistakenly permits only the current king to call claimThrone()
. As a result, all new claim attempts revert, effectively preventing any player from participating and blocking game progression..
Likelihood:
This will occur when a new player, who is not the current king, attempts to claim the throne at any point during the game. It also consistently prevents the game from even starting since the initial currentKing
is address(0)
and no one else can claim.
Impact:
The game becomes completely non-functional as no player can successfully claim the throne. This results in the pot never accumulating and all core game mechanics being rendered unusable.
The following Foundry test demonstrates that a valid new player is unable to claim the throne due to the inverted logic in the require
condition.
To fix this issue, simply invert the condition in the require
statement so that it blocks reclaims by the current king, rather than allowing only the king to call the function:
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.