top of page

All you need to know about ERC721 NFT standard by OpenZeppelin

ERC721 is Ethereum's standard for token creation, primarily focusing on the ERC721 standard for non-fungible tokens (NFTs). ERC721 is suitable for situations where individual tokens have unique properties and cannot be exchanged directly, such as real estate or collectibles.


The OpenZeppelin smart contracts library provides easy-to-use and customize ERC721 functionality. This library also contains various extensions and other useful tools. The example given is a game-item that is tokenized using ERC721. Each time an item is passed to a player, a new token is generated and sent to them. The function `awardItem` is used to mint new tokens and award them to the player.


The ERC721 convention contains metadata and enumeration extensions. Metadata is data about a token that can be stored off-chain. The example shows a token with a tokenURI that includes a JSON file that stores information about the game object, such as its name, description, image, and other attributes.


However, the text hints at a potential problem: since the token information is stored outside the chain, the developer can change it, potentially changing the rules of the game One solution is to store all object information at chain, but that can be expensive. Another is to use a centralized file system such as IPFS to store tokenURI information, but this is beyond the scope of this write-up.

2 views0 comments

Comments


bottom of page