Created
May 17, 2021 08:09
-
-
Save christoph2806/478d97015293efaf27901884c3a119bd 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.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
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
pragma solidity 0.8.0; | |
// SPDX-License-Identifier: MIT | |
contract Peter { | |
bool paidOut = false; | |
function payout(uint256 a) public { | |
if(paidOut) { | |
revert('Already paid out'); | |
} | |
paidOut = true; | |
address payable recipient; | |
recipient = payable(msg.sender); | |
recipient.transfer(a); | |
} | |
function goOn() public payable { | |
paidOut = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment