Impact: Broken Incentive Model & Unfair ETH Distribution
Under normal gameplay, each new throne claimant is expected to reward the previous king with a small portion of their ETH payment. This mechanism is crucial to the game's incentive design, encouraging users to participate, compete, and defend the throne.
However, in the current implementation, the payout logic is completely missing. Although a previousKingPayout
variable exists, it is never used to transfer funds to the prior king, effectively nullifying the reward system.
Likelihood High:
This occurs on every call to claimThrone()
after the initial claim.
The payout is always omitted, since there is no conditional logic or transfer for the previous king.
Impact High:
Zero ETH is rewarded to the previous king, removing any economic incentive for users to play competitively.
Misleads players based on expectations set in documentation, game design, or UI — resulting in trust issues, reduced engagement, and centralization of funds into the pot or platform.
This test demonstrates that a previous king receives no payout when dethroned — violating the intended mechanics.
Explanation:
The test sets up a two-player scenario where Player1 becomes king, then gets dethroned by Player2. According to the game's rules, Player1 should receive a portion of Player2's payment. However, in the current implementation, Player1's balance remains the same — confirming no payout occurred.
Update the claimThrone()
function to explicitly reward the previous king before updating the currentKing
variable. Ensure the reward is calculated as a fixed percentage of the new claim fee (e.g., 10%).
Explanation:
This mitigation ensures that dethroned kings receive a defined share of the new claim fee by storing it in pendingWinnings
. Using pendingWinnings
also avoids direct transfers, which helps prevent reentrancy and ensures compatibility with pull-based withdrawal mechanisms withdrawWinnings()
.
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.