github.com/InjectiveLabs/sdk-go@v1.53.0/chain/tokenfactory/types/keys.go (about) 1 package types 2 3 import ( 4 "strings" 5 ) 6 7 const ( 8 // ModuleName defines the module name 9 ModuleName = "tokenfactory" 10 11 // StoreKey defines the primary module store key 12 StoreKey = ModuleName 13 14 // RouterKey is the message route for slashing 15 RouterKey = ModuleName 16 17 // QuerierRoute defines the module's query routing key 18 QuerierRoute = ModuleName 19 20 // MemStoreKey defines the in-memory store key 21 MemStoreKey = "mem_tokenfactory" 22 ) 23 24 // KeySeparator is used to combine parts of the keys in the store 25 const KeySeparator = "|" 26 27 var ( 28 DenomAuthorityMetadataKey = []byte{0x01} 29 DenomsPrefixKey = []byte{0x02} 30 CreatorPrefixKey = []byte{0x03} 31 AdminPrefixKey = []byte{0x04} 32 ParamsKey = []byte{0x05} 33 ) 34 35 // GetDenomPrefixStore returns the store prefix where all the data associated with a specific denom 36 // is stored 37 func GetDenomPrefixStore(denom string) []byte { 38 return []byte(strings.Join([]string{string(DenomsPrefixKey), denom, ""}, KeySeparator)) 39 } 40 41 // GetCreatorPrefix returns the store prefix where the list of the denoms created by a specific 42 // creator are stored. 43 func GetCreatorPrefix(creator string) []byte { 44 return []byte(strings.Join([]string{string(CreatorPrefixKey), creator, ""}, KeySeparator)) 45 } 46 47 // GetCreatorsPrefix returns the store prefix where a list of all creator addresses are stored 48 func GetCreatorsPrefix() []byte { 49 return append(CreatorPrefixKey, []byte(KeySeparator)...) 50 }