NFTs

What are NFTs?

NFTs are the individual, ownable items stored by the Marble contract. Upon creation, every NFT is given a unique contract-wide serial number used to identify it among all other NFTs in the contract.

Ownership of an NFT can be proven by controlling the account that owns a given NFT. Every NFT also belongs to one and only one Group, which dictates the different kinds of behaviors it can perform.

Behavior Rules

NFTs follow the behavior rules set by their respective groups. For example, if an NFT belongs to a group whose transferrable behavior is set to false, then the NFT is not transferrable. If the group manager were to activate transferability with the toggle() action, the NFT would become transferrable.

See the Groups page for a list of all Behaviors.

Table Breakdown

Table Name: nfts

Table Scoping: self

Field Name

Field Type

Description

serial

uint64_t

Contract-wide NFT serial number (Primary Key).

group

name

Group name identifier.

owner

name

Account that owns the NFT.

Additional Indices

bygroup, byowner

Create an NFT

To create a new group, call the newnft() action on your Marble contract.

Required Authority: group.manager

Action Parameters

  • name owner: The account that will own the new NFT.

  • name group: The group to create the NFT under.

  • bool log: When true, will launch an inline logevent() action with the NFT's assigned serial number.

Examples

Cleos
Marble CLI
Cleos
cleos push action {account} newnft '[ {params} ]' -p {manager}
Marble CLI
marble make nft ...

Transfer an NFT

To transfer an NFT, call the transfernft() action on your Marble contract.

Required Authority: nft.owner

Action Parameters

  • uint64_t serial: The serial number of the NFT to transfer.

  • name new_owner: The account name receiving the NFT.

  • string memo: An optional memo field.

Examples

Cleos
Marble CLI
Cleos
cleos push action {account} transfernft '[ {params} ]' -p {owner}
Marble CLI
marble transfer ...

Destroy an NFT

To destroy an NFT, call the destroynft() action on your Marble contract.

Required Authority: group.manager

Action Parameters

  • uint64_t serial: The serial number of the NFT to destroy.

  • string memo: An optional memo field.

Examples

Cleos
Marble CLI
Cleos
cleos push action {account} destroynft '[ {params} ]' -p {manager}
Marble CLI
marble remove ...