On-Chain User Groups in Ultra
This document describes the feature of on-chain user groups in Ultra. It serves as a guide for both users and developers to understand how this feature works and how it can be utilized in smart contracts.
What Will You Learn?
- Smart Contract Actions: Understand how to create and manage groups through actions like
- CLI Commands: Get a hands-on guide on how to use
cleoscommands for performing various actions.
- Table Descriptions: Get acquainted with the blockchain tables like
users.athat store state information for the group management system.
- Any account can create a group.
- The creator pays for the RAM usage.
- Optionally, a URI and hash for off-chain metadata can be specified during creation.
- All groups reside in a global scope, not under the creator's scope.
For each group, the following information is stored on-chain:
- ID: Globally unique identifier that auto-increases.
- Creator: The EOSIO account that created the group.
- User Number: Number of users in the group.
- Meta_URI: URI for metadata (e.g.,
- Meta_Hash: Hash of the metadata.
meta_hashcan have values.
- Both can be empty.
- Cannot have an empty
meta_hashis not empty.
- Only the creator can update
- The creator pays for the additional RAM usage or receives a RAM refund.
- Only the creator can add new users to or remove existing users from the group.
- The creator pays for RAM when adding users and receives a RAM refund when removing users.
- Any smart contract can utilize groups for various functionalities.
- A user needs to belong to a group to mint tokens.
- Issue an NFT to a user if the user belongs to a specific group.
- Ownership rules can be group-dependent.