-
Notifications
You must be signed in to change notification settings - Fork 0
/
msg.go
64 lines (56 loc) · 2.31 KB
/
msg.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package types
import "cosmossdk.io/math"
type TokenFactoryMsg struct {
/// Contracts can create denoms, namespaced under the contract's address.
/// A contract may create any number of independent sub-denoms.
CreateDenom *CreateDenom `json:"create_denom,omitempty"`
/// Contracts can change the admin of a denom that they are the admin of.
ChangeAdmin *ChangeAdmin `json:"change_admin,omitempty"`
/// Contracts can mint native tokens for an existing factory denom
/// that they are the admin of.
MintTokens *MintTokens `json:"mint_tokens,omitempty"`
/// Contracts can burn native tokens for an existing factory denom
/// that they are the admin of.
/// Currently, the burn from address must be the admin contract.
BurnTokens *BurnTokens `json:"burn_tokens,omitempty"`
/// Sets the metadata on a denom which the contract controls
SetMetadata *SetMetadata `json:"set_metadata,omitempty"`
/// Forces a transfer of tokens from one address to another.
ForceTransfer *ForceTransfer `json:"force_transfer,omitempty"`
}
// CreateDenom creates a new factory denom, of denomination:
// factory/{creating contract address}/{Subdenom}
// Subdenom can be of length at most 44 characters, in [0-9a-zA-Z./]
// The (creating contract address, subdenom) pair must be unique.
// The created denom's admin is the creating contract address,
// but this admin can be changed using the ChangeAdmin binding.
type CreateDenom struct {
Subdenom string `json:"subdenom"`
Metadata *Metadata `json:"metadata,omitempty"`
}
// ChangeAdmin changes the admin for a factory denom.
// If the NewAdminAddress is empty, the denom has no admin.
type ChangeAdmin struct {
Denom string `json:"denom"`
NewAdminAddress string `json:"new_admin_address"`
}
type MintTokens struct {
Denom string `json:"denom"`
Amount math.Int `json:"amount"`
MintToAddress string `json:"mint_to_address"`
}
type BurnTokens struct {
Denom string `json:"denom"`
Amount math.Int `json:"amount"`
BurnFromAddress string `json:"burn_from_address"`
}
type SetMetadata struct {
Denom string `json:"denom"`
Metadata Metadata `json:"metadata"`
}
type ForceTransfer struct {
Denom string `json:"denom"`
Amount math.Int `json:"amount"`
FromAddress string `json:"from_address"`
ToAddress string `json:"to_address"`
}