claimeThrone
functionAccording to the protocolls description, when a new king claims the throne than a small payout has to be paid to previous king. But not only previous king is not getting paid, amount to be paid to previous king is also hardcoded to be 0 (zero)
Normally, when next king claims the throne, previous king receives a small payout from next player's claimFee
In this scenario, payout for previous king is not only not calculated and is zero through out the process but also all the funds is distributed to platformFee
and pot
MIssing transfer logic, no any low level call, transfer or send function call to the previous king's address for the payout.
Can be considered fradulent if players expects reward.
Likelihood:
Will happen everytime when some one claims the throne.
Impact:
If players believe they will receive a reward upon being dethroned (as is standard in similar games), the lack of such payout could be legally or ethically questionable.
Paste this test function inside Game.t.sol
for testing
To prevent this behaviour of the protocol, We can apply following measures to ensure previous king gets payout when next claim is claimed.
Add a percantage for previous king payout from the next claimFee
.
Additionally adding a MINIMUM and MAXIMUM (in percantage) value a king can get as a payout from the protocol after the next claim.
Defensive checks to make sure payout does not exceed more than Max and Min values of Payout.
Simple Example of how this could work is.
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.