The documentation specifies that the previous king should receive a small portion of the next player's claimFee
as a payout when dethroned. This is a core part of the incentive mechanism described in both the inline comments and the project README.
However, the Game::claimThrone()
function never actually computes or transfers any payout to the previous king. The variable previousKingPayout
is defined and used in a defensive fee cap, but it is always set to 0
and never updated. As a result, the previous king will receives nothing, and the logic intended to ensure fee correctness becomes dead code.
The defensive cap
sentAmount - previousKingPayout
is meaningless becausepreviousKingPayout
is always 0.
Likelihood:
This happens on every throne claim after the first one.
The payout logic is completely missing, regardless of game round or state.
Impact:
Previous kings never receive the compensation promised in the documentation.
Players are financially disincentivized from participating multiple times.
Funds that should go to dethroned kings are instead redirected to the platform fees or the pot.
Add this proof of code to the Game.t.sol
test file. Also make sure to correct the breaking logic that prevent anyone to call claimThrone to check this missing payout.
Add explicit logic to calculate and send a payout to the dethroned king before updating the game state:
Then update the defensive fee cap logic accordingly:
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.