As per description the king should"Receives a small payout from the next player's claimFee (if applicable)."
However, there is no logic in place that updates the pendingWinnings of the previous king
Likelihood: High
This is a functionality that is part of the requirements but not implemented.
Impact: Medium
The king is expected to receive a small payout, but will never receive it
To validate the issue, we can run the following test (with the default setup as per Game.t.sol)
NOTE: that this requires to fix the issue in H1 first (to be able to claim the throne)
logs
As can be seen from the logs and this test, we have player1 being the first king, then player2 claiming the throne afterwards. It is expected that player 1 will have earned a small fee. However the balance of player1 is the same before and after the game (and calling claimWinnings).
Instead withdrawWinnings called from player1 will revert.
In order to fix this, the logic needs to be built. There is currently only local uint256 previousKingPayout = 0; that is not used (it is not set and always 0). Roughly the following should be considered (as this is a missing feature, and no documentation on how much the amount should be):
Add logic to calculate the payout amount (either percentage based or fixed amount)
on a new claimThrone: update the pendingWinnings of the previous king (so currentKing before assigning it to the new caller)
then the payout could be claimed via 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.