Groups
Groups are managed collections of Items that share behaviors and supply stats, and are included as a core feature in all Marble contracts. All Marble Digital Items belong to one and only one group.
Marble automatically enforces supply control mechanics into Item creation and destruction. The mechanical rules are as follows:
- Creating a new Item increases the group's
supply
andissued_supply
by 1. - Destroying or Consuming an Item reduces the group's
supply
by 1. - A group's
supply
of Items can never exceed thesupply_cap
. - A group's
supply
can never be reduced below 0.
Table Name:
groups
Table Scope:
self
No Additional Indices
Field Name | Field Type | Description |
title | string | Group title. |
subtitle | string | Group subtitle. |
group_name | name | Name Identifier (Primary Key). |
manager | name | Account assigned as group manager. |
supply | uint64_t | Circulating supply of Items. |
issued_supply | uint64_t | Total lifetime issued supply of Items. |
supply_cap | uint64_t | Max circulating supply of Items. |
To create a new group, simply call the
newgroup()
action on your Marble contract.Required Authority:
admin
Name | Type | Example | Description |
title | string | "Test Group" | Title of group. |
description | string | "Test Group for Testing" | Description of the group. |
group_name | name | testgroup | The name identifier of the group. |
manager | name | testaccount1 | The account name of the group manager. |
supply_cap | uint64_t | 21000000 | The maximum number of Items from this group that can exist at one time. |
Cleos
Marble CLI
cleos push action {account} newgroup '[ ... ]' -p {account}
marble make group ...
Edit the group title and/or description with the
editgroup()
action.Required Authority:
group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of the group to edit. |
new_title | string | "New Group Title" | The new group title. |
new_description | string | "New Group Description" | The new group description. |
Cleos
Marble CLI
cleos push action {account} editgroup '[ ... ]' -p {account}
Set a new group manager with the
setmanager()
action.Required Authority:
group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of the group to edit. |
new_manager | name | testaccount2 | Account name of the new group manager. |
memo | string | "Take over from here" | Optional memo. |
Cleos
Marble CLI
cleos push action {account} setmanager '[ ... ]' -p {account}
marble modify manager ...
Last modified 3yr ago