Back to Home

Proxy

Unclassified
0xb52749b42000...95bd38dee196
Spurious DragonContract #46KSource VerifiedEdit this contract
Deployed May 4, 2017 (9 years ago)Block 3,649,104

Upgradeable proxy that asks a settings contract both where to delegate and how many bytes the answer will be, because it predates RETURNDATASIZE.

Spurious Dragon EraVerified Source

Historical Significance

Byzantium made this contract obsolete. After RETURNDATASIZE, a proxy just copies whatever came back and the size table disappears. Reading this code is a good way to see what upgradeable proxies cost before that opcode existed. Every function added to the implementation also had to be registered, by selector, with its exact return width, or calls through the proxy would silently truncate.

Key Facts
Deployment Block
3,649,104
Deployment Date
May 4, 2017, 05:20 PM
Code Size
605.0 B
Gas at Deploy
235,308
Transactions by Year
20171

Description

One storage slot holds the settings contract. A call with empty calldata logs a Deposit and stops, so the address can be funded like an ordinary account. Anything else is forwarded.

Forwarding takes two reads from settings. The first, sizes, maps the incoming function selector to the number of bytes that function returns. The second, target, gives the current implementation. The proxy then copies its calldata to memory zero, delegatecalls the implementation with ten thousand gas held back, and returns exactly the number of bytes the first lookup promised.

That first lookup is the whole design. This is Homestead-era code, compiled before RETURNDATASIZE existed, so a proxy had no way to discover how much data a delegated call produced. The options were to guess a fixed size, or to keep a table. This one keeps a table, off-chain of itself, in a contract the operator can update alongside the implementation.

The selector is read straight out of calldata with inline assembly into a bytes32 and narrowed to bytes4 only at the point of the lookup.

Source Verified

Solidityeh_crack_source_verified
Compiler: v0.4.10
Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Unclassified

Bytecode Overview

Opcodes605
Unique Opcodes121
Jump Instructions30
Storage Operations6

External Links