Exchange deposit wallet (UserWallet). Owner-only ETH collection and ERC-20 token sweeping with Deposit event logging.
Key Facts
Description
The UserWallet is an exchange deposit wallet pattern deployed across large-scale exchange infrastructure in mid-2017. Each user depositing to an exchange receives their own dedicated contract instance, with the exchange hot wallet set as owner at construction time.
Incoming ETH triggers the payable fallback function, which emits a Deposit(sender, value, value) event with both sender and value as indexed parameters — enabling efficient off-chain event log filtering for the exchange to detect and credit incoming deposits without scanning all transactions.
The owner has three operational functions: collect() transfers all accumulated ETH to the owner address; collectToken(token, to, amount) sweeps ERC-20 tokens by calling the token contract directly via raw bytes4(0xa9059cbb) encoding of the transfer selector; and kill() selfdestructs the contract, forwarding any remaining ETH to owner.
This architecture — one contract per deposit address — was a common pattern among exchanges in 2017 before more efficient multicall and proxy patterns emerged. The raw .call() approach for ERC-20 sweeping predates the standardized SafeERC20 wrappers and reflects the tooling available at the time of deployment.
Source verification achieved with Solidity 0.4.11+commit.68ef5810 (optimizer ON). The reconstructed bytecode is 554 bytes vs 553 bytes on-chain — a 1-byte difference in the LOG3 event encoding sequence attributable to optimizer stack scheduling non-determinism in early Solidity releases.
Source Verified
554 bytes compiled vs 553 bytes on-chain (99.8% match). 1-byte optimizer stack scheduling variant in LOG3 event encoding — a known Solidity 0.4.x optimizer non-determinism with no behavioral difference. Compiler: solc 0.4.11+commit.68ef5810, optimizer ON.
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
Source verified through compiler archaeology (near-exact bytecode match).
View Verification ProofShow source code (Solidity)
pragma solidity ^0.4.11;
contract UserWallet {
address owner;
event Deposit(address indexed sender, uint256 indexed value, uint256 data);
function UserWallet(address _owner) { owner = _owner; }
function () payable { if (msg.value > 0) Deposit(msg.sender, msg.value, msg.value); }
function collectToken(address _tokenContract, address _to, uint256 _amount) {
if (msg.sender == owner) { if (!_tokenContract.call(bytes4(0xa9059cbb), _to, _amount)) throw; }
}
function kill() { if (msg.sender == owner) { selfdestruct(owner); } }
function collect() { if (msg.sender == owner) { owner.transfer(this.balance); } }
}External Links
Related contracts
Contract 0x21e3d6...2896a9
Same deployerOwner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit(from, value, 88) event; owner-only collect() sweeps the balance.
0x21e3d6...2896a9July 27, 2016Contract 0x6b15ac...270f81
Same deployerByte-identical deployment of an owner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit event; owner-only collect() sweeps ETH.
0x6b15ac...270f81July 27, 2016Contract 0xb2acdc...43b271
Same deployerByte-identical deployment of an owner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit event; owner-only collect() sweeps ETH.
0xb2acdc...43b271July 27, 2016Contract 0xb2b257...705e7f
Same deployerOwner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit(from, value, 88) event; owner-only collect() sweeps the balance.
0xb2b257...705e7fJuly 27, 2016Contract 0xbc2006...02f1ff
Same deployerByte-identical deployment of an owner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit event; owner-only collect() sweeps ETH.
0xbc2006...02f1ffJuly 27, 2016Contract 0x9bc55f...b53595
Same deployerByte-identical deployment of an owner-controlled deposit wallet (Homestead, Jul 2016): a payable fallback logs a Deposit event; owner-only collect() sweeps ETH.
0x9bc55f...b53595July 27, 2016