The bug occurs because the function sends Ether to caller using `call` function which can call back into the function before the call is updated.
An attacker could repeatedly call the `claimAllRewards()` function to exhaust the contracts funds. this could make the contract
unable to fulfil its obligation, leading to a denial of service.
An attacker could exploit the reentrancy by calling the claimAllReward() function before the contract has updated the reward
array.
As a result the contract will transfer Ether to the attackers address and the rewards array will remain unchanged, allowing the
attcker to claim the rewards again in subsequent calls.
Aderyn and slither.
Update the state before making external calls.
Use the `send()` functions instead of `call()`
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.