In this section we describe the processing of the token messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the state section.
A MsgCreateToken
creates and stores a new Token struct (which is a class overview for minting tokens). Sets up the Token by initiating a cw1155 smart contract, and saving the address in the Token as well as a unique name (namespace).
type MsgCreateToken struct {
Minter string
Class DIDFragment
Name string
Description string
Image string
TokenType string
Cap github_com_cosmos_cosmos_sdk_types.Uint
}
The field's descriptions is as follows:
minter
- a string containing the address of the minterclass
- a string containing the token protocol entity DID (validated)name
- a string containing the token name, which must be unique (namespace)description
- a string containing any arbitrary descriptionimage
- a string containing the image url for the tokentokenType
- a string containing the token type eg. ixo1155cap
- a integer containing the maximum number of tokens with this name that can be minted, 0 is unlimited
A MsgMintToken
mints tokens on the ixo1155 contract that was instantiate on the Token creation. There will also be TokenProperties created for each unique id.
Allows a Minter to directly mint the token with a name that is specified in the Token, and a unique index. The minted tokens id
is a hex encoded md5 hash of the token name
plus index
, with no separators.
type MsgMintToken struct {
Minter string
ContractAddress string
Owner string
MintBatch []*MintBatch
}
The field's descriptions is as follows:
minter
- a string containing the address of the mintercontractAddress
- a string containing the contract address, same as theContractAddress
of the Tokenowner
- a string containing the address of the owner to mint the tokens formintBatch
- a list of MintBatch
A MsgTransferToken
transfers tokens on the ixo1155 contract that was instantiate on the Token creation and where the tokens was minted.
type MsgTransferToken struct {
Owner string
Recipient string
Tokens []*TokenBatch
}
The field's descriptions is as follows:
owner
- a string containing the address of the owner to transfer the tokens fromrecipient
- a string containing the address of the owner to transfer the tokens totokens
- a list of TokenBatch. All the tokens must be on the smart contract.
A MsgRetireToken
burns the tokens on the ixo1155 contract that was instantiate on the Token creation and where the tokens was minted. It also adds the retire details to the Token Retired
field to keep a record of the retire event. Retiring credits is permanent and cannot be undone.
type MsgRetireToken struct {
Owner string
Tokens []*TokenBatch
Jurisdiction string
Reason string
}
The field's descriptions is as follows:
owner
- a string containing the address of the owner of the tokens to retiretokens
- a list of TokenBatch. All the tokens must be on the smart contract.reason
- a string containing any arbitrary reason that specifies the reason for retiring tokens.jurisdiction
- a string containing the jurisdiction of the token owner. A jurisdiction has the format: [-[ ]] The country-code must be 2 alphabetic characters, the sub-national-code can be 1-3 alphanumeric characters, and the postal-code can be up to 64 alphanumeric characters. Only the country-code is required, while the sub-national-code and postal-code are optional and can be added for increased precision.
A MsgCancelToken
burns the tokens on the ixo1155 contract that was instantiate on the Token creation and where the tokens was minted. It also adds the cancel details to the Token Cancelled
field to keep a record of the cancel event.
Cancels a specified amount of tradable tokens, removing the amount from the token owner's tradable balance(by burning it) and removing the amount from the token’s tradable supply. Cancelling credits is permanent and cannot be undone.
type MsgCancelToken struct {
Owner string
Tokens []*TokenBatch
Reason string
}
The field's descriptions is as follows:
owner
- a string containing the address of the owner of the tokens to retiretokens
- a list of TokenBatch. All the tokens must be on the smart contract.reason
- a string containing any arbitrary reason that specifies the reason for retiring tokens.
A MsgPauseToken
changes the Paused
field on the Token which stops allowance of token minting temporarily if set to true
or allow minting again if set to false
type MsgPauseToken struct {
Minter string
ContractAddress string
Paused bool
}
The field's descriptions is as follows:
minter
- a string containing the address of the minter, must be same asMinter
of the Token, must also be the signers addresscontractAddress
- a string containing the contract address, same as theContractAddress
of the Tokenpaused
- a boolean indicating whether to stop allowance of token minting temporarily
A MsgPauseToken
changes the Cancelled
field on the Token which stops allowance of token minting permanently
type MsgStopToken struct {
Minter string
ContractAddress string
}
The field's descriptions is as follows:
minter
- a string containing the address of the minter, must be same asMinter
of the Token, must also be the signers addresscontractAddress
- a string containing the contract address, same as theContractAddress
of the Token
A MintBatch allows batching mint token info
type MintBatch struct {
Name string
Index string
Amount github_com_cosmos_cosmos_sdk_types.Uint
Collection string
TokenData []*TokenData
}
The field's descriptions is as follows:
name
- a string containing the token name, which is same as TokenName
index
- a string containing the unique identifier hexstring that identifies the tokenamount
- a integer indicating how many tokens must be minted for this uniqueindex
and generateid
collection
- a string containing the did of the "collection" the token was minted towards (eg. Supamoto Malawi Did)tokenData
- a list of TokenData
A TokenBatch allows batching tokens for transfering and retiring
type TokenBatch struct {
Id string
Amount github_com_cosmos_cosmos_sdk_types.Uint
}
The field's descriptions is as follows:
id
- a string containing the unique identifier of the token (TokenProperties)amount
- a integer indicating how many tokens is in the batch for the specifiedid