Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why aren't catalog keys generated using the contract name and address? #121

Open
cybercent opened this issue Feb 22, 2023 · 3 comments
Open

Comments

@cybercent
Copy link

cybercent commented Feb 22, 2023

Currently, the catalog keys appear to be generated by the user.
It is difficult to obtain information about a contract without the key.
The only way to get the key for a contract in the current implementation appears to be to loop through the entire catalog at once or in batches and compare contract name and address.

A simpler approach would have been to generate the key from the contract name.

Example for TopShot:

Address: 0x0b2a3299cc857e29
Contract: TopShot
Resource: NFT

So the key would be

Key:  0b2a3299cc857e29_TopShot_NFT
@cybercent cybercent changed the title Why are not catalog keys derived from contract name and address Why aren't catalog keys generated using the contract name and address? Feb 22, 2023
@bshahid331
Copy link
Contributor

We have refrained from pursuing this approach due to the unfortunate circumstance that certain "NFT Contracts" may house multiple "NFT Collections", making a one-to-one correspondence unfeasible. Although this approach is not ideal for NFT design, we have intentionally avoided restricting users to a single implementation approach. It is possible to create multiple distinct "collection" catalog entries that share the same NFT Contract.

In fact, we leverage the metadata field labeled "Collection Display Name" to discern which "collection" a given NFT pertains to in cases where multiple collections exist within a single contract.

@cybercent
Copy link
Author

Multiple NFT collections implemented in the same contract would have a different resource names, the NFT in my example.

It is possible to create multiple distinct "collection" catalog entries that share the same NFT Contract.

This appears to be a very bad design decision, unless the scope of the NFT catalog is to display all NFTs in a user's account, regardless of how many paths for the same collection that user created.

@bshahid331
Copy link
Contributor

I'm talking about the occurence where they use the same resource/NFT.

I agree it is a poor design design and not how I would design it personally but we have to support it as it's used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants