From eec1b067497c0b55c7995dc44651ef7ddf070eb1 Mon Sep 17 00:00:00 2001 From: Dorin Marian Iancu Date: Fri, 29 Sep 2023 09:39:00 +0300 Subject: [PATCH] burn old token --- locked-asset/energy-factory/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/locked-asset/energy-factory/src/lib.rs b/locked-asset/energy-factory/src/lib.rs index 419527336..a39dcc117 100644 --- a/locked-asset/energy-factory/src/lib.rs +++ b/locked-asset/energy-factory/src/lib.rs @@ -209,9 +209,15 @@ pub trait SimpleLockEnergy: ); let output_tokens = self.update_energy(&user, |energy: &mut Energy| { - self.extend_new_token_period(payment, unlock_epoch, current_epoch, energy) + self.extend_new_token_period(payment.clone(), unlock_epoch, current_epoch, energy) }); + self.send().esdt_local_burn( + &payment.token_identifier, + payment.token_nonce, + &payment.amount, + ); + self.send().direct_esdt( &caller, &output_tokens.token_identifier,