Documentation ¶
Index ¶
- func DeductFees(txFeesKeeper types.TxFeesKeeper, bankKeeper types.BankKeeper, ctx sdk.Context, ...) error
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- type DeductFeeDecorator
- type Hooks
- type Keeper
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) error
- func (k Keeper) CalcFeeSpotPrice(ctx sdk.Context, inputDenom string) (osmomath.BigDec, error)
- func (k Keeper) ConvertToBaseToken(ctx sdk.Context, inputFee sdk.Coin) (sdk.Coin, error)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetBaseDenom(ctx sdk.Context) (denom string, err error)
- func (k Keeper) GetConsParams(ctx sdk.Context) (*consensustypes.QueryParamsResponse, error)
- func (k Keeper) GetFeeToken(ctx sdk.Context, denom string) (types.FeeToken, error)
- func (k Keeper) GetFeeTokens(ctx sdk.Context) (feetokens []types.FeeToken)
- func (k Keeper) GetFeeTokensStore(ctx sdk.Context) storetypes.KVStore
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) HandleUpdateFeeTokenProposal(ctx sdk.Context, p *types.UpdateFeeTokenProposal) error
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IsSufficientFee(ctx sdk.Context, minBaseGasPrice osmomath.Dec, gasRequested uint64, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SenderValidationSetFeeTokens(ctx sdk.Context, sender string, feetokens []types.FeeToken) error
- func (k Keeper) SetBaseDenom(ctx sdk.Context, denom string) error
- func (k Keeper) SetFeeTokens(ctx sdk.Context, feetokens []types.FeeToken) error
- func (k Keeper) SetParam(ctx sdk.Context, key []byte, value interface{})
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) ValidateFeeToken(ctx sdk.Context, feeToken types.FeeToken) error
- type MempoolFeeDecorator
- type Querier
- func (q Querier) BaseDenom(ctx context.Context, _ *types.QueryBaseDenomRequest) (*types.QueryBaseDenomResponse, error)
- func (q Querier) DenomPoolId(ctx context.Context, req *types.QueryDenomPoolIdRequest) (*types.QueryDenomPoolIdResponse, error)
- func (q Querier) DenomSpotPrice(ctx context.Context, req *types.QueryDenomSpotPriceRequest) (*types.QueryDenomSpotPriceResponse, error)
- func (q Querier) FeeTokens(ctx context.Context, _ *types.QueryFeeTokensRequest) (*types.QueryFeeTokensResponse, error)
- func (q Querier) GetEipBaseFee(_ context.Context, _ *types.QueryEipBaseFeeRequest) (*types.QueryEipBaseFeeResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeductFees ¶
func DeductFees(txFeesKeeper types.TxFeesKeeper, bankKeeper types.BankKeeper, ctx sdk.Context, acc sdk.AccountI, fees sdk.Coins) error
DeductFees deducts fees from the given account and transfers them to the set module account.
func NewMsgServerImpl ¶
Types ¶
type DeductFeeDecorator ¶
type DeductFeeDecorator struct {
// contains filtered or unexported fields
}
DeductFeeDecorator deducts fees from the first signer of the tx. If the first signer does not have the funds to pay for the fees, we return an InsufficientFunds error. We call next AnteHandler if fees successfully deducted.
CONTRACT: Tx must implement FeeTx interface to use DeductFeeDecorator
func NewDeductFeeDecorator ¶
func NewDeductFeeDecorator(tk Keeper, ak types.AccountKeeper, bk types.BankKeeper, fk types.FeegrantKeeper) DeductFeeDecorator
func (DeductFeeDecorator) AnteHandle ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for incentives keeper
func (Hooks) AfterEpochEnd ¶
func (Hooks) BeforeEpochStart ¶
func (Hooks) GetModuleName ¶
GetModuleName implements types.EpochHooks.
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, storeKey storetypes.StoreKey, poolManager types.PoolManager, protorevKeeper types.ProtorevKeeper, distributionKeeper types.DistributionKeeper, consensusKeeper types.ConsensusKeeper, dataDir string, paramSpace paramtypes.Subspace, ) Keeper
func (Keeper) AfterEpochEnd ¶
at the end of each epoch, swap all non-OSMO fees into the desired denom and send either to fee collector or community pool. Staking fee collector for staking rewards. - All non-native rewards that have a pool with liquidity and a link set in protorev get swapped to native denom - All resulting native tokens get sent to the fee collector. - Any non-native tokens that did not have associated pool stay in the balance of staking fee collector. Community pool fee collector. - All non-native rewards that have a pool with liquidity and a link set in protorev get swapped to a denom configured by parameter. - All resulting parameter denom tokens get sent to the community pool. - Any non-native tokens that did not have associated pool stay in the balance of community pool fee collector.
func (Keeper) BeforeEpochStart ¶
func (Keeper) CalcFeeSpotPrice ¶
CalcFeeSpotPrice converts the provided tx fees into their equivalent value in the base denomination. Spot Price Calculation: spotPrice / (1 - spreadFactor), where spotPrice is defined as: (tokenBalanceIn / tokenWeightIn) / (tokenBalanceOut / tokenWeightOut)
func (Keeper) ConvertToBaseToken ¶
ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the txfees module's exported genesis.
func (Keeper) GetBaseDenom ¶
GetFeeToken returns the fee token record for a specific denom, In our case the baseDenom is uosmo.
func (Keeper) GetConsParams ¶
func (k Keeper) GetConsParams(ctx sdk.Context) (*consensustypes.QueryParamsResponse, error)
GetConsParams returns the current consensus parameters from the consensus params store.
func (Keeper) GetFeeToken ¶
GetFeeToken returns a unique fee token record for a specific denom. If the denom doesn't exist, returns an error.
func (Keeper) GetFeeTokens ¶
func (Keeper) GetFeeTokensStore ¶
func (k Keeper) GetFeeTokensStore(ctx sdk.Context) storetypes.KVStore
func (Keeper) HandleUpdateFeeTokenProposal ¶
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
InitGenesis initializes the txfees module's state from a provided genesis state.
func (Keeper) IsSufficientFee ¶
func (k Keeper) IsSufficientFee(ctx sdk.Context, minBaseGasPrice osmomath.Dec, gasRequested uint64, feeCoin sdk.Coin) error
IsSufficientFee checks if the feeCoin provided (in any asset), is worth enough osmo at current spot prices to pay the gas cost of this tx.
func (Keeper) SenderValidationSetFeeTokens ¶
func (k Keeper) SenderValidationSetFeeTokens(ctx sdk.Context, sender string, feetokens []types.FeeToken) error
SenderValidationSetFeeTokens first checks to see if the sender is whitelisted to set fee tokens. If the sender is whitelisted, it sets the fee tokens. If the sender is not whitelisted, it returns an error.
func (Keeper) SetBaseDenom ¶
SetBaseDenom sets the base fee denom for the chain. Should only be used once.
func (Keeper) SetFeeTokens ¶
func (Keeper) SetParam ¶
SetParam sets a specific txfees module's parameter with the provided parameter.
func (Keeper) ValidateFeeToken ¶
ValidateFeeToken validates that a fee token record is valid It checks: - The denom exists - The denom is not the base denom - The gamm pool exists - The gamm pool includes the base token and fee token.
type MempoolFeeDecorator ¶
type MempoolFeeDecorator struct { TxFeesKeeper Keeper Opts types.MempoolFeeOptions }
MempoolFeeDecorator will check if the transaction's fee is at least as large as the local validator's minimum gasFee (defined in validator config). If fee is too low, decorator returns error and tx is rejected from mempool. Note this only applies when ctx.CheckTx = true If fee is high enough or not CheckTx, then call next AnteHandler CONTRACT: Tx must implement FeeTx to use MempoolFeeDecorator.
func NewMempoolFeeDecorator ¶
func NewMempoolFeeDecorator(txFeesKeeper Keeper, opts types.MempoolFeeOptions) MempoolFeeDecorator
func (MempoolFeeDecorator) AnteHandle ¶
func (MempoolFeeDecorator) GetMinBaseGasPriceForTx ¶
type Querier ¶
type Querier struct { Keeper mempool1559.EipState }
Querier defines a wrapper around the x/txfees keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) BaseDenom ¶
func (q Querier) BaseDenom(ctx context.Context, _ *types.QueryBaseDenomRequest) (*types.QueryBaseDenomResponse, error)
func (Querier) DenomPoolId ¶
func (q Querier) DenomPoolId(ctx context.Context, req *types.QueryDenomPoolIdRequest) (*types.QueryDenomPoolIdResponse, error)
func (Querier) DenomSpotPrice ¶
func (q Querier) DenomSpotPrice(ctx context.Context, req *types.QueryDenomSpotPriceRequest) (*types.QueryDenomSpotPriceResponse, error)
func (Querier) FeeTokens ¶
func (q Querier) FeeTokens(ctx context.Context, _ *types.QueryFeeTokensRequest) (*types.QueryFeeTokensResponse, error)
func (Querier) GetEipBaseFee ¶
func (q Querier) GetEipBaseFee(_ context.Context, _ *types.QueryEipBaseFeeRequest) (*types.QueryEipBaseFeeResponse, error)