mirror of https://github.com/status-im/EIPs.git
reformatted
This commit is contained in:
parent
7f9a46bfe5
commit
5dc879024a
|
@ -44,6 +44,8 @@ function totalSupply() constant returns (uint256 totalSupply)
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the total token supply
|
Get the total token supply
|
||||||
|
|
||||||
|
|
||||||
#### balanceOf
|
#### balanceOf
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
@ -51,6 +53,8 @@ function balanceOf(address _owner) constant returns (uint256 balance)
|
||||||
```
|
```
|
||||||
|
|
||||||
Get the account balance of another account with address `_owner`
|
Get the account balance of another account with address `_owner`
|
||||||
|
|
||||||
|
|
||||||
#### transfer
|
#### transfer
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
@ -58,6 +62,8 @@ function transfer(address _to, uint256 _value) returns (bool success)
|
||||||
```
|
```
|
||||||
|
|
||||||
Send `_value` amount of tokens to address `_to`
|
Send `_value` amount of tokens to address `_to`
|
||||||
|
|
||||||
|
|
||||||
#### transferFrom
|
#### transferFrom
|
||||||
|
|
||||||
``` js
|
``` 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`
|
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:
|
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
|
#### approve
|
||||||
|
|
||||||
``` js
|
``` 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.
|
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/
|
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.
|
make sure to set the allowance to 0 before setting it to another value for the same spender.
|
||||||
|
|
||||||
|
|
||||||
#### allowance
|
#### allowance
|
||||||
|
|
||||||
``` js
|
``` 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`
|
Returns the amount which `_spender` is still allowed to withdraw from `_owner`
|
||||||
|
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
|
||||||
|
|
||||||
#### Transfer
|
#### Transfer
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
@ -91,6 +105,8 @@ event Transfer(address indexed _from, address indexed _to, uint256 _value)
|
||||||
```
|
```
|
||||||
|
|
||||||
Triggered when tokens are transferred.
|
Triggered when tokens are transferred.
|
||||||
|
|
||||||
|
|
||||||
#### Approval
|
#### Approval
|
||||||
|
|
||||||
``` js
|
``` js
|
||||||
|
|
Loading…
Reference in New Issue