EIP20Interface.sol 2.4 KB

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