-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[move] Add NFT module to framework + use natural numbers as example #739
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -0,0 +1,38 @@ | |||
module Num { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would NumNFT be a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it, but then the type that gets minted is NFT<NumNFT>
, which seems a bit verbose... We could also have different struct vs module names, but that goes against standard Move conventions, which I would prefer not to do in an example.
- Add `NFT<T>` type, intended to be an ERC721-like standard that we can point folks to. Functions are extensively documented to suggest the intended usage. It's not 100% clear to me that this provides much value over asking folks to define an object with a `T` field + their own `mint` and `burn` functions, but I think this template is a helpful starting point for anyone coming from Eth. - Add `Num` as a silly example of how to use the standard
55054ac
to
9907047
Compare
This is a great example! However, I think we should think more thoroughly about what the standard should look like. The most important thing is to make it easy for various wallets, explorers, marketplaces, and games to differentiate(e.g., to tell which move objects are fungible coins, collectibles, or just some random objects) and render these metadata. For example, without a common We should also think across different asset classes as well such as semi-fungible tokens and fungible tokens. |
+1 to all of this. I'm not the biggest expert on these standards (especially the non-Eth ones), and would love design help/feedback/implementation help on how we should define these standards in Move, to what extent we should strive for compatibility with existing standards vs learning from their mistakes, how this impacts mirroring, etc. I set up some time with you to brainstorm on this tomorrow. To say a few quick things:
and then either adding
On the image part: I was thinking of standardizing this at the level of
For fungible coins, our standard is In general, I think the approach we should take for clients to understand how they should display and interpret Sui objects is that they should use the Move type. Clients will understand a subset of important Move types defined in the framework, and over time that set will grow to include types defined by popular third-party use-cases (and hopefully third-party standards as well!) |
Co-authored-by: Chris Li <76067158+666lcz@users.noreply.github.com>
NFT<T>
type, intended to be an ERC721-like standard that we can point folks to. Functions are extensively documented to suggest the intended usage. It's not 100% clear to me that this provides much value over asking folks to define an object with aT
field + their ownmint
andburn
functions, but I think this template is a helpful starting point for anyone coming from Eth.Num
as a silly example of how to use the standard