2

I'm trying to create NFTs (non-fungible tokens), but I don't quite understand this part - is each token its own contract? or are all of them stored in the NFT equivalent of a 'balances' mapping in a factory contract? If these are both options which is better?

2

No, NFTS are not contracts of their own.

A single NFT is a uint256 ID, which is mapped to an owner address. In solidity, this would be something like

mapping(uint => address) tokenIds

The spec lists a number of reference implementations, you should probably use one of those rather than roll your own.

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.