platformFeesBalance Defensive Check Is IneffectiveIn claimThrone(), the contract implements a defensive check intended to ensure that the platform fee never exceeds the amount remaining after paying the previous king:
However, previousKingPayout is always zero in the current implementation, meaning this check never serves its intended purpose.
This leads to one of two outcomes:
The check always passes, making it redundant.
If in the future previousKingPayout is introduced for actual payouts, the current code might behave incorrectly because the logic hasn’t been tested in that context.
High in terms of design bug detection — the code path runs every claimThrone() call.
Impact:
Currently, this does not result in a direct financial loss because previousKingPayout is never nonzero.
However, it violates intended design assumptions, which can cause:
Incorrect fee calculations if previousKingPayout logic is added later.
Misleading security guarantees since the defensive check appears functional but is effectively dead code.
Execution:
Result: The defensive check never activates because previousKingPayout is always zero
If previousKingPayout is unused, remove both the variable and this check to reduce confusion
Replace the current code with this
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.