Skip to content

Instantly share code, notes, and snippets.

@veridelisi
Last active May 23, 2023 11:40
Show Gist options
  • Save veridelisi/b10b5953ffbfadebf6d55278e8452d61 to your computer and use it in GitHub Desktop.
Save veridelisi/b10b5953ffbfadebf6d55278e8452d61 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.17;
contract BasicBankV2 {
mapping(address => uint256) public balances;
/// @notice deposit ether into the contract
/// @dev it should work properly when called multiple times
function addEther() external payable {
balances[msg.sender] += msg.value;
}
function sentEther(uint256 amount, address to) public payable {
//payable(to).transfer(amount);
(bool sent,) = payable(to).call{value: amount}("");
require(sent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment