Documentation ¶
Index ¶
- func ConsistentBalanceInvariant(k Keeper) sdk.Invariant
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type EvmHooks
- type Keeper
- func (k Keeper) CallEVM(ctx sdk.Context, abi abi.ABI, from, contract common.Address, method string, ...) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallEVMWithData(ctx sdk.Context, from common.Address, contract *common.Address, data []byte) (*evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CreateCoinMetadata(ctx sdk.Context, contract common.Address) (*banktypes.Metadata, error)
- func (k Keeper) DeleteTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) DeployERC20Contract(ctx sdk.Context, coinMetadata banktypes.Metadata) (common.Address, error)
- func (k Keeper) EvmHooks() EvmHooks
- func (k Keeper) GetAllTokenPairs(ctx sdk.Context) []types.TokenPair
- func (k Keeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
- func (k Keeper) GetDenomMap(ctx sdk.Context, denom string) []byte
- func (k Keeper) GetERC20Map(ctx sdk.Context, erc20 common.Address) []byte
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin
- func (k Keeper) GetTokenPair(ctx sdk.Context, id []byte) (types.TokenPair, bool)
- func (k Keeper) GetTokenPairID(ctx sdk.Context, token string) []byte
- func (k Keeper) IsDenomForErc20(denom string) bool
- func (k Keeper) IsDenomRegistered(ctx sdk.Context, denom string) bool
- func (k Keeper) IsERC20Registered(ctx sdk.Context, erc20 common.Address) bool
- func (k Keeper) IsTokenPairRegistered(ctx sdk.Context, id []byte) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) QueryERC20(ctx sdk.Context, contract common.Address) (types.ERC20Data, error)
- func (k Keeper) RegisterCoin(ctx sdk.Context, denom string) (*types.TokenPair, error)
- func (k Keeper) RegisterERC20(ctx sdk.Context, contract common.Address) (types.TokenPair, error)
- func (k Keeper) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, ...) (err error)
- func (k Keeper) SetDenomMap(ctx sdk.Context, denom string, id []byte)
- func (k Keeper) SetERC20Map(ctx sdk.Context, erc20 common.Address, id []byte)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTokenPair(ctx sdk.Context, tokenPair types.TokenPair)
- func (k Keeper) SplitCoinsByErc20(amt sdk.Coins) (nativeCoins sdk.Coins, nativeErc20Tokens sdk.Coins)
- func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
- func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsistentBalanceInvariant ¶
ConsistentBalanceInvariant checks that all accounts have consistent balances in bank and erc20
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the erc20 module invariants
Types ¶
type EvmHooks ¶
type EvmHooks struct {
// contains filtered or unexported fields
}
EvmHooks wrapper struct for erc20 keeper
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey sdk.StoreKey, ps paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, evmKeeper types.EVMKeeper, ) *Keeper
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM( ctx sdk.Context, abi abi.ABI, from, contract common.Address, method string, args ...interface{}, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVM performs a smart contract method call using given args
func (Keeper) CallEVMWithData ¶
func (k Keeper) CallEVMWithData( ctx sdk.Context, from common.Address, contract *common.Address, data []byte, ) (*evmtypes.MsgEthereumTxResponse, error)
CallEVMWithData performs a smart contract method call using contract data
func (Keeper) CreateCoinMetadata ¶
func (k Keeper) CreateCoinMetadata(ctx sdk.Context, contract common.Address) (*banktypes.Metadata, error)
CreateCoinMetadata generates the coin metadata to represent the ERC20 token.
func (Keeper) DeleteTokenPair ¶
DeleteTokenPair removes a token pair.
func (Keeper) DeployERC20Contract ¶
func (k Keeper) DeployERC20Contract( ctx sdk.Context, coinMetadata banktypes.Metadata, ) (common.Address, error)
DeployERC20Contract creates and deploys an ERC20 contract on the EVM with the erc20 module account as owner.
func (Keeper) GetAllTokenPairs ¶
GetAllTokenPairs gets all registered token tokenPairs
func (Keeper) GetBalance ¶
func (Keeper) GetDenomMap ¶
GetDenomMap returns the token pair id for the given denomination
func (Keeper) GetERC20Map ¶
GetERC20Map returns the token pair id for the given address
func (Keeper) GetTokenPair ¶
GetTokenPair gets registered token pair from the identifier
func (Keeper) GetTokenPairID ¶
GetTokenPairID returns the pair id from either of the registered tokens.
func (Keeper) IsDenomForErc20 ¶
func (Keeper) IsDenomRegistered ¶
IsDenomRegistered checks if registered coin denom is registered
func (Keeper) IsERC20Registered ¶
IsERC20Registered checks if registered ERC20 token is registered
func (Keeper) IsTokenPairRegistered ¶
IsTokenPairRegistered checks if registered token tokenPair is registered
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) QueryERC20 ¶
QueryERC20 returns the data of a deployed ERC20 contract
func (Keeper) RegisterCoin ¶
RegisterCoin deploys an erc20 contract and creates the token pair for the existing cosmos coin
func (Keeper) RegisterERC20 ¶
RegisterERC20 registers the token pair between the coin and the ERC20
func (Keeper) SetDenomMap ¶
SetDenomMap sets the token pair id for the denomination
func (Keeper) SetERC20Map ¶
SetERC20Map sets the token pair id for the given address
func (Keeper) SetTokenPair ¶
SetTokenPair stores a token pair
func (Keeper) SplitCoinsByErc20 ¶
func (Keeper) TokenPair ¶
func (k Keeper) TokenPair(c context.Context, req *types.QueryTokenPairRequest) (*types.QueryTokenPairResponse, error)
func (Keeper) TokenPairs ¶
func (k Keeper) TokenPairs(c context.Context, req *types.QueryTokenPairsRequest) (*types.QueryTokenPairsResponse, error)