Exchange deposit wallet that forwards incoming ether to a controller-supplied destination and delegates token sweeps to a per-token sweeper contract.
Historical Significance
The delegatecall to a per-token sweeper is the interesting part. Tokens of this period disagreed on whether transfer returned a boolean, so a single hardcoded collection routine would have failed on some of them. Resolving the sweeper at call time let one deployed wallet handle tokens whose interfaces had not been written yet.
Token Information
Key Facts
Description
A per-customer deposit address from an exchange wallet system. The payable fallback reads destination() from the controller, sends the received ether there, and calls logSweep on the controller with the sender, the destination, a zero token address and the amount, so ether and token movements land in the same log stream.
sweep asks the controller for sweeperOf the given token and delegatecalls that sweeper with the original calldata, which lets the operator change how a token is collected without touching the deposit addresses already in circulation. tokenFallback is present and empty so that ERC223 transfers into the wallet do not revert.
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.0;
contract Controller {
function destination() returns (address);
function logSweep(address from, address to, address token, uint amount);
function sweeperOf(address _token) returns (address);
}
contract UserWallet {
Controller controller;
function () payable {
address dest = controller.destination();
dest.transfer(msg.value);
controller.logSweep(this, dest, 0, msg.value);
}
function tokenFallback(address _from, uint _value, bytes _data) {
}
function sweep(address _token, uint _amount) returns (bool) {
return controller.sweeperOf(_token).delegatecall(msg.data);
}
}