types

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package types provides compatibility shims for the cosmos/evm migration. This file will be progressively removed as each usage is migrated to the correct cosmos/evm package.

Copyright Tharsis Labs Ltd.(Evmos) SPDX-License-Identifier:ENCL-1.0(https://github.com/evmos/evmos/blob/main/LICENSE)

Index

Constants

View Source
const (
	// MainnetEVMChainID is the EIP-155 chain ID for uptick_117-1.
	MainnetEVMChainID uint64 = 117
	// TestnetEVMChainID is the EIP-155 chain ID for uptick_1170-3.
	TestnetEVMChainID uint64 = 1170
)
View Source
const AttoPhoton = "auptick"

AttoPhoton is the base denomination for Uptick.

View Source
const BIP44HDPath = "m/44'/60'/0'/0/0"

BIP44HDPath is the default HD path for EVM keys.

View Source
const BaseDenomUnit = 18

BaseDenomUnit is the number of decimal places in the base denom (18 for EVM chains).

View Source
const Bip44CoinType = 60

Bip44CoinType is the BIP-44 coin type for EVM chains.

View Source
const RootCodespace = "uptick"

RootCodespace is the codespace for all errors defined in this package

Variables

View Source
var (
	ErrKeyTypeNotSupported = sdkerrors.Register(RootCodespace, codeKeyTypeNotSupported, "key type 'secp256k1' not supported")
)

errors

View Source
var PowerReduction = math.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil))

PowerReduction is the power reduction for EVM chains (10^18).

ProtoAccount is the default proto account type. In cosmos/evm, standard BaseAccount is used instead of EthAccount.

Functions

func ChainIDFromGenesisFile added in v0.4.0

func ChainIDFromGenesisFile(homePath string) string

ChainIDFromGenesisFile reads the Cosmos chain-id from $home/config/genesis.json.

func ConvertAddressCosmos2Evm added in v0.2.16

func ConvertAddressCosmos2Evm(cosmosAddress string) (string, error)

func ConvertAddressEvm2Cosmos added in v0.2.16

func ConvertAddressEvm2Cosmos(evmAddress string) (string, error)

func GetUptickAddressFromBech32

func GetUptickAddressFromBech32(address string) (sdk.AccAddress, error)

GetUptickAddressFromBech32 returns the sdk.Account address of given address, while also changing bech32 human readable prefix (HRP) to the value set on the global sdk.Config (eg: `uptick`). The function fails if the provided bech32 address is invalid.

func IsSupportedKey

func IsSupportedKey(pubkey cryptotypes.PubKey) bool

IsSupportedKey returns true if the pubkey type is supported by the chain (i.e eth_secp256k1, amino multisig, ed25519). NOTE: Nested multisigs are not supported.

func IsValidChainID added in v0.4.0

func IsValidChainID(chainID string) bool

IsValidChainID reports whether chainID is a Cosmos EIP-155 id of the form {name}_{eip155}-{revision}, e.g. uptick_117-1.

func ParseEIP155ChainID added in v0.4.0

func ParseEIP155ChainID(chainID string) (uint64, error)

ParseEIP155ChainID extracts the EIP-155 id from a Cosmos chain-id of the form {name}_{eip155}-{revision}, e.g. uptick_117-1 → 117.

func ResolveEVMChainID added in v0.4.0

func ResolveEVMChainID(appOpts servertypes.AppOptions, cosmosChainID string) uint64

ResolveEVMChainID derives the EIP-155 chain id from the Cosmos chain-id ({name}_{eip155}-{revision}). app.toml / --evm.evm-chain-id is only used when no parseable Cosmos chain-id is available. The cosmos/evm default 262144 is treated as unset so NewRootCmd's temporary app does not lock start.

func ValidateAddress added in v0.4.0

func ValidateAddress(addr string) error

ValidateAddress validates that the given string is a valid hex (Ethereum) address.

Types

type EthAccount added in v0.4.0

type EthAccount struct {
	*authtypes.BaseAccount
	CodeHash string
}

EthAccount wraps BaseAccount with a CodeHash for EVM compatibility. In cosmos/evm, EthAccount is no longer used — standard BaseAccount is used instead. This type is provided as a temporary shim during migration.

type GenesisState added in v0.3.0

type GenesisState map[string]json.RawMessage

GenesisState of the blockchain is represented here as a map of raw json messages key'd by a identifier string. The identifier is used to determine which module genesis information belongs to so it may be appropriately routed during init chain. Within this application default genesis information is retrieved from the ModuleBasicManager which populates json from each BasicModule object provided to it during init.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL