This piece of code allows an external contract to execute an arbitrary operation before the flash loan is paid back.
This piece of code allows an arbitrary external contract (receiverAddress
) to execute an arbitrary operation before the flash loan is paid back, potentially allowing malicious behavior.
Modifying the code ensures that the state is modified only after the external contract has executed and funds have been returned, making the code less susceptible to reentrancy attacks. Without this, the funds can be manipulated.
Manual code analysis.
To fix this reentrancy vulnerability, we should follow the pattern of performing state changes after interacting with external contracts. Update the state (such as modifying s_currentlyFlashLoaning
) after the external contract call is made.
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.