Back to Home

SweepableWallet

0xee1012e02027...b43d3c474bb3
ByzantiumSource VerifiedEdit this contract
Deployed September 13, 2018 (8 years ago)Block 6,325,965

Late 2018 custody address that anyone may empty, provided the money goes to its owner: one function moves ether or any ERC20, with the wallet's own address standing in for ether.

Byzantium EraVerified Source

Historical Significance

Most deposit addresses of this period solve the collection problem by giving the sweeper the keys. This one inverts it. By making the destination, not the caller, the thing that is authorised, the wallet turns sweeping into a permissionless operation that cannot be misdirected. The private key stays offline and the sweeping infrastructure becomes disposable.

The other idea in here is the sentinel. Treating the contract's own address as the name for ether gives a single function signature that covers both asset kinds, years before the practice of using the zero address for the same purpose settled into convention. It is a small piece of interface design, made by someone who had to operate several hundred of these and did not want two code paths to reason about.

Token Information
Decimals
0
Key Facts
Deployment Block
6,325,965
Deployment Date
Sep 13, 2018, 08:02 PM
Code Size
1.0 KB

Description

The interface is borrowed from ERC20 and used for something else. transferFrom takes a token, a destination and an amount, and balanceOf takes a token, but the token argument is a selector rather than a subject: pass the wallet's own address and it means ether, pass anything else and it means that contract's balance held here. One code path, two asset kinds, no separate withdrawEther.

The access rule is the part worth reading twice. A caller is allowed through if it is the owner, or if the destination is the owner. Anyone at all can therefore push the wallet's contents home, and only the owner can send them anywhere else. That is deliberate: it lets an operator run an automated collector that holds no private key of any consequence, because the worst a compromised collector can do is move money to the address it was already going to.

Ether leaves through send wrapped in a require rather than transfer, which keeps the 2300 gas stipend and produces a plain revert instead of bubbling the callee's error. The ERC20 interface it compiles against declares transfer as returning nothing, so the token's return value is never examined, only the success of the call. Each move logs a Transfer event with the token and destination indexed, reusing the ERC20 topic for an outbound sweep.

Source Verified

Solidityeh_crack_source_verified
Compiler: v0.4.24

Bytecode Overview

Opcodes1,061
Unique Opcodes147
Jump Instructions54
Storage Operations11

External Links

Related contracts