From 5dc879024aeb906b59e8ac4207c63a8e940d8ee5 Mon Sep 17 00:00:00 2001 From: Fabian Vogelsteller Date: Mon, 24 Apr 2017 15:42:04 +0200 Subject: [PATCH] reformatted --- EIPS/eip-token-standard.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/EIPS/eip-token-standard.md b/EIPS/eip-token-standard.md index a7ffa494..59806a76 100644 --- a/EIPS/eip-token-standard.md +++ b/EIPS/eip-token-standard.md @@ -44,6 +44,8 @@ function totalSupply() constant returns (uint256 totalSupply) ``` Get the total token supply + + #### balanceOf ``` js @@ -51,6 +53,8 @@ function balanceOf(address _owner) constant returns (uint256 balance) ``` Get the account balance of another account with address `_owner` + + #### transfer ``` js @@ -58,6 +62,8 @@ function transfer(address _to, uint256 _value) returns (bool success) ``` Send `_value` amount of tokens to address `_to` + + #### transferFrom ``` js @@ -67,6 +73,8 @@ function transferFrom(address _from, address _to, uint256 _value) returns (bool Send `_value` amount of tokens from address `_from` to address `_to` The `transferFrom` method is used for a withdraw workflow, allowing contracts to send tokens on your behalf, for example to "deposit" to a contract address and/or to charge fees in sub-currencies; the command should fail unless the `_from` account has deliberately authorized the sender of the message via some mechanism; we propose these standardized APIs for approval: + + #### approve ``` js @@ -76,6 +84,8 @@ function approve(address _spender, uint256 _value) returns (bool success) Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value. To prevent attack vectors like described here: https://docs.google.com/document/d/1YLPtQxZu1UAvO9cZ1O2RPXBbT0mooh4DYKjA_jp-RLM/ make sure to set the allowance to 0 before setting it to another value for the same spender. + + #### allowance ``` js @@ -83,7 +93,11 @@ function allowance(address _owner, address _spender) constant returns (uint256 r ``` Returns the amount which `_spender` is still allowed to withdraw from `_owner` + + ### Events + + #### Transfer ``` js @@ -91,6 +105,8 @@ event Transfer(address indexed _from, address indexed _to, uint256 _value) ``` Triggered when tokens are transferred. + + #### Approval ``` js