ERC223-aware withdrawal wallet that looks up a per-token withdrawer contract and delegates the entire call to it.
Historical Significance
Splitting the withdrawal logic out per token was a practical answer to a real problem: tokens of this era disagreed on whether transfer returned a value, some reverted on zero amounts, and a few required an allowance reset before a second approval. Rather than encode every quirk in each deposit address, the operator could register a withdrawer for each awkward token and leave the wallets untouched.
Token Information
Key Facts
Description
The contract holds a single registry address. withdraw asks that registry for the withdrawer registered against the given token, then delegatecalls it with the original calldata and logs the boolean result. Running the withdrawer's code in this contract's own storage context means the withdrawer can move balances that belong to the wallet.
tokenFallback is implemented and deliberately empty so that ERC223 tokens, which call back into the receiving contract on transfer, do not cause the transfer to fail. The payable fallback accepts ether without comment.
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 Registry {
function withdrawerOf(address _token) constant returns (address);
}
contract Wallet {
Registry registry;
event LogWithdrawBalance(bool);
function () payable {
}
function tokenFallback(address _from, uint256 _value, bytes _data) {
}
function withdraw(address _token, uint256 _amount) returns (bool) {
bool ok = registry.withdrawerOf(_token).delegatecall(msg.data);
LogWithdrawBalance(ok);
return ok;
}
}