The contract explicitly states in the "King (Current King)" actor definition: "Receives a small payout from the next player's claimFee
(if applicable)."
The claimThrone()
function fails to pay out the intended portion of the claimFee
to the previous king, leading to unjust enrichment of the game's pot or platform fees, and direct financial loss for the previous king, as the logic for calculating and transferring this payout is entirely absent from the code.
In src/Game.sol
, within the claimThrone()
function, the variable previousKingPayout
is explicitly initialized to 0
and is never updated with any calculation based on the sentAmount
or claimFee
. Consequently, no msg.sender.transfer()
or similar mechanism is ever called to send a portion of the incoming fee to the currentKing
(who is about to become the previousKing
). This contradicts the described game mechanic where the current King should receive a payout from the next claimant. All funds that should have gone to the previous king are instead added to the pot
or platformFeesBalance
.
Likelihood: This issue is highly likely to occur because the flaw is inherent in the function's logic and will trigger every single time a new player claims the throne (after the very first king has been established). The code explicitly sets previousKingPayout
to 0
and has no mechanism to calculate or send this payout, meaning the described game mechanic for previous kings' earnings will never function as intended.
Impact:
Direct Financial Loss (for Previous King): The currentKing
who is dethroned does not receive the "small payout from the next player's claimFee
" as described in the game's rules. This is a direct financial loss for a legitimate actor.
The game's core rule regarding the previous king's payout is not implemented, breaking the stated functionality and user expectations.
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.