Skip to content

Instantly share code, notes, and snippets.

@asselstine
Created September 12, 2018 02:46
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 asselstine/6e193211613004118204f520bcad2b0e to your computer and use it in GitHub Desktop.
Save asselstine/6e193211613004118204f520bcad2b0e to your computer and use it in GitHub Desktop.
HoneyPot Contract
pragma solidity ^0.4.8;
contract HoneyPot {
mapping (address => uint) public balances;
function HoneyPot() payable {
put();
}
function put() payable {
balances[msg.sender] = msg.value;
}
function get() {
if (!msg.sender.call.value(balances[msg.sender])()) {
throw;
}
balances[msg.sender] = 0;
}
function() {
throw;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment