Creating an ERC-1155 token – ERC1155NFTToken
In MyERC20Token
and DigitalArtERC721Token
, we create all required smart contracts on our own, which we can learn and understand and customize these contracts. In this section, we will use one of the most popular open source smart contract frameworks, OpenZeppelin, to build our ERC1155MultiNFTToken
.
OpenZeppelin is a library that provides reusable, battle-tested, modular templates. The libraries have many trusted smart contracts for complex smart contract creation, including ERC-20, ERC-21, ERC-1155, and many other OpenZeppelin contracts.
NFT digital assets are often saved in the InterPlanetary File System (IPFS). The ERC-1155 token defines a token URI to store token JSON metadata, which has NFT token information, including the image location.
An NFT’s metadata is often saved in the IPFS. Next, we will upload NFT images to the IPFS.
Uploading NFT images
We will first create 5 NFT collections. The images are under...