Trait pallet_dapp_staking::pallet::Config
source · 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§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent> + TryInto<Event<Self>>
The overarching event type.
sourcetype RuntimeFreezeReason: From<FreezeReason>
type RuntimeFreezeReason: From<FreezeReason>
The overarching freeze reason.
sourcetype Currency: FunMutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason, Balance = Balance>
type Currency: FunMutateFreeze<Self::AccountId, Id = Self::RuntimeFreezeReason, Balance = Balance>
Currency used for staking. Reference: https://github.com/paritytech/substrate/pull/12951/
sourcetype SmartContract: Parameter + Member + MaxEncodedLen + SmartContractHandle<Self::AccountId>
type SmartContract: Parameter + Member + MaxEncodedLen + SmartContractHandle<Self::AccountId>
Describes smart contract in the context required by dApp staking.
sourcetype ContractRegisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
type ContractRegisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
Privileged origin that is allowed to register smart contracts to the protocol.
sourcetype ContractUnregisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
type ContractUnregisterOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
Privileged origin that is allowed to unregister smart contracts from the protocol.
sourcetype ManagerOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
type ManagerOrigin: EnsureOrigin<<Self as Config>::RuntimeOrigin>
Privileged origin for managing dApp staking pallet.
sourcetype NativePriceProvider: PriceProvider
type NativePriceProvider: PriceProvider
Used to provide price information about the native token.
sourcetype StakingRewardHandler: StakingRewardHandler<Self::AccountId>
type StakingRewardHandler: StakingRewardHandler<Self::AccountId>
Used to handle reward payouts & reward pool amount fetching.
sourcetype CycleConfiguration: CycleConfiguration
type CycleConfiguration: CycleConfiguration
Describes era length, subperiods & period length, as well as cycle length.
sourcetype Observers: DAppStakingObserver
type Observers: DAppStakingObserver
dApp staking event observers, notified when certain events occur.
sourcetype AccountCheck: AccountCheck<Self::AccountId>
type AccountCheck: AccountCheck<Self::AccountId>
Used to check whether an account is allowed to participate in dApp staking.
sourcetype BaseNativeCurrencyPrice: Get<FixedU128>
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.
sourcetype EraRewardSpanLength: Get<u32>
type EraRewardSpanLength: Get<u32>
Maximum length of a single era reward span length entry.
sourcetype RewardRetentionInPeriods: Get<PeriodNumber>
type RewardRetentionInPeriods: Get<PeriodNumber>
Number of periods for which we keep rewards available for claiming. After that period, they are no longer claimable.
sourcetype MaxNumberOfContracts: Get<u32>
type MaxNumberOfContracts: Get<u32>
Maximum number of contracts that can be integrated into dApp staking at once.
sourcetype MaxUnlockingChunks: Get<u32>
type MaxUnlockingChunks: Get<u32>
Maximum number of unlocking chunks that can exist per account at a time.
sourcetype MinimumLockedAmount: Get<Balance>
type MinimumLockedAmount: Get<Balance>
Minimum amount an account has to lock in dApp staking in order to participate.
sourcetype UnlockingPeriod: Get<EraNumber>
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.
sourcetype MaxNumberOfStakedContracts: Get<u32>
type MaxNumberOfStakedContracts: Get<u32>
Maximum amount of stake contract entries an account is allowed to have at once.
sourcetype MinimumStakeAmount: Get<Balance>
type MinimumStakeAmount: Get<Balance>
Minimum amount staker can stake on a contract.
sourcetype NumberOfTiers: Get<u32>
type NumberOfTiers: Get<u32>
Number of different tiers.
sourcetype RankingEnabled: Get<bool>
type RankingEnabled: Get<bool>
Tier ranking enabled.
sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight info for various calls & operations in the pallet.