config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: Apache-2.0 Imports: 32 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// Bech32Prefix defines the Bech32 prefix used for accounts on the exemplary Cosmos EVM blockchain.
	Bech32Prefix = "cosmos"
	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address.
	Bech32PrefixAccAddr = Bech32Prefix
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key.
	Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address.
	Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key.
	Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address.
	Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key.
	Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
	// BaseDenomUnit defines the precision of the base denomination.
	BaseDenomUnit = 18
	// EVMChainID defines the EIP-155 replay-protection chain id for the current ethereum chain config.
	EVMChainID = 262144
)
View Source
const (
	// ExampleChainDenom is the denomination of the Cosmos EVM example chain's base coin.
	ExampleChainDenom = "aatom"

	// ExampleDisplayDenom is the display denomination of the Cosmos EVM example chain's base coin.
	ExampleDisplayDenom = "atom"

	// EighteenDecimalsChainID is the chain ID for the 18 decimals chain.
	EighteenDecimalsChainID = 9001

	// SixDecimalsChainID is the chain ID for the 6 decimals chain.
	SixDecimalsChainID = 9002

	// TwelveDecimalsChainID is the chain ID for the 12 decimals chain.
	TwelveDecimalsChainID = 9003

	// TwoDecimalsChainID is the chain ID for the 2 decimals chain.
	TwoDecimalsChainID = 9004

	// TestChainID1 is test chain IDs for IBC E2E test
	TestChainID1 = 9005
	// TestChainID2 is test chain IDs for IBC E2E test
	TestChainID2 = 9006

	// WEVMOSContractMainnet is the WEVMOS contract address for mainnet
	WEVMOSContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517"
)

Variables

View Source
var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{
	EighteenDecimalsChainID: {
		Denom:         ExampleChainDenom,
		ExtendedDenom: ExampleChainDenom,
		DisplayDenom:  ExampleDisplayDenom,
		Decimals:      evmtypes.EighteenDecimals.Uint32(),
	},

	SixDecimalsChainID: {
		Denom:         "utest",
		ExtendedDenom: "atest",
		DisplayDenom:  "test",
		Decimals:      evmtypes.SixDecimals.Uint32(),
	},

	EVMChainID: {
		Denom:         "atest",
		ExtendedDenom: "atest",
		DisplayDenom:  "test",
		Decimals:      evmtypes.EighteenDecimals.Uint32(),
	},
	TwelveDecimalsChainID: {
		Denom:         "ptest2",
		ExtendedDenom: "atest2",
		DisplayDenom:  "test2",
		Decimals:      evmtypes.TwelveDecimals.Uint32(),
	},
	TwoDecimalsChainID: {
		Denom:         "ctest3",
		ExtendedDenom: "atest3",
		DisplayDenom:  "test3",
		Decimals:      evmtypes.TwoDecimals.Uint32(),
	},
	TestChainID1: {
		Denom:         ExampleChainDenom,
		ExtendedDenom: ExampleChainDenom,
		DisplayDenom:  ExampleChainDenom,
		Decimals:      evmtypes.EighteenDecimals.Uint32(),
	},
	TestChainID2: {
		Denom:         ExampleChainDenom,
		ExtendedDenom: ExampleChainDenom,
		DisplayDenom:  ExampleChainDenom,
		Decimals:      evmtypes.EighteenDecimals.Uint32(),
	},
}

ChainsCoinInfo is a map of the chain id and its corresponding EvmCoinInfo that allows initializing the app with different coin info based on the chain id

Functions

func BlockedAddresses added in v0.5.0

func BlockedAddresses() map[string]bool

BlockedAddresses returns all the app's blocked account addresses.

Note, this includes:

  • module accounts
  • Ethereum's native precompiled smart contracts
  • Cosmos EVM' available static precompiled contracts

func GetBlockGasLimit added in v0.5.0

func GetBlockGasLimit(appOpts servertypes.AppOptions, logger log.Logger) uint64

GetBlockGasLimit reads the genesis json file using AppGenesisFromFile to extract the consensus block gas limit before InitChain is called.

func GetChainIDFromHome added in v0.5.0

func GetChainIDFromHome(home string) (string, error)

GetChainIDFromHome returns the chain ID from the client configuration in the given home directory.

func GetCosmosPoolMaxTx added in v0.5.0

func GetCosmosPoolMaxTx(appOpts servertypes.AppOptions, logger log.Logger) int

func GetLegacyPoolConfig added in v0.5.0

func GetLegacyPoolConfig(appOpts servertypes.AppOptions, logger log.Logger) *legacypool.Config

GetLegacyPoolConfig reads the legacy pool configuration from appOpts and overrides default values with values from app.toml if they exist and are non-zero.

func GetMaccPerms added in v0.5.0

func GetMaccPerms() map[string][]string

GetMaccPerms returns a copy of the module account permissions

func GetMinGasPrices added in v0.5.0

func GetMinGasPrices(appOpts servertypes.AppOptions, logger log.Logger) sdk.DecCoins

GetMinGasPrices reads the min gas prices from the app options, set from app.toml This is currently not used, but is kept in case this is useful for the mempool, in addition to the min tip flag

func GetMinTip added in v0.5.0

func GetMinTip(appOpts servertypes.AppOptions, logger log.Logger) *uint256.Int

GetMinTip reads the min tip from the app options, set from app.toml This field is also known as the minimum priority fee

func InitAppConfig added in v0.5.0

func InitAppConfig(denom string, evmChainID uint64) (string, interface{})

InitAppConfig helps to override default appConfig template and configs. return "", nil if no custom configuration is required for the application.

func MustGetDefaultNodeHome added in v0.5.0

func MustGetDefaultNodeHome() string

func SetBech32Prefixes added in v0.5.0

func SetBech32Prefixes(config *sdk.Config)

SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.

func SetBip44CoinType added in v0.5.0

func SetBip44CoinType(config *sdk.Config)

SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.

Types

Jump to

Keyboard shortcuts

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