The organiser can get his share plus what is supposed to be awarded to Ram, because the Dussehra::WantToBeLikeRam
array does not get reset after the organiser gets paid.
The Dussehra::killRavana
function uses the product of length of Dussehra::WantToBeLikeRam
array and Dussehra::entranceFee
as part of the values used to compute how much the organiser receives(half of that product, with the other half to be awarded to Ram). If the array is not reset to zero after the first payment to organiser, The function can be called again before ram withdraws and organiser gets paid the other half, thereby reducing ram rewards to zero and leaving ram with nothing!
Please find below; a demonstration of this concept. The test operates with two participants who enter with 1 ether each.
Paste the following into the test suite
Ram can end up with no reward!
Manual Review + Foundry
Please consider deleting Dussehra::WantToBeLikeRam
as organiser gets paid first time. This resets it.
Below is a demonstration:
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.