cairo-contracts icon indicating copy to clipboard operation
cairo-contracts copied to clipboard

Migrate ERC721 Enumerate extension

Open bal7hazar opened this issue 1 year ago • 6 comments

🧐 Motivation

To be feature partiy with the Cairo 0 version, having a ERC721 Enumerable extension proposition would be interesting.

📝 Details

Here are 2 repo which did an implementation:

  • https://github.com/carbonable-labs/cairo-erc-721/tree/main/src/extensions/enumerable
  • https://github.com/Seraph-Labs/Cairo-Contracts/blob/main/seraphlabs/tokens/src/erc721/extensions/enumerable.cairo

bal7hazar avatar Aug 31 '23 09:08 bal7hazar

Is there any concern to not have done it yet (maybe this issue #207)?

Also are you comfortable to split the current ERC721 implementation between ERC721 and ERC721Metadata (in order to have ERC721Metadata defined as an extension separated from the core ERC721)?

bal7hazar avatar Aug 31 '23 09:08 bal7hazar

@Bal7hazar i think the best is to wait for components to streamline this eventual separation. although not a blocker, another feature that'd help here is supertraits (or similar) to extend a trait with another i.e. extend ERC721 by just defining the metadata-specific fields on top. I think there might be a way of emulating it now though.

martriay avatar Sep 05 '23 07:09 martriay

@martriay thanks for sharing your thoughts, just to ensure I understand well, do you think it's risky for the community if OZ repo have a pre-component implementation right now and make another other one after the component feature is released (with the risk of changing the signature or storage making the upgrade not possible easily) ?

I understand that you could have other priority, my point is if I (or someone else) make a PR with a proposition right now, would you accept to merge it in the repo? (Assuming it passes the merging process ofc).

bal7hazar avatar Sep 05 '23 07:09 bal7hazar

@Bal7hazar sorry for the long silence. are you still willing to work on this?

martriay avatar Nov 22 '23 08:11 martriay

Hey @martriay actually there is already a component version made by Seraph-Labs:

https://github.com/Seraph-Labs/Cairo-Contracts/blob/main/src/tokens/erc721/extensions/enumerable.cairo

bal7hazar avatar Nov 24 '23 11:11 bal7hazar

Great! That'd be a useful reference. We're still going to add this to our library, I expect us to work tackle it sometime during Q1 2024. Anyone interested in tackling it before will be welcomed :)

martriay avatar Nov 24 '23 11:11 martriay