Deposit address that forwards its whole balance to a vault on every payment and logs the payer, with an owner-only escape hatch for stranded tokens.
Historical Significance
Sweeping the full balance rather than the received amount is the detail that makes this self-correcting: a deposit that lands while the vault is unreachable is not lost, it is simply collected by the next one. Indexing both the payer and the vault in a single event is the other practical touch, and it is what lets one operator run the same contract for many vaults and still reconcile by destination.
Key Facts
Description
Two addresses are held: an owner who can change nothing but configuration, and the vault that receives the money. The payable fallback sends the contract's entire balance to the vault, not just the amount received, so any dust left behind by an earlier failed forward goes out with the next payment. It then emits TransferEther with both the payer and the vault indexed, which lets an operator query by either side.
drainTokens is the token counterpart and is owner-only. It takes an amount, a token and a destination, and treats the zero address as a shorthand for the vault, so the common case of sweeping a stray token to where the ether goes needs no extra argument. changeOwnership and changeVaultAddress are the only other functions, both owner-only, both returning a boolean rather than reverting on success.
The forward uses transfer, so the 2300 gas stipend applies and a vault that is itself a contract with any real fallback logic will reject the payment and revert the whole deposit.
Source Verified
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
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.23;
contract ERC20 {
function transfer(address _to, uint256 _value) public;
}
contract Deposit {
address public owner;
address public vault;
event TransferEther(address indexed from, address indexed vault, uint256 value);
function () public payable {
vault.transfer(address(this).balance);
emit TransferEther(msg.sender, vault, msg.value);
}
function changeOwnership(address _newOwner) public returns (bool) {
require(msg.sender == owner);
owner = _newOwner;
return true;
}
function drainTokens(uint256 _amount, address _token, address _to) public returns (bool) {
require(msg.sender == owner);
if (_to == address(0)) {
ERC20(_token).transfer(vault, _amount);
} else {
ERC20(_token).transfer(_to, _amount);
}
return true;
}
function changeVaultAddress(address _vault) public returns (bool) {
require(msg.sender == owner);
vault = _vault;
return true;
}
}External Links
Related contracts
Msg
Same eraMinimal contract that stores a single public string in state, exposed via the auto-generated m() getter. First of 281 identical siblings. Source verified by EthereumHistory.
0x2c8f58...37b173January 13, 2018Wallet
Same eraToken collection wallet that moves an entire token balance to a chosen address, without the ERC223 callback handler.
0x002204...531195January 19, 2018Wallet
Same eraOwner wallet that forwards ether to its owner, logs any call from a stranger with the full calldata, and lets the owner execute arbitrary calls.
0x001feb...9e7a4fJanuary 20, 2018Forwarder
Same eraNinety-three bytes with one hardcoded destination: every payment received is transferred straight back out to the same address.
0x458353...a562deJanuary 20, 2018Sweeper
Same eraMinimal ETH sweeper, first of 1,900 identical deployments in a 2-day burst in January 2018. All sweep to a single hardcoded destination. Source verified by EthereumHistory.
0xeb15f6...6cb3e1January 23, 2018Sweep
Same eraETH sweep-to-fixed-recipient — fallback forwards the contract's entire balance to `0xd293a88c…8d4` via `.send()` and reverts on failure. Massive cluster of 1899 identical deployments — likely deposit-address contracts for a single custodian.
0x00188b...b260a7January 23, 2018