-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys.go
39 lines (33 loc) · 1.14 KB
/
keys.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
package types
const (
// ModuleName string name of module
ModuleName = "erc20"
// StoreKey key for ethereum storage data, account code (StateDB) or block
// related data for Web3.
// The erc20 module should use a prefix store.
StoreKey = ModuleName
// RouterKey uses module name for routing
RouterKey = ModuleName
QueryParameters = "params"
QueryTokenMapping = "token-mapping"
QueryContractByDenom = "contract-by-denom"
QueryDenomByContract = "denom-by-contract"
QueryContractTem = "current-template-contract"
)
// KVStore key prefixes
var (
KeyPrefixContractToDenom = []byte{0x01}
KeyPrefixDenomToContract = []byte{0x02}
KeyPrefixTemplateContract = []byte{0x03}
)
// ContractToDenomKey defines the store key for contract to denom reverse index
func ContractToDenomKey(contract []byte) []byte {
return append(KeyPrefixContractToDenom, contract...)
}
// DenomToContractKey defines the store key for denom to contract mapping
func DenomToContractKey(denom string) []byte {
return append(KeyPrefixDenomToContract, denom...)
}
func ConstructContractKey(str string) []byte {
return append(KeyPrefixTemplateContract, []byte(str)...)
}