Documentation
¶
Index ¶
- func MergeInflationParams(partial inflationtypes.MsgEditInflationParams, ...) (inflationtypes.Params, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQuerier(keeper Keeper) types.QueryServer
- type Hooks
- type Keeper
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber uint64)
- func (k Keeper) AllocatePolynomialInflation(ctx sdk.Context, mintedCoin sdk.Coin, params types.Params) (staking, strategic, community sdk.Coin, err error)
- func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ uint64)
- func (k Keeper) CirculatingSupply(c context.Context, _ *types.QueryCirculatingSupplyRequest) (*types.QueryCirculatingSupplyResponse, error)
- func (k Keeper) EpochMintProvision(c context.Context, _ *types.QueryEpochMintProvisionRequest) (*types.QueryEpochMintProvisionResponse, error)
- func (k Keeper) GetCirculatingSupply(ctx sdk.Context, mintDenom string) sdkmath.Int
- func (k Keeper) GetEpochMintProvision(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetEpochsPerPeriod(ctx sdk.Context) (res uint64)
- func (k Keeper) GetInflationDistribution(ctx sdk.Context) (res types.InflationDistribution)
- func (k Keeper) GetInflationEnabled(ctx sdk.Context) (res bool)
- func (k Keeper) GetInflationRate(ctx sdk.Context, mintDenom string) sdk.Dec
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPeriodsPerYear(ctx sdk.Context) (res uint64)
- func (k Keeper) GetPolynomialFactors(ctx sdk.Context) (res []sdk.Dec)
- func (k Keeper) GetProportions(_ sdk.Context, coin sdk.Coin, proportion sdk.Dec) sdk.Coin
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InflationRate(c context.Context, _ *types.QueryInflationRateRequest) (*types.QueryInflationRateResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MintAndAllocateInflation(ctx sdk.Context, coins sdk.Coin, params types.Params) (staking, strategic, community sdk.Coin, err error)
- func (k Keeper) MintCoins(ctx sdk.Context, coin sdk.Coin) error
- func (k Keeper) Period(c context.Context, _ *types.QueryPeriodRequest) (*types.QueryPeriodResponse, error)
- func (k Keeper) SkippedEpochs(c context.Context, _ *types.QuerySkippedEpochsRequest) (*types.QuerySkippedEpochsResponse, error)
- func (k Keeper) Sudo() sudoExtension
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeInflationParams ¶ added in v1.2.0
func MergeInflationParams( partial inflationtypes.MsgEditInflationParams, inflationParams inflationtypes.Params, ) (inflationtypes.Params, error)
MergeInflationParams: Takes the given Inflation params and merges them into the existing partial params, keeping any existing values that are not set in the partial.
func NewMsgServerImpl ¶ added in v1.2.0
NewMsgServerImpl returns an implementation of the inflation MsgServer interface for the provided Keeper.
func NewQuerier ¶ added in v1.2.0
func NewQuerier(keeper Keeper) types.QueryServer
NewQuerier returns an implementation of the oracle QueryServer interface for the provided Keeper.
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
Hooks wrapper struct for inflation keeper
func (Hooks) AfterEpochEnd ¶
type Keeper ¶
type Keeper struct { CurrentPeriod collections.Sequence NumSkippedEpochs collections.Sequence Params collections.Item[types.Params] // contains filtered or unexported fields }
Keeper of the inflation store
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, paramspace paramstypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, distributionKeeper types.DistrKeeper, stakingKeeper types.StakingKeeper, sudoKeeper types.SudoKeeper, feeCollectorName string, ) Keeper
NewKeeper creates a new mint Keeper instance
func (Keeper) AfterEpochEnd ¶
AfterEpochEnd mints and allocates coins at the end of each epoch. If inflation is disabled as a module parameter, the state for "NumSkippedEpochs" increments.
func (Keeper) AllocatePolynomialInflation ¶ added in v1.1.0
func (k Keeper) AllocatePolynomialInflation( ctx sdk.Context, mintedCoin sdk.Coin, params types.Params, ) ( staking, strategic, community sdk.Coin, err error, )
AllocatePolynomialInflation allocates coins from the inflation to external modules according to allocation proportions:
- staking rewards -> sdk `auth` module fee collector
- strategic reserves -> root account of x/sudo module
- community pool -> `sdk `distr` module community pool
func (Keeper) BeforeEpochStart ¶
BeforeEpochStart: noop, We don't need to do anything here
func (Keeper) CirculatingSupply ¶
func (k Keeper) CirculatingSupply( c context.Context, _ *types.QueryCirculatingSupplyRequest, ) (*types.QueryCirculatingSupplyResponse, error)
CirculatingSupply returns the total supply in circulation excluding the team allocation in the first year
func (Keeper) EpochMintProvision ¶
func (k Keeper) EpochMintProvision( c context.Context, _ *types.QueryEpochMintProvisionRequest, ) (*types.QueryEpochMintProvisionResponse, error)
EpochMintProvision returns the EpochMintProvision of the inflation module.
func (Keeper) GetCirculatingSupply ¶
GetCirculatingSupply returns the bank supply of the mintDenom excluding the team allocation in the first year
func (Keeper) GetEpochMintProvision ¶
GetEpochMintProvision retrieves necessary params KV storage and calculate EpochMintProvision
func (Keeper) GetEpochsPerPeriod ¶ added in v1.2.0
func (Keeper) GetInflationDistribution ¶ added in v1.2.0
func (k Keeper) GetInflationDistribution(ctx sdk.Context) (res types.InflationDistribution)
func (Keeper) GetInflationEnabled ¶ added in v1.2.0
func (Keeper) GetInflationRate ¶
GetInflationRate returns the inflation rate for the current period.
func (Keeper) GetPeriodsPerYear ¶ added in v1.2.0
func (Keeper) GetPolynomialFactors ¶ added in v1.2.0
func (Keeper) GetProportions ¶
GetAllocationProportion calculates the proportion of coins that is to be allocated during inflation for a given distribution.
func (Keeper) InflationRate ¶
func (k Keeper) InflationRate( c context.Context, _ *types.QueryInflationRateRequest, ) (*types.QueryInflationRateResponse, error)
InflationRate returns the inflation rate for the current period.
func (Keeper) MintAndAllocateInflation ¶
func (k Keeper) MintAndAllocateInflation( ctx sdk.Context, coins sdk.Coin, params types.Params, ) ( staking, strategic, community sdk.Coin, err error, )
MintAndAllocateInflation performs inflation minting and allocation
func (Keeper) MintCoins ¶
MintCoins implements an alias call to the underlying supply keeper's MintCoins to be used in BeginBlocker.
func (Keeper) Period ¶
func (k Keeper) Period( c context.Context, _ *types.QueryPeriodRequest, ) (*types.QueryPeriodResponse, error)
Period returns the current period of the inflation module.
func (Keeper) SkippedEpochs ¶
func (k Keeper) SkippedEpochs( c context.Context, _ *types.QuerySkippedEpochsRequest, ) (*types.QuerySkippedEpochsResponse, error)
SkippedEpochs returns the number of skipped Epochs of the inflation module.
func (Keeper) Sudo ¶ added in v1.2.0
func (k Keeper) Sudo() sudoExtension
Sudo extends the Keeper with sudo functions. See sudo.go.
These Sudo functions should: 1. Not be called in other methods in the module. 2. Only be callable by the x/sudo root or sudo contracts.
The intention behind "Keeper.Sudo()" is to make it more obvious to the developer that an unsafe function is being used when it's called.