Candy-Labs / CandyContracts

Open-source NFT contract implementations
MIT License
11 stars 7 forks source link

Add contract variant that includes tokenOfOwnerByIndex and tokenByIndex #2

Closed kyokosdream closed 2 years ago

kyokosdream commented 2 years ago

The CandyCreatorV1A contract doesn't include these two methods (even though Chiru Labs' ERC721A contract does) since for large collections, it can significantly increase the gas fees for transfers etc.

However, many project creators want to retain this functionality (for showing a each visitor's owned tokens on their project website for example). Recommend adding a variant to the contract repository that includes these methods.

kyokosdream commented 2 years ago

These functions have now been removed in the latest ERC721A release and will exist as optional extensions in that repo.

kyokosdream commented 2 years ago

This has been added to CandyCreator721AVotes in the revised-voting branch since we need tokensOfOwner to enumerate a users token so they can be burned through ERC721ABurnable. tokensOfOwnerByIndex is no longer supported by ERC721A v3.1 which is the version currently used in our branch.