mirror of https://github.com/status-im/EIPs.git
ERC777: Add function modifiers (#1920)
This commit is contained in:
parent
c8f3b4e300
commit
6bf57fbfc6
|
@ -139,6 +139,7 @@ function name() external view returns (string memory)
|
|||
|
||||
Get the name of the token, e.g., `"MyToken"`.
|
||||
|
||||
> <small>**identifier:** `06fdde03`</small>
|
||||
> <small>**returns:** Name of the token.</small>
|
||||
|
||||
**`symbol` function**
|
||||
|
@ -149,6 +150,7 @@ function symbol() external view returns (string memory)
|
|||
|
||||
Get the symbol of the token, e.g., `"MYT"`.
|
||||
|
||||
> <small>**identifier:** `95d89b41`</small>
|
||||
> <small>**returns:** Symbol of the token.</small>
|
||||
|
||||
**`totalSupply` function**
|
||||
|
@ -165,6 +167,7 @@ returned by the `balanceOf` function.
|
|||
*NOTE*: The total supply MUST be equal to the sum of all the minted tokens
|
||||
as defined in all the `Minted` events minus the sum of all the burned tokens as defined in all the `Burned` events.
|
||||
|
||||
> <small>**identifier:** `18160ddd`</small>
|
||||
> <small>**returns:** Total supply of tokens currently in circulation.</small>
|
||||
|
||||
**`balanceOf` function**
|
||||
|
@ -177,6 +180,7 @@ Get the balance of the account with address `holder`.
|
|||
|
||||
The balance MUST be zero (`0`) or higher.
|
||||
|
||||
> <small>**identifier:** `70a08231`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`holder`: Address for which the balance is returned.</small>
|
||||
>
|
||||
|
@ -210,6 +214,7 @@ The following rules MUST be applied regarding the *granularity*:
|
|||
*NOTE*: Most of the tokens SHOULD be fully partition-able.
|
||||
I.e., this function SHOULD return `1` unless there is a good reason for not allowing any fraction of the token.
|
||||
|
||||
> <small>**identifier:** `556f0dc7`</small>
|
||||
> <small>**returns:** The smallest non-divisible part of the token.</small>
|
||||
|
||||
*NOTE*: [`defaultOperators`][defaultOperators] and [`isOperatorFor`][isOperatorFor] are also `view` functions,
|
||||
|
@ -322,6 +327,7 @@ Get the list of *default operators* as defined by the token contract.
|
|||
|
||||
*NOTE*: If the token contract does not have any *default operators*, this function MUST return an empty list.
|
||||
|
||||
> <small>**identifier:** `06e48538`</small>
|
||||
> <small>**returns:** List of addresses of all the *default operators*.
|
||||
|
||||
**`authorizeOperator` function**
|
||||
|
@ -337,6 +343,7 @@ This right SHALL NOT be revoked.
|
|||
Hence this function MUST `revert` if it is called to authorize the holder (`msg.sender`)
|
||||
as an *operator* for itself (i.e. if `operator` is equal to `msg.sender`).
|
||||
|
||||
> <small>**identifier:** `959b8c3f`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`operator`: Address to set as an *operator* for `msg.sender`.</small>
|
||||
|
||||
|
@ -354,6 +361,7 @@ This right SHALL NOT be revoked.
|
|||
Hence this function MUST `revert` if it is called to revoke the holder (`msg.sender`)
|
||||
as an *operator* for itself (i.e., if `operator` is equal to `msg.sender`).
|
||||
|
||||
> <small>**identifier:** `fad8b32a`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`operator`: Address to rescind as an *operator* for `msg.sender`.</small>
|
||||
|
||||
|
@ -365,6 +373,7 @@ function isOperatorFor(address operator, address holder) external view returns (
|
|||
|
||||
Indicate whether the `operator` address is an *operator* of the `holder` address.
|
||||
|
||||
> <small>**identifier:** `d95b6371`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`operator`: Address which may be an *operator* of `holder`.</small>
|
||||
> <small>`holder`: Address of a *holder* which may have the `operator` address as an *operator*.</small>
|
||||
|
@ -484,6 +493,7 @@ Send the `amount` of tokens from the address `msg.sender` to the address `to`.
|
|||
|
||||
The *operator* and the *holder* MUST both be the `msg.sender`.
|
||||
|
||||
> <small>**identifier:** `9bd9bbc6`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`to`: Recipient of the tokens.</small>
|
||||
> <small>`amount`: Number of tokens to send.</small>
|
||||
|
@ -506,6 +516,7 @@ This call MUST be equivalent to `send` with the addition
|
|||
that the *operator* MAY specify an explicit value for `operatorData`
|
||||
(which cannot be done with the `send` function).
|
||||
|
||||
> <small>**identifier:** `62ad1b83`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`from`: *Holder* whose tokens are being sent.</small>
|
||||
> <small>`to`: Recipient of the tokens.</small>
|
||||
|
@ -675,6 +686,7 @@ Burn the `amount` of tokens from the address `msg.sender`.
|
|||
|
||||
The *operator* and the *holder* MUST both be the `msg.sender`.
|
||||
|
||||
> <small>**identifier:** `fe9d9303`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`amount`: Number of tokens to burn.</small>
|
||||
> <small>`data`: Information provided by the *holder*.</small>
|
||||
|
@ -690,6 +702,7 @@ Burn the `amount` of tokens on behalf of the address `from`.
|
|||
*Reminder*: If the *operator* address is not an authorized operator of the `from` address,
|
||||
then the burn process MUST `revert`.
|
||||
|
||||
> <small>**identifier:** `fc673c4f`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`from`: *Holder* whose tokens will be burned.</small>
|
||||
> <small>`amount`: Number of tokens to burn.</small>
|
||||
|
@ -740,6 +753,7 @@ by the `operator` address.
|
|||
|
||||
*NOTE*: This function MUST NOT be called outside of a burn, send or [ERC20] transfer process.
|
||||
|
||||
> <small>**identifier:** `75ab9782`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`operator`: Address which triggered the balance decrease (through sending or burning).</small>
|
||||
> <small>`from`: *Holder* whose tokens were sent.</small>
|
||||
|
@ -825,6 +839,7 @@ by the `operator` address.
|
|||
|
||||
*NOTE*: This function MUST NOT be called outside of a mint, send or [ERC20] transfer process.
|
||||
|
||||
> <small>**identifier:** `0023de29`</small>
|
||||
> <small>**parameters**</small>
|
||||
> <small>`operator`: Address which triggered the balance increase (through sending or minting).</small>
|
||||
> <small>`from`: *Holder* whose tokens were sent (or `0x0` for a mint).</small>
|
||||
|
|
Loading…
Reference in New Issue