Savings contract that logs deposits with a fixed account id and can be emptied or destroyed.
Historical Significance
The fixed id of 88 is compiled into the bytecode as a literal, which means every deployment of this design reported the same account number. Written when selfdestruct was still spelled suicide, and when a failed ownership check commonly did nothing at all instead of reverting, so a stranger's call would appear to succeed.
Key Facts
Description
A small savings contract. Its payable fallback accepts ether and, when the amount is above zero, emits a Deposit event carrying the sender, a fixed account id of 88, and the amount. The creator can call collect() to send the whole balance to themselves, or kill() to destroy the contract and release its balance. Both are silently ignored when called by anyone else rather than reverting. The bytecode carries no metadata trailer, so this is an exact match rather than a partial one.
Source Verified
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
pragma solidity ^0.4.0;
contract PiggyBank {
address owner;
event Deposit(address indexed user, uint256 indexed id, uint256 amount);
function PiggyBank() {
owner = msg.sender;
}
function() payable {
if (msg.value > 0) {
Deposit(msg.sender, 88, msg.value);
}
}
function kill() {
if (msg.sender == owner) {
suicide(owner);
}
}
function collect() {
if (msg.sender == owner) {
owner.send(this.balance);
}
}
}External Links
Related contracts
PiggyBank
Same deployerA simple ETH piggy bank contract with deposit events, owner-only collect, and self-destruct. Uses a hardcoded instance ID (88) in deposit events to distinguish
0xd01d0b...2f09fdFebruary 19, 2016DepositWallet
Same deployerFirst of 7,123 identical ETH+ERC-20 deposit forwarders deployed March-May 2017. Source recovered by EthereumHistory, byte-for-byte verified.
0x55166e...208b62March 22, 2017