From 985c5d305329fd9d400120d86dce5c386e19cd50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 16 May 2019 19:14:32 -0300 Subject: [PATCH] Final draft for IERC777. --- contracts/token/ERC777/IERC777.sol | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/contracts/token/ERC777/IERC777.sol b/contracts/token/ERC777/IERC777.sol index 6aaac74b2..6056f8c35 100644 --- a/contracts/token/ERC777/IERC777.sol +++ b/contracts/token/ERC777/IERC777.sol @@ -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,