Documentation
¶
Index ¶
- Constants
- Variables
- func Enable0000(jt *vm.JumpTable)
- func Enable0001(jt *vm.JumpTable)
- func Enable0002(jt *vm.JumpTable)
- func EvmAppOptions(chainID uint64) error
- func NewEVMGenesisState() *evmtypes.GenesisState
- func NewErc20GenesisState() *erc20types.GenesisState
- func NewFeeMarketGenesisState() *feemarkettypes.GenesisState
- func NewMintGenesisState() *minttypes.GenesisState
- func SetBech32Prefixes(config *sdk.Config)
- func SetBip44CoinType(config *sdk.Config)
- type GenesisState
Constants ¶
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 // DisplayDenom defines the denomination displayed to users in client applications. DisplayDenom = "atom" // BaseDenom defines to the default denomination used in the Cosmos EVM example chain. BaseDenom = "aatom" // 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 )
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 CosmosChainID = 262144 // 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 ¶
var ( Multiplier = uint64(10) SstoreConstantGas = uint64(500) )
var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ EighteenDecimalsChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, EVMChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, }
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 Enable0000 ¶
enable0000 contains the logic to modify the CREATE and CREATE2 opcodes constant gas value.
func Enable0001 ¶
enable0001 contains the logic to modify the CALL opcode constant gas value.
func Enable0002 ¶
enable0002 contains the logic to modify the SSTORE opcode constant gas value.
func EvmAppOptions ¶
EvmAppOptions allows to setup the global configuration for the Cosmos EVM chain.
func NewEVMGenesisState ¶
func NewEVMGenesisState() *evmtypes.GenesisState
NewEVMGenesisState returns the default genesis state for the EVM module.
NOTE: for the example chain implementation we need to set the default EVM denomination and enable ALL precompiles.
func NewErc20GenesisState ¶
func NewErc20GenesisState() *erc20types.GenesisState
NewErc20GenesisState returns the default genesis state for the ERC20 module.
NOTE: for the example chain implementation we are also adding a default token pair, which is the base denomination of the chain (i.e. the WEVMOS contract).
func NewFeeMarketGenesisState ¶
func NewFeeMarketGenesisState() *feemarkettypes.GenesisState
NewFeeMarketGenesisState returns the default genesis state for the feemarket module.
NOTE: for the example chain implementation we are disabling the base fee.
func NewMintGenesisState ¶
func NewMintGenesisState() *minttypes.GenesisState
NewMintGenesisState returns the default genesis state for the mint module.
NOTE: for the example chain implementation we are also adding a default minter.
func SetBech32Prefixes ¶
SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.
func SetBip44CoinType ¶
SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.
Types ¶
type GenesisState ¶
type GenesisState map[string]json.RawMessage
GenesisState of the blockchain is represented here as a map of raw json messages key'd by an 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.