Final draft for IERC777.

This commit is contained in:
Nicolás Venturo
2019-05-16 19:14:32 -03:00
parent b7c250b7cb
commit 985c5d3053

View File

@ -2,6 +2,12 @@ pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC777Token standard as defined in the EIP.
*
* This contract uses the
* [`ERC1820Registry`](https://eips.ethereum.org/EIPS/eip-1820) to let token
* holders and recipients react to token movements by using setting implementers
* for the associated interfaces in said registry. See `IERC1820Registry` and
* `ERC1820Implementer`.
*/
interface IERC777 {
/**
@ -43,6 +49,12 @@ interface IERC777 {
* `operatorData`. See `IERC777Sender` and `IERC777Recipient`.
*
* Emits a `Sent` event.
*
* Requirements
*
* - the caller must have at least `amount` tokens.
* - `to` cannot be the zero address.
* - if `to` is a contract, it must implement the tokensReceived interface.
*/
function send(address to, uint256 amount, bytes calldata data) external;
@ -54,6 +66,10 @@ interface IERC777 {
* will be called with `data` and empty `operatorData`. See `IERC777Sender`.
*
* Emits a `Burned` event.
*
* Requirements
*
* - the caller must have at least `amount` tokens.
*/
function burn(uint256 amount, bytes calldata data) external;
@ -111,6 +127,14 @@ interface IERC777 {
* `operatorData`. See `IERC777Sender` and `IERC777Recipient`.
*
* Emits a `Sent` event.
*
* Requirements
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens.
* - the caller must be an operator for `from`.
* - `to` cannot be the zero address.
* - if `to` is a contract, it must implement the tokensReceived interface.
*/
function operatorSend(
address from,
@ -128,6 +152,12 @@ interface IERC777 {
* will be called with `data` and `operatorData`. See `IERC777Sender`.
*
* Emits a `Burned` event.
*
* Requirements
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens.
* - the caller must be an operator for `from`.
*/
function operatorBurn(
address from,