Created
May 13, 2017 20:21
-
-
Save obscuren/a73aba8293817dc962dba690395c4759 to your computer and use it in GitHub Desktop.
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.11; | |
contract Burner { | |
uint256 public totalBurned; | |
function Purge() public { | |
// the caller of purge action receives 0.01% out of the | |
// current balance. | |
uint256 fee = this.balance / 1000; | |
assembly { | |
mstore(0, 0x30ff) | |
// transfer all funds to a new contract that will selfdestruct | |
// and destroy all ether in the process. | |
create(sub(balance(address), fee), 30, 2) | |
pop | |
} | |
msg.sender.transfer(fee); | |
} | |
function Burn() payable { | |
totalBurned += msg.value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment