treasury

Abstract

The treasury manages all stable currencies which are supported by RIZON Blockchain.

State

Currency

Currency defines a single currency info
1
type Currency struct {
2
// denom is the name of the currency
3
Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"`
4
// desc is a description of the currency
5
Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty" yaml:"desc"`
6
// owner is who can mint this currency
7
Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"`
8
// mintable indicates whether this currency can be minted or not
9
Mintable bool `protobuf:"varint,4,opt,name=mintable,proto3" json:"mintable,omitempty" yaml:"mintable"`
10
}
Copied!

Currencies

Currencies is the list of all supported currencies' name
1
type Currencies struct {
2
// denoms is the denom list of all currencies
3
Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty" yaml:"denoms"`
4
}
Copied!

Sequence

Sequence describes currency sequence number of current state
1
type Sequence struct {
2
// number is the currency sequence number of current state
3
Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty" yaml:"number"`
4
}
Copied!

Params

Params defines the parameters for the treasury module
1
type Params struct {
2
// mintable indicates whether every currencie of treasury module are able to mint or not
3
Mintable bool `protobuf:"varint,1,opt,name=mintable,proto3" json:"mintable,omitempty" yaml:"mintable"`
4
// sequence of currency state
5
Sequence int64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty" yaml:"sequence"`
6
// currency_list is the list of supported currencies
7
CurrencyList []Currency `protobuf:"bytes,3,rep,name=currency_list,json=currencyList,proto3" json:"currency_list" yaml:"currency_list"`
8
}
Copied!

Message

MsgMintRequest

MsgMintRequest defines a SDK message for minting currency

structure

1
type MsgMintRequest struct {
2
// receiver is the target address of minted coins
3
Receiver string `protobuf:"bytes,1,opt,name=receiver,proto3" json:"receiver,omitempty" yaml:"receiver"`
4
// signer is who requests minting
5
Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty" yaml:"signer"`
6
// amount is the amount to mint
7
Amount types.Coin `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount"`
8
}
Copied!

request sample

1
{
2
"body": {
3
"messages": [
4
{
5
"@type": "/rizonworld.rizon.treasury.MsgMintRequest",
6
"amount": {
7
"amount": "100",
8
"denom": "skrw"
9
},
10
"receiver": "rizon136fzkc73rm5def5fngs386qdlxcuvxvrte8lk7",
11
"signer": "rizon136fzkc73rm5def5fngs386qdlxcuvxvrte8lk7"
12
}
13
],
14
}
Copied!

MsgBurnRequest

MsgBurnRequest defines a SDK message for burning currency

structure

1
type MsgBurnRequest struct {
2
// signer is who requests burning
3
Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty" yaml:"signer"`
4
// amount is the amount to burn
5
Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount"`
6
}
Copied!

request sample

1
{
2
"body": {
3
"messages": [
4
{
5
"@type": "/rizonworld.rizon.treasury.MsgBurnRequest",
6
"amount": {
7
"amount": "100",
8
"denom": "susd"
9
},
10
"signer": "rizon136fzkc73rm5def5fngs386qdlxcuvxvrte8lk7"
11
}
12
],
13
}
Copied!

Event

EndBlocker

TBD

msg_server

Mint

Type
AttributeKey
AttributeValue
mint
denom
{msg.Amount.Denom}
mint
receiver
{msg.Receiver}
mint
amount
{msg.Amount.Amount}
message
module
treasury
message
sender
{msg.Signer}

Burn

Type
AttributeKey
AttributeValue
burn
denom
{msg.Amount.Denom}
burn
amount
{msg.Amount.Amount}
message
module
treasury
message
sender
{msg.Signer}

Parameter

Key
Type
Example
Mintable
bool
true
Sequence
int64
1
CurrencyList
[]Currency
[{"denom":"skrw","desc":"stable coin of KRW","owner":"rizon136fzkc73rm5def5fngs386qdlxcuvxvrte8lk7","mintable":true}]