forked from Kava-Labs/kava
/
keys.go
32 lines (24 loc) · 934 Bytes
/
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
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/common"
)
const (
// ModuleName name that will be used throughout the module
ModuleName = "evmutil"
StoreKey = "utilevm" // note: cannot be emvutil due to collision with x/evm
// RouterKey Top level router key
RouterKey = ModuleName
)
var AccountStoreKeyPrefix = []byte{0x00} // prefix for keys that store accounts
// AccountStoreKey turns an address to a key used to get the account from the store
func AccountStoreKey(addr sdk.AccAddress) []byte {
return append(AccountStoreKeyPrefix, address.MustLengthPrefix(addr)...)
}
// ModuleAddress is the native module address for EVM
var ModuleEVMAddress common.Address
func init() {
ModuleEVMAddress = common.BytesToAddress(authtypes.NewModuleAddress(ModuleName).Bytes())
}