I was wondering if anyone had any idea on how to create multiple unique ERC721 tokens (similar to cryptoPunks and cryptoKitties). For instance, say I want to write a smart contract to create 1000 soccer cards where users can buy and then eventually ‘mint’ their names on it. How do I create these cards efficiently in my smart contract and do I store them on the blockchain??
Generally speaking, NFT owners are stored on the blockchain like: mapping(uint256 => address) tokenOwners;
And other information are stored in off-chain except tokenURI, which has details about the NFTs metadata.
thanks for your response! But how do I actually create the 1000 cards when I deploy my smart contract initially. Do I use a for loop that iterates 1000 times?? I’m just not sure.
Also, where would I store things like the card’s image and details etc…if it’s not on the blockchain doesn’t that mean it’s centralized and can be edited?
Looping will be limited by gas consumption of each iteration, you could try to work on optimizing that. Why don’t you run some tests on local or remix and see how far you get? I’d consider using the Multicall module from solidity, or Multicall from ethers, which will batch multiple RPC calls.
If you can’t do 1k in a single loop, then make 5 calls with 200, etc.