Groups
What are 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.
Supply Mechanics
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 Breakdown
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.
Create a New Group
To create a new group, simply call the newgroup()
action on your Marble contract.
Required Authority: admin
Action Parameters
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.
Examples
Edit Group Details
Edit the group title and/or description with the editgroup()
action.
Required Authority: group.manager
Action Parameters
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.
Examples
Set a New Manager
Set a new group manager with the setmanager()
action.
Required Authority: group.manager
Action Parameters
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.
Examples
Last updated