The claimThrone function contains a block of dead code. A local variable previousKingPayout is initialized to 0 and is never updated. However, a subsequent if statement checks a condition involving this variable that can never logically be met, rendering the entire if block unreachable.
While this does not pose a direct security threat, it reduces code clarity, can lead to confusion for future developers, and represents a minor gas inefficiency. It may also indicate a partially removed feature, which could have other unforeseen side effects.
It is recommended to remove the unused previousKingPayout variable and the entire unreachable if block that depends on it. This change simplifies the code, improves readability, and provides minor gas savings.
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.