08.ERC721
ERC721¶
Simple Summary¶
A standard interface for non-fungible tokens, also known as deeds.
Abstract¶
The following standard allows for the implementation of a standard API for NFTs within smart contracts. This standard provides basic functionality to track and transfer NFTs.
We considered use cases of NFTs being owned and transacted by individuals as well as consignment to third party brokers/wallets/auctioneers (“operators”). NFTs can represent ownership over digital or physical assets. We considered a diverse universe of assets, and we know you will dream up many more:
- Physical property — houses, unique artwork
- Virtual collectibles — unique pictures of kittens, collectible cards
- “Negative value” assets — loans, burdens and other responsibilities
In general, all houses are distinct and no two kittens are alike. NFTs are distinguishable and you must track the ownership of each one separately.
Motivation¶
A standard interface allows wallet/broker/auction applications to work with any NFT on Ethereum. We provide for simple ERC-721 smart contracts as well as contracts that track an arbitrarily large number of NFTs. Additional applications are discussed below.
This standard is inspired by the ERC-20 token standard and builds on two years of experience since EIP-20 was created. EIP-20 is insufficient for tracking NFTs because each asset is distinct (non-fungible) whereas each of a quantity of tokens is identical (fungible).
Differences between this standard and EIP-20 are examined below.
Specification¶
对比ERC20,不一样的如下
ownerOf: 根据token的address返回owner的address
safeTransferFrom
setApproveForAll
getApproved
isApproveForAll