Token.sol
1 // Abstract contract for the full ERC 20 Token standard 2 // https://github.com/ethereum/EIPs/issues/20 3 pragma solidity ^0.4.8; 4 5 contract Token { 6 /* This is a slight change to the ERC20 base standard. 7 function totalSupply() constant returns (uint256 supply); 8 is replaced with: 9 uint256 public totalSupply; 10 This automatically creates a getter function for the totalSupply. 11 This is moved to the base contract since public getter functions are not 12 currently recognised as an implementation of the matching abstract 13 function by the compiler. 14 */ 15 /// total amount of tokens 16 uint256 public totalSupply; 17 18 /// @param _owner The address from which the balance will be retrieved 19 /// @return The balance 20 function balanceOf(address _owner) constant returns (uint256 balance); 21 22 /// @notice send `_value` token to `_to` from `msg.sender` 23 /// @param _to The address of the recipient 24 /// @param _value The amount of token to be transferred 25 /// @return Whether the transfer was successful or not 26 function transfer(address _to, uint256 _value) returns (bool success); 27 28 /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` 29 /// @param _from The address of the sender 30 /// @param _to The address of the recipient 31 /// @param _value The amount of token to be transferred 32 /// @return Whether the transfer was successful or not 33 function transferFrom(address _from, address _to, uint256 _value) returns (bool success); 34 35 /// @notice `msg.sender` approves `_spender` to spend `_value` tokens 36 /// @param _spender The address of the account able to transfer the tokens 37 /// @param _value The amount of tokens to be approved for transfer 38 /// @return Whether the approval was successful or not 39 function approve(address _spender, uint256 _value) returns (bool success); 40 41 /// @param _owner The address of the account owning tokens 42 /// @param _spender The address of the account able to transfer the tokens 43 /// @return Amount of remaining tokens allowed to spent 44 function allowance(address _owner, address _spender) constant returns (uint256 remaining); 45 46 event Transfer(address indexed _from, address indexed _to, uint256 _value); 47 event Approval(address indexed _owner, address indexed _spender, uint256 _value); 48 }