1

I'm generating a one-time address for each order in my store, and the order is payed with an ERC-20 token.

Is there any way I could sweep the tokens from this address, without an additional transaction to deposit some ether first (that will later cover the gas required to transfer the tokens)?

1

No, right now you can't pay for transactions using ERC20 tokens.

There's the ERC 865 proposal to have this functionality, but it is not yet implemented.

If you are the one implementing the ERC20 token, the best you can do would be to add a custom function which can be called only by the owner of the smart contract, or by an admin, which would be able to transfer tokens from arbitrary addresses.

This owner/admin account would need to have ETH available to make the transactions though. Also, the people using the token would need to trust that the owner/admin won't transfer the tokens from their accounts.

  • I'm thinking that instead of having the admin/owner arbitrarily move balances, the contract could expose a custom transfer function that accepts a transfer from A to B if A's signature is included as an additional transaction parameter. This transaction will be sent from B's account, so B would pay the gas. – Lucian Boca May 10 '18 at 7:43
  • skimming through the discussion in that ERC 865 thread, I think they actually have a solution to that trust issue I pointed out. – Tudor Constantin May 10 '18 at 7:48

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.