2021-03-23 22:30:29 +08:00
|
|
|
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/solc-0.6/contracts/token/ERC721/IERC721Receiver.sol
|
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
2021-03-30 18:25:39 +08:00
|
|
|
pragma solidity 0.6.9;
|
2021-03-23 22:30:29 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @title ERC721 token receiver interface
|
|
|
|
|
* @dev Interface for any contract that wants to support safeTransfers
|
|
|
|
|
* from ERC721 asset contracts.
|
|
|
|
|
*/
|
|
|
|
|
interface IERC721Receiver {
|
|
|
|
|
/**
|
|
|
|
|
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
|
|
|
|
|
* by `operator` from `from`, this function is called.
|
|
|
|
|
*
|
|
|
|
|
* It must return its Solidity selector to confirm the token transfer.
|
|
|
|
|
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
|
|
|
|
|
*
|
|
|
|
|
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
|
|
|
|
|
*/
|
|
|
|
|
function onERC721Received(
|
|
|
|
|
address operator,
|
|
|
|
|
address from,
|
|
|
|
|
uint256 tokenId,
|
|
|
|
|
bytes calldata data
|
|
|
|
|
) external returns (bytes4);
|
|
|
|
|
}
|