A single-purpose key holder: the only thing it can do is call burn on one fixed token, and the only person who can ask is its owner.
Historical Significance
Contracts this narrow are usually about who holds the key rather than what the code does. A token issuer that wants burning to be possible but not to sit on the same key as minting or ownership can put this in between, hand it to a different party, and know that the worst that party can do is destroy supply. It is access control expressed as a deployment rather than as a role.
Key Facts
Description
Two addresses in storage, an owner and a token, and three functions. burnTokens checks the caller is the owner, calls burn on the token for the given amount, and asserts the call returned true before logging the amount destroyed.
Using assert rather than require on the token's return value means a refused burn consumes all remaining gas instead of refunding it. In this compiler that is the documented difference between the two, and choosing assert here says the author treated a false return as impossible rather than as an expected outcome.
changeOwner hands over control with no zero-address check and no second step. There is no way to change the token, no way to withdraw anything, and no fallback, so the contract cannot hold ether and cannot be repurposed.
Source Verified
Byzantium Era
First Metropolis hard fork. Added zk-SNARK precompiles, REVERT opcode, and staticcall.
Bytecode Overview
Verified Source Available
This contract has verified source code.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.15;
contract Token {
function burn(uint256 _value) returns (bool);
}
contract Burner {
address public owner;
Token public token;
event Burn(uint256 amount);
function burnTokens(uint256 _amount) {
require(msg.sender == owner);
assert(token.burn(_amount));
Burn(_amount);
}
function changeOwner(address _newOwner) {
require(msg.sender == owner);
owner = _newOwner;
}
}