I need help with understanding how this transaction was created. Link: https://bscscan.com/tx/0x02fa7264da976f01138b452b737350e4382e54fa60ee8b68b23b2efabb43c54a

How it is possible to make a transaction with ~17 identical groups transfers inside? I think he called a function in his custom solidity contract 17 times using some kind of loop but I want to have deeper understanding of how it works and googling gave me nothing.

Is it possible to swap token A(BUSD) for token B if I code a contract that performs actions displayed in Logs?

  1. Transfer() some BUSD to LP pair contract using BUSD contract transfer function.
  2. Approve() BUSD with Pancake RouterV2 contract as spender
  3. Calculate and transfer() amount of token B to dead address(burn?)
  4. Calculate and transfer() amount of token B to LP pair contract(liq. provider fee?)
  5. Transfer() remaining amount of token B to my wallet
  6. Sync(), (LP Pair contract function)
  7. Swap(), (LP Pair contract function)

If I code a smart contract that calls these functions inside of one main function will it work?

1 Answer 1


From a custom contract, you can call as many external contracts as you like, in the order that you choose (subject to the block gas limit). This is what this contract did.

However, making multiple swaps in one transaction is not as simple as calling the transactions corresponding to the events in the log. You need to have a deep understanding of the DEX and IERC20 contracts that you call to determine what function to call, in what order, and with what parameters. It cannot be explained in one answer (or even many answers).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.