Skip to main content
๐Ÿ› Bug HuntSO Solidity Hardโšก+35 XP

Reentrancy Vulnerability

This withdraw function is vulnerable to reentrancy.

๐Ÿ› Find the bug
1function withdraw(uint amt) external {
2 require(balances[msg.sender] >= amt);
3 msg.sender.call{value: amt}("");
4 balances[msg.sender] -= amt;
5}
๐Ÿ› The bug is on line 3

๐Ÿ”ง Select the correct fix: