diff --git a/runtime-modules/project-token/src/lib.rs b/runtime-modules/project-token/src/lib.rs index 960ea3a284..5fba7a5ab3 100644 --- a/runtime-modules/project-token/src/lib.rs +++ b/runtime-modules/project-token/src/lib.rs @@ -836,6 +836,8 @@ decl_module! { /// - event deposited #[weight = WeightInfoToken::::buy_on_amm_with_existing_account()] fn buy_on_amm(origin, token_id: T::TokenId, member_id: T::MemberId, amount: ::Balance, slippage_tolerance: Option<(Permill, JoyBalanceOf)>) -> DispatchResult { + Self::ensure_unfrozen_state()?; + if amount.is_zero() { return Ok(()); // noop } @@ -916,6 +918,8 @@ decl_module! { /// - event deposited #[weight = WeightInfoToken::::sell_on_amm()] fn sell_on_amm(origin, token_id: T::TokenId, member_id: T::MemberId, amount: ::Balance, slippage_tolerance: Option<(Permill, JoyBalanceOf)>) -> DispatchResult { + Self::ensure_unfrozen_state()?; + if amount.is_zero() { return Ok(()); // noop }