1

I'm looking to build a smart contract with a function which is able to generate a unique and limited amount of ERC721 tokens based on an input string. I also want to be able to look up all the tokens based on the input string.

How should I go about approaching this complying with best practices?

Example:
I input the string "Cow", to a function in the smart contract.
Next, I should be able to create a parent token which represent the string, and each child token should have a numerical ID within the range 1-50.

2

I input the string "Cow", to a function in the smart contract. Next, I should be able to create a parent token which represents the string, and each child token should have a numerical ID within the range 1-50.

A contract factory could serve as both an ERC721 deployer and a registry (inventory) of the deployed tokens. ERC721, itself takes care of instances of COW.

A shortcoming of this approach is the cost of deploying each token contract. ERC1155 (multitoken) is a way of doing this in a single contract. In essence, the familiar functions with the addition of a token argument and another dimension in the storage layout.

Hope it helps.

| improve this answer | |
  • 2
    +1 for ERC1155, it perfectly fits the use case - blog.enjincoin.io/… – iamdefinitelyahuman Nov 13 '19 at 17:26
  • Thanks, I didn't give that standard a second thought, I for sure will now. Thank you fellas! – NowsyMe Nov 13 '19 at 19:22

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.