-
Notifications
You must be signed in to change notification settings - Fork 137
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
Attachments #357
Comments
There are lots of interesting use cases that could emerge here.
|
Here's an example of modifying the Top Shot contract to support autographs that would be preferably done via extensions instead of editing the original contract: |
This commit in particular highlights the autographs extensibility that could instead be done outside of the Top Shot contract |
Could mixins be used to model this? If a mixin is stored in another account? And you could say i want
There has to be some guidelines to what could be done in a mixin then i guess. Maybe you should only get a reference to the parent. |
An important issue with smart contract code rather than application code is that extending it can be used to introduce attacks. While extension methods cannot replace existing methods and perform a person-in-the-middle attack, they can add new functions that use existing code and member variables in ways that lead to undesirable results for the user. IMO it's important to look at what any proposal takes from the security of the system as well as what it adds to its expressiveness. |
Thank you @alxocity and everyone else for starting this discussion! Extensions have been on our roadmap since the beginning, and we're excited to work on this. I had a call with @alxocity last Friday, and started a new topic in the forum to discuss this further: https://forum.onflow.org/t/extensibility/622 Please have a look and please share your thoughts! Hopefully we can discuss this together, come up with a proposal, and get it implemented 🚀 I'm also very happy to set up another call with more people who are interested to answer the open questions and work out a proposal. Please let me know! |
The core attachments proposal has been implemented and merged into a feature branch, hopefully to come to master soon. The portion of the proposal that originally included iteration will be handled separately in the future, tracked in the issue here: #2193 |
Issue To Be Solved
Ability to extend a resource without updating the resource contract.
Suggest A Solution
Essentially this, but in Cadence/Flow:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods
Context
This would allow adding Autographs to NBA TopShot moments, and generically adding resources to other resources without editing the parent resource contract. This would open up full personalization for anyone's NFTs. https://discord.gg/mCtsWyS
The text was updated successfully, but these errors were encountered: