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, ...)
- func (iths IBCTransferHooks) AfterRefundTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.SysCoin, ...)
- func (iths IBCTransferHooks) AfterSendTransfer(ctx sdk.Context, sourcePort, sourceChannel string, token sdk.SysCoin, ...)
- 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) CheckMsgSubmitProposal(ctx sdk.Context, msg govTypes.MsgSubmitProposal) sdk.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) DeleteExternalContractForDenom(ctx sdk.Context, denom string) bool
- 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) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
- 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) 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) IbcTransferVouchers(ctx sdk.Context, from, to string, vouchers sdk.SysCoins) error
- 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)
- func (k Keeper) RejectedHandler(_ sdk.Context, _ govTypes.Content)
- func (k Keeper) SetAutoContractForDenom(ctx sdk.Context, denom string, contract common.Address)
- func (k Keeper) SetExternalContractForDenom(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) VoteHandler(_ sdk.Context, _ govTypes.Proposal, _ govTypes.Vote) (string, sdk.Error)
- type SendToIbcEventHandler
- type Subspace
- type SupplyKeeper
- type TransferKeeper
Constants ¶
const (
SendToIbcEventName = "__OkcSendToIbc"
)
Variables ¶
var SendToIbcEvent abi.Event
SendToIbcEvent represent the signature of `event __OkcSendToIbc(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
}
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 EvmKeeper ¶
type EvmKeeper interface { GetChainConfig(ctx sdk.Context) (evmtypes.ChainConfig, bool) GenerateCSDBParams() evmtypes.CommitStateDBParams }
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 ¶
func (iths IBCTransferHooks) AfterSendTransfer( ctx sdk.Context, sourcePort, sourceChannel string, token sdk.SysCoin, sender sdk.AccAddress, receiver string, isSource bool)
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) CheckMsgSubmitProposal ¶
CheckMsgSubmitProposal validates MsgSubmitProposal
func (Keeper) ConvertVoucherToERC20 ¶
func (k Keeper) ConvertVoucherToERC20(ctx sdk.Context, from sdk.AccAddress, voucher sdk.SysCoin, autoDeploy bool) error
ConvertVoucherToERC20 convert vouchers into evm token.
func (Keeper) ConvertVouchers ¶
ConvertVouchers convert vouchers into native coins or evm tokens.
func (Keeper) DeleteExternalContractForDenom ¶
DeleteExternalContractForDenom delete the external contract mapping for native denom, returns false if mapping not exists.
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) GetExternalContracts ¶
func (k Keeper) GetExternalContracts(ctx sdk.Context) (out []types.TokenMapping)
GetExternalContracts returns all external contract mappings
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) 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) IbcTransferVouchers ¶
IbcTransferVouchers transfer vouchers to other chain by ibc
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, convert these vouchers into evm tokens.
func (Keeper) SetAutoContractForDenom ¶
SetAutoContractForDenom set the auto deployed contract for native denom
func (Keeper) SetExternalContractForDenom ¶
func (k Keeper) SetExternalContractForDenom(ctx sdk.Context, denom string, contract common.Address) error
SetExternalContractForDenom set the external 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
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 GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI }