The application design assumes that during the claimThrone
function execution, a previous king will receive a small portion of a new claim fee. The functional implements defensive check to make sure that platformFee
doesn't exceed available amount after previousKingPayout.
However, the claimThrone
function misses essential logic to calculate and send a portion of fee that should be send to a previous king. Additionaly, it makes the mentioned defensive check useless and causes higher gas fee during deployment.
Likelihood:
The issue will occur every time from the second call to the claim Throne
function.
Impact:
Previous king won't receive any portion of a new claim fee.
Additional defence check and unused code costs approximately additional 9711 gas during deployment.
Depending on how an owner of the game wants to proceed, there 2 ways to solve this issue:
Implement the missing logic for calculation and sending a portion of fee to a previous king.
Remove unnecesary checks and code from the claimThrone
function as below.
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.