Created
September 12, 2018 02:46
-
-
Save asselstine/6e193211613004118204f520bcad2b0e to your computer and use it in GitHub Desktop.
HoneyPot Contract
This file contains 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.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