referrerpolicy=no-referrer-when-downgrade

Trait pallet_treasury::pallet::Config

source ·
pub trait Config<I: 'static = ()>: Config {
Show 19 associated items type Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>; type RejectOrigin: EnsureOrigin<Self::RuntimeOrigin>; type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>; type SpendPeriod: Get<BlockNumberFor<Self, I>>; type Burn: Get<Permill>; type PalletId: Get<PalletId>; type BurnDestination: OnUnbalanced<NegativeImbalanceOf<Self, I>>; type WeightInfo: WeightInfo; type SpendFunds: SpendFunds<Self, I>; type MaxApprovals: Get<u32>; type SpendOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BalanceOf<Self, I>>; type AssetKind: Parameter + MaxEncodedLen; type Beneficiary: Parameter + MaxEncodedLen; type BeneficiaryLookup: StaticLookup<Target = Self::Beneficiary>; type Paymaster: Pay<Beneficiary = Self::Beneficiary, AssetKind = Self::AssetKind>; type BalanceConverter: ConversionFromAssetBalance<<Self::Paymaster as Pay>::Balance, Self::AssetKind, BalanceOf<Self, I>>; type PayoutPeriod: Get<BlockNumberFor<Self, I>>; type BenchmarkHelper: ArgumentsFactory<Self::AssetKind, Self::Beneficiary>; type BlockNumberProvider: BlockNumberProvider;
}
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 Currency: Currency<Self::AccountId> + ReservableCurrency<Self::AccountId>

The staking balance.

source

type RejectOrigin: EnsureOrigin<Self::RuntimeOrigin>

Origin from which rejections must come.

source

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

The overarching event type.

source

type SpendPeriod: Get<BlockNumberFor<Self, I>>

Period between successive spends.

source

type Burn: Get<Permill>

Percentage of spare funds (if any) that are burnt per spend period.

source

type PalletId: Get<PalletId>

The treasury’s pallet id, used for deriving its sovereign account ID.

source

type BurnDestination: OnUnbalanced<NegativeImbalanceOf<Self, I>>

Handler for the unbalanced decrease when treasury funds are burned.

source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

source

type SpendFunds: SpendFunds<Self, I>

Runtime hooks to external pallet using treasury to compute spend funds.

source

type MaxApprovals: Get<u32>

DEPRECATED: associated with spend_local call and will be removed in May 2025. Refer to https://github.com/paritytech/polkadot-sdk/pull/5961 for migration to spend.

The maximum number of approvals that can wait in the spending queue.

NOTE: This parameter is also used within the Bounties Pallet extension if enabled.

source

type SpendOrigin: EnsureOrigin<Self::RuntimeOrigin, Success = BalanceOf<Self, I>>

The origin required for approving spends from the treasury outside of the proposal process. The Success value is the maximum amount in a native asset that this origin is allowed to spend at a time.

source

type AssetKind: Parameter + MaxEncodedLen

Type parameter representing the asset kinds to be spent from the treasury.

source

type Beneficiary: Parameter + MaxEncodedLen

Type parameter used to identify the beneficiaries eligible to receive treasury spends.

source

type BeneficiaryLookup: StaticLookup<Target = Self::Beneficiary>

Converting trait to take a source type and convert to Self::Beneficiary.

source

type Paymaster: Pay<Beneficiary = Self::Beneficiary, AssetKind = Self::AssetKind>

Type for processing spends of Self::AssetKind in favor of Self::Beneficiary.

source

type BalanceConverter: ConversionFromAssetBalance<<Self::Paymaster as Pay>::Balance, Self::AssetKind, BalanceOf<Self, I>>

Type for converting the balance of an Self::AssetKind to the balance of the native asset, solely for the purpose of asserting the result against the maximum allowed spend amount of the Self::SpendOrigin.

source

type PayoutPeriod: Get<BlockNumberFor<Self, I>>

The period during which an approved treasury spend has to be claimed.

source

type BenchmarkHelper: ArgumentsFactory<Self::AssetKind, Self::Beneficiary>

Helper type for benchmarks.

source

type BlockNumberProvider: BlockNumberProvider

Provider for the block number. Normally this is the frame_system pallet.

Object Safety§

This trait is not object safe.

Implementors§