๐ Bug HuntSO Solidity Hardโก+35 XP
Reentrancy Vulnerability
This withdraw function is vulnerable to reentrancy.
๐ Find the bug
1
function withdraw() external {2
uint amount = balances[msg.sender];3
(bool ok,) = msg.sender.call{value: amount}("");4
balances[msg.sender] = 0;5
}๐ The bug is on line 4