Attribute Macro frame_support::pallet_macros::origin

source ·
#[origin]
Expand description

The #[pallet::origin] attribute allows you to define some origin for the pallet.

Item must be either a type alias, an enum, or a struct. It needs to be public.

E.g.:

#[pallet::origin]
pub struct Origin<T>(PhantomData<(T)>);

WARNING: modifying origin changes the outer runtime origin. This outer runtime origin can be stored on-chain (e.g. in pallet-scheduler), thus any change must be done with care as it might require some migration.

NOTE: for instantiable pallets, the origin must be generic over T and I.