1

I'm just getting into Solidity by building a first project around collectibles, ERC 721.

There's for example 1500 different collectibles, each has an available amount defined by a criteria. These collectibles will be distributed in packs of 5, totally randomly after an initial purchase. These collectibles will be generated from a database that has properties like "name", "image", "id", etc

How would one go about generating 1500 * availability tokens (amounting to a total of 150000 tokens)? Pass an array of ids to a function called only once from a specific private address and generate them and store them in a mapping storage? I'm anticipating this will require a lot of gas, how could I evaluate the costs of creating such a large number of tokens?

2
  • Will you do all 150,000 in one series? Or will you have multiple series? It makes a difference in the type of solution that will be appropriate. Sep 19 '18 at 15:16
  • I have the same doubt, did you resolve it?? Apr 12 at 20:41
1

First of all, ERC721 has its amount fixed as 1, so you might wanna use ERC1155.

If you want to create 1500K ERC721 or 1500 ERC1155(1K of each) collectibles, I would not suggest you create all of them in one go, as there is a high possibility that they will exceed the block gas limit.

From your question, I see that you have all the different token URIs stored in a database. So, you can create these collectibles in batches, such that it's efficient for you.

You can use truffle or hardhat for gas estimation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.