Back to Home

TokenTraderFactory

Utility
0x780a5c18c5e6...89bd93600d50
Spurious DragonSource VerifiedEdit this contract
Deployed November 26, 2016 (9 years ago)Block 2,695,095

The factory behind the TokenTrader contracts: it deploys a trader per asset and price, hands it to the caller, and vouches for what it built.

Spurious Dragon EraVerified Source

Historical Significance

The registry is the useful half: a contract that says which addresses it deployed lets a stranger verify the code behind an offer without reading bytecode, which is the problem every later factory and token-list had to solve. It is also an early example of contracts being created by other contracts as ordinary practice rather than as a demonstration.

Context

Deployed in late 2016 and early 2017, after ERC-20 had settled the transfer interface but before automated market makers with a pricing curve existed. Trading a token then meant a centralised exchange listing it or a contract like this one quoting a fixed price.

Key Facts
Deployment Block
2,695,095
Deployment Date
Nov 26, 2016, 01:24 AM
Code Size
2.7 KB

Description

The factory that produces TokenTrader contracts. createTradeContract takes an asset address, the prices, the lot size and the trading switches, refuses a buy price above the sell price and a lot size of zero, deploys the trader, and transfers its ownership to whoever made the call.

It keeps a public mapping recording every trader it created, so a buyer can check that a contract offering to trade with them came from this factory and therefore runs the code the factory compiles. Trading pairs are identified by the hash of the asset address and the lot size, and the first trader for a pair emits an event announcing a new book alongside the listing event emitted for every trader.

The factory takes no fee and keeps no funds.

Heuristic Analysis

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

Detected Type: Utility

Bytecode Overview

Opcodes2,740
Unique Opcodes175
Jump Instructions149
Storage Operations48

External Links

Related contracts