Skip to content

Instantly share code, notes, and snippets.

@obscuren
Created May 13, 2017 20:21
Show Gist options
  • Save obscuren/a73aba8293817dc962dba690395c4759 to your computer and use it in GitHub Desktop.
Save obscuren/a73aba8293817dc962dba690395c4759 to your computer and use it in GitHub Desktop.
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