When transferring funds to an uninitialized or Inactive address in a TON-related transaction, there is a possibility that the transfer may be called back.
This occurs when the receiving account is inactive, and the **"bounce-flag" **has not been cleared. To prevent the transfer from being called back, it is necessary to clear the bounce-flag
before sending the funds. This can be done by sending a message to the uninitialized account with a special flag set to clear the bounce-flag. By doing so, the funds will be successfully transferred without being recalled.
Here is an example for the bounced-flag implementation in Tact language:
bounced(msg: Slice) {
msg.skipBits(32); // 0xFFFFFFFF // Parse bounced message
let op: Int = msg.loadUint(32);
let queryId: Int = msg.loadUint(64);
let jettonAmount: Int = msg.loadCoins();
require(op == 0x178d4519 || op == 0x7bdd97de, "Invalid bounced message");
self.balance = self.balance + jettonAmount; // Update balance
}