Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERC777: Add function modifiers #1920

Merged
merged 1 commit into from
Apr 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions EIPS/eip-777.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand All @@ -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**
Expand All @@ -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**
Expand All @@ -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>
>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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**
Expand All @@ -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>

Expand All @@ -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>

Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down