// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; contract SafeVault { mapping(address => uint256) public balances; function deposit() external payable { balances[msg.sender] += msg.value; } function withdraw(uint256 amount) external { require(amount > 0, "amount=0"); require(balances[msg.sender] >= amount, "insufficient"); balances[msg.sender] -= amount; (bool ok,) = payable(msg.sender).call{value: amount}(""); require(ok, "transfer failed"); } }