From 66208a2d9ebaf168e67bd9239b3f0d651409c1ca Mon Sep 17 00:00:00 2001 From: Roman Olearski Date: Thu, 6 Apr 2017 09:46:17 +0200 Subject: [PATCH] I. DEX Task: The Peerplays DEX should only allow UIA and sidechain assets to be paired (traded) with the core token (PPY). --- libraries/chain/market_evaluator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/chain/market_evaluator.cpp b/libraries/chain/market_evaluator.cpp index 27c31ae4..3cd072f2 100644 --- a/libraries/chain/market_evaluator.cpp +++ b/libraries/chain/market_evaluator.cpp @@ -52,6 +52,11 @@ void_result limit_order_create_evaluator::do_evaluate(const limit_order_create_o if( _sell_asset->options.blacklist_markets.size() ) FC_ASSERT( _sell_asset->options.blacklist_markets.find(_receive_asset->id) == _sell_asset->options.blacklist_markets.end() ); + // I. DEX Task + FC_ASSERT(_receive_asset->id == asset_id_type() || _sell_asset->id == asset_id_type(), + "No asset in the trade is CORE."); + + FC_ASSERT( is_authorized_asset( d, *_seller, *_sell_asset ) ); FC_ASSERT( is_authorized_asset( d, *_seller, *_receive_asset ) );