1

i'm new to ERC721 tokens so this may be a stupid question.

Following the Opensea docs and other docs (for example openzeppelin ones), I just create a simple ERC721 token that i called "avatar" which have some properties (gender, eyes, mounth, etc) and if i understand good, this properties will be server by an API server. So in the player profile page on the future website i will need to code something that will call this API server to get for example the picture of this avatar.

My question is: if i want to implement also Items (for example glasses) that player can buy to wear it to their avatar, where i have to code this items? It will be inside the Metadata?

  • 2
    This is an opinion based question and I don't think it belongs on Stack Exchange until you have attempted to code something and want to review where you got stuck. Yes you can store classes inside the metadata; and yes you store them in a separate contract instead of metadata. This question is not answerable. – William Entriken Jul 3 at 19:35
0

You have a variety of options of how you implement items, these could include (but not limited to):

  • Storing items with the metadata (e.g. centralized)
  • Creating a relationship between the ERC721 avatar and the purchased item e.g. the avatar could own the purchased item which could also be an ERC721.

What options are best depend on your use case for your avatar.

  • 1
    Thanks for the reply. I was thinking the same: ERC721 Avatar could own other ERC721 (Items), but in this way i suppose that the cost will be more: double transactions. – Crowdsale Guy Jul 4 at 8:17
  • It really depends on your use case. I am working on an ERC721 token avatar with separate items as ERC721. – abcoathup Jul 5 at 0:09

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.