INNER CODE UNIT · Rust

slash

AstarNetwork/Astar · pallets/collator-selection/src/lib.rs:735

                    let slash = T::SlashRatio::get() * deposit;
                    let remain = deposit.saturating_sub(slash);

                    let (imbalance, _) = T::Currency::slash_reserved(who, slash);
                    T::Currency::unreserve(who, remain);

                    if let Some(dest) = SlashDestination::<T>::get() {
                        T::Currency::resolve_creating(&dest, imbalance);
                    }

                    <LastAuthoredBlock<T>>::remove(who);

                    Self::deposit_event(Event::CandidateSlashed(who.clone()));
                }
            });
        }

        /// Assemble the current set of candidates and invulnerables into the next collator set.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…