-
Notifications
You must be signed in to change notification settings - Fork 0
/
assets.go
48 lines (41 loc) · 1.47 KB
/
assets.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
package types
import (
"strings"
sdk "github.com/cosmos/cosmos-sdk/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
)
// nolint
const (
// DisplayDenom defines the denomination displayed to users in client applications.
DisplayDenom = "fury"
// BaseDenom defines to the default denomination used in Blackfury (staking, EVM, governance, etc.)
BaseDenom = AttoFuryDenom
AttoFuryDenom = "afury" // 1e-18
MicroUSMDenom = "uusm" // 1e-6
)
var (
// MicroUSMTarget defines the target exchange rate of uusm denominated in uUSD.
MicroUSMTarget = sdk.OneDec()
)
func SetDenomMetaDataForStableCoins(ctx sdk.Context, k bankkeeper.Keeper) {
for _, base := range []string{MicroUSMDenom} {
if _, ok := k.GetDenomMetaData(ctx, base); ok {
continue
}
display := base[1:] // e.g., usm
// Register meta data to bank module
k.SetDenomMetaData(ctx, banktypes.Metadata{
Description: "The native stable token of the Blackfury.",
DenomUnits: []*banktypes.DenomUnit{
{Denom: "u" + display, Exponent: uint32(0), Aliases: []string{"micro" + display}}, // e.g., uusm
{Denom: "m" + display, Exponent: uint32(3), Aliases: []string{"milli" + display}}, // e.g., musm
{Denom: display, Exponent: uint32(6), Aliases: []string{}}, // e.g., usm
},
Base: base,
Display: display,
Name: strings.ToUpper(display), // e.g., USM
Symbol: strings.ToUpper(display), // e.g., USM
})
}
}