Behaviors
A Behavior is a specific action that an individual Item may perform. Items follow the behavior rules set by their respective groups.
For example, if an Item belongs to a group whose
transfer
behavior is set to false, then the Item is not transferrable. If the group manager were to activate transferability with the toggle()
action, the Item would become transferrable.The following behaviors are created for every group by default. Group behaviors apply to all the Items in a given group, and behaviors can be added, removed, or toggled on and off by the group manager.
Name | Default | Description |
mint | true | Allows Items to be created with the mintitem() action. |
transfer | true | Allows Item ownership to be transferred with the transferitem() action. |
activate | false | Allows Items to be activated with the activateitem() action. |
reclaim | false | Allows Items to be reclaimed by the group manager with the reclaimitem() action. |
consume | false | Allows Items to be consumed by the item owner with the consumeitem() action. |
destroy | true | Allows Items to be destroyed by the group manager with the destroyitem() action. |
By default all behaviors are unlocked meaning the group manager can individually toggle them on or off at any time. Group managers may also choose to lock behaviors in a specific state to ensure immutability.
Table Name:
behaviors
Table Scope:
group_name
No Additional Indices
Name | Type | Example | Description |
behavior_name | name | transferitem | Name of behavior. |
state | bool | true | Behavior on/off state. |
locked | bool | false | Behavior lock state. |
Toggle a behavior on or off with the
toggle()
action.Required Authority:
group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of group with behavior to toggle. |
behavior_name | name | transferitem | Name of behavior to toggle on or off. |
Cleos
Marble CLI
cleos push action {account} toggle '[{params}]'
marble ...
Behaviors can be locked with the
lockbhvr()
action.Locking a behavior is an irreversible action. Please be sure the locked behavior is in the desired state.
Required Authority:
group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of the group with the behavior to lock. |
behavior_name | name | transfer | Name of the behavior to lock. |
Cleos
Marble CLI
cleos push action {account} lockbhvr '[ ... ]' -p {account}
marble ...
New behaviors can be added to a group with the
addbehavior()
action.Required Authority:
group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of group to receive behavior. |
behavior_name | name | freeze | Name of new behavior. |
initial_state | bool | true | Initial state of new behavior. |
Cleos
Marble CLI
cleos push action {account} addbehavior '[{params}]'
marble ...
Existing behaviors can be removed with the
rmvbehavior()
action.Required Authority: group.manager
Name | Type | Example | Description |
group_name | name | testgroup | Name of group with behavior to remove. |
behavior_name | name | freeze | Name of behavior to remove. |
Cleos
Marble CLI
cleos push action {account} rmvbehavior '[{params}]'
marble ...
Last modified 3yr ago