Skip to content

Commit

Permalink
ERC777: Add constraint to revert if hooks revert
Browse files Browse the repository at this point in the history
This constraint was present implicitly and has been added explicitly for
clarity.
  • Loading branch information
0xjac committed Apr 29, 2019
1 parent 19c47ef commit aa84e71
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EIPS/eip-777.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ The token contract MUST `revert` when sending in any of the following cases:

- Any of the resulting balances becomes negative, i.e. becomes less than zero (`0`).

- The `tokensToSend` hook of the *holder* `revert`s.

- The `tokensReceived` hook of the *recipient* `revert`s.

The token contract MAY send tokens from many *holders*, to many *recipients*, or both. In this case:

- The previous send rules MUST apply to all the *holders* and all the *recipients*.
Expand Down Expand Up @@ -598,6 +602,7 @@ The token contract MUST `revert` when minting in any of the following cases:
- The resulting *recipient* balance after the mint is not a multiple of the *granularity* defined by the token contract.
- The *recipient* is a contract, and it does not implement the `ERC777TokensRecipient` interface via [ERC1820].
- The address of the *recipient* is `0x0`.
- The `tokensReceived` hook of the *recipient* `revert`s.

*NOTE*: The initial token supply at the creation of the token contract MUST be considered as minting
for the amount of the initial supply to the address(es) receiving the initial supply.
Expand Down Expand Up @@ -687,6 +692,8 @@ The token contract MUST `revert` when burning in any of the following cases:

- The address of the *holder* is `0x0`.

- The `tokensToSend` hook of the *holder* `revert`s.

*[ERC20] compatibility requirement*:
While a `Sent` event MUST NOT be emitted when burning;
if the token contract is [ERC20] enabled, a `Transfer` event with the `to` parameter set to `0x0` SHOULD be emitted.
Expand Down

0 comments on commit aa84e71

Please sign in to comment.