Skip to content

Commit

Permalink
disallows selling notransferable tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderian committed Nov 28, 2024
1 parent 981121e commit a76562e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pallets/market/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,13 @@ pub mod pallet {
let mut swaps: Vec<AtomicSwapOf<T>> = 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::<T>::NontransferableToken
);

let amount_in = amount_out;
amount_out = match pool.kind {
PoolKind::StableSwap => {
Expand Down

0 comments on commit a76562e

Please sign in to comment.