refund()
function can be called multiple times in a single transaction before the state changes which can drain the contract balance. This attack is a classic reentrancy attack and can be prevented by changing state before the external call ("sendValue()"
) to prevent from reentrancy attack.
Reentrancy is possible because of state changes after sendValue()
function which can drain the contract balance by calling refund()
function multiple times in a single transaction before the state changes.
Drain contract balance by calling refund()
function multiple times in a single transaction before the state changes.
Manual Review
This is a common reentrancy pattern to prevent reentrancy attack. It is recommended to use this pattern.
It saves from reentrancy attack and maintains the array length.
reentrancy in refund() function
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.