The claimThrone()
function allows any player (other than the current king) to pay the required fee and become the new king of the game, increasing the pot and claim fee each time. The game is intended to continue until the grace period expires, at which point the last king is declared the winner.
Due to a poorly implemented require check in the claim throne function, the king will always be the zero address, and only the zero address can call the claim throne function, leading to denial of service for other users.
Likelihood:
This issue will occur anytime, and will be noticed right after deployment, as no one would be able to claim the throne due to the current king beind the zero address at deployment.
Even if the owner resets the game, the same issue still occurs as no one would be ever be able to claim the throne
Impact:
Only the current king can call claimThrone()
, which prevents other players from participating and claiming the throne, and halts the game.
The game will not progress normally, as the pot and platform fees will always be empty as no user would be able to play the game, and the owner has no earnings.
Notice that everytime a player calls claimThrone, it will give an error. At deployment, the current king address is set to the zero address.
Correct the logic so that the msg.sender is not the current king, and thus only the king will be denied service.
Optionally, we can remove the entire line, as the current king can keep sending to reclaim the throne, afterall it is the king's loss as the claimfee increases whenever claimThrone() is called.
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.