-
Notifications
You must be signed in to change notification settings - Fork 140
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
Adding default implementations to interface methods #989
Comments
Notes
|
merge after secure cadence release |
Would it be possible to reconsider and have this as part of that release? If we can do that and at the same time implement getViews and resolveViews in NFT contract it would solve the linking problem that is a very hard one. |
The code for the release was feature frozen a few months ago and then received security audits, so unfortunately we will not be able to get it into this release, but will definitely try to get it into the next release, given that is is now complete. |
good to go once we verify there are no security implications, might need adding more test cases. |
Issue To Be Solved
In order to evolve contracts and standards like the NFT contract Interface having some way to specify the default behavior of a interface method is needed.
Say you want to add a
getName(): String
method to all INFT types. In order to do that safely the sanes way is IMHO to add support for default implementations.Suggested Solution
Interface methods can today contain pre and post blocks. One suggestion from bluesign is that they can also contain a default block. And when implementing an interface methods that have a default block can be left unimplemented in the implementing code
Context
See here for context onflow/flow-nft#9
The text was updated successfully, but these errors were encountered: