diff --git a/pallets/ocex/src/lib.rs b/pallets/ocex/src/lib.rs index 23afc3383..468861cb4 100644 --- a/pallets/ocex/src/lib.rs +++ b/pallets/ocex/src/lib.rs @@ -1530,7 +1530,8 @@ pub mod pallet { ); let fee_to_be_burnt = Percent::from_percent(distribution.burn_ration) * fees; - let fee_to_be_distributed = fees - fee_to_be_burnt; + let fee_to_be_distributed = + fees.saturating_sub(fee_to_be_burnt); // Burn the fee let imbalance = T::NativeCurrency::burn( fee_to_be_burnt.saturated_into(), @@ -2118,11 +2119,12 @@ pub mod pallet { let _ = T::NativeCurrency::unreserve(&bidder, total_bidder_reserve_balance); let amount_to_be_burnt = Percent::from_percent(fee_config.burn_ration) * total_bidder_reserve_balance; - let trasnferable_amount = total_bidder_reserve_balance - amount_to_be_burnt; + let transferable_amount = + total_bidder_reserve_balance.saturating_sub(amount_to_be_burnt); T::NativeCurrency::transfer( &bidder, &fee_config.recipient_address, - trasnferable_amount, + transferable_amount, ExistenceRequirement::KeepAlive, )?; @@ -2139,7 +2141,7 @@ pub mod pallet { Self::deposit_event(Event::::AuctionClosed { bidder, burned: Compact::from(amount_to_be_burnt), - paid_to_operator: Compact::from(trasnferable_amount), + paid_to_operator: Compact::from(transferable_amount), }) } Ok(())