Automatically merged updates to draft EIP(s) 777

Hi, I'm a bot! This change was automatically merged because:

 - It only modifies existing Draft or Last Call EIP(s)
 - The PR was approved or written by at least one author of each modified EIP
 - The build is passing
This commit is contained in:
Jacques Dafflon 2019-03-25 01:12:29 +01:00 committed by EIP Automerge Bot
parent e269280362
commit 48b2ff3cdf
1 changed files with 28 additions and 24 deletions

View File

@ -40,22 +40,28 @@ This standard tries to improve the widely used [ERC20] token standard. The main
``` solidity
interface ERC777Token {
function name() external view returns (string);
function symbol() external view returns (string);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function balanceOf(address tokenHolder) external view returns (uint256);
function granularity() external view returns (uint256);
function defaultOperators() external view returns (address[]);
function defaultOperators() external view returns (address[] memory);
function isOperatorFor(address operator, address tokenHolder) external view returns (bool);
function authorizeOperator(address operator) external;
function revokeOperator(address operator) external;
function isOperatorFor(address operator, address tokenHolder) external view returns (bool);
function send(address to, uint256 amount, bytes data) external;
function operatorSend(address from, address to, uint256 amount, bytes data, bytes operatorData) external;
function send(address to, uint256 amount, bytes calldata data) external;
function operatorSend(
address from,
address to,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external;
function burn(uint256 amount, bytes data) external;
function operatorBurn(address from, uint256 amount, bytes data, bytes operatorData) external;
function burn(uint256 amount, bytes calldata data) external;
function operatorBurn(address from, uint256 amount, bytes calldata data, bytes calldata operatorData) external;
event Sent(
address indexed operator,
@ -108,7 +114,7 @@ The `view` functions detailed below MUST be implemented.
**`name` function**
``` solidity
function name() external view returns (string)
function name() external view returns (string memory)
```
Get the name of the token, e.g., `"MyToken"`.
@ -118,7 +124,7 @@ Get the name of the token, e.g., `"MyToken"`.
**`symbol` function**
``` solidity
function symbol() external view returns (string)
function symbol() external view returns (string memory)
```
Get the symbol of the token, e.g., `"MYT"`.
@ -248,7 +254,7 @@ Token contracts MAY implement other functions to manage *operators*.
**`defaultOperators` function** <a id="defaultOperators"></a>
``` solidity
function defaultOperators() external view returns (address[])
function defaultOperators() external view returns (address[] memory)
```
Get the list of *default operators* as defined by the token contract.
@ -373,7 +379,7 @@ Token contracts MAY implement other functions to send tokens.
**`send` function**
``` solidity
function send(address to, uint256 amount, bytes data) external
function send(address to, uint256 amount, bytes calldata data) external
```
Send the `amount` of tokens from the address `msg.sender` to the address `to`.
@ -388,7 +394,7 @@ The *operator* and the *token holder* MUST both be the `msg.sender`.
**`operatorSend` function**
``` solidity
function operatorSend(address from, address to, uint256 amount, bytes data, bytes operatorData) external
function operatorSend(address from, address to, uint256 amount, bytes calldata data, bytes calldata operatorData) external
```
Send the `amount` of tokens on behalf of the address `from` to the address `to`.
@ -525,7 +531,7 @@ Token contracts MAY implement other functions to burn tokens.
**`burn` function**
``` solidity
function burn(uint256 amount, bytes data) external;
function burn(uint256 amount, bytes calldata data) external
```
Burn the `amount` of tokens from the address `msg.sender`.
@ -539,7 +545,7 @@ The *operator* and the *token holder* MUST both be the `msg.sender`.
**`operatorBurn` function**
``` solidity
function operatorBurn(address from, uint256 amount, bytes data, bytes operatorData) external;
function operatorBurn(address from, uint256 amount, bytes calldata data, bytes calldata operatorData) external
```
Burn the `amount` of tokens on behalf of the address `from`.
@ -569,8 +575,8 @@ interface ERC777TokensSender {
address from,
address to,
uint256 amount,
bytes data,
bytes operatorData
bytes calldata userData,
bytes calldata operatorData
) external;
}
```
@ -580,7 +586,7 @@ interface ERC777TokensSender {
**`tokensToSend`**
``` solidity
function tokensToSend(address operator, address from, address to, uint256 amount, bytes data, bytes operatorData) external
function tokensToSend(address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData) external
```
Notify a send or burn (if `to` is `0x0`) of `amount` tokens from the `from` address to the `to` address by the `operator` address.
@ -626,8 +632,8 @@ interface ERC777TokensRecipient {
address from,
address to,
uint256 amount,
bytes data,
bytes operatorData
bytes calldata data,
bytes calldata operatorData
) external;
}
```
@ -642,7 +648,7 @@ If the *recipient* is a contract, which has not registered an `ERC777TokensRecip
**`tokensReceived`**
``` solidity
function tokensReceived(address operator, address from, address to, uint256 amount, bytes data, bytes operatorData) external
function tokensReceived(address operator, address from, address to, uint256 amount, bytes calldata data, bytes calldata operatorData) external
```
Notify a send or mint (if `from` is `0x0`) of `amount` tokens from the `from` address to the `to` address by the `operator` address.
@ -780,14 +786,12 @@ The [repository with the reference implementation][0xjac/ERC777] contains all th
The GitHub repository [0xjac/ERC777] contains the [reference implementation]. The reference implementation is also available via [npm][npm/erc777] and can be installed with `npm install erc777`.
## Copyright
Copyright and related rights waived via [CC0].
[operators]: #operators
[ERC20]: https://eips.ethereum.org/EIPS/eip-20
[ERC777]: https://eips.ethereum.org/EIPS/eip-777
[ERC1820]: https://eips.ethereum.org/EIPS/eip-1820