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

add a metadata view to designate an nft as a pack #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

austinkline
Copy link
Contributor

@austinkline austinkline commented Jan 30, 2023

Closes: #149

Description

Some NFTs on Flow are Packs. They can be opened to obtain the contents inside of them, but are largely useless afterwards. Two examples of this are NFL All Day packs, and Gaia NFT Packs. In both of these cases, there isn't a standard metadata view to designate them as opened. Because of that, users are at risk of purchasing a pack they might not know is empty.

This view adds a way to detect if something is a pack, letting marketplaces decide what they should do with that information. Perhaps that just means displaying that the pack is opened, or it could mean disabling trading altogether.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels
  • Update the version in package.json when there is a change in the smart contracts

Comment on lines +700 to +706
pub enum PackStatus: UInt8 {
pub case Sealed
pub case RevealRequested
pub case Revealed
pub case OpenRequested
pub case Opened
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if an enum is the right call given its finality. We could instead make it a string so we can add to this as needed. Both Gaia and AD packs use an enum, though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we potentially make it an integer, and then have a switch statement to indicate what its status is? that way we can add more to it if needed, but it is still similar to an enum

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong feelings on that part either way. I was talking to Chris on the Gaia team and he had suggested maybe going with a "Consumable" standard instead where packs are just a one-time consumable. In which case, we would amend this to let you ask how many charges are left in some capacity.

I'll open a ticket to discuss this and then we can amend this PR as needed, it is just a starting point for discussion 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjartek
Copy link
Contributor

bjartek commented Jan 30, 2023

+1

Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks pretty good! I'll try to get some of the studio engineers to look at it also

Comment on lines +700 to +706
pub enum PackStatus: UInt8 {
pub case Sealed
pub case RevealRequested
pub case Revealed
pub case OpenRequested
pub case Opened
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we potentially make it an integer, and then have a switch statement to indicate what its status is? that way we can add more to it if needed, but it is still similar to an enum

@austinkline
Copy link
Contributor Author

Added a ticket so we can discuss:
#149

@bjartek
Copy link
Contributor

bjartek commented Feb 3, 2023

The semantics of packs is different in every implementation i have seen. Can we open up a bigger discussion around consumable/pack semantics?

I tried to create a tax reporting export to koinly and some packs/opening logic does not have enough data to cost-allocate the items in the pack/consumable to the new nfts. This is a pretty huge problem if the tax government comes calling.

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

Successfully merging this pull request may close these issues.

Packs Metadata Standard
3 participants