Intended Payout to the Previous King in claimThrone is Not Implemented, Breaking a Core Economic Incentive
Normal Behavior: The code includes comments and a variable (previousKingPayout) that strongly suggest an intention to pay a portion of the claimFee to the king who was just dethroned. The comment in the function description reads: "If there's a previous king, a small portion of the new claim fee is sent to them."
The Issue: This logic is completely absent from the implementation. The variable previousKingPayout is initialized to 0 and is never updated or used to send funds. The entire claimFee (less platform fees) goes directly to the pot.
Likelihood: HIGH
The payout logic is missing, so it will never occur.
Impact: MEDIUM
This is a failure to implement a specified feature that is part of the game's core economic design.
Not rewarding the previous king reduces the incentive to participate and hold the throne, potentially leading to lower engagement than designed.
It misrepresents the game's mechanics to anyone reading the code comments or documentation.
Have account_A become the currentKing.
Have account_B call claimThrone() to become the new king.
Observe: Check the ETH balance of account_A. It has not increased. All funds from account_B's claim have gone to the platformFeesBalance and the pot. The previousKingPayout logic was not executed because it doesn't exist.
Add this code to the test file.
Implement the payout logic. This requires adding a new configuration variable and modifying the claimThrone function.
Add a new state variable for the payout percentage:
Update the constructor and add a setter function for this new variable.
Refactor claimThrone to calculate and send the payout:
Solidity
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.