Documentation ¶
Index ¶
- Constants
- Variables
- func NewQuerier(keeper Keeper) sdk.Querier
- func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
- type AccountKeeper
- type BankKeeper
- type EvmKeeper
- type GovKeeper
- type IBCTransferHooks
- func (iths IBCTransferHooks) AfterRecvTransfer(ctx sdk.Context, destPort, destChannel string, token sdk.SysCoin, ...) error
- func (iths IBCTransferHooks) AfterRefundTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.SysCoin, ...) error
- func (iths IBCTransferHooks) AfterSendTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.SysCoin, ...) error
- type Keeper
- func (k Keeper) AfterDepositPeriodPassed(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) AfterSubmitProposalHandler(_ sdk.Context, _ govTypes.Proposal)
- func (k Keeper) CallModuleERC20(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
- func (k Keeper) CallModuleERC20Proxy(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
- func (k Keeper) CheckMsgSubmitProposal(ctx sdk.Context, msg govTypes.MsgSubmitProposal) sdk.Error
- func (k Keeper) ConvertNativeToERC20(ctx sdk.Context, from sdk.AccAddress, native sdk.SysCoin, ...) error
- func (k Keeper) ConvertNatives(ctx sdk.Context, from string, vouchers sdk.SysCoins) error
- func (k Keeper) ConvertVoucherToERC20(ctx sdk.Context, from sdk.AccAddress, voucher sdk.SysCoin, autoDeploy bool) error
- func (k Keeper) ConvertVouchers(ctx sdk.Context, from string, vouchers sdk.SysCoins) error
- func (k Keeper) DeleteContractForDenom(ctx sdk.Context, denom string) bool
- func (k Keeper) DeployModuleERC20(ctx sdk.Context, denom string) (common.Address, error)
- func (k Keeper) GetContractByDenom(ctx sdk.Context, denom string) (contract common.Address, found bool)
- func (k Keeper) GetContracts(ctx sdk.Context) (out []types.TokenMapping)
- func (k Keeper) GetDenomByContract(ctx sdk.Context, contract common.Address) (denom string, found bool)
- func (k Keeper) GetEthAccount(ctx sdk.Context, addr common.Address) (*ethermint.EthAccount, bool)
- func (k Keeper) GetImplementTemplateContract(ctx sdk.Context) (types.CompiledContract, bool)
- func (k Keeper) GetMaxDepositPeriod(ctx sdk.Context, content sdkGov.Content) (maxDepositPeriod time.Duration)
- func (k Keeper) GetMinDeposit(ctx sdk.Context, content sdkGov.Content) (minDeposit sdk.SysCoins)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetProxyTemplateContract(ctx sdk.Context) (types.CompiledContract, bool)
- func (k Keeper) GetSourceChannelID(ctx sdk.Context, ibcVoucherDenom string) (channelID string, err error)
- func (k Keeper) GetVotingPeriod(ctx sdk.Context, content sdkGov.Content) (votingPeriod time.Duration)
- func (k Keeper) IbcTransferNative20(ctx sdk.Context, from, to string, native20s sdk.SysCoins, ...) error
- func (k Keeper) IbcTransferVouchers(ctx sdk.Context, from, to string, vouchers sdk.SysCoins) error
- func (k Keeper) InitInternalTemplateContract(ctx sdk.Context)
- func (k Keeper) IterateMapping(ctx sdk.Context, cb func(denom, contract string) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OnMintVouchers(ctx sdk.Context, vouchers sdk.SysCoins, receiver string) error
- func (k Keeper) OnUnescrowNatives(ctx sdk.Context, natives sdk.SysCoins, receiver string) error
- func (k Keeper) ProxyContractRedirect(ctx sdk.Context, denom string, tp types.RedirectType, addr common.Address) error
- func (k Keeper) RejectedHandler(_ sdk.Context, _ govTypes.Content)
- func (k Keeper) SetContractForDenom(ctx sdk.Context, denom string, contract common.Address) error
- func (k *Keeper) SetGovKeeper(gk GovKeeper)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetTemplateContract(ctx sdk.Context, typeStr string, str string) error
- func (k Keeper) VoteHandler(_ sdk.Context, _ govTypes.Proposal, _ govTypes.Vote) (string, sdk.Error)
- type SendNative20ToIbcEventHandler
- type SendToIbcEventHandler
- type Subspace
- type SupplyKeeper
- type TransferKeeper
Constants ¶
const ( SendToIbcEventName = "__EVOSendToIbc" SendNative20ToIbcEventName = "__EVOSendNative20ToIbc" SendToWasmEventName = "__EVOSendToWasm" )
Variables ¶
var SendNative20ToIbcEvent abi.Event
SendNative20ToIbcEvent represent the signature of `event __EVOSendNative20ToIbc(string recipient, uint256 amount, string portID, string channelID)`
var SendToIbcEvent abi.Event
SendToIbcEvent represent the signature of `event __EVOSendToIbc(string recipient, uint256 amount)`
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
func RegisterInvariants ¶
func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper)
RegisterInvariants registers the erc20 module invariants
Types ¶
type AccountKeeper ¶
type AccountKeeper interface { GetAccount(ctx sdk.Context, addr sdk.AccAddress) authexported.Account SetAccount(ctx sdk.Context, acc authexported.Account) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) authexported.Account }
AccountKeeper defines the expected account keeper interface
type BankKeeper ¶
type BankKeeper interface { BlacklistedAddr(addr sdk.AccAddress) bool SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error }
type GovKeeper ¶
type GovKeeper interface { GetDepositParams(ctx sdk.Context) govtypes.DepositParams GetVotingParams(ctx sdk.Context) govtypes.VotingParams }
GovKeeper defines the expected gov Keeper
type IBCTransferHooks ¶
type IBCTransferHooks struct {
Keeper
}
func NewIBCTransferHooks ¶
func NewIBCTransferHooks(k Keeper) IBCTransferHooks
func (IBCTransferHooks) AfterRecvTransfer ¶
func (IBCTransferHooks) AfterRefundTransfer ¶
func (IBCTransferHooks) AfterSendTransfer ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper wraps the CommitStateDB, allowing us to pass in SDK context while adhering to the StateDB interface.
func NewKeeper ¶
func NewKeeper( cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, ak AccountKeeper, sk SupplyKeeper, bk BankKeeper, ek EvmKeeper, tk TransferKeeper) Keeper
NewKeeper generates new erc20 module keeper
func (Keeper) AfterDepositPeriodPassed ¶
func (Keeper) AfterSubmitProposalHandler ¶
nolint
func (Keeper) CallModuleERC20 ¶
func (k Keeper) CallModuleERC20(ctx sdk.Context, contract common.Address, method string, args ...interface{}) ([]byte, error)
CallModuleERC20 call a method of ModuleERC20 contract
func (Keeper) CallModuleERC20Proxy ¶
func (Keeper) CheckMsgSubmitProposal ¶
CheckMsgSubmitProposal validates MsgSubmitProposal
func (Keeper) ConvertNativeToERC20 ¶
func (k Keeper) ConvertNativeToERC20(ctx sdk.Context, from sdk.AccAddress, native sdk.SysCoin, contract common.Address) error
ConvertNativeToERC20 convert native into evm token.
func (Keeper) ConvertNatives ¶
ConvertNatives convert natives into evm tokens.
func (Keeper) ConvertVoucherToERC20 ¶
func (k Keeper) ConvertVoucherToERC20(ctx sdk.Context, from sdk.AccAddress, voucher sdk.SysCoin, autoDeploy bool) error
ConvertVoucherToERC20 convert voucher into evm token.
func (Keeper) ConvertVouchers ¶
ConvertVouchers convert vouchers into evm tokens.
func (Keeper) DeleteContractForDenom ¶
DeleteContractForDenom delete the contract mapping for native denom, returns false if mapping not exists.
func (Keeper) DeployModuleERC20 ¶
DeployModuleERC20 deploy an embed erc20 contract
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
func (Keeper) GetContracts ¶
func (k Keeper) GetContracts(ctx sdk.Context) (out []types.TokenMapping)
GetContracts returns all contract mappings
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) GetEthAccount ¶
GetEthAccount returns an eth account.
func (Keeper) GetImplementTemplateContract ¶
func (Keeper) GetMaxDepositPeriod ¶
func (k Keeper) GetMaxDepositPeriod(ctx sdk.Context, content sdkGov.Content) (maxDepositPeriod time.Duration)
GetMaxDepositPeriod returns max deposit period
func (Keeper) GetMinDeposit ¶
GetMinDeposit returns min deposit
func (Keeper) GetProxyTemplateContract ¶
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) GetVotingPeriod ¶
func (k Keeper) GetVotingPeriod(ctx sdk.Context, content sdkGov.Content) (votingPeriod time.Duration)
GetVotingPeriod returns voting period
func (Keeper) IbcTransferNative20 ¶
func (k Keeper) IbcTransferNative20(ctx sdk.Context, from, to string, native20s sdk.SysCoins, portID, channelID string) error
IbcTransferNative20 transfer native20 to other chain by ibc
func (Keeper) IbcTransferVouchers ¶
IbcTransferVouchers transfer vouchers to other chain by ibc
func (Keeper) InitInternalTemplateContract ¶
func (Keeper) IterateMapping ¶
IterateMapping iterates over all the stored mapping and performs a callback function
func (Keeper) OnMintVouchers ¶
OnMintVouchers after minting vouchers on this chain
func (Keeper) OnUnescrowNatives ¶
OnUnescrowNatives after unescrow natives on this chain
func (Keeper) ProxyContractRedirect ¶
func (Keeper) SetContractForDenom ¶
SetContractForDenom set the contract for native denom, 1. if any existing for denom, replace the old one. 2. if any existing for contract, return error.
func (*Keeper) SetGovKeeper ¶
SetGovKeeper sets keeper of gov
func (Keeper) SetTemplateContract ¶
type SendNative20ToIbcEventHandler ¶
type SendNative20ToIbcEventHandler struct {
Keeper
}
func NewSendNative20ToIbcEventHandler ¶
func NewSendNative20ToIbcEventHandler(k Keeper) *SendNative20ToIbcEventHandler
func (SendNative20ToIbcEventHandler) EventID ¶
func (h SendNative20ToIbcEventHandler) EventID() common.Hash
EventID Return the id of the log signature it handles
type SendToIbcEventHandler ¶
type SendToIbcEventHandler struct {
Keeper
}
func NewSendToIbcEventHandler ¶
func NewSendToIbcEventHandler(k Keeper) *SendToIbcEventHandler
func (SendToIbcEventHandler) EventID ¶
func (h SendToIbcEventHandler) EventID() common.Hash
EventID Return the id of the log signature it handles
type SupplyKeeper ¶
type SupplyKeeper interface { SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) error BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI }
type TransferKeeper ¶
type TransferKeeper interface { SendTransfer( ctx sdk.Context, sourcePort, sourceChannel string, token sdk.CoinAdapter, sender sdk.AccAddress, receiver string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, ) error DenomPathFromHash(ctx sdk.Context, denom string) (string, error) GetDenomTrace(ctx sdk.Context, denomTraceHash tmbytes.HexBytes) (types.DenomTrace, bool) }