Move event definition at the top of IERC20, IERC777 and IERC1820 (#3228)

This commit is contained in:
Jean Cvllr
2022-03-30 16:36:37 +01:00
committed by GitHub
parent e7719ded56
commit 3f49408fb6
3 changed files with 42 additions and 26 deletions

View File

@ -7,6 +7,20 @@ pragma solidity ^0.8.0;
* @dev Interface of the ERC20 standard as defined in the EIP. * @dev Interface of the ERC20 standard as defined in the EIP.
*/ */
interface IERC20 { interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/** /**
* @dev Returns the amount of tokens in existence. * @dev Returns the amount of tokens in existence.
*/ */
@ -65,18 +79,4 @@ interface IERC20 {
address to, address to,
uint256 amount uint256 amount
) external returns (bool); ) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
} }

View File

@ -13,6 +13,30 @@ pragma solidity ^0.8.0;
* {ERC1820Implementer}. * {ERC1820Implementer}.
*/ */
interface IERC777 { interface IERC777 {
/**
* @dev Emitted when `amount` tokens are created by `operator` and assigned to `to`.
*
* Note that some additional user `data` and `operatorData` can be logged in the event.
*/
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
/**
* @dev Emitted when `operator` destroys `amount` tokens from `account`.
*
* Note that some additional user `data` and `operatorData` can be logged in the event.
*/
event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);
/**
* @dev Emitted when `operator` is made operator for `tokenHolder`
*/
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
/**
* @dev Emitted when `operator` is revoked its operator status for `tokenHolder`
*/
event RevokedOperator(address indexed operator, address indexed tokenHolder);
/** /**
* @dev Returns the name of the token. * @dev Returns the name of the token.
*/ */
@ -182,12 +206,4 @@ interface IERC777 {
bytes data, bytes data,
bytes operatorData bytes operatorData
); );
event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData);
event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData);
event AuthorizedOperator(address indexed operator, address indexed tokenHolder);
event RevokedOperator(address indexed operator, address indexed tokenHolder);
} }

View File

@ -18,6 +18,10 @@ pragma solidity ^0.8.0;
* For an in-depth explanation and source code analysis, see the EIP text. * For an in-depth explanation and source code analysis, see the EIP text.
*/ */
interface IERC1820Registry { interface IERC1820Registry {
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
event ManagerChanged(address indexed account, address indexed newManager);
/** /**
* @dev Sets `newManager` as the manager for `account`. A manager of an * @dev Sets `newManager` as the manager for `account`. A manager of an
* account is able to set interface implementers for it. * account is able to set interface implementers for it.
@ -109,8 +113,4 @@ interface IERC1820Registry {
* @return True if `account` implements `interfaceId`, false otherwise. * @return True if `account` implements `interfaceId`, false otherwise.
*/ */
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool); function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
event ManagerChanged(address indexed account, address indexed newManager);
} }