PRC-721
1 PRC-721 Protocol Standard
1.1 PRC-721 Smart Contract Interface Implementation
1.1.1 PRC-721 & PRC-165 Interfaces
pragma solidity ^0.4.20;
interface PRC721 {
// Returns the number of NFTs owned by the given account
function balanceOf(address _owner) external view returns (uint256);
// Returns the owner of the given NFT
function ownerOf(uint256 _tokenId) external view returns (address);
// Transfer ownership of NFT
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;
// Transfer ownership of NFT
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external payable;
// Transfer ownership of NFT
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
// Grants address ‘_approved’ the authorization of the NFT ‘_tokenId’
function approve(address _approved, uint256 _tokenId) external payable;
// Grant/revoke all NFTs’ authorization of the ‘_operator’
function setApprovalForAll(address _operator, bool _approved) external;
// Query the authorized address of NFT
function getApproved(uint256 _tokenId) external view returns (address);
// Query whether the ‘_operator’ is the authorized address of the ‘_owner’
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
// The successful ‘transferFrom’ and ‘safeTransferFrom’ will trigger the ‘Transfer’ Event
event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);
// The successful ‘Approval’ will trigger the ‘Approval’ event
event Approval(address indexed _owner, address indexed _approved, uint256 indexed _tokenId);
// The successful ‘setApprovalForAll’ will trigger the ‘ApprovalForAll’ event
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
}
interface PRC165 { // Query whether the interface ‘interfaceID’ is supported function supportsInterface(bytes4 interfaceID) external view returns (bool); }
1.1.2 OPTIONAL Metadata Extension Interface
1.1.3 OPTIONAL Enumeration Extension Interface
Last updated