-
Notifications
You must be signed in to change notification settings - Fork 170
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
FEATURE: V2 NonFungibleToken Standard #126
Conversation
Very good and much better than the current standard. I left few minor comments. |
Hi, |
@bymi15 That is a separate workstream that is unrelated to this standard update. I'll respond to your issue. Thank you! |
What do we think about adding a batch deposit, batch transfer, and batch withdraw? Is that worth adding? |
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.
Didn't realize this was out! Left some comments, and I'd also like to discuss how we can make use of scoped providers to encourage protecting capabilities that can withdraw. Or maybe we can bake it into both V2 standards in some way? Here's my first attempt at scoped providers as a starting point, I'd love for us to try and incorporate it as closely as we can into the standard:
I saw in mail that austin commented on the transfer discussion that has been marked as resolved. Just a heads up that there might be new comments in resolved discussions. |
@bjartek @bluesign @austinkline and anyone else who can give feedback. Quick question about how this should be structured. Right now, I have it so that all the resource interfaces are in a contract ( |
I don't really have any important comments, I love the proposal!! Can't wait to see what people can create using multiple NFTs and FTs on a single contract 🎉 |
Just to make sure I understand the question fully, is this mostly around separating the interface from any implementation? Or is there some other reason to split things up? Is there a compute cost to putting them elsewhere to consider as well? |
We originally were going to completely remove type specifications in interfaces from the language, which would mean there would be no contract interface at all here and everything would have been contained in the We still want to have general utility functions and types for token such as |
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.
Great job drafting this up @joshuahannan!
I left some more general comments on the forum post, but LMK if it's better to discuss on this PR going forward: https://forum.onflow.org/t/streamlined-token-standards-proposal/3075/45?u=pete
@nvdtf I addressed all your review comments and made almost all of the changes you suggested. Let me know if you have any other comments! Thank you so much for the review! :) |
With We currently rely on My suggestion is to add the following signature to the
implementation would look like this for legacy contracts (or really however the developer sees fit)
Another note: the current
|
Thanks for the comment @cody-evaluate! I'll update the I agree that what you are asking for would be very nice to have and if it wasn't so late in the process, I would put it in with no hesitation so that every project would have to implement it. As I said in Discord, we've promised to the community that we won't introduce any more breaking changes to the standard, which this would be because it would require that people implement it. We could put it in there with a default implementation though, which would not break any contracts that have already been updated. The downside though is that since there is a default implementation, contracts don't have to implement the function, meaning that there is no guarantee that every NFT has a proper implementation of this method. A lot of projects have already updated their contracts, so I can try to ping the ones I'm connected with, like at Dapper, but there is no guarantee that they actually add it. Is that okay? |
@joshuahannan its better than nothing i guess but this should really be required and even though its late, we are still in the staging period so theres really no other time to do something like this. The biggest issue is this removes a necessary piece of functionality that has been standard in production since the beginning with no replacement currently making some operations with large collections literally impossible. I would have assumed all public signatures/fields of the current standard interfaces would be supported in the new standard either directly or with a replacement otherwise you risk breaking things with no way to rectify. I dont think you could even have a "default implementation" because theres no standard way for how to store NFTs in a collection anymore and |
I understand, but we had no idea that anyone was actually using |
this would be an example use case in a script for current mainnet
|
here is a working example of getting the NFT ID at index you cant even get index
this works for the same collection
|
* implement EVMBridgedMetadata in ExampleNFT * add updated MetadataViews EVMBridgedMetadata view to go tests * add docs covering new views * fix EVMBridgedMetadata.symbol assignment * add EVMBridgedMetadata implementation test coverage * update Flow-CLI install step in ci workflow action * remove merged docs * remove merged script
I think that it is time to merge this to master! If nobody has any issues with me merging this, I'll merge it on Monday once we've tested it with the new CLI version next week. I'm going to create a branch that is based off current master so that we still have a record of the cadence 0.42 versions of the contracts. |
…tional capabilities get
Amazing work everyone! 👏 |
Adds the v2 fungible token standard, as described in this flip: onflow/flips#56
A few highlights:
NonFungibleTokenInterface
) with event specifications, functions to get the NFT and collection types that the contract implements, and functions to get important metadata views for the types in the contract. This will help external parties learn about which types a contract implements since contracts can implement multiple collection and NFT types now.createEmptyCollection
methodThe contract currently has a couple errors that should be able to be resolved easily, such as it not working properly with the
createEmptyCollectionFunction
field of theNFTCollectionData
metadata view, and theownedNFTs
field not conforming to the resource interface's field, but there are no other errors.I am looking for feedback on the initial proposal. Tests will come later
There are probably more things that I am missing, but most of the details are in the forum post, so that is another good resource.