0

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.

0

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);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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