Last active
April 30, 2021 01:00
-
-
Save apow2/407e8a781d04d1aa5ce177902aa9fd01 to your computer and use it in GitHub Desktop.
a tip jar
This file contains hidden or 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
contract TipJar{ | |
address owner; | |
constructor() public{ | |
owner = msg.sender; | |
} | |
receive() external payable{ | |
} | |
fallback() external payable { | |
} | |
function withdrawBalance(){ | |
require(msg.sender==owner); | |
uint256 balance = address(this).balance; | |
msg.sender.transfer(balance) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment