ETHERLITE (LETH), a May 2016 token on the ethereum.org template with built-in buy and sell for ETH and a small fee on purchases.
Historical Significance
An early attempt to put a token's own market inside the token contract, using the ethereum.org template. The buy and sell prices differ by a factor of 10^8 (buy charges 1/10000 wei per unit, sell pays 10000 wei per unit). Source reconstructed from bytecode; exact runtime and creation match with solc v0.2.1, verified on Etherscan and Sourcify.
Context
Deployed on 4 May 2016 by 0xe4282c8d102f650882aff3c00dcef89dbdc02d0f, one of a series of token experiments from that address in the same hour, two days before it deployed two plain MyToken contracts that were verified on Etherscan. The contract still holds its entire supply and no ETH.
Token Information
Key Facts
Description
ETHERLITE extends the 2016 ethereum.org MyToken template (transfer, transferFrom with spentAllowance, approveAndCall, a version string, here "1.1") with an exchange built into the contract. buy() sets feeaddress to the deployer, issues msg.value x 10000 token units out of the contract's own balance, and keeps back 1/10000 of them as a fee, emitted as a Transfer to feeaddress but never credited to it. sell() returns tokens to the contract and sends back 10000 wei per token unit. Supply is 10^30 units with 2 decimals.
Source Verified
Template identification only, not a byte-for-byte source-code crack. The selector signature matches the 2016 'TutorialToken' example from the Solidity documentation (ConsenSys HumanStandardToken + unitsOneEthCanBuy + buy() + sell()). I have not produced an exact compiled match.
Historian Categories
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Homestead Era
The first planned hard fork. Removed the canary contract, adjusted gas costs.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); }
contract MyToken {
/* Initializes contract with initial supply tokens to the creator of the contract */
function MyToken(uint256 initialSupply, string tokenName, uint8 decimalUnits, string tokenSymbol, string versionOfTheCode) {
balanceOf[msg.sender] = initialSupply; // Give the creator all initial tokens
totalSupply = initialSupply; // Update total supply
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
version = versionOfTheCode;
}
/* Send coins */
/* Allow another contract to spend some tokens in your behalf */
/* A contract attempts to get the coins */
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (balanceOf[_from] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (spentAllowance[_from][msg.sender] + _value > allowance[_from][msg.sender]) throw; // Check allowance
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
spentAllowance[_from][msg.sender] += _value;
Transfer(_from, _to, _value);
return true;
}
function transfer(address _to, uint256 _value) {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
function buy() returns (uint amount) {
uint price = 10000;
feeaddress = 0xe4282c8d102f650882aff3c00dcef89dbdc02d0f;
amount = msg.value * price;
uint fee;
uint netamount = amount / price * 9999;
fee = amount - netamount;
if (balanceOf[this] < netamount) throw;
balanceOf[msg.sender] += netamount;
balanceOf[this] -= netamount + fee;
Transfer(this, msg.sender, netamount);
Transfer(this, feeaddress, fee);
}
function sell(uint amount) returns (uint revenue) {
uint price = 10000;
if (balanceOf[msg.sender] < amount) throw;
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
revenue = amount * price;
msg.sender.send(revenue);
Transfer(msg.sender, this, amount);
return revenue;
}
/* Public variables of the token */
string public name;
string public symbol;
string public version;
uint8 public decimals;
uint256 public totalSupply;
address public feeaddress;
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => mapping (address => uint256)) public spentAllowance;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) {
allowance[msg.sender][_spender] = _value;
tokenRecipient spender = tokenRecipient(_spender);
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
/* This unnamed function is called whenever someone tries to send ether to it */
function () {
throw; // Prevents accidental sending of ether
}
}External Links
Related contracts
token
Same eraBare Homestead-era token (Mar 14 2016): public balanceOf mapping + a single unchecked transfer firing the standard Transfer event.
0xc77f06...494c69March 14, 2016DinastyCoinToken
Same eraHomestead-era transfer-only token, DinastyCoinToken (DCT), fixed supply 200000000 and 6 decimals.
0x3693fd...c11466March 14, 2016token
Same eraMinimal Homestead-era token shell (Mar 14 2016): just a public balanceOf mapping and its compiler-generated getter, with no other functions.
0x38e1da...41a81aMarch 14, 2016DianstyCoinToken
Same eraDianstyCoinToken (DCT), a named Ethereum token deployed on 14 March 2016.
0x6d4de8...d5dba4March 14, 2016sultancoin
Same eraA fixed-supply token with direct transfers only, deployed March 2016.
0x9a11ff...0b797dMarch 15, 2016666๐
Same eraSix hundred and sixty six units, named and ticketed with a ram emoji.
0x7684aa...d0ed06March 16, 2016