Documentation ¶
Index ¶
- Constants
- Variables
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AfterRecvTransfer(ctx sdk.Context, destPort, destChannel string, token sdk.Coin, receiver string, ...)
- func (k Keeper) AfterRefundTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, ...)
- func (k Keeper) AfterSendTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.Coin, ...)
- func (k Keeper) CallEVM(ctx sdk.Context, to *common.Address, data []byte, value *big.Int) (*ethtypes.Message, *evmtypes.MsgEthereumTxResponse, error)
- func (k Keeper) CallModuleCRC20(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
- func (k Keeper) ContractByDenom(goCtx context.Context, req *types.ContractByDenomRequest) (*types.ContractByDenomResponse, error)
- func (k Keeper) ConvertCoinFromCRC20ToNative(ctx sdk.Context, contract common.Address, receiver common.Address, ...) error
- func (k Keeper) ConvertCoinFromNativeToCRC20(ctx sdk.Context, sender common.Address, coin sdk.Coin, autoDeploy bool) error
- func (k Keeper) ConvertCoinsFromNativeToCRC20(ctx sdk.Context, sender common.Address, coins sdk.Coins, autoDeploy bool) error
- func (k Keeper) ConvertVouchersToEvmCoins(ctx sdk.Context, from string, coins sdk.Coins) error
- func (k Keeper) DeleteExternalContractForDenom(ctx sdk.Context, denom string) bool
- func (k Keeper) DenomByContract(goCtx context.Context, req *types.DenomByContractRequest) (*types.DenomByContractResponse, error)
- func (k Keeper) DeployModuleCRC20(ctx sdk.Context, denom string) (common.Address, error)
- func (k Keeper) GetAutoContracts(ctx sdk.Context) (out []types.TokenMapping)
- func (k Keeper) GetContractByDenom(ctx sdk.Context, denom string) (contract common.Address, found bool)
- func (k Keeper) GetDenomByContract(ctx sdk.Context, contract common.Address) (denom string, found bool)
- func (k Keeper) GetEvmParams(ctx sdk.Context) evmTypes.Params
- func (k Keeper) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSourceChannelID(ctx sdk.Context, ibcVoucherDenom string) (channelID string, err error)
- func (k Keeper) IbcTransferCoins(ctx sdk.Context, from, destination string, coins sdk.Coins) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnRecvVouchers(ctx sdk.Context, tokens sdk.Coins, receiver string)
- func (k Keeper) SetAutoContractForDenom(ctx sdk.Context, denom string, address common.Address)
- func (k Keeper) SetExternalContractForDenom(ctx sdk.Context, denom string, address common.Address) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type LogProcessEvmHook
- type SendCroToIbcHandler
- type SendToAccountHandler
- type SendToEthereumHandler
- type SendToIbcHandler
Constants ¶
const ( SendToAccountEventName = "__HazlorSendToAccount" SendToEthereumEventName = "__HazlorSendToEthereum" SendToIbcEventName = "__HazlorSendToIbc" SendCroToIbcEventName = "__HazlorSendCroToIbc" )
Variables ¶
var ( // SendToAccountEvent represent the signature of // `event __HazlorSendToAccount(address recipient, uint256 amount)` SendToAccountEvent abi.Event // SendToEthereumEvent represent the signature of // `event __HazlorSendToEthereum(address recipient, uint256 amount, uint256 bridge_fee)` SendToEthereumEvent abi.Event // SendToIbcEvent represent the signature of // `event __HazlorSendToIbc(string recipient, uint256 amount)` SendToIbcEvent abi.Event // SendCroToIbcEvent represent the signature of // `event __HazlorSendCroToIbc(string recipient, uint256 amount)` SendCroToIbcEvent abi.Event )
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey, memKey sdk.StoreKey, paramSpace paramtypes.Subspace, bankKeeper types.BankKeeper, transferKeeper types.TransferKeeper, evmKeeper *evmkeeper.Keeper, ) *Keeper
func (Keeper) AfterRecvTransfer ¶
func (Keeper) AfterRefundTransfer ¶
func (Keeper) AfterSendTransfer ¶
func (Keeper) CallEVM ¶
func (k Keeper) CallEVM(ctx sdk.Context, to *common.Address, data []byte, value *big.Int) (*ethtypes.Message, *evmtypes.MsgEthereumTxResponse, error)
CallEVM execute an evm message from native module
func (Keeper) CallModuleCRC20 ¶
func (k Keeper) CallModuleCRC20(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
CallModuleCRC20 call a method of ModuleCRC20 contract
func (Keeper) ContractByDenom ¶
func (k Keeper) ContractByDenom(goCtx context.Context, req *types.ContractByDenomRequest) (*types.ContractByDenomResponse, error)
ContractByDenom query contract by denom, returns both external contract and auto deployed contract
func (Keeper) ConvertCoinFromCRC20ToNative ¶
func (k Keeper) ConvertCoinFromCRC20ToNative(ctx sdk.Context, contract common.Address, receiver common.Address, amount sdk.Int) error
ConvertCoinFromCRC20ToNative convert erc20 token to native token
func (Keeper) ConvertCoinFromNativeToCRC20 ¶
func (k Keeper) ConvertCoinFromNativeToCRC20(ctx sdk.Context, sender common.Address, coin sdk.Coin, autoDeploy bool) error
ConvertCoinFromNativeToCRC20 convert native token to erc20 token
func (Keeper) ConvertCoinsFromNativeToCRC20 ¶
func (k Keeper) ConvertCoinsFromNativeToCRC20(ctx sdk.Context, sender common.Address, coins sdk.Coins, autoDeploy bool) error
ConvertCoinsFromNativeToCRC20 convert native tokens to erc20 tokens
func (Keeper) ConvertVouchersToEvmCoins ¶
func (Keeper) DeleteExternalContractForDenom ¶
DeleteExternalContractForDenom delete the external contract mapping for native denom, returns false if mapping not exists.
func (Keeper) DenomByContract ¶
func (k Keeper) DenomByContract(goCtx context.Context, req *types.DenomByContractRequest) (*types.DenomByContractResponse, error)
DenomByContract query denom by contract
func (Keeper) DeployModuleCRC20 ¶
DeployModuleCRC20 deploy an embed erc20 contract
func (Keeper) GetAutoContracts ¶
func (k Keeper) GetAutoContracts(ctx sdk.Context) (out []types.TokenMapping)
GetAutoContracts returns all auto-deployed contract mappings
func (Keeper) GetContractByDenom ¶
func (k Keeper) GetContractByDenom(ctx sdk.Context, denom string) (contract common.Address, found bool)
GetContractByDenom find the corresponding contract for the denom, external contract is taken in preference to auto-deployed one
func (Keeper) GetDenomByContract ¶
func (k Keeper) GetDenomByContract(ctx sdk.Context, contract common.Address) (denom string, found bool)
GetDenomByContract find native denom by contract address
func (Keeper) GetEvmParams ¶
GetEvmParams returns the total set of evm parameters.
func (Keeper) GetExternalContracts ¶
func (k Keeper) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
GetExternalContracts returns all external contract mappings
func (Keeper) GetSourceChannelID ¶
func (k Keeper) GetSourceChannelID(ctx sdk.Context, ibcVoucherDenom string) (channelID string, err error)
GetSourceChannelID returns the channel id for an ibc voucher The voucher has for format ibc/hash(path)
func (Keeper) IbcTransferCoins ¶
func (Keeper) OnRecvVouchers ¶
func (Keeper) SetAutoContractForDenom ¶
SetAutoContractForDenom set the auto deployed contract for native denom
type LogProcessEvmHook ¶
type LogProcessEvmHook struct {
// contains filtered or unexported fields
}
LogProcessEvmHook is an evm hook that convert specific contract logs into native module calls
func NewLogProcessEvmHook ¶
func NewLogProcessEvmHook(handlers ...types.EvmLogHandler) *LogProcessEvmHook
func (LogProcessEvmHook) PostTxProcessing ¶
func (h LogProcessEvmHook) PostTxProcessing(ctx sdk.Context, txHash common.Hash, logs []*ethtypes.Log) error
PostTxProcessing implements EvmHook interface
type SendCroToIbcHandler ¶
type SendCroToIbcHandler struct {
// contains filtered or unexported fields
}
SendCroToIbcHandler handles `__HazlorSendCroToIbc` log
func NewSendCroToIbcHandler ¶
func NewSendCroToIbcHandler(bankKeeper types.BankKeeper, hazlorKeeper Keeper) *SendCroToIbcHandler
func (SendCroToIbcHandler) EventID ¶
func (h SendCroToIbcHandler) EventID() common.Hash
type SendToAccountHandler ¶
type SendToAccountHandler struct {
// contains filtered or unexported fields
}
SendToAccountHandler handles `__HazlorSendToAccount` log
func NewSendToAccountHandler ¶
func NewSendToAccountHandler(bankKeeper types.BankKeeper, hazlorKeeper Keeper) *SendToAccountHandler
func (SendToAccountHandler) EventID ¶
func (h SendToAccountHandler) EventID() common.Hash
type SendToEthereumHandler ¶
type SendToEthereumHandler struct {
// contains filtered or unexported fields
}
SendToEthereumHandler handles `__HazlorSendToEthereum` log
func NewSendToEthereumHandler ¶
func NewSendToEthereumHandler(hazlorKeeper Keeper) *SendToEthereumHandler
func (SendToEthereumHandler) EventID ¶
func (h SendToEthereumHandler) EventID() common.Hash
type SendToIbcHandler ¶
type SendToIbcHandler struct {
// contains filtered or unexported fields
}
SendToIbcHandler handles `__HazlorSendToIbc` log
func NewSendToIbcHandler ¶
func NewSendToIbcHandler(bankKeeper types.BankKeeper, hazlorKeeper Keeper) *SendToIbcHandler
func (SendToIbcHandler) EventID ¶
func (h SendToIbcHandler) EventID() common.Hash