pub trait Config: Config {
Show 25 associated items type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>; type RuntimeFreezeReason: From<FreezeReason>; type Currency: FunMutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason, Balance = Balance>; type SmartContract: Parameter + Member + MaxEncodedLen + SmartContractHandle<Self::AccountId>; type ContractRegisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>; type ContractUnregisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>; type ManagerOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>; type NativePriceProvider: PriceProvider; type StakingRewardHandler: StakingRewardHandler<Self::AccountId>; type CycleConfiguration: CycleConfiguration; type Observers: DAppStakingObserver; type AccountCheck: AccountCheck<Self::AccountId>; type TierSlots: TierSlotFunc; type BaseNativeCurrencyPrice: Get<FixedU128>; type EraRewardSpanLength: Get<u32>; type RewardRetentionInPeriods: Get<PeriodNumber>; type MaxNumberOfContracts: Get<u32>; type MaxUnlockingChunks: Get<u32>; type MinimumLockedAmount: Get<Balance>; type UnlockingPeriod: Get<EraNumber>; type MaxNumberOfStakedContracts: Get<u32>; type MinimumStakeAmount: Get<Balance>; type NumberOfTiers: Get<u32>; type RankingEnabled: Get<bool>; type WeightInfo: WeightInfo;
}
Expand description

Configuration trait of this pallet.

The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.

Consequently, a runtime that wants to include this pallet must implement this trait.

Required Associated Types§

source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>

The overarching event type.

source

type RuntimeFreezeReason: From<FreezeReason>

The overarching freeze reason.

source

type Currency: FunMutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason, Balance = Balance>

Currency used for staking. Reference: https://github.com/paritytech/substrate/pull/12951/

source

type SmartContract: Parameter + Member + MaxEncodedLen + SmartContractHandle<Self::AccountId>

Describes smart contract in the context required by dApp staking.

source

type ContractRegisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>

Privileged origin that is allowed to register smart contracts to the protocol.

source

type ContractUnregisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>

Privileged origin that is allowed to unregister smart contracts from the protocol.

source

type ManagerOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>

Privileged origin for managing dApp staking pallet.

source

type NativePriceProvider: PriceProvider

Used to provide price information about the native token.

source

type StakingRewardHandler: StakingRewardHandler<Self::AccountId>

Used to handle reward payouts & reward pool amount fetching.

source

type CycleConfiguration: CycleConfiguration

Describes era length, subperiods & period length, as well as cycle length.

source

type Observers: DAppStakingObserver

dApp staking event observers, notified when certain events occur.

source

type AccountCheck: AccountCheck<Self::AccountId>

Used to check whether an account is allowed to participate in dApp staking.

source

type TierSlots: TierSlotFunc

Used to calculate total number of tier slots for some price.

source

type BaseNativeCurrencyPrice: Get<FixedU128>

Base native currency price used to calculate base number of slots. This is used to adjust tier configuration, tier thresholds specifically, based on the native token price changes.

When dApp staking thresholds were modeled, a base price was set from which the initial configuration is derived. E.g. for a price of 0.05$, we get 100 slots, and certain tier thresholds. Using these values as the base, we can adjust the configuration based on the current price.

This is connected with the TierSlots associated type, since it’s used to calculate the total number of slots for the given price.

source

type EraRewardSpanLength: Get<u32>

Maximum length of a single era reward span length entry.

source

type RewardRetentionInPeriods: Get<PeriodNumber>

Number of periods for which we keep rewards available for claiming. After that period, they are no longer claimable.

source

type MaxNumberOfContracts: Get<u32>

Maximum number of contracts that can be integrated into dApp staking at once.

source

type MaxUnlockingChunks: Get<u32>

Maximum number of unlocking chunks that can exist per account at a time.

source

type MinimumLockedAmount: Get<Balance>

Minimum amount an account has to lock in dApp staking in order to participate.

source

type UnlockingPeriod: Get<EraNumber>

Number of standard eras that need to pass before unlocking chunk can be claimed. Even though it’s expressed in ‘eras’, it’s actually measured in number of blocks.

source

type MaxNumberOfStakedContracts: Get<u32>

Maximum amount of stake contract entries an account is allowed to have at once.

source

type MinimumStakeAmount: Get<Balance>

Minimum amount staker can stake on a contract.

source

type NumberOfTiers: Get<u32>

Number of different tiers.

source

type RankingEnabled: Get<bool>

Tier ranking enabled.

source

type WeightInfo: WeightInfo

Weight info for various calls & operations in the pallet.

Object Safety§

This trait is not object safe.

Implementors§