Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, k Keeper) (resTags sdk.Tags)
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
- func KeyClaim(claimID string) []byte
- func NewQuerier(keeper Keeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type Claim
- type ClaimClass
- type Claims
- type GenesisState
- type Keeper
- func (k Keeper) AddTaxProceeds(ctx sdk.Context, epoch sdk.Int, addition sdk.Coins)
- func (k Keeper) GetIssuance(ctx sdk.Context, denom string, epoch sdk.Int) (issuance sdk.Int)
- func (k Keeper) GetParams(ctx sdk.Context) Params
- func (k Keeper) GetRewardWeight(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) GetTaxCap(ctx sdk.Context, denom string) (res sdk.Int)
- func (k Keeper) GetTaxRate(ctx sdk.Context) (res sdk.Dec)
- func (k Keeper) PeekTaxProceeds(ctx sdk.Context, epoch sdk.Int) (res sdk.Coins)
- func (k Keeper) ProcessClaims(ctx sdk.Context, class ClaimClass, rewardees map[string]sdk.Int)
- func (k Keeper) SetParams(ctx sdk.Context, params Params)
- func (k Keeper) SetRewardWeight(ctx sdk.Context, weight sdk.Dec)
- func (k Keeper) SetTaxCap(ctx sdk.Context, denom string, cap sdk.Int)
- func (k Keeper) SetTaxRate(ctx sdk.Context, rate sdk.Dec)
- type Params
Constants ¶
const ( QueryTaxRate = "tax-rate" QueryTaxCap = "tax-cap" QueryMiningRewardWeight = "mining-reward-weight" QueryBalance = "balance" QueryActiveClaims = "active-claims" QueryRewards = "rewards" QueryParams = "params" QueryIssuance = "issuance" )
query endpoints supported by the governance Querier
const (
//nolint default paramspace for treasury keeper
DefaultParamspace = "treasury"
)
const StoreKey = "treasury"
StoreKey is string representation of the store key for treasury
Variables ¶
var ( KeyRewardWeight = []byte("reward_weight") PrefixClaim = []byte("claim") ParamStoreKeyParams = []byte("params") )
nolint
Functions ¶
func EndBlocker ¶ added in v0.0.5
EndBlocker called to adjust macro weights (tax, mining reward) and settle outstanding claims.
func InitGenesis ¶ added in v0.0.5
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState)
new oracle genesis
func NewQuerier ¶ added in v0.0.5
NewQuerier is the module level router for state queries
func ParamKeyTable ¶ added in v0.0.5
ParamKeyTable for treasury module
func RegisterCodec ¶ added in v0.0.5
Register concrete types on codec codec
func ValidateGenesis ¶ added in v0.0.5
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided oracle genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)
Types ¶
type Claim ¶
type Claim struct {
// contains filtered or unexported fields
}
Claim is an interface that directs its rewards to an attached bank account.
func NewClaim ¶ added in v0.0.5
func NewClaim(class ClaimClass, weight sdk.Int, recipient sdk.AccAddress) Claim
NewClaim generates a Claim instance.
type ClaimClass ¶ added in v0.0.5
type ClaimClass byte
const ( // RouterKey is they name of the treasury module RouterKey = "treasury" OracleClaimClass ClaimClass = iota BudgetClaimClass ClaimClass = iota )
type GenesisState ¶ added in v0.0.5
type GenesisState struct {
Params Params `json:"params"` // treasury params
}
GenesisState - all treasury state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.0.5
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func ExportGenesis ¶ added in v0.0.5
func ExportGenesis(ctx sdk.Context, k Keeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, and validator/delegator distribution info's
func NewGenesisState ¶ added in v0.0.5
func NewGenesisState(params Params) GenesisState
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper of the treasury store
func NewKeeper ¶
func NewKeeper(key sdk.StoreKey, cdc *codec.Codec, ak auth.AccountKeeper, bk bank.Keeper, mk market.Keeper, dk distribution.Keeper, paramspace params.Subspace) Keeper
NewKeeper constructs a new keeper
func (Keeper) AddTaxProceeds ¶ added in v0.0.5
AddTaxProceeds add tax proceeds that have been added this epoch
func (Keeper) GetIssuance ¶ added in v0.0.5
GetIssuance fetches the total issuance count of the coin matching {denom}. If the {epoch} applies to a previous period, fetches the last stored snapshot issuance of the coin. For virgin calls, iterates through the accountkeeper and computes the genesis issuance.
func (Keeper) GetRewardWeight ¶ added in v0.0.5
GetRewardWeight returns the mining reward weight
func (Keeper) GetTaxCap ¶ added in v0.0.5
GetTaxCap gets the Tax Cap. Denominated in integer units of the reference {denom}
func (Keeper) GetTaxRate ¶ added in v0.0.5
GetTaxRate gets the tax rate
func (Keeper) PeekTaxProceeds ¶ added in v0.0.5
PeekTaxProceeds peeks the total amount of taxes that have been collected in the given epoch.
func (Keeper) ProcessClaims ¶ added in v0.0.5
AddClaim adds a funding claim to the treasury. Settled around once a month.
func (Keeper) SetRewardWeight ¶ added in v0.0.5
SetRewardWeight sets the ratio of the treasury that goes to mining rewards, i.e. supply of Luna that is burned.
type Params ¶ added in v0.0.5
type Params struct { TaxRateMin sdk.Dec `json:"tax_rate_min"` // percentage cap on taxes. Defaults to 2%. TaxRateMax sdk.Dec `json:"tax_rate_max"` // percentage floor on taxes. Defaults to 0. TaxCap sdk.Coin `json:"tax_cap"` // Tax Cap in TerraSDR RewardMin sdk.Dec `json:"reward_min"` // percentage floor on miner rewards for seigniorage. Defaults to 0.1. RewardMax sdk.Dec `json:"reward_max"` // percentage cap on miner rewards for seigniorage. Defaults to 0.9 EpochLong sdk.Int `json:"epoch_long"` EpochShort sdk.Int `json:"epoch_short"` }
Params treasury parameters
func DefaultParams ¶ added in v0.0.5
func DefaultParams() Params
DefaultParams creates default treasury module parameters