Skip to content

Instantly share code, notes, and snippets.

@gakonst
Last active November 22, 2017 08:51
Show Gist options
  • Save gakonst/232dc9d6d2503838c9a3e3b8858fbb37 to your computer and use it in GitHub Desktop.
Save gakonst/232dc9d6d2503838c9a3e3b8858fbb37 to your computer and use it in GitHub Desktop.
pragma solidity 0.4.18;
contract ForceEther {
bool youWin = false;
function onlyNonZeroBalance() {
require(this.balance > 0);
youWin = true;
}
// throw if any ether is received
function() payable {
revert();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment