ERC-721 Token Standards, Extensions and utils

Deployment of ERC-721 token can be done through Remix IDE or locally using Truffle. Since eRon blockchain supports EVM and Web3, it is compatible with Ethereum development toolsets. Remix is the easiest way to deploy the ERC-721 smart contract onto the eRon blockchain.

To deploy an ERC-721 token using Remix IDE, navigate to the Remix page. In the deploy section, choose Injected Web3 and ensure that your MetaMask is connected to the eRon blockchain. To connect to the eRon blockchain, visit the eRon blockchain's staking page, which will automatically create a new MetaMask network for you. Alternatively, you can configure your MetaMask manually.

                          
                            
                            // SPDX-License-Identifier: GPL-3.0
                            
                            
                              pragma solidity ^0.8.1;
                            
                            
                              import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
                            
                            
                                import "@openzeppelin/contracts/utils/Counters.sol";
                            
                            
                                import "@openzeppelin/contracts/access/Ownable.sol";
                            
                            
                                contract MyERC721Token is ERC721URIStorage, Ownable {
                            
                            
                                    using Counters for Counters.Counter;
                            
                            
                                    Counters.Counter private _tokenIds;
                            
                            
                                    constructor() ERC721("MyERC721Token", "Test Token") {}
                            
                            
                                    function mintNFT(address recipient, string memory tokenURI)
                            
                            
                                        public onlyOwner
                            
                            
                                        returns (uint256)
                            
                            
                                    {
                            
                            
                                        _tokenIds.increment();
                            
                            
                                        uint256 newItemId = _tokenIds.current();
                            
                            
                                        _mint(recipient, newItemId);
                            
                            
                                        _setTokenURI(newItemId, tokenURI);
                            
                            
                                        return newItemId;
                            
                            
                                    }
                            
                            
                                }
                            
                          
                        

MetaData URI is a link (usually on ipfs) that returns a JSON object with information about your NFT token.

This set of interfaces, contracts, and utilities are all related to the ERC-721 Non-Fungible Token Standard.

The ERC specifies four interfaces:

{IERC721}: Core functionality required in all compliant implementation.

{IERC721Metadata}: Optional extension that adds name, symbol, and token URI, almost always included.

{IERC721Enumerable}: Optional extension that allows enumerating the tokens on chain, often not included since it requires large gas overhead.

{IERC721Receiver}: An interface that must be implemented by contracts if they want to accept tokens through safeTransferFrom.

{ERC721}: The core and metadata extensions, with a base URI mechanism.

{ERC721Enumerable}: The enumerable extension.

{ERC721Holder}: A bare bones implementation of the receiver interface.

Additionally there are a few of other extensions:

{ERC721Consecutive}: An implementation of ERC-2309 for minting batchs of tokens during construction, in accordance with ERC-721.

{ERC721URIStorage}: A more flexible but more expensive way of storing metadata.

{ERC721Votes}: Support for voting and vote delegation.

{ERC721Royalty}: A way to signal royalty information following ERC-2981.

{ERC721Pausable}: A primitive to pause contract operation.

{ERC721Burnable}: A way for token holders to burn their own tokens.

{ERC721Wrapper}: Wrapper to create an ERC-721 backed by another ERC-721, with deposit and withdraw methods. Useful in conjunction with {ERC721Votes}.