From a76562ef3a5966f6a676c1558656362dbe426963 Mon Sep 17 00:00:00 2001 From: Marian Vanderka Date: Tue, 26 Nov 2024 10:22:59 +0100 Subject: [PATCH] disallows selling notransferable tokens --- pallets/market/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pallets/market/src/lib.rs b/pallets/market/src/lib.rs index fd7e82be7..5a8db6db8 100644 --- a/pallets/market/src/lib.rs +++ b/pallets/market/src/lib.rs @@ -997,6 +997,13 @@ pub mod pallet { let mut swaps: Vec> = vec![]; let mut amount_out = amount_in; for (pool, swap) in pools.iter().zip(path.into_iter()) { + // check input asset id, or the foundation has a veto + ensure!( + !T::NontransferableTokens::contains(&swap.0) || + T::FoundationAccountsProvider::get().contains(&sender), + Error::::NontransferableToken + ); + let amount_in = amount_out; amount_out = match pool.kind { PoolKind::StableSwap => {