-
Notifications
You must be signed in to change notification settings - Fork 397
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
feat(grc): remake of grc721 nft standard #3973
base: master
Are you sure you want to change the base?
feat(grc): remake of grc721 nft standard #3973
Conversation
…21 (old) and grc20 - currently grc721 is a copy of grc20 adapted for non fungible tokens - remake impl also contains a new functionality when compared to the old one - batch operations (transfer, transfer from, mint and burn) - tellers have been updated with these batch operations
- modify tellers so they work how they are supposed to - fix imports
🛠 PR Checks Summary🔴 Pending initial approval by a review team member, or review from tech-staff Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
@@ -0,0 +1 @@ | |||
module gno.land/p/demo/grc/grc721-remake |
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.
A -
character is not allowed in the package name; thus, the CI has failed. You need to change it.
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.
Thanks, this was fixed in 4ee51ca
Modeling after grc20
This implementation is completely based on the exiting grc20 with adaptation to the concept of nft (taken from previos grc721 implementation). What I mean to say is, this code introduces the Teller system to the existing grc721. To maintain consistency I have also decided to keep the exact same godoc comments from the grc20 in places where applicable.
Regardless, grc20 may be lacking in some features regarding extensions (#3692) so I have decided to attemt to bypass them in this approach (this also removes the need for having additions like grc721_metadata etc.)
Hooks
Hooks (in context of token standards) are a concept that allows developers creating fungible and non fungible tokens to customize them to their own liking without having to have their own implementation of the token/nft. It encourages the use of the existing basic implementation, or rather Teller interface.
How it works: admin (meaning token creator) just defines a structure that is going to represent a hook which needs to implement a
Hook
interface (3 funcs):GetHookType()
defining which token-native function is going to trigger the hook (mint, transfer, burn, etc)GetHookTime()
defining the time of the triggering - before or after the native funcOnTransfer()
orOnMint()
...After creating a hook, token admin would just call the method
RegisterHook()
over the token (nft) instance which would add the hook to the token's hook registry and the hook would automatically be triggered on desired occasion.Example (from hooks_test.gno):
Batch operations
This implementation also adds a feature where batch operations are implemented such as BatchTransfer, BatchMint, BatchBurn, etc which are implemented through tellers as well. This contributes to easier usage of the nft realms and some gas efficiency.