You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.4 KiB
39 lines
1.4 KiB
7 years ago
|
pragma solidity ^0.4.24;
|
||
7 years ago
|
|
||
7 years ago
|
|
||
7 years ago
|
/**
|
||
|
* @title ERC721 token receiver interface
|
||
|
* @dev Interface for any contract that wants to support safeTransfers
|
||
7 years ago
|
* from ERC721 asset contracts.
|
||
7 years ago
|
*/
|
||
7 years ago
|
contract IERC721Receiver {
|
||
7 years ago
|
/**
|
||
|
* @dev Magic value to be returned upon successful reception of an NFT
|
||
7 years ago
|
* Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`,
|
||
7 years ago
|
* which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
|
||
7 years ago
|
*/
|
||
7 years ago
|
bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;
|
||
7 years ago
|
|
||
|
/**
|
||
|
* @notice Handle the receipt of an NFT
|
||
|
* @dev The ERC721 smart contract calls this function on the recipient
|
||
7 years ago
|
* after a `safetransfer`. This function MAY throw to revert and reject the
|
||
7 years ago
|
* transfer. Return of other than the magic value MUST result in the
|
||
7 years ago
|
* transaction being reverted.
|
||
7 years ago
|
* Note: the contract address is always the message sender.
|
||
7 years ago
|
* @param _operator The address which called `safeTransferFrom` function
|
||
|
* @param _from The address which previously owned the token
|
||
7 years ago
|
* @param _tokenId The NFT identifier which is being transferred
|
||
7 years ago
|
* @param _data Additional data with no specified format
|
||
7 years ago
|
* @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
|
||
7 years ago
|
*/
|
||
7 years ago
|
function onERC721Received(
|
||
7 years ago
|
address _operator,
|
||
7 years ago
|
address _from,
|
||
|
uint256 _tokenId,
|
||
|
bytes _data
|
||
|
)
|
||
|
public
|
||
|
returns(bytes4);
|
||
7 years ago
|
}
|