Skip to content

Lesson 11 NFT: Mapping confusion & IPFS unable to load #1430

Answered by cromewar
aloyboi asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @aloyboi
Interesting question, let's try to answer it!
tokenIdToBreed is mapping (similar to a dict on python) so it relates a number with a Breed object (enum), but python does not understand the logic behind Enums on Solidity, so this way we can pass a simple integer into the python script and brownie will just run it, internally that integer will reference the Enum object containing the breeds of each PUG. And remember that a Enum is just a nice way to enumerate stuff, like 0 BREED1, 1 BREED2 and so on.

In addition to my questions, when I am creating collectibles, I actually have a repeated breed for token_id 0 and 1, does the course tutorial tackle this problem?

You mean you r…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@aloyboi
Comment options

@cromewar
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants