1 | = ERC 721
|
2 |
|
3 | [.readme-notice]
|
4 | NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc721
|
5 |
|
6 | This set of interfaces, contracts, and utilities are all related to the https://eips.ethereum.org/EIPS/eip-721[ERC721 Non-Fungible Token Standard].
|
7 |
|
8 | TIP: For a walk through on how to create an ERC721 token read our xref:ROOT:erc721.adoc[ERC721 guide].
|
9 |
|
10 | The EIP specifies four interfaces:
|
11 |
|
12 | * {IERC721}: Core functionality required in all compliant implementation.
|
13 | * {IERC721Metadata}: Optional extension that adds name, symbol, and token URI, almost always included.
|
14 | * {IERC721Enumerable}: Optional extension that allows enumerating the tokens on chain, often not included since it requires large gas overhead.
|
15 | * {IERC721Receiver}: An interface that must be implemented by contracts if they want to accept tokens through `safeTransferFrom`.
|
16 |
|
17 | OpenZeppelin Contracts provides implementations of all four interfaces:
|
18 |
|
19 | * {ERC721}: The core and metadata extensions, with a base URI mechanism.
|
20 | * {ERC721Enumerable}: The enumerable extension.
|
21 | * {ERC721Holder}: A bare bones implementation of the receiver interface.
|
22 |
|
23 | Additionally there are a few of other extensions:
|
24 |
|
25 | * {ERC721URIStorage}: A more flexible but more expensive way of storing metadata.
|
26 | * {ERC721Votes}: Support for voting and vote delegation.
|
27 | * {ERC721Royalty}: A way to signal royalty information following ERC2981.
|
28 | * {ERC721Pausable}: A primitive to pause contract operation.
|
29 | * {ERC721Burnable}: A way for token holders to burn their own tokens.
|
30 |
|
31 | NOTE: This core set of contracts is designed to be unopinionated, allowing developers to access the internal functions in ERC721 (such as <<ERC721-_mint-address-uint256-,`_mint`>>) and expose them as external functions in the way they prefer. On the other hand, xref:ROOT:erc721.adoc#Presets[ERC721 Presets] (such as {ERC721PresetMinterPauserAutoId}) are designed using opinionated patterns to provide developers with ready to use, deployable contracts.
|
32 |
|
33 | == Core
|
34 |
|
35 | {{IERC721}}
|
36 |
|
37 | {{IERC721Metadata}}
|
38 |
|
39 | {{IERC721Enumerable}}
|
40 |
|
41 | {{ERC721}}
|
42 |
|
43 | {{ERC721Enumerable}}
|
44 |
|
45 | {{IERC721Receiver}}
|
46 |
|
47 | == Extensions
|
48 |
|
49 | {{ERC721Pausable}}
|
50 |
|
51 | {{ERC721Burnable}}
|
52 |
|
53 | {{ERC721URIStorage}}
|
54 |
|
55 | {{ERC721Votes}}
|
56 |
|
57 | {{ERC721Royalty}}
|
58 |
|
59 | == Presets
|
60 |
|
61 | These contracts are preconfigured combinations of the above features. They can be used through inheritance or as models to copy and paste their source code.
|
62 |
|
63 | {{ERC721PresetMinterPauserAutoId}}
|
64 |
|
65 | == Utilities
|
66 |
|
67 | {{ERC721Holder}}
|