1

I have a ERC20 token on a wallet called ETH (Ethereum Meta) but I don't have any ETH on that address so I can't transfer the ERC20 tokens because I cant pay the gas fee. I have some ETH on another address. I don't want to send/deposit my ETH to the wallet that have the ERC20. so what I wanted was to know if it was by any way possible to pay the gas fee from another wallet? or let the receiver of the ERC20 pay the gas fee??

1 Answer 1

1

What you want isn't entirely possible, but there are edge cases that could help.

No, one account can't pay the gas fee for another accounts transaction at the lowest level in Ethereum. You would, in most cases, need to transfer the ETH from that account to the account that needs to do the other transaction.

However, ERC20 tokens do have the approve and transferFrom methods. With these, the account holding your ERC20 tokens could approve the account with ETH to transfer its assets, paying the ETH fees for the transfer. (using transferFrom). This does, of course, requires that the ERC20 account has already paid the ETH fee to do a transaction calling approve. If you haven't done that, and can't, then the other account wont have the allowance to do a transferFrom. At least, usually.

There are even more specific cases though where contracts allow you to set an allowance without needing to call approve from the ERC20 account at all. An example is USDC (current implementation), specifically the permit and transferWithAuthorization functions.

The former allows the USDC account to sign a message off-chain that says that another account can call the permit function to set the allowance themselves, once. This is good if the approved account is then expected to transfer multiple/many times in the future without needing further approval/interaction with the USDC account holder.

The transferWithAuthorization function is similar, but the USDC account signs a message that allows the other account to transfer up to a specific amount just once. This would be good for you if you just wanted to transfer all of the USDC out of an account one time.

In both of these cases, your USDC account wouldn't need any ETH to transferred to it to get the USDC fully out. However these aren't standard ERC20 functions. Some contracts may follow USDC and have them, some may implement similar but different methods, and most ERC20s don't have this at all.

2
  • 1
    Could he sign a transaction with the account holding ERC20 tokens and let account with ETH broadcast it to the network?
    – Sky
    Apr 3, 2022 at 17:29
  • 1
    @Sky No, an actual transaction on the Ethereum blockchain will pay the fee from the signer of the transaction. There isn't a way to pay for someone else's raw transaction, though some smart contract wallets like Gnosis Safe enable the ability to do so. There are also EIPs for implementing account abstraction that may enable it, but they are as of yet not implemented
    – natewelch_
    Apr 3, 2022 at 17:32

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.