What is ERC721

ERC-721 is a standard for non-fungible tokens (NFTs) that defines a specific function interface. It contains the following properties and methods.

name(): returns the name of the token.
symbol(): returns the symbol of the token.
balanceOf(): returns the number of tokens owned by an account.
ownerOf(uint256 tokenId): return the owner of the token with the specified tokenId.
safeTransferFrom(address from, address to, uint256 tokenId): safe transfer function for transferring tokens from one address to another.
approve(address to, uint256 tokenId): approve an address to manage the specified tokenId.
getApproved(uint256 tokenId): view the approved address for a given tokenId.
setApprovalForAll(address operator, bool approved): set whether a certain address (operator) is allowed to manage all tokens.
isApprovedForAll(address owner, address operator): check if an address (owner) has approved another address (operator) to manage all its tokens.

PS: How to tell if a contract is ERC-721 contract. Generally speaking, ERC-721 contracts usually implement an ERC165 interface method, which is called supportsInterface, so we just need to call supportsInterface. If it returns true, it means the contract complies with the ERC-721 standard.

Similar Posts