Skip to content

Commit

Permalink
project-token pallet: disable buy/sell_on_amm when pallet is frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
mnaamani committed Jan 8, 2024
1 parent e3db20d commit d707c68
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime-modules/project-token/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,8 @@ decl_module! {
/// - event deposited
#[weight = WeightInfoToken::<T>::buy_on_amm_with_existing_account()]
fn buy_on_amm(origin, token_id: T::TokenId, member_id: T::MemberId, amount: <T as Config>::Balance, slippage_tolerance: Option<(Permill, JoyBalanceOf<T>)>) -> DispatchResult {
Self::ensure_unfrozen_state()?;

if amount.is_zero() {
return Ok(()); // noop
}
Expand Down Expand Up @@ -916,6 +918,8 @@ decl_module! {
/// - event deposited
#[weight = WeightInfoToken::<T>::sell_on_amm()]
fn sell_on_amm(origin, token_id: T::TokenId, member_id: T::MemberId, amount: <T as Config>::Balance, slippage_tolerance: Option<(Permill, JoyBalanceOf<T>)>) -> DispatchResult {
Self::ensure_unfrozen_state()?;

if amount.is_zero() {
return Ok(()); // noop
}
Expand Down

0 comments on commit d707c68

Please sign in to comment.