-
Notifications
You must be signed in to change notification settings - Fork 0
/
keys.go
58 lines (43 loc) · 1.4 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
)
// constants
const (
// DefaultPrefix prefix
DefaultPrefix = "uptick"
// ModuleName module name
ModuleName = "erc721"
// StoreKey to be used when creating the KVStore
StoreKey = ModuleName
// RouterKey to be used for message routing
RouterKey = ModuleName
TransferERC721Memo = ":IBCTransferFromERC721"
)
// ModuleAddress is the native module address for EVM
var ModuleAddress common.Address
var AccModuleAddress sdk.AccAddress
func init() {
AccModuleAddress = authtypes.NewModuleAddress(ModuleName)
ModuleAddress = common.BytesToAddress(authtypes.NewModuleAddress(ModuleName).Bytes())
}
// prefix bytes for the EVM persistent store
const (
prefixTokenPair = iota + 1
prefixTokenPairByERC721
prefixTokenPairByClass
prefixNFTUIDPairByNFTUID
prefixNFTUIDPairByTokenUID
prefixEvmAddressByContractTokenId
)
// KVStore key prefixes
var (
KeyPrefixTokenPair = []byte{prefixTokenPair}
KeyPrefixTokenPairByERC721 = []byte{prefixTokenPairByERC721}
KeyPrefixTokenPairByClass = []byte{prefixTokenPairByClass}
KeyPrefixNFTUIDPairByNFTUID = []byte{prefixNFTUIDPairByNFTUID}
KeyPrefixNFTUIDPairByTokenUID = []byte{prefixNFTUIDPairByTokenUID}
KeyPrefixEvmAddressByContractTokenId = []byte{prefixEvmAddressByContractTokenId}
)