keeper

package
v0.21.0-rc.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

type Hooks struct {
	// contains filtered or unexported fields
}

Hooks wrapper struct for incentives keeper

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber uint64)

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber uint64)

epochs hooks

type Keeper

type Keeper struct {
	CurrentPeriod    collections.Sequence
	NumSkippedEpochs collections.Sequence
	// contains filtered or unexported fields
}

Keeper of the inflation store

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	paramspace paramstypes.Subspace,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	dk types.DistrKeeper,
	sk types.StakingKeeper,
	feeCollectorName string,
) Keeper

NewKeeper creates a new mint Keeper instance

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber uint64)

AfterEpochEnd mints and allocates coins at the end of each epoch end

func (Keeper) AllocateExponentialInflation

func (k Keeper) AllocateExponentialInflation(
	ctx sdk.Context,
	mintedCoin sdk.Coin,
	params types.Params,
) (
	staking, strategic, community sdk.Coin,
	err error,
)

AllocateExponentialInflation allocates coins from the inflation to external modules according to allocation proportions:

  • staking rewards -> sdk `auth` module fee collector
  • usage incentives -> `x/incentives` module
  • community pool -> `sdk `distr` module community pool

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ uint64)

BeforeEpochStart: noop, We don't need to do anything here

func (Keeper) CirculatingSupply

CirculatingSupply returns the total supply in circulation excluding the team allocation in the first year

func (Keeper) EpochMintProvision

EpochMintProvision returns the EpochMintProvision of the inflation module.

func (Keeper) EpochsPerPeriod

func (k Keeper) EpochsPerPeriod(ctx sdk.Context) (res uint64)

func (Keeper) ExponentialCalculation

func (k Keeper) ExponentialCalculation(ctx sdk.Context) (res types.ExponentialCalculation)

VotePeriod returns the number of blocks during which voting takes place.

func (Keeper) GetCirculatingSupply

func (k Keeper) GetCirculatingSupply(ctx sdk.Context, mintDenom string) sdkmath.Int

GetCirculatingSupply returns the bank supply of the mintDenom excluding the team allocation in the first year

func (Keeper) GetEpochMintProvision

func (k Keeper) GetEpochMintProvision(ctx sdk.Context) sdk.Dec

GetEpochMintProvision retrieves necessary params KV storage and calculate EpochMintProvision

func (Keeper) GetInflationRate

func (k Keeper) GetInflationRate(ctx sdk.Context, mintDenom string) sdk.Dec

GetInflationRate returns the inflation rate for the current period.

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of inflation parameters.

func (Keeper) GetProportions

func (k Keeper) GetProportions(
	_ sdk.Context,
	coin sdk.Coin,
	proportion sdk.Dec,
) sdk.Coin

GetAllocationProportion calculates the proportion of coins that is to be allocated during inflation for a given distribution.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) InflationDistribution

func (k Keeper) InflationDistribution(ctx sdk.Context) (res types.InflationDistribution)

VoteThreshold returns the minimum percentage of votes that must be received for a ballot to pass.

func (Keeper) InflationEnabled

func (k Keeper) InflationEnabled(ctx sdk.Context) (res bool)

VoteThreshold returns the minimum percentage of votes that must be received for a ballot to pass.

func (Keeper) InflationRate

InflationRate returns the inflation rate for the current period.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

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

func (k Keeper) MintCoins(ctx sdk.Context, coin sdk.Coin) error

MintCoins implements an alias call to the underlying supply keeper's MintCoins to be used in BeginBlocker.

func (Keeper) Params

Params returns params of the mint module.

func (Keeper) Period

Period returns the current period of the inflation module.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the inflation params in a single key

func (Keeper) SkippedEpochs

SkippedEpochs returns the number of skipped Epochs of the inflation module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL