* Initial migration to Solidity 0.6.x - v3.0 first steps (#2063) * Initial migration, missing GSN, 721, 777 and Crowdsales. * Add _beforeTokenOperation and _afterTokenOperation. * Add documentation for hooks. * Add hooks doc * Add missing drafts * Add back ERC721 with hooks * Bring back ERC777 * Notes on hooks * Bring back GSN * Make functions virtual * Make GSN overrides explicit * Fix ERC20Pausable tests * Remove virtual from some view functions * Update linter * Delete examples * Remove unnecessary virtual * Remove roles from Pausable * Remove roles * Remove users of roles * Adapt ERC20 tests * Fix ERC721 tests * Add all ERC721 hooks * Add ERC777 hooks * Fix remaining tests * Bump compiler version * Move 721BurnableMock into mocks directory * Remove _before hooks * Fix tests * Upgrade linter * Put modifiers last * Remove _beforeTokenApproval and _beforeOperatorApproval hooks
33 lines
1.1 KiB
Solidity
33 lines
1.1 KiB
Solidity
pragma solidity ^0.6.0;
|
|
|
|
/**
|
|
* @dev Interface of the ERC777TokensRecipient standard as defined in the EIP.
|
|
*
|
|
* Accounts can be notified of {IERC777} tokens being sent to them by having a
|
|
* contract implement this interface (contract holders can be their own
|
|
* implementer) and registering it on the
|
|
* https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry].
|
|
*
|
|
* See {IERC1820Registry} and {ERC1820Implementer}.
|
|
*/
|
|
interface IERC777Recipient {
|
|
/**
|
|
* @dev Called by an {IERC777} token contract whenever tokens are being
|
|
* moved or created into a registered account (`to`). The type of operation
|
|
* is conveyed by `from` being the zero address or not.
|
|
*
|
|
* This call occurs _after_ the token contract's state is updated, so
|
|
* {IERC777-balanceOf}, etc., can be used to query the post-operation state.
|
|
*
|
|
* This function may revert to prevent the operation from being executed.
|
|
*/
|
|
function tokensReceived(
|
|
address operator,
|
|
address from,
|
|
address to,
|
|
uint256 amount,
|
|
bytes calldata userData,
|
|
bytes calldata operatorData
|
|
) external;
|
|
}
|