Skip to content

Instantly share code, notes, and snippets.

@michielmulders
Created August 5, 2018 16:11
Show Gist options
  • Save michielmulders/579df26262ac710e6ac3be4e15a82c5d to your computer and use it in GitHub Desktop.
Save michielmulders/579df26262ac710e6ac3be4e15a82c5d to your computer and use it in GitHub Desktop.
Checks Effects Interaction Pattern Solidity Ethereum
function auctionEnd() public {
// 1. Checks
require(now >= auctionEnd);
require(!ended);
// 2. Effects
ended = true;
// 3. Interaction
beneficiary.transfer(highestBid);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment