keeper

package
v8.0.0-...-9bdc3c7 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k Keeper) types.MsgServer

func NewQueryServer

func NewQueryServer(k Keeper) types.QueryServer

Types

type Keeper

type Keeper struct {
	Schema      collections.Schema
	Params      collections.Item[types.Params]
	ERC20Token  collections.Map[string, types.ERC20Token]                            // baseDenom -> ERC20Token
	BridgeToken collections.Map[collections.Pair[string, string], types.BridgeToken] // baseDenom -> BridgeToken
	IBCToken    collections.Map[collections.Pair[string, string], types.IBCToken]    // baseDenom -> IBCToken
	DenomIndex  collections.Map[string, string]                                      // bridgeDenom/erc20_contract/ibc_denom -> baseDenom
	Cache       collections.Map[string, sdkmath.Int]                                 // crosschain cache
	// contains filtered or unexported fields
}

Keeper of this module maintains collections of erc20.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	evmKeeper types.EVMKeeper,
	evmErc20Keeper types.ERC20TokenKeeper,
	authority string,
) Keeper

NewKeeper creates new instances of the erc20 Keeper

func (Keeper) AddBridgeToken

func (k Keeper) AddBridgeToken(ctx context.Context, baseDenom, chainName, contract string, isNative bool) error

func (Keeper) AddERC20Token

func (k Keeper) AddERC20Token(ctx context.Context, name, symbol string, decimals uint8, erc20Addr common.Address, contractOwner types.Owner) (types.ERC20Token, error)

func (Keeper) AddIBCToken

func (k Keeper) AddIBCToken(ctx context.Context, channel, baseDenom, ibcDenom string) error

func (Keeper) BaseCoinToEvm

func (k Keeper) BaseCoinToEvm(ctx context.Context, holder common.Address, coin sdk.Coin) (string, error)

func (Keeper) CheckEnableErc20

func (k Keeper) CheckEnableErc20(ctx context.Context) error

func (Keeper) ConvertCoin

func (k Keeper) ConvertCoin(ctx context.Context, sender sdk.AccAddress, receiver common.Address, coin sdk.Coin) (erc20Addr string, err error)

func (Keeper) ConvertCoinNativeCoin

func (k Keeper) ConvertCoinNativeCoin(ctx context.Context, erc20Token types.ERC20Token, sender sdk.AccAddress, receiver common.Address, coin sdk.Coin) error

func (Keeper) ConvertCoinNativeERC20

func (k Keeper) ConvertCoinNativeERC20(ctx context.Context, erc20Token types.ERC20Token, sender sdk.AccAddress, receiver common.Address, coin sdk.Coin) error

func (Keeper) DeleteCache

func (k Keeper) DeleteCache(ctx context.Context, key string) error

func (Keeper) DeployUpgradableToken

func (k Keeper) DeployUpgradableToken(ctx sdk.Context, from common.Address, name, symbol string, decimals uint8) (common.Address, error)

func (Keeper) ERC20BaseInfo

func (k Keeper) ERC20BaseInfo(ctx context.Context, contractAddr common.Address) (name, symbol string, decimals uint8, err error)

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)

ExportGenesis export module status

func (Keeper) GetBaseDenom

func (k Keeper) GetBaseDenom(ctx context.Context, token string) (string, error)

func (Keeper) GetBridgeToken

func (k Keeper) GetBridgeToken(ctx context.Context, chainName, baseDenom string) (types.BridgeToken, error)

func (Keeper) GetBridgeTokens

func (k Keeper) GetBridgeTokens(ctx context.Context, chainName string) ([]types.BridgeToken, error)

func (Keeper) GetCache

func (k Keeper) GetCache(ctx context.Context, key string) (sdkmath.Int, error)

func (Keeper) GetERC20Token

func (k Keeper) GetERC20Token(ctx context.Context, baseDenom string) (types.ERC20Token, error)

func (Keeper) GetIBCToken

func (k Keeper) GetIBCToken(ctx context.Context, channel, baseDenom string) (types.IBCToken, error)

func (Keeper) HasCache

func (k Keeper) HasCache(ctx context.Context, key string) (bool, error)

func (Keeper) HasToken

func (k Keeper) HasToken(ctx context.Context, denom string) (bool, error)

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data types.GenesisState) error

InitGenesis import module genesis

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) MintingEnabled

func (k Keeper) MintingEnabled(ctx context.Context, receiver sdk.AccAddress, isBaseDenom bool, tokenName string) (erc20Token types.ERC20Token, err error)

func (Keeper) ReSetCache

func (k Keeper) ReSetCache(ctx context.Context, oldKey, newKey string) error

func (Keeper) RegisterNativeCoin

func (k Keeper) RegisterNativeCoin(ctx context.Context, name, symbol string, decimals uint8) (types.ERC20Token, error)

func (Keeper) RegisterNativeERC20

func (k Keeper) RegisterNativeERC20(ctx sdk.Context, erc20Addr common.Address) (types.ERC20Token, error)

func (Keeper) SetCache

func (k Keeper) SetCache(ctx context.Context, key string, amount sdkmath.Int) error

func (Keeper) ToggleTokenConvert

func (k Keeper) ToggleTokenConvert(ctx context.Context, token string) (types.ERC20Token, error)

Jump to

Keyboard shortcuts

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