fn transfer_mnt(user: &T::AccountId, user_accrued: Balance, distribute_all: bool) -> DispatchResult {
		//TODO: Need to discuss what we should do.
		// Error/Event/save money to MntAccrued/stop producing mnt tokens

		let threshold = match distribute_all {
			true => Balance::zero(),
			false => MntClaimThreshold::<T>::get(),
		};

		if user_accrued >= threshold && user_accrued > 0 {
			let mnt_treasury_balance = T::MultiCurrency::free_balance(MNT, &Self::get_account_id());
			if user_accrued <= mnt_treasury_balance {
				T::MultiCurrency::transfer(MNT, &Self::get_account_id(), &user, user_accrued)?;
				MntAccrued::<T>::remove(user); // set to 0
			}
		} else {
			MntAccrued::<T>::insert(user, user_accrued);
		}
		Ok(())
	}
/// Transfer MNT tokens to user balance if they are above the threshold.
/// Otherwise, put them into internal storage.
///
/// - `user`: MNT tokens recipient.
/// - `user_accrued`: The total amount of accrued tokens.
/// - `distribute_all`: boolean, distribute all or part of accrued MNT tokens.
Transfer MNT tokens to user balance if they are above the threshold.
Otherwise, put them into internal storage.

`user`: MNT tokens recipient.
`user_accrued`: The total amount of accrued tokens.
`distribute_all`: boolean, distribute all or part of accrued MNT tokens.
Transfer MNT tokens to user balance if they are above the threshold . Otherwise put them into internal storage . ` user ` : MNT tokens recipient . ` user_accrued ` : The total amount of accrued tokens . ` distribute_all ` : boolean distribute all or part of accrued MNT tokens .
fn transfer_mnt(user: &T::AccountId, user_accrued: Balance, distribute_all: bool) -> DispatchResult {
		//TODO: Need to discuss what we should do.
		// Error/Event/save money to MntAccrued/stop producing mnt tokens
		let threshold = match distribute_all {
			true => Balance::zero(),
			false => MntClaimThreshold::<T>::get(),
		};
		if user_accrued >= threshold && user_accrued > 0 {
			let mnt_treasury_balance = T::MultiCurrency::free_balance(MNT, &Self::get_account_id());
			if user_accrued <= mnt_treasury_balance {
				T::MultiCurrency::transfer(MNT, &Self::get_account_id(), &user, user_accrued)?;
				MntAccrued::<T>::remove(user); // set to 0
			}
		} else {
			MntAccrued::<T>::insert(user, user_accrued);
		}
		Ok(())
	}
fn transfer_mnt ( user : & T :: AccountId , user_accrued : Balance , distribute_all : bool ) -> DispatchResult { //TODO: Need to discuss what we should do. // Error/Event/save money to MntAccrued/stop producing mnt tokens let threshold = match distribute_all { true => Balance :: zero ( ) , false => MntClaimThreshold :: < T > :: get ( ) , } ; if user_accrued >= threshold && user_accrued > 0 { let mnt_treasury_balance = T :: MultiCurrency :: free_balance ( MNT , & Self :: get_account_id ( ) ) ; if user_accrued <= mnt_treasury_balance { T :: MultiCurrency :: transfer ( MNT , & Self :: get_account_id ( ) , & user , user_accrued ) ? ; MntAccrued :: < T > :: remove ( user ) ; // set to 0 } } else { MntAccrued :: < T > :: insert ( user , user_accrued ) ; } Ok ( ( ) ) }
Transfer MNT tokens to user balance if they are above the threshold.
Transfer MNT tokens to user balance if they are above the threshold .
user
&T::AccountId
user_accrued
Balance
distribute_all
bool
user
&T::AccountId
user_accrued
Balance
distribute_all
bool