Attribute Macro frame_support::pallet_macros::compact

source ·
Expand description

Declares the arguments of a call function to be encoded using [codec::Compact].

This will results in smaller extrinsic encoding.

A common example of compact is for numeric values that are often times far far away from their theoretical maximum. For example, in the context of a crypto-currency, the balance of an individual account is oftentimes way less than what the numeric type allows. In all such cases, using compact is sensible.

pub mod custom_pallet {
    impl<T: Config> Pallet<T> {
        pub fn some_dispatchable(_origin: OriginFor<T>, #[pallet::compact] _input: u32) -> DispatchResult {


Documentation for this macro can be found at `frame_support::pallet_macros::compact`.