In the claimThrone()
function, the intended behavior is to reward the previous king with a portion of the fee when a new king claims the throne. However, no such transfer occurs — the amount (previousKingReward
) is hardcoded to zero:
This results in no ETH being sent to the dethroned king, violating the game's fairness .
Medium
Likelihood:
This occurs every time a new player successfully calls claimThrone()
and becomes the king.
The previous king is always denied the expected compensation, which can be easily observed on-chain and exploited to game the system.
Impact:
Violates game fairness. (no incentive to be king).
Reduces trust in the system for real users.
Enables malicious frontrunning behavior — attackers can grief by repeatedly stealing the throne without loss.
Assume player 1 is the currentKing
player2 came and claim the throne
there is no tracking of sharing portion to previous king its hardcoded to zero;
Further issues :
Previous king receives nothing:
previousKingPayout = 0
, and no transfer is made.
This breaks the incentive loop that is core to the throne game design.
Platform receives nothing:
currentPlatformFee = 0
, and is added to the platform balance.
The code contains a dead check:
Pot receives all the ETH:
amountToPot = sentAmount - currentPlatformFee
→ always equals full sentAmount
.
This causes the pot to grow unnaturally fast with no real fee deductions.
Add logic to give incentives to the previous king
Remve Hardcoded currentPlatFormFee
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.