Last active
May 23, 2023 11:40
-
-
Save veridelisi/b10b5953ffbfadebf6d55278e8452d61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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