Deposit wallet that accepts ether through a payable fallback and routes token sweeps through a central sweeper list by delegatecall.
Historical Significance
A later build of the same deposit-wallet design, compiled with the optimizer off. The delegatecall indirection is what makes this scale: an exchange can deploy addresses continuously and still change how sweeps work, because none of the logic lives in the addresses it handed out.
Token Information
Key Facts
Description
One storage slot holds the sweeper list, set at construction. The payable fallback is empty, which is the point: the address can receive ether from an ordinary transfer with no further logic.
sweep asks the list which sweeper is registered for the given token, then delegatecalls it with the calldata it received. The sweeper's code executes against this wallet's storage and balance, so a single deployed sweeper serves every wallet, and swapping it out changes behaviour everywhere at once.
The amount parameter is read and discarded in the body with a bare expression statement. The sweeper needs it, and it is already in the calldata being forwarded, so the wallet has no use for it beyond keeping the signature honest.
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)
contract UserWallet {
AbstractSweeperList sweeperList;
function UserWallet(address _sweeperlist) {
sweeperList = AbstractSweeperList(_sweeperlist);
}
function () public payable { }
function sweep(address _token, uint _amount)
returns (bool) {
(_amount);
return sweeperList.sweeperOf(_token).delegatecall(msg.data);
}
}
contract AbstractSweeperList {
function sweeperOf(address _token) returns (address);
}