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 EVMOptionsFn
- type GenesisState
- type SetupOptions
- type XOSD
- func (app *XOSD) AppCodec() codec.Codec
- func (app *XOSD) AutoCliOpts() autocli.AppOptions
- func (app *XOSD) BeginBlocker(ctx sdk.Context) (sdk.BeginBlock, error)
- func (app *XOSD) Configurator() module.Configurator
- func (app *XOSD) DefaultGenesis() map[string]json.RawMessage
- func (app *XOSD) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error)
- func (app *XOSD) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
- func (app *XOSD) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error)
- func (app *XOSD) GetBaseApp() *baseapp.BaseApp
- func (app *XOSD) GetIBCKeeper() *ibckeeper.Keeper
- func (app *XOSD) GetKey(storeKey string) *storetypes.KVStoreKey
- func (app *XOSD) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
- func (app *XOSD) GetStakingKeeperSDK() stakingkeeper.Keeper
- func (app *XOSD) GetSubspace(moduleName string) paramstypes.Subspace
- func (app *XOSD) GetTKey(storeKey string) *storetypes.TransientStoreKey
- func (app *XOSD) GetTxConfig() client.TxConfig
- func (app *XOSD) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
- func (app *XOSD) InterfaceRegistry() types.InterfaceRegistry
- func (app *XOSD) LegacyAmino() *codec.LegacyAmino
- func (app *XOSD) LoadHeight(height int64) error
- func (app *XOSD) Name() string
- func (app *XOSD) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
- func (app *XOSD) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig)
- func (app *XOSD) RegisterNodeService(clientCtx client.Context, cfg config.Config)
- func (app *XOSD) RegisterTendermintService(clientCtx client.Context)
- func (app *XOSD) RegisterTxService(clientCtx client.Context)
- func (app XOSD) RegisterUpgradeHandlers()
- func (app *XOSD) SimulationManager() *module.SimulationManager
- func (app *XOSD) TxConfig() client.TxConfig
Constants ¶
const ( // XOSChainDenom is the denomination of the Cosmos EVM example chain's base coin. XOSChainDenom = "aatom" // XOSDisplayDenom is the display denomination of the Cosmos EVM example chain's base coin. XOSDisplayDenom = "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" CosmosChainID = "xos_1267" // TestChainID1 is test chain IDs for IBC E2E test TestChainID1 = "testchain_9001" // TestChainID2 is test chain IDs for IBC E2E test TestChainID2 = "testchain_9002" )
const WTOKENContractMainnet = "0xD4949664cD82660AaE99bEdc034a0deA8A0bd517"
WTOKENContractMainnet is the WTOKEN contract address for mainnet
Variables ¶
var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{ EighteenDecimalsChainID: { Denom: XOSChainDenom, DisplayDenom: XOSDisplayDenom, Decimals: evmtypes.EighteenDecimals, }, CosmosChainID: { Denom: "axos", DisplayDenom: "xos", 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 )
var ExampleTokenPairs = []erc20types.TokenPair{ { Erc20Address: WTOKENContractMainnet, Denom: XOSChainDenom, Enabled: true, ContractOwner: erc20types.OWNER_MODULE, }, }
ExampleTokenPairs creates a slice of token pairs, that contains a pair for the native denom of the example chain implementation.
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 bankkeeper.Keeper, erc20Keeper erc20Keeper.Keeper, authzKeeper authzkeeper.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 WTOKEN contract).
func NewFeeMarketGenesisState ¶ added in v0.5.2
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 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.
type XOSD ¶
type XOSD 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
// the module manager
ModuleManager *module.Manager
BasicModuleManager module.BasicManager
// contains filtered or unexported fields
}
XOSD 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), ) *XOSD
NewExampleApp returns a reference to an initialized XOSD.
func SetupWithGenesisValSet ¶
func SetupWithGenesisValSet(t *testing.T, chainID string, valSet *cmttypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *XOSD
SetupWithGenesisValSet initializes a new XOSD 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 XOSD.
func (*XOSD) AppCodec ¶
AppCodec returns XOSD'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 (*XOSD) AutoCliOpts ¶
func (app *XOSD) AutoCliOpts() autocli.AppOptions
AutoCliOpts returns the autocli options for the app.
func (*XOSD) BeginBlocker ¶
BeginBlocker application updates every begin block
func (*XOSD) Configurator ¶
func (app *XOSD) Configurator() module.Configurator
func (*XOSD) DefaultGenesis ¶
func (app *XOSD) DefaultGenesis() map[string]json.RawMessage
DefaultGenesis returns a default genesis from the registered AppModuleBasic's.
func (*XOSD) EndBlocker ¶
EndBlocker application updates every end block
func (*XOSD) ExportAppStateAndValidators ¶
func (app *XOSD) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error)
ExportAppStateAndValidators exports the state of the application for a genesis file.
func (*XOSD) FinalizeBlock ¶
func (app *XOSD) FinalizeBlock(req *abci.RequestFinalizeBlock) (res *abci.ResponseFinalizeBlock, err error)
func (*XOSD) GetBaseApp ¶
GetBaseApp implements the TestingApp interface.
func (*XOSD) GetIBCKeeper ¶
GetIBCKeeper implements the TestingApp interface.
func (*XOSD) GetKey ¶
func (app *XOSD) 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 (*XOSD) GetMemKey ¶
func (app *XOSD) GetMemKey(storeKey string) *storetypes.MemoryStoreKey
GetMemKey returns the MemStoreKey for the provided mem key.
NOTE: This is solely used for testing purposes.
func (*XOSD) GetStakingKeeperSDK ¶
func (app *XOSD) GetStakingKeeperSDK() stakingkeeper.Keeper
GetStakingKeeperSDK implements the TestingApp interface.
func (*XOSD) GetSubspace ¶
func (app *XOSD) 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 (*XOSD) GetTKey ¶
func (app *XOSD) 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 (*XOSD) GetTxConfig ¶
GetTxConfig implements the TestingApp interface.
func (*XOSD) InitChainer ¶
func (app *XOSD) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error)
InitChainer application update at chain initialization
func (*XOSD) InterfaceRegistry ¶
func (app *XOSD) InterfaceRegistry() types.InterfaceRegistry
InterfaceRegistry returns XOSD's InterfaceRegistry
func (*XOSD) LegacyAmino ¶
func (app *XOSD) LegacyAmino() *codec.LegacyAmino
LegacyAmino returns XOSD'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 (*XOSD) LoadHeight ¶
LoadHeight loads a particular height
func (*XOSD) PreBlocker ¶
func (app *XOSD) PreBlocker(ctx sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error)
func (*XOSD) RegisterAPIRoutes ¶
RegisterAPIRoutes registers all application module routes with the provided API server.
func (*XOSD) RegisterNodeService ¶
func (*XOSD) RegisterTendermintService ¶
RegisterTendermintService implements the Application.RegisterTendermintService method.
func (*XOSD) RegisterTxService ¶
RegisterTxService implements the Application.RegisterTxService method.
func (XOSD) RegisterUpgradeHandlers ¶
func (app XOSD) RegisterUpgradeHandlers()
func (*XOSD) SimulationManager ¶
func (app *XOSD) SimulationManager() *module.SimulationManager
SimulationManager implements the SimulationApp interface