Dussehra::withdraw
function.Description: According to the CEI pattern, state changes should be made before doing external calls. In the context of the withdraw function this is not the case. Although I did not find an immediate impact for this, I still think this is prone to errors in the future, such as reentrancy.
Impact: Possibility of adding reentrancy vulnerability in the future.
Recommended mitigation: In the withdraw
function, move the line totalAmountGivenToRam = 0;
above the external call.
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.