Documentation ¶
Overview ¶
nolint:deadcode unused noalias
Index ¶
- Variables
- func MR(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- func NewQuerier(keeper Keeper) sdk.Querier
- func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
- func ParamKeyTable() params.KeyTable
- func SR(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- func TRL(ctx sdk.Context, epoch int64, k Keeper) sdk.Dec
- type Keeper
- func (k Keeper) ClearSRs(ctx sdk.Context)
- func (k Keeper) ClearTRs(ctx sdk.Context)
- func (k Keeper) ClearTSLs(ctx sdk.Context)
- func (k Keeper) Codespace() sdk.CodespaceType
- func (k Keeper) GetEpochInitialIssuance(ctx sdk.Context) (res sdk.Coins)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetRewardWeight(ctx sdk.Context) (rewardWeight sdk.Dec)
- func (k Keeper) GetSR(ctx sdk.Context, epoch int64) (res sdk.Dec)
- func (k Keeper) GetTR(ctx sdk.Context, epoch int64) (res sdk.Dec)
- func (k Keeper) GetTSL(ctx sdk.Context, epoch int64) (res sdk.Int)
- func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) (taxCap sdk.Int)
- func (k Keeper) GetTaxRate(ctx sdk.Context) (taxRate sdk.Dec)
- func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap sdk.Int) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MiningIncrement(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) PeekEpochSeigniorage(ctx sdk.Context) sdk.Int
- func (k Keeper) PeekEpochTaxProceeds(ctx sdk.Context) (res sdk.Coins)
- func (k Keeper) RecordEpochInitialIssuance(ctx sdk.Context)
- func (k Keeper) RecordEpochTaxProceeds(ctx sdk.Context, delta sdk.Coins)
- func (k Keeper) RewardPolicy(ctx sdk.Context) (res types.PolicyConstraints)
- func (k Keeper) SeigniorageBurdenTarget(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) SetEpochInitialIssuance(ctx sdk.Context, issuance sdk.Coins)
- func (k Keeper) SetEpochTaxProceeds(ctx sdk.Context, taxProceeds sdk.Coins)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetRewardWeight(ctx sdk.Context, rewardWeight sdk.Dec)
- func (k Keeper) SetSR(ctx sdk.Context, epoch int64, SR sdk.Dec)
- func (k Keeper) SetTR(ctx sdk.Context, epoch int64, TR sdk.Dec)
- func (k Keeper) SetTSL(ctx sdk.Context, epoch int64, TSL sdk.Int)
- func (k Keeper) SetTaxCap(ctx sdk.Context, denom string, cap sdk.Int)
- func (k Keeper) SetTaxRate(ctx sdk.Context, taxRate sdk.Dec)
- func (k Keeper) SettleSeigniorage(ctx sdk.Context)
- func (k Keeper) TaxPolicy(ctx sdk.Context) (res types.PolicyConstraints)
- func (k Keeper) UpdateIndicators(ctx sdk.Context)
- func (k Keeper) UpdateRewardPolicy(ctx sdk.Context) (newRewardWeight sdk.Dec)
- func (k Keeper) UpdateTaxCap(ctx sdk.Context) sdk.Coins
- func (k Keeper) UpdateTaxPolicy(ctx sdk.Context) (newTaxRate sdk.Dec)
- func (k Keeper) WindowLong(ctx sdk.Context) (res int64)
- func (k Keeper) WindowProbation(ctx sdk.Context) (res int64)
- func (k Keeper) WindowShort(ctx sdk.Context) (res int64)
- type TestInput
Constants ¶
This section is empty.
Variables ¶
var ( PubKeys = []crypto.PubKey{ secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), secp256k1.GenPrivKey().PubKey(), } Addrs = []sdk.AccAddress{ sdk.AccAddress(PubKeys[0].Address()), sdk.AccAddress(PubKeys[1].Address()), sdk.AccAddress(PubKeys[2].Address()), } ValAddrs = []sdk.ValAddress{ sdk.ValAddress(PubKeys[0].Address()), sdk.ValAddress(PubKeys[1].Address()), sdk.ValAddress(PubKeys[2].Address()), } InitTokens = sdk.TokensFromConsensusPower(200) InitCoins = sdk.NewCoins(sdk.NewCoin(core.MicroLunaDenom, InitTokens)) )
Functions ¶
func NewQuerier ¶
NewQuerier is the module level router for state queries
func NewTestMsgCreateValidator ¶
func NewTestMsgCreateValidator(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) staking.MsgCreateValidator
func ParamKeyTable ¶
ParamKeyTable returns ParamTable for treasury module
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the treasury store
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, supplyKeeper types.SupplyKeeper, marketKeeper types.MarketKeeper, stakingKeeper types.StakingKeeper, distrKeeper types.DistributionKeeper, oracleModuleName string, distributionModuleName string, codespace sdk.CodespaceType) Keeper
NewKeeper creates a new treasury Keeper instance
func (Keeper) Codespace ¶
func (k Keeper) Codespace() sdk.CodespaceType
Codespace returns the codespace
func (Keeper) GetEpochInitialIssuance ¶
GetEpochInitialIssuance returns epoch initial issuance
func (Keeper) GetRewardWeight ¶
GetRewardWeight loads the reward weight
func (Keeper) GetTaxCap ¶
GetTaxCap gets the tax cap denominated in integer units of the reference {denom}
func (Keeper) GetTaxRate ¶
GetTaxRate loads the tax rate
func (Keeper) IterateTaxCap ¶
func (k Keeper) IterateTaxCap(ctx sdk.Context, handler func(denom string, taxCap sdk.Int) (stop bool))
IterateTaxCap iterates all tax cap
func (Keeper) MiningIncrement ¶
MiningIncrement is a factor used to determine how fast MRL should grow over time
func (Keeper) PeekEpochSeigniorage ¶
PeekEpochSeigniorage returns epoch seigniorage
func (Keeper) PeekEpochTaxProceeds ¶
PeekEpochTaxProceeds peeks the total amount of taxes that have been collected in the given epoch.
func (Keeper) RecordEpochInitialIssuance ¶
RecordEpochInitialIssuance updates epoch initial issuance from supply keeper
func (Keeper) RecordEpochTaxProceeds ¶
RecordEpochTaxProceeds adds tax proceeds that have been added this epoch
func (Keeper) RewardPolicy ¶
func (k Keeper) RewardPolicy(ctx sdk.Context) (res types.PolicyConstraints)
RewardPolicy defines constraints for RewardWeight
func (Keeper) SeigniorageBurdenTarget ¶
SeigniorageBurdenTarget defines fixed target for the Seigniorage Burden. Between 0 and 1.
func (Keeper) SetEpochInitialIssuance ¶
SetEpochInitialIssuance stores epoch initial issuance
func (Keeper) SetEpochTaxProceeds ¶
SetEpochTaxProceeds stores tax proceeds for the given epoch
func (Keeper) SetRewardWeight ¶
SetRewardWeight sets the reward weight
func (Keeper) SetTaxCap ¶
SetTaxCap sets the tax cap denominated in integer units of the reference {denom}
func (Keeper) SetTaxRate ¶
SetTaxRate sets the tax rate
func (Keeper) SettleSeigniorage ¶
SettleSeigniorage computes seigniorage and distributes it to oracle and distribution(community-pool) account
func (Keeper) TaxPolicy ¶
func (k Keeper) TaxPolicy(ctx sdk.Context) (res types.PolicyConstraints)
TaxPolicy defines constraints for TaxRate
func (Keeper) UpdateIndicators ¶
UpdateIndicators updates interal indicators
func (Keeper) UpdateRewardPolicy ¶
UpdateRewardPolicy updates reward-weight with w(t+1) = w(t)*SB_target/SB_rolling(t)
func (Keeper) UpdateTaxCap ¶
UpdateTaxCap updates all denom's tax cap
func (Keeper) UpdateTaxPolicy ¶
UpdateTaxPolicy updates tax-rate with t(t+1) = t(t) * (TL_year(t) + INC) / TL_month(t)
func (Keeper) WindowLong ¶
WindowLong is a long period window for moving average
func (Keeper) WindowProbation ¶
WindowProbation is a period of time to prevent updates