Do you really want to burn some ETH?
Sending it to
0x0000000000000000000000000000000000000000
or 0x000000000000000000000000000000000000dEaD
is a popular choice, but the ETH is not really burned. There is technically a private key with access to the funds, its just that no one knows it (probably).
Of course, there is practically 0 chance of anyone ever finding the private key to these addresses, but if some does... it's a lot of ETH to dump on the market.
With Burn4Ever, ETH is really burned, forever :)
A self destructing contract can send the remaining ETH in the contract to any address. Specifically, to itself. ETH sent to the contract this way is truly burned and has no way to be restored (well maybe via a fork).
Thanks to CREATE2
and ERC-2470 we can have a constant contract address, that anyone can deploy a contract to.
The contract has a single instruction: Burn all the ETH in the balance.
If there is ETH in the contract, once it is initiated, the ETH will be burned.
To compensate the burner, 0.1% of the ETH in the contract will be sent to the burner (Yay MEV!)
The contract will always be on the same address on all chains that support ERC-2470.
0xc326af5d2699b6554b5ed11cfc5829e373ae6284
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("BURN4EVER"));
0x608060405234801561001057600080fd5b503273ffffffffffffffffffffffffffffffffffffffff166103e8478161003357fe5b04600067ffffffffffffffff8111801561004c57600080fd5b506040519080825280601f01601f19166020018201604052801561007f5781602001600182028036833780820191505090505b506040518082805190602001908083835b602083106100b35780518252602082019150602081019050602083039250610090565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610115576040519150601f19603f3d011682016040523d82523d6000602084013e61011a565b606091505b5050503073ffffffffffffffffffffffffffffffffffffffff16fffe
0xce0042B868300000d44A59004Da54A005ffdcf9f
let burnForeverAddress = ethers.utils.getCreate2Address(
deployerContract.address,
ethers.utils.keccak256(ethers.utils.toUtf8Bytes(VERSION)),
ethers.utils.keccak256(deployTx.data),
);
The library shows an example and a code snippet to deploy the contract.
Before running any command, make sure to install dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
Run the Mocha tests:
$ yarn test
Polupate the .env
file as seen in the example file .env.example
ts-node ./src/Burn4Ever.ts