Skip to content

Instantly share code, notes, and snippets.

@christoph2806
Created May 17, 2021 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christoph2806/478d97015293efaf27901884c3a119bd to your computer and use it in GitHub Desktop.
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=
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