// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// A simple contract named EtherBox for managing balances and allowing withdrawals.
contract EtherBox {
// Mapping to keep track of balances for each address.
mapping (address => uint) public balance;
// Attempts to send a specified amount from the caller's balance.
// Using transfer for safer Ether transactions.
function SimpleSendToAccount(uint amount) public returns (bool) {
// Check if the caller has enough balance to send the amount.
if(balance[msg.sender] >= amount) {
// Deduct the amount from the caller's balance.
balance[msg.sender] -= amount;
// Transfer the amount to the caller. Reverts on failure.
payable(msg.sender).transfer(amount);