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

Flow NFT contracts do not implement a standard way to name their public collection path #157

Closed
cybercent opened this issue Feb 22, 2023 · 3 comments
Labels
bug Something isn't working Feedback SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board

Comments

@cybercent
Copy link

Instructions

Given:

  • The contract name and address (0x0b2a3299cc857e29, TopShot)
  • The NFT token ID (1234)
  • The Owner address (0x01)

Determine:

  • NFT metadata using metadata views

Problem

In the below example the CollectionPublicPath might not exists in the contract.

  let collection = account
        .getCapability(ExampleNFT.CollectionPublicPath)
        .borrow<&{MetadataViews.ResolverCollection}>()
        ?? panic("Could not borrow a reference to the collection")

Example TopShot uses a different name for that variable.

Steps to Reproduce

Acceptance Criteria

Context

Also, the NFT Catalog does not have a simple way to fetch the metadata of a single NFT when only the data above is known.

@cybercent cybercent added bug Something isn't working Feedback labels Feb 22, 2023
@cybercent
Copy link
Author

onflow/nft-catalog#121

@alilloig alilloig added the SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board label Feb 22, 2023
@joshuahannan
Copy link
Member

Thanks for sharing! So when we originally created the NFT standard, it wasn't possible to have paths as variables, so we weren't able to include a path requirement in the NonFungibleToken.Vault definition. As you probably know, upgrades are difficult in that we can't add paths to existing types, so adding these requirements on their own isn't really possible.

Additionally, the metadata views have a view to get the paths in the NFTCollectionData view, so projects can decide how they would like to store them and they can use the standard view to share them.

I do acknowledge that is is difficult to get metadata about an NFT without the paths though, but I'm not sure what we could do to have a standard for this in the short term since we can't add a path field requirement to the NFT standard without breaking every contract.

We do have a change that addresses this in the NFT standard V2 though, which will include breaking changes and will come later this year assuming we get enough buy-in from the community.
I'd recommend reading through those changes and leaving feedback, because we definitely could use the help. 🙂

Besides that, is there another option that you think we could do to make this easier?

@joshuahannan
Copy link
Member

Closing this because it is addressed with metadata views and the NFT V2 standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Feedback SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board
Projects
None yet
Development

No branches or pull requests

3 participants