Documentation
¶
Index ¶
- Constants
- Variables
- func BlockedAddresses() map[string]bool
- func EvmAppOptions(chainID string) error
- func GetMaccPerms() map[string][]string
- func NewAvailableStaticPrecompiles(stakingKeeper stakingkeeper.Keeper, ...) map[common.Address]vm.PrecompiledContract
- func NewEVMGenesisState() *evmtypes.GenesisState
- func NewErc20GenesisState() *erc20types.GenesisState
- func NewFeeMarketGenesisState() *feemarkettypes.GenesisState
- func NewMintGenesisState() *minttypes.GenesisState
- func NoOpEVMOptions(_ string) error
- func SetupTestingApp(chainID string) func() (ibctesting.TestingApp, map[string]json.RawMessage)
- type BankKeeper
- type EVMD
- func (app *EVMD) AppCodec() codec.Codec
- func (app *EVMD) AutoCliOpts() autocli.AppOptions
- func (app *EVMD) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *EVMD) Configurator() module.Configurator
- func (app *EVMD) DefaultGenesis() map[string]json.RawMessage
- func (app *EVMD) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *EVMD) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *EVMD) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error)
- func (app *EVMD) GetBaseApp() *baseapp.BaseApp
- func (app *EVMD) GetIBCKeeper() *ibckeeper.Keeper
- func (app *EVMD) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *EVMD) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *EVMD) GetStakingKeeperSDK() stakingkeeper.Keeper
- func (app *EVMD) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *EVMD) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *EVMD) GetTxConfig() client.TxConfig
- func (app *EVMD) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *EVMD) InterfaceRegistry() types.InterfaceRegistry
- func (app *EVMD) LegacyAmino() *codec.LegacyAmino
- func (app *EVMD) LoadHeight(height int64) error
- func (app *EVMD) Name() string
- func (app *EVMD) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *EVMD) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *EVMD) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *EVMD) RegisterTendermintService(clientCtx client.Context)
- func (app *EVMD) RegisterTxService(clientCtx client.Context)
- func (app EVMD) RegisterUpgradeHandlers()
- func (app *EVMD) SimulationManager() *module.SimulationManager
- func (app *EVMD) TxConfig() client.TxConfig
- type EVMOptionsFn
- type GenesisState
- type SetupOptions
Constants ¶
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 = "cosmos_9001" // SixDecimalsChainID is the chain ID for the 6 decimals chain. SixDecimalsChainID = "ossix_9002" // TwelveDecimalsChainID is the chain ID for the 12 decimals chain. TwelveDecimalsChainID = "ostwelve_9003" // TwoDecimalsChainID is the chain ID for the 2 decimals chain. TwoDecimalsChainID = "ostwo_9004" CosmosChainID = "cosmos_262144" // TestChainID1 is test chain IDs for IBC E2E test TestChainID1 = "testchain_9001" // TestChainID2 is test chain IDs for IBC E2E test TestChainID2 = "testchain_9002" // WEVMOSContractMainnet is the WEVMOS contract address for mainnet WEVMOSContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517" )
Variables ¶
var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{ EighteenDecimalsChainID: { Denom: ExampleChainDenom, ExtendedDenom: ExampleChainDenom, DisplayDenom: ExampleDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, CosmosChainID: { Denom: "atest", ExtendedDenom: "atest", DisplayDenom: "test", 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
var ( // DefaultNodeHome default home directories for the application daemon DefaultNodeHome string )
Functions ¶
func BlockedAddresses ¶
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 EvmAppOptions ¶
EvmAppOptions allows to setup the global configuration for the Cosmos EVM chain.
func GetMaccPerms ¶
GetMaccPerms returns a copy of the module account permissions
func NewAvailableStaticPrecompiles ¶
func NewAvailableStaticPrecompiles( stakingKeeper stakingkeeper.Keeper, distributionKeeper distributionkeeper.Keeper, bankKeeper cmn.BankKeeper, erc20Keeper erc20Keeper.Keeper, transferKeeper transferkeeper.Keeper, channelKeeper *channelkeeper.Keeper, evmKeeper *evmkeeper.Keeper, govKeeper govkeeper.Keeper, slashingKeeper slashingkeeper.Keeper, evidenceKeeper evidencekeeper.Keeper, ) map[common.Address]vm.PrecompiledContract
NewAvailableStaticPrecompiles returns the list of all available static precompiled contracts from Cosmos EVM.
NOTE: this should only be used during initialization of the Keeper.
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 NoOpEVMOptions ¶
NoOpEVMOptions is a no-op function that can be used when the app does not need any specific configuration.
func SetupTestingApp ¶
func SetupTestingApp(chainID string) func() (ibctesting.TestingApp, map[string]json.RawMessage)
SetupTestingApp initializes the IBC-go testing application need to keep this design to comply with the ibctesting SetupTestingApp func and be able to set the chainID for the tests properly
Types ¶
type BankKeeper ¶
type BankKeeper interface {
evmtypes.BankKeeper
cmn.BankKeeper
}
type EVMD ¶
type EVMD struct {
*baseapp.BaseApp
// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
AuthzKeeper authzkeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
// IBC keepers
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
TransferKeeper transferkeeper.Keeper
// Cosmos EVM keepers
FeeMarketKeeper feemarketkeeper.Keeper
EVMKeeper *evmkeeper.Keeper
Erc20Keeper erc20keeper.Keeper
PreciseBankKeeper precisebankkeeper.Keeper
// the module manager
ModuleManager *module.Manager
BasicModuleManager module.BasicManager
// contains filtered or unexported fields
}
EVMD extends an ABCI application, but with most of its parameters exported.
func NewExampleApp ¶
func NewExampleApp( logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool, appOpts servertypes.AppOptions, evmAppOptions EVMOptionsFn, baseAppOptions ...func(*baseapp.BaseApp), ) *EVMD
NewExampleApp returns a reference to an initialized EVMD.
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *EVMD
SetupWithGenesisValSet initializes a new EVMD with a validator set and genesis accounts that also act as delegators. For simplicity, each validator is bonded with a delegation of one consensus engine unit in the default token of the simapp from first genesis account. A Nop logger is set in EVMD.
func (*EVMD) AppCodec ¶
AppCodec returns EVMD's app codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*EVMD) AutoCliOpts ¶
func (app *EVMD) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*EVMD) BeginBlocker ¶
BeginBlocker application updates every begin block
func (*EVMD) Configurator ¶
func (app *EVMD) Configurator() module.Configurator
func (*EVMD) DefaultGenesis ¶
func (app *EVMD) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*EVMD) EndBlocker ¶
EndBlocker application updates every end block
func (*EVMD) ExportAppStateAndValidators ¶
func (app *EVMD) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*EVMD) FinalizeBlock ¶
func (app *EVMD) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error)
func (*EVMD) GetBaseApp ¶
GetBaseApp implements the TestingApp interface.
func (*EVMD) GetIBCKeeper ¶
GetIBCKeeper implements the TestingApp interface.
func (*EVMD) GetKey ¶
func (app *EVMD) GetKey(storeKey string) *storetypes.KVStoreKey
GetKey returns the KVStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*EVMD) GetMemKey ¶
func (app *EVMD) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*EVMD) GetStakingKeeperSDK ¶
func (app *EVMD) GetStakingKeeperSDK() stakingkeeper.Keeper
GetStakingKeeperSDK implements the TestingApp interface.
func (*EVMD) GetSubspace ¶
func (app *EVMD) GetSubspace(moduleName string) paramstypes.Subspace
GetSubspace returns a param subspace for a given module name.
NOTE: This is solely to be used for testing purposes.
func (*EVMD) GetTKey ¶
func (app *EVMD) GetTKey(storeKey string) *storetypes.TransientStoreKey
GetTKey returns the TransientStoreKey for the provided store key.
NOTE: This is solely to be used for testing purposes.
func (*EVMD) GetTxConfig ¶
GetTxConfig implements the TestingApp interface.
func (*EVMD) InitChainer ¶
func (app *EVMD) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*EVMD) InterfaceRegistry ¶
func (app *EVMD) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns EVMD's InterfaceRegistry
func (*EVMD) LegacyAmino ¶
func (app *EVMD) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns EVMD's amino codec.
NOTE: This is solely to be used for testing purposes as it may be desirable for modules to register their own custom testing types.
func (*EVMD) LoadHeight ¶
LoadHeight loads a particular height
func (*EVMD) PreBlocker ¶
func (app *EVMD) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
func (*EVMD) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*EVMD) RegisterNodeService ¶
func (*EVMD) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*EVMD) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (EVMD) RegisterUpgradeHandlers ¶
func (app EVMD) RegisterUpgradeHandlers()
func (*EVMD) SimulationManager ¶
func (app *EVMD) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface
type EVMOptionsFn ¶
EVMOptionsFn defines a function type for setting app options specifically for the Cosmos EVM app. The function should receive the chainID and return an error if any.
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.
type SetupOptions ¶
type SetupOptions struct {
Logger log.Logger
DB *dbm.MemDB
AppOpts servertypes.AppOptions
}
SetupOptions defines arguments that are passed into `Simapp` constructor.
