Documentation ¶
Index ¶
Constants ¶
const (
ModuleName = "incentive"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claim ¶
type Claim struct { Owner sdk.AccAddress `json:"owner" yaml:"owner"` Reward sdk.Coin `json:"reward" yaml:"reward"` Denom string `json:"denom" yaml:"denom"` ClaimPeriodID uint64 `json:"claim_period_id" yaml:"claim_period_id"` }
Claim stores the rewards that can be claimed by owner
type ClaimPeriod ¶
type ClaimPeriod struct { Denom string `json:"denom" yaml:"denom"` ID uint64 `json:"id" yaml:"id"` End time.Time `json:"end" yaml:"end"` TimeLock time.Duration `json:"time_lock" yaml:"time_lock"` }
ClaimPeriod stores the state of an ongoing claim period
func NewClaimPeriod ¶
NewClaimPeriod returns a new ClaimPeriod
func (ClaimPeriod) Validate ¶
func (cp ClaimPeriod) Validate() error
Validate performs a basic check of a ClaimPeriod fields.
type ClaimPeriods ¶
type ClaimPeriods []ClaimPeriod
ClaimPeriods array of ClaimPeriod
func (ClaimPeriods) Validate ¶
func (cps ClaimPeriods) Validate() error
Validate checks if all the ClaimPeriods are valid and there are no duplicated entries.
type GenesisClaimPeriodID ¶
type GenesisClaimPeriodID struct { Denom string `json:"denom" yaml:"denom"` ID uint64 `json:"id" yaml:"id"` }
GenesisClaimPeriodID stores the next claim id and its corresponding denom
func (GenesisClaimPeriodID) Validate ¶
func (gcp GenesisClaimPeriodID) Validate() error
Validate performs a basic check of a GenesisClaimPeriodID fields.
type GenesisClaimPeriodIDs ¶
type GenesisClaimPeriodIDs []GenesisClaimPeriodID
GenesisClaimPeriodIDs array of GenesisClaimPeriodID
func (GenesisClaimPeriodIDs) Validate ¶
func (gcps GenesisClaimPeriodIDs) Validate() error
Validate checks if all the GenesisClaimPeriodIDs are valid and there are no duplicated entries.
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` PreviousBlockTime time.Time `json:"previous_block_time" yaml:"previous_block_time"` RewardPeriods RewardPeriods `json:"reward_periods" yaml:"reward_periods"` ClaimPeriods ClaimPeriods `json:"claim_periods" yaml:"claim_periods"` Claims Claims `json:"claims" yaml:"claims"` NextClaimPeriodIDs GenesisClaimPeriodIDs `json:"next_claim_period_ids" yaml:"next_claim_period_ids"` }
GenesisState is the state that must be provided at genesis.
func NewGenesisState ¶
func NewGenesisState(params Params, previousBlockTime time.Time, rp RewardPeriods, cp ClaimPeriods, c Claims, ids GenesisClaimPeriodIDs) GenesisState
NewGenesisState returns a new genesis state
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic validation of genesis data returning an error for any failed validation criteria.
type Params ¶
type Params struct { Active bool `json:"active" yaml:"active"` // top level governance switch to disable all rewards Rewards Rewards `json:"rewards" yaml:"rewards"` }
Params governance parameters for the incentive module
type Reward ¶
type Reward struct { Active bool `json:"active" yaml:"active"` // governance switch to disable a period Denom string `json:"denom" yaml:"denom"` // the collateral denom rewards apply to, must be found in the cdp collaterals AvailableRewards sdk.Coin `json:"available_rewards" yaml:"available_rewards"` // the total amount of coins distributed per period Duration time.Duration `json:"duration" yaml:"duration"` // the duration of the period TimeLock time.Duration `json:"time_lock" yaml:"time_lock"` // how long rewards for this period are timelocked ClaimDuration time.Duration `json:"claim_duration" yaml:"claim_duration"` // how long users have after the period ends to claim their rewards }
Reward stores the specified state for a single reward period.
type RewardPeriod ¶
type RewardPeriod struct { Denom string `json:"denom" yaml:"denom"` Start time.Time `json:"start" yaml:"start"` End time.Time `json:"end" yaml:"end"` Reward sdk.Coin `json:"reward" yaml:"reward"` // per second reward payouts ClaimEnd time.Time `json:"claim_end" yaml:"claim_end"` ClaimTimeLock time.Duration `json:"claim_time_lock" yaml:"claim_time_lock"` // the amount of time rewards are timelocked once they are sent to users }
RewardPeriod stores the state of an ongoing reward
func NewRewardPeriod ¶
func NewRewardPeriod(denom string, start time.Time, end time.Time, reward sdk.Coin, claimEnd time.Time, claimTimeLock time.Duration) RewardPeriod
NewRewardPeriod returns a new RewardPeriod
func NewRewardPeriodFromReward ¶
func NewRewardPeriodFromReward(reward Reward, blockTime time.Time) RewardPeriod
NewRewardPeriodFromReward returns a new reward period from the input reward and block time
func (RewardPeriod) Validate ¶
func (rp RewardPeriod) Validate() error
Validate performs a basic check of a RewardPeriod fields.
type RewardPeriods ¶
type RewardPeriods []RewardPeriod
RewardPeriods array of RewardPeriod
func (RewardPeriods) Validate ¶
func (rps RewardPeriods) Validate() error
Validate checks if all the RewardPeriods are valid and there are no duplicated entries.