previousKingPayout
Within the Game::claimThrone
function, the variable previousKingPayout is always explicitly initialized to 0 on each invocation. As a result, the following conditional check becomes redundant:
Given that:
previousKingPayout
is always zero,
currentPlatformFee
is derived as (sentAmount * platformFeePercentage) / 100
,
and platformFeePercentage
is bounded between 0 and 100,
this check will always evaluate to false
, rendering the logic unnecessary. The condition is effectively comparing currentPlatformFee > sentAmount
, which should never occur if platformFeePercentage
is properly constrained.
The redundant check is found in the following portion of the claimThrone
function:
Likelihood:
None – This code path is not reachable due to constant values.
Impact:
None – The redundant logic has no effect on contract behavior or fund flow.
While this does not introduce any functional risk, it adds unnecessary complexity and may confuse future maintainers.
Remove the unreachable conditional block to simplify the function and improve code clarity:
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.