1

Is it possible to send multiple ECR20 tokens (i.e, USDT and USDC) from a single Ethereum address (EOA) to another address (EOA) in a single transaction (either with or without a smart contract)? If yes, would this lead to a reduction in gas costs? If it would, how would one go about in calculating the savings?

I've read conflicting information on this topic. According to one reddit user:

Without such a wrapper contract, moving several tokens in one transaction is impossible.

Yet, according to another user:

It'd definitely save gas. All transactions have 21k gas and contracts add on top of that depending on the ops used. If you create a contract that combines the work of 2 transactions, you'd save the 21k of one of the transactions

Who's right? And if it is possible to send two tokens in a single transaction how would I go about in calculating the fee savings?

This question does seem to address (no pun intended) sending eth + other tokens in a single transaction. Would the same answer apply to sending multiple ECR20 tokens without sending eth? Also, it does not address the possibility of sending tokens via smart contract which according to the reddit post above should reduce the cost by 21,000 gas as this fee would be assessed only once.

2 Answers 2

1

Both of those are right.

The main idea is that there is a contract which does the logic. This is the "wrapper contract" the first quote is referring to. If you don't use a contract, you have to send individual transactions which can only do one thing: transfer one token amount, for example.

There are two ways to transfer ERC-20 tokens: direct transfer with the transfer function or indirect transfer with a combination of approve and transferFrom. Usually, when trading, the second indirect method is used, but it depends on your needs.

If your contract owns the tokens you can simple make a function which looks something like this (if sending all to the same receiver):

function SendMultiple() public {
    tokenA.transfer(receiver, amount);
    tokenB.transfer(receiver, amount);
    tokenC.transfer(receiver, amount);
}
0

Just be aware that 21k is the amount of gas to send ETH (or MATIC, or BNB) from an account to another. Token transfer is another issue, it's about executing a function in a smart contract. I think answer number 2 confused things. Another issue is that the one who call the transfer function in a token contract MUST be the owner of the token, so a contract cannot transfer multiple tokens UNLESS the contract OWNS these tokens, as Lauri wrote above (but I think this should be emphasized).

If your question is whether it is possible to transfer 2 types of tokens through an external account with just one transaction, then the answer is no, it is not. Because you, with your account, need to access the contracts individually, calling the transfer function.

Your Answer

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

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