← Code LabSolidity0/50 solved · 0%
Security · medium

33. Checks-Effects-Interactions

Order matters when sending ether.

Implement `withdraw()` for `mapping(address => uint256) public balances` following CEI: check, zero out balance, then `call` to send ether.
Required in your answer: balances[msg.sender] = 0.call{value:require(ok