// SPDX-License-Identifier: MIT pragma solidity >=0.7.6 <0.8.0; /** * @title ERC721 Non-Fungible Token Standard, basic interface (functions). * @dev See https://eips.ethereum.org/EIPS/eip-721 * @dev This interface only contains the standard functions. See IERC721Events for the events. * @dev Note: The ERC-165 identifier for this interface is 0x80ac58cd. */ interface IERC721 { /** * Gets the balance of the specified address * @param owner address to query the balance of * @return balance uint256 representing the amount owned by the passed address */ function balanceOf(address owner) external view returns (uint256 balance); /** * Gets the owner of the specified ID * @param tokenId uint256 ID to query the owner of * @return owner address currently marked as the owner of the given ID */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * Approves another address to transfer the given token ID * @dev The zero address indicates there is no approved address. * @dev There can only be one approved address per token at a given time. * @dev Can only be called by the token owner or an approved operator. * @param to address to be approved for the given token ID * @param tokenId uint256 ID of the token to be approved */ function approve(address to, uint256 tokenId) external; /** * Gets the approved address for a token ID, or zero if no address set * @dev Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to query the approval of * @return operator address currently approved for the given token ID */ function getApproved(uint256 tokenId) external view returns (address operator); /** * Sets or unsets the approval of a given operator * @dev An operator is allowed to transfer all tokens of the sender on their behalf * @param operator operator address to set the approval * @param approved representing the status of the approval to be set */ function setApprovalForAll(address operator, bool approved) external; /** * Tells whether an operator is approved by a given owner * @param owner owner address which you want to query the approval of * @param operator operator address which you want to query the approval of * @return bool whether the given operator is approved by the given owner */ function isApprovedForAll(address owner, address operator) external view returns (bool); /** * Transfers the ownership of a given token ID to another address * @dev Usage of this method is discouraged, use `safeTransferFrom` whenever possible * @dev Requires the msg sender to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function transferFrom( address from, address to, uint256 tokenId ) external; /** * Safely transfers the ownership of a given token ID to another address * * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * * @dev Requires the msg sender to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred */ function safeTransferFrom( address from, address to, uint256 tokenId ) external; /** * Safely transfers the ownership of a given token ID to another address * * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise, * the transfer is reverted. * * @dev Requires the msg sender to be the owner, approved, or operator * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId uint256 ID of the token to be transferred * @param data bytes data to send along with a safe transfer check */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; }