Skip to content

Commit

Permalink
multi-transfer: move_refund_batch_to_safe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CostinCarabas committed Nov 27, 2024
1 parent a4f51fa commit dab4a14
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion multi-transfer-esdt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ pub trait MultiTransferEsdt:
refund_batch.push(Transaction::from(tx_fields));
refund_payments.push(EsdtTokenPayment::new(token_identifier, 0, amount));
} else {
require!(
self.unprocessed_refund_txs(tx_nonce).is_empty(),
"This transcation is already marked as unprocessed"
);
self.unprocessed_refund_txs(tx_nonce)
.set(Transaction::from(tx_fields));

Expand Down Expand Up @@ -175,10 +179,14 @@ pub trait MultiTransferEsdt:
let esdt_safe_addr = self.get_esdt_safe_address();
let own_sc_address = self.blockchain().get_sc_address();
let sc_shard = self.blockchain().get_shard_of_address(&own_sc_address);
let token_roles = self.blockchain().get_esdt_local_roles(token_id);

if self.is_account_same_shard_frozen(sc_shard, &esdt_safe_addr, token_id) {
if self.is_account_same_shard_frozen(sc_shard, &esdt_safe_addr, token_id)
|| token_roles.has_role(&EsdtLocalRole::Transfer)
{
return false;
}

return true;
}

Expand Down

0 comments on commit dab4a14

Please sign in to comment.