types

package
v12.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthInflation        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowInflation          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupInflation = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ParamsKey                           = []byte("Params")
	ParamStoreKeyMintDenom              = []byte("ParamStoreKeyMintDenom")
	ParamStoreKeyExponentialCalculation = []byte("ParamStoreKeyExponentialCalculation")
	ParamStoreKeyInflationDistribution  = []byte("ParamStoreKeyInflationDistribution")
	ParamStoreKeyEnableInflation        = []byte("ParamStoreKeyEnableInflation")
)
View Source
var (
	DefaultInflationDenom         = evm.DefaultEVMDenom
	DefaultInflation              = true
	DefaultExponentialCalculation = V2ExponentialCalculation{
		A:             sdk.NewDec(int64(300_000_000)),
		R:             sdk.NewDecWithPrec(50, 2),
		C:             sdk.NewDec(int64(9_375_000)),
		BondingTarget: sdk.NewDecWithPrec(66, 2),
		MaxVariance:   sdk.ZeroDec(),
	}
	DefaultInflationDistribution = V2InflationDistribution{
		StakingRewards:  sdk.NewDecWithPrec(533333334, 9),
		UsageIncentives: sdk.NewDecWithPrec(333333333, 9),
		CommunityPool:   sdk.NewDecWithPrec(133333333, 9),
	}
)

Functions

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the parameter key table.

Types

type V2ExponentialCalculation

type V2ExponentialCalculation struct {
	// a defines the initial value
	A github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=a,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"a"`
	// r defines the reduction factor
	R github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=r,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"r"`
	// c defines the parameter for long term inflation
	C github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=c,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"c"`
	// bonding_target
	BondingTarget github_com_cosmos_cosmos_sdk_types.Dec `` /* 140-byte string literal not displayed */
	// max_variance
	MaxVariance github_com_cosmos_cosmos_sdk_types.Dec `` /* 134-byte string literal not displayed */
}

V2ExponentialCalculation holds factors to calculate exponential inflation on each period. Calculation reference: periodProvision = exponentialDecay * bondingIncentive f(x) = (a * (1 - r) ^ x + c) * (1 + max_variance - bondedRatio * (max_variance / bonding_target))

func (*V2ExponentialCalculation) Descriptor

func (*V2ExponentialCalculation) Descriptor() ([]byte, []int)

func (*V2ExponentialCalculation) Marshal

func (m *V2ExponentialCalculation) Marshal() (dAtA []byte, err error)

func (*V2ExponentialCalculation) MarshalTo

func (m *V2ExponentialCalculation) MarshalTo(dAtA []byte) (int, error)

func (*V2ExponentialCalculation) MarshalToSizedBuffer

func (m *V2ExponentialCalculation) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*V2ExponentialCalculation) ProtoMessage

func (*V2ExponentialCalculation) ProtoMessage()

func (*V2ExponentialCalculation) Reset

func (m *V2ExponentialCalculation) Reset()

func (*V2ExponentialCalculation) Size

func (m *V2ExponentialCalculation) Size() (n int)

func (*V2ExponentialCalculation) String

func (m *V2ExponentialCalculation) String() string

func (*V2ExponentialCalculation) Unmarshal

func (m *V2ExponentialCalculation) Unmarshal(dAtA []byte) error

func (*V2ExponentialCalculation) XXX_DiscardUnknown

func (m *V2ExponentialCalculation) XXX_DiscardUnknown()

func (*V2ExponentialCalculation) XXX_Marshal

func (m *V2ExponentialCalculation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*V2ExponentialCalculation) XXX_Merge

func (m *V2ExponentialCalculation) XXX_Merge(src proto.Message)

func (*V2ExponentialCalculation) XXX_Size

func (m *V2ExponentialCalculation) XXX_Size() int

func (*V2ExponentialCalculation) XXX_Unmarshal

func (m *V2ExponentialCalculation) XXX_Unmarshal(b []byte) error

type V2GenesisState

type V2GenesisState struct {
	// V2Params defines all the parameters of the module.
	V2Params V2Params `protobuf:"bytes,1,opt,name=V2Params,proto3" json:"V2Params"`
	// period is the amount of past periods, based on the epochs per period param
	Period uint64 `protobuf:"varint,2,opt,name=period,proto3" json:"period,omitempty"`
	// epoch_identifier for inflation
	EpochIdentifier string `protobuf:"bytes,3,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"`
	// epochs_per_period is the number of epochs after which inflation is recalculated
	EpochsPerPeriod int64 `protobuf:"varint,4,opt,name=epochs_per_period,json=epochsPerPeriod,proto3" json:"epochs_per_period,omitempty"`
	// skipped_epochs is the number of epochs that have passed while inflation is disabled
	SkippedEpochs uint64 `protobuf:"varint,5,opt,name=skipped_epochs,json=skippedEpochs,proto3" json:"skipped_epochs,omitempty"`
}

V2GenesisState defines the inflation module's genesis state.

func (*V2GenesisState) Descriptor

func (*V2GenesisState) Descriptor() ([]byte, []int)

func (*V2GenesisState) GetEpochIdentifier

func (m *V2GenesisState) GetEpochIdentifier() string

func (*V2GenesisState) GetEpochsPerPeriod

func (m *V2GenesisState) GetEpochsPerPeriod() int64

func (*V2GenesisState) GetPeriod

func (m *V2GenesisState) GetPeriod() uint64

func (*V2GenesisState) GetSkippedEpochs

func (m *V2GenesisState) GetSkippedEpochs() uint64

func (*V2GenesisState) GetV2Params

func (m *V2GenesisState) GetV2Params() V2Params

func (*V2GenesisState) Marshal

func (m *V2GenesisState) Marshal() (dAtA []byte, err error)

func (*V2GenesisState) MarshalTo

func (m *V2GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*V2GenesisState) MarshalToSizedBuffer

func (m *V2GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*V2GenesisState) ProtoMessage

func (*V2GenesisState) ProtoMessage()

func (*V2GenesisState) Reset

func (m *V2GenesisState) Reset()

func (*V2GenesisState) Size

func (m *V2GenesisState) Size() (n int)

func (*V2GenesisState) String

func (m *V2GenesisState) String() string

func (*V2GenesisState) Unmarshal

func (m *V2GenesisState) Unmarshal(dAtA []byte) error

func (*V2GenesisState) XXX_DiscardUnknown

func (m *V2GenesisState) XXX_DiscardUnknown()

func (*V2GenesisState) XXX_Marshal

func (m *V2GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*V2GenesisState) XXX_Merge

func (m *V2GenesisState) XXX_Merge(src proto.Message)

func (*V2GenesisState) XXX_Size

func (m *V2GenesisState) XXX_Size() int

func (*V2GenesisState) XXX_Unmarshal

func (m *V2GenesisState) XXX_Unmarshal(b []byte) error

type V2InflationDistribution

type V2InflationDistribution struct {
	// staking_rewards defines the proportion of the minted minted_denom that is
	// to be allocated as staking rewards
	StakingRewards github_com_cosmos_cosmos_sdk_types.Dec `` /* 143-byte string literal not displayed */
	// usage_incentives defines the proportion of the minted minted_denom that is
	// to be allocated to the incentives module address
	UsageIncentives github_com_cosmos_cosmos_sdk_types.Dec `` /* 146-byte string literal not displayed */
	// community_pool defines the proportion of the minted minted_denom that is to
	// be allocated to the community pool
	CommunityPool github_com_cosmos_cosmos_sdk_types.Dec `` /* 140-byte string literal not displayed */
}

V2InflationDistribution defines the distribution in which inflation is allocated through minting on each epoch (staking, incentives, community). It excludes the team vesting distribution, as this is minted once at genesis. The initial V2InflationDistribution can be calculated from the native coin Model like this: mintDistribution1 = distribution1 / (1 - teamVestingDistribution) 0.5333333 = 40% / (1 - 25%)

func (*V2InflationDistribution) Descriptor

func (*V2InflationDistribution) Descriptor() ([]byte, []int)

func (*V2InflationDistribution) Marshal

func (m *V2InflationDistribution) Marshal() (dAtA []byte, err error)

func (*V2InflationDistribution) MarshalTo

func (m *V2InflationDistribution) MarshalTo(dAtA []byte) (int, error)

func (*V2InflationDistribution) MarshalToSizedBuffer

func (m *V2InflationDistribution) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*V2InflationDistribution) ProtoMessage

func (*V2InflationDistribution) ProtoMessage()

func (*V2InflationDistribution) Reset

func (m *V2InflationDistribution) Reset()

func (*V2InflationDistribution) Size

func (m *V2InflationDistribution) Size() (n int)

func (*V2InflationDistribution) String

func (m *V2InflationDistribution) String() string

func (*V2InflationDistribution) Unmarshal

func (m *V2InflationDistribution) Unmarshal(dAtA []byte) error

func (*V2InflationDistribution) XXX_DiscardUnknown

func (m *V2InflationDistribution) XXX_DiscardUnknown()

func (*V2InflationDistribution) XXX_Marshal

func (m *V2InflationDistribution) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*V2InflationDistribution) XXX_Merge

func (m *V2InflationDistribution) XXX_Merge(src proto.Message)

func (*V2InflationDistribution) XXX_Size

func (m *V2InflationDistribution) XXX_Size() int

func (*V2InflationDistribution) XXX_Unmarshal

func (m *V2InflationDistribution) XXX_Unmarshal(b []byte) error

type V2Params

type V2Params struct {
	// mint_denom specifies the type of coin to mint
	MintDenom string `protobuf:"bytes,1,opt,name=mint_denom,json=mintDenom,proto3" json:"mint_denom,omitempty"`
	// exponential_calculation takes in the variables to calculate exponential inflation
	ExponentialCalculation V2ExponentialCalculation `protobuf:"bytes,2,opt,name=exponential_calculation,json=exponentialCalculation,proto3" json:"exponential_calculation"`
	// inflation_distribution of the minted denom
	InflationDistribution V2InflationDistribution `protobuf:"bytes,3,opt,name=inflation_distribution,json=inflationDistribution,proto3" json:"inflation_distribution"`
	// enable_inflation is the parameter that enables inflation and halts increasing the skipped_epochs
	EnableInflation bool `protobuf:"varint,4,opt,name=enable_inflation,json=enableInflation,proto3" json:"enable_inflation,omitempty"`
}

V2Params holds parameters for the inflation module.

func DefaultParams

func DefaultParams() V2Params

func NewParams

func NewParams(
	mintDenom string,
	exponentialCalculation V2ExponentialCalculation,
	inflationDistribution V2InflationDistribution,
	enableInflation bool,
) V2Params

func (*V2Params) Descriptor

func (*V2Params) Descriptor() ([]byte, []int)

func (*V2Params) GetEnableInflation

func (m *V2Params) GetEnableInflation() bool

func (*V2Params) GetExponentialCalculation

func (m *V2Params) GetExponentialCalculation() V2ExponentialCalculation

func (*V2Params) GetInflationDistribution

func (m *V2Params) GetInflationDistribution() V2InflationDistribution

func (*V2Params) GetMintDenom

func (m *V2Params) GetMintDenom() string

func (*V2Params) Marshal

func (m *V2Params) Marshal() (dAtA []byte, err error)

func (*V2Params) MarshalTo

func (m *V2Params) MarshalTo(dAtA []byte) (int, error)

func (*V2Params) MarshalToSizedBuffer

func (m *V2Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*V2Params) ParamSetPairs

func (p *V2Params) ParamSetPairs() paramtypes.ParamSetPairs

Implements params.ParamSet

func (*V2Params) ProtoMessage

func (*V2Params) ProtoMessage()

func (*V2Params) Reset

func (m *V2Params) Reset()

func (*V2Params) Size

func (m *V2Params) Size() (n int)

func (*V2Params) String

func (m *V2Params) String() string

func (*V2Params) Unmarshal

func (m *V2Params) Unmarshal(dAtA []byte) error

func (V2Params) Validate

func (p V2Params) Validate() error

func (*V2Params) XXX_DiscardUnknown

func (m *V2Params) XXX_DiscardUnknown()

func (*V2Params) XXX_Marshal

func (m *V2Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*V2Params) XXX_Merge

func (m *V2Params) XXX_Merge(src proto.Message)

func (*V2Params) XXX_Size

func (m *V2Params) XXX_Size() int

func (*V2Params) XXX_Unmarshal

func (m *V2Params) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL