An IOU token created by a RipplePay-style contract: only its parent may move balances, so it exists to make a credit line visible in a wallet.
Historical Significance
Ripple's model is credit between named parties rather than a bearer asset, and this is an attempt to carry that onto Ethereum: the obligation is recorded by a central contract, and the token exists only so a wallet has something to display. It is an early example of a contract wearing the token interface without being transferable, which the standards of the time had no way to signal, so a wallet showing this balance gives its holder no hint that they cannot spend it.
Context
Deployed in April 2016, when the Ethereum Wallet listed any contract answering balanceOf, name, symbol and decimals as a token. Nothing in ERC-20 as drafted distinguished a transferable token from a display of somebody else's ledger.
Token Information
Key Facts
Description
A balance display for a credit line rather than a token anyone can spend. It carries a name, a symbol and a decimals field, a public balanceOf mapping and a Transfer event, which is enough for a wallet of the period to show it, but its transfer function takes a from address as well as a to and throws unless the caller is the owner.
That owner is the contract that created it. A parent named RipplePayMain deploys one of these per currency through newCurrency and moves balances through issueIOU, so the ledger of who owes what lives in the parent and this contract only mirrors it. A holder cannot send their own balance to anyone.
This instance was created with the name XYZ, the symbol XYZ and zero decimal places.
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
This contract has verified source code on Etherscan.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract IOU {
address owner;
/* Public variables of the token */
string public name;
string public symbol;
uint8 public decimals;
/* This creates an array with all balances */
mapping (address => uint256) public balanceOf;
/* This generates a public event on the blockchain that will notify clients */
event Transfer(address indexed from, address indexed to, uint256 value);
function IOU(string tokenName, string tokenSymbol, uint8 decimalUnits) {
owner = msg.sender; // sets main RipplePay contract as owner
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
decimals = decimalUnits; // Amount of decimals for display purposes
}
/* update balances so they display in ethereum-wallet */
function transfer(address _from, address _to, uint256 _value) {
if(msg.sender != owner) throw; // can only be invoked by main RipplePay contract
balanceOf[_from] -= _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
}
}
contract RipplePayMain {
mapping(string => address) currencies;
function newCurrency(string currencyName, string currencySymbol, uint8 decimalUnits){
currencies[currencySymbol] = new IOU(currencyName, currencySymbol, decimalUnits);
}
function issueIOU(string _currency, uint256 _amount, address _to){
// update creditLines in main contract, then update balances in IOU contract to display in ethereum-wallet
IOU(currencies[_currency]).transfer(msg.sender, _to, _amount);
}
}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, 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, 2016CampusCoin
Same eraByte-identical deployment of: Standard ethereum.org tutorial token (Homestead, Mar 2016): name/symbol/decimals metadata, a public balanceOf mapping and an overf
0x00f0b1...e6fcd2March 16, 2016