Behaviors

What is a Behavior?

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.

Behaviors

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.

Behavior Locking

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 Breakdown

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

Toggle a behavior on or off with the toggle() action.

Required Authority: group.manager

Action Parameters

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.

Examples

cleos push action {account} toggle '[{params}]'

Lock a Behavior

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

Action Parameters

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.

Examples

cleos push action {account} lockbhvr '[ ... ]' -p {account}

Add a New Behavior

New behaviors can be added to a group with the addbehavior() action.

Required Authority: group.manager

Action Parameters

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.

Examples

cleos push action {account} addbehavior '[{params}]'

Remove a Behavior

Existing behaviors can be removed with the rmvbehavior() action.

Required Authority: group.manager

Action Parameters

Name

Type

Example

Description

group_name

name

testgroup

Name of group with behavior to remove.

behavior_name

name

freeze

Name of behavior to remove.

Examples

cleos push action {account} rmvbehavior '[{params}]'

Last updated