Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventTypeMint = ModuleName AttributeKeyRemainedTokens = "remained_tokens" AttributeKeyUnfreezenTokens = "unfreezen_tokens" )
Minting module event types
View Source
const ( // module name ModuleName = "mint" // default paramspace for params keeper DefaultParamspace = ModuleName // StoreKey is the default store key for mint StoreKey = ModuleName // QuerierRoute is the querier route for the minting store. QuerierRoute = StoreKey // Query endpoints supported by the minting querier QueryParameters = "parameters" QueryRemainAmount = "remained_amount" )
nolint
Variables ¶
View Source
var ( KeyMintDenom = []byte("MintDenom") KeyInflationRateChange = []byte("InflationRateChange") KeyInflationMax = []byte("InflationMax") KeyInflationMin = []byte("InflationMin") KeyGoalBonded = []byte("GoalBonded") KeyBlocksPerYear = []byte("BlocksPerYear") KeyUnfreezeAmountPerBlock = []byte("UnfreezeAmountPerBlock") )
Parameter store keys
View Source
var MinterKey = []byte{0x00}
the one key to use for the keeper store
View Source
var ModuleCdc *codec.Codec
generic sealed codec to be used throughout this module
Functions ¶
func UpdatedParamKeyTable ¶
ParamTable for minting module.
Types ¶
type Minter ¶
type Minter struct { Inflation sdk.Dec `json:"inflation" yaml:"inflation"` // current annual inflation rate AnnualProvisions sdk.Dec `json:"annual_provisions" yaml:"annual_provisions"` // current annual expected provisions RemainedTokens sdk.Coins `json:"remained_tokens" yaml:"remained_tokens"` }
Minter represents the minting state.
func DefaultInitialMinter ¶
func DefaultInitialMinter() Minter
DefaultInitialMinter returns a default initial Minter object for a new chain which uses an inflation rate of 13%.
func InitialMinter ¶
InitialMinter returns an initial Minter object with a given inflation value.
type Params ¶
type Params struct { MintDenom string `json:"mint_denom" yaml:"mint_denom"` // type of coin to mint InflationRateChange sdk.Dec `json:"inflation_rate_change" yaml:"inflation_rate_change"` // maximum annual change in inflation rate InflationMax sdk.Dec `json:"inflation_max" yaml:"inflation_max"` // maximum inflation rate InflationMin sdk.Dec `json:"inflation_min" yaml:"inflation_min"` // minimum inflation rate GoalBonded sdk.Dec `json:"goal_bonded" yaml:"goal_bonded"` // goal of percent bonded atoms BlocksPerYear uint64 `json:"blocks_per_year" yaml:"blocks_per_year"` // expected blocks per year }
mint parameters
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.AccAddress // TODO remove with genesis 2-phases refactor https://github.com/cosmos/cosmos-sdk/issues/2862 SetModuleAccount(sdk.Context, exported.ModuleAccountI) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error SendCoinsFromModuleToModule(ctx sdk.Context, senderModule, recipientModule string, amt sdk.Coins) sdk.Error MintCoins(ctx sdk.Context, name string, amt sdk.Coins) sdk.Error }
SupplyKeeper defines the expected supply keeper
type UpdatedParams ¶
type UpdatedParams struct { MintDenom string `json:"mint_denom" yaml:"mint_denom"` UnfreezeAmountPerBlock int64 `json:"unfreeze_amount_per_block" yaml:"unfreeze_amount_per_block"` }
func DefaultUpdatedParams ¶
func DefaultUpdatedParams() UpdatedParams
default minting module parameters
func NewUpdatedParams ¶
func NewUpdatedParams(mintDenom string, unfreezeAmountPerBlock int64) UpdatedParams
func (*UpdatedParams) ParamSetPairs ¶
func (p *UpdatedParams) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
func (UpdatedParams) String ¶
func (p UpdatedParams) String() string
Click to show internal directories.
Click to hide internal directories.