Created
August 11, 2021 07:15
-
-
Save camharris/dd7e507b73a5c695bf11fba6ef4f4d91 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=true&runs=200&gist=
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
pragma solidity ^0.6.0; | |
contract MyWallet { | |
address payable private owner; | |
constructor() public { | |
owner = msg.sender; | |
} | |
receive() external payable { | |
} | |
function sendEther(address payable _to, uint _amount) public { | |
require(msg.sender == owner, "Must own this wallet to send Ether from it"); | |
require(address(this).balance >= _amount, "Cannot send more than this wallet holds"); | |
_to.transfer(_amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment