The Game
contract allows players to claim the throne by paying a claimFee, becoming the currentKing, with the game ending when the gracePeriod expires and a winner as the last player to claimFee when the grace period expires. The claimThrone
function lacks a check to prevent claims after the gracePeriod has expired, allowing claims Even when graceperiods expires, violating the intended game mechanics.
Likelihood:
Players can call claimThrone
after the gracePeriod expires, as the gameNotEnded modifier only checks gameEnded, which remains false until declareWinner is called.
No incentive or restriction prevents players from claiming the throne during the expired grace period, as the contract does not enforce a pause.
Undermines game rules by allowing throne claims when the current king should be declared the winner, potentially delaying or manipulating the game’s outcome.
Increases pot and claimFee unexpectedly, disrupting fair distribution of winnings and platform fees.
Before running this test, Kindly change the clamThrone
require to
require(msg.sender != currentKing);
Tool Used
Manual Review
Add a check to check if the game has ended.
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.