Back to Home

MyToken

Token
0x95815dae168d...684b996f4998
FrontierContract #2,666Source VerifiedEdit this contract
Deployed October 24, 2015 (10 years ago)Block 434,877

The 2015 tutorial token renamed to MyToken, leaving its initialiser as a public function any account can call to set its own balance.

Frontier EraVerified Source

Historical Significance

A copy of the tutorial token broken by a one-word edit: the contract was renamed and the initialiser was not, so what should have been a constructor became a public function. In 2015 the constructor was just the function sharing the contract's name, which made this a mistake anyone renaming a contract could make silently.

Context

Ethereum's Frontier network went live on 30 July 2015. The tutorial token of that period predates ERC-20: balances are read through coinBalanceOf, transfers are sent with sendCoin, and the event announcing one is called CoinTransfer.

Key Facts
Deployment Block
434,877
Deployment Date
Oct 24, 2015, 11:36 PM
Code Size
296.0 B
Gas at Deploy
95,721

Description

The token from the 2015 ethereum.org tutorial, in the form that predates ERC-20. It keeps one public mapping of balances, hands the whole supply to whoever creates it, and moves units with sendCoin(receiver, amount), which checks the sender's balance, returns false rather than reverting when it is short, and announces a successful move with a CoinTransfer event.

There is no approval, no allowance, no decimals, no name and no symbol. The supply is set once and cannot be added to.

The contract carries a defect that survives in the deployed code. Its initialiser is named token, but the contract is not, so it is not a constructor: it never ran at deployment, and it is a public function that any account can call at any time to write itself whatever balance it likes. Nothing about the supply is fixed and nothing restricts who sets it.

The default it writes when called with zero is 90,000,000 units, in place of the 1,000,000,000 the published tutorial used.

Heuristic Analysis

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

Detected Type: Token
Has ERC-20-like patterns

Bytecode Overview

Opcodes296
Unique Opcodes82
Jump Instructions15
Storage Operations9

External Links

Related contracts