Skip to content

Commit

Permalink
launch: migrate old bridged wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianFranzen committed Feb 26, 2025
1 parent d909c27 commit 444f532
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pallets/launch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,32 @@ pub mod pallet {
TransferFromVirtual { source: Vec<u8>, target: T::AccountId, amount: BalanceOf<T> },
}

/// Old bridged token wallet from which to migrate
const OLD_BRIDGED_WALLET: AccountId = AccountId::new([
109, 111, 100, 108, 116, 101, 115, 116, 108, 110, 99, 104, 52, 98, 114, 105, 100, 103, 101,
100, 45, 101, 114, 99, 50, 48, 0, 0, 0, 0, 0, 0,
]);

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T>
where
T::AccountId: From<AccountId>,
Balance: From<BalanceOf<T>> + From<AirdropBalanceOf<T>>,
BalanceOf<T>: From<u128>,
{
fn on_runtime_upgrade() -> frame_support::weights::Weight {
if let Err(error) = CurrencyOf::<T>::transfer(
&T::AccountId::from(OLD_BRIDGED_WALLET),
&Application::Bridging.account_id::<T>(),
(103_579_710 * ANLOG).into(),
ExistenceRequirement::AllowDeath,
) {
log::warn!(
target: LOG_TARGET,
"🤔 Unable to migrate old bridging funds: {:?}", error
);
}

match LaunchLedger::compile(LAUNCH_LEDGER) {
Ok(plan) => return plan.run(),
Err(error) => {
Expand Down

0 comments on commit 444f532

Please sign in to comment.