Tron2steem Bug Fix: Filter out TRC-10 Tokens

justyy -

Critical Bug Identified:

The transaction processing logic for Tron2STEEM Swap did not filter out TRC-10 token transfers, which was a severe oversight. In theory, this vulnerability could be exploited to trigger unintended swaps, leading to significant financial losses.

Impact:

Fix Summary:

To mitigate this issue, a strict filter has been added to process only TRX or USDT, USDD transactions by verifying the transaction's contract type.

for (let tx of currentPageTransactions) {             
    // Check if the transaction is a TRX transfer (TransferContract)
    const contractType = tx.raw_data.contract[0].type;
    if (contractType !== "TransferContract") {
        console.log(`Skipping non-TRX transaction: ${contractType}`);
        continue;
    }
    // the rest of the code

Key Changes in Code:

Steem to the Moon🚀!