Function Dussehra::withdraw
does not follow CEI rules - the value of totalAmountGivenToRam
variable is changed after executing msg.sender.call{value: amount}("");
line
Although there is a possibility for reentrancy attack, such could be initiated only by OnlyRam
(i.e. by the selected user for Ram) which is indeed the winner of the event and should take the prize.
This is a classic example of the reentrancy type of attack. Please refer for more information here :
https://solidity-by-example.org/hacks/re-entrancy/
Move the totalAmountGivenToRam = 0;
line before the .call functionality.
Manual review
The `withdraw` function sends the given amount to Ram. If the attacker calls the `withdraw` function again before the state variable is changed, the function will revert because there are no more funds in the contract. This reentrancy has no impact for the protocol. It is recommended to follow the CEI pattern, but this is informational.
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.