Documentation ¶
Index ¶
Constants ¶
View Source
const ( EventTypeMint = ModuleName AttributeKeyYear = "year" AttributeKeyAnnualProvisions = "annual_provisions" )
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" QueryAnnualProvisions = "annual_provisions" )
nolint
Variables ¶
View Source
var ( KeyMintDenom = []byte("MintDenom") KeyInitalInflationAmount = []byte("InitalInflationAmount") KeyInflationFactorPerYear = []byte("InflationFactorPerYear") KeyBlocksPerYear = []byte("BlocksPerYear") )
Parameter store keys
View Source
var DefaultInflationFactor = []sdk.Dec{ sdk.NewDec(1), sdk.NewDecWithPrec(85, 2), sdk.NewDecWithPrec(85, 2), sdk.NewDecWithPrec(85, 2), sdk.NewDecWithPrec(9, 1), }
View Source
var DefaultInitalInflationAmount = sdk.NewDecFromInt(sdk.NewIntWithDecimal(81000000, 18)) //81000000 in the 1st year
View Source
var MinterKey = []byte{0x01}
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 RegisterCodec ¶
Types ¶
type Minter ¶
type Minter struct { CurrentYearIndex uint64 `json:"current_year_index" yaml:"current_year_index"` // current year index AnnualProvisions sdk.Dec `json:"annual_provisions" yaml:"annual_provisions"` // current annual expected provisions }
Minter represents the minting state.
func DefaultInitialMinter ¶
DefaultInitialMinter set the initial minter
func InitialMinter ¶
InitialMinter returns an initial Minter object with a given inflation value.
func NewMinter ¶
NewMinter returns a new Minter object with the given inflation and annual provisions values.
func (Minter) BlockProvision ¶
BlockProvision returns the provisions for a block based on the annual provisions rate.
func (Minter) NextAnnualProvisions ¶
NextAnnualProvisions returns the next annual provisions based
type Params ¶
type Params struct { MintDenom string `json:"mint_denom" yaml:"mint_denom"` // type of coin to mint InitalInflationAmount sdk.Dec `json:"initial_inflation_amount" yaml:"initial_inflation_amount"` //initial amount of minted coins InflationFactorPerYear []sdk.Dec `json:"inflation_factor_per_year" yaml:"inflation_factor_per_year"` // BlocksPerYear uint64 `json:"blocks_per_year" yaml:"blocks_per_year"` // expected blocks per year }
mint parameters
func DefaultParams ¶
func DefaultParams() Params
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
Implements params.ParamSet
type StakingKeeper ¶
type StakingKeeper interface { StakingTokenSupply(ctx sdk.Context) sdk.Int BondedRatio(ctx sdk.Context) sdk.Dec }
StakingKeeper defines the expected staking keeper
type SupplyKeeper ¶
type SupplyKeeper interface { GetModuleAddress(name string) sdk.AccAddress GetModuleAccount(ctx sdk.Context, name string) exported.ModuleAccountI // TODO remove with genesis 2-phases refactor https://github.com/pocblockchain/pocc/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
Click to show internal directories.
Click to hide internal directories.