Call ERC transfer with ETH from another account (i.e. meta-transactions) #1279
-
I want to transfer an ERC20 token from accountA to accountB but only accountC has ETH (for gas fees). Can I call |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
ATM, tx fee is debited from the balance of the one who signs a transaction.
Sending doesn't require a wallet, just a URL of node (RPC URL). Ethers js has a handy way to to that. const provider = ethers.providers.JsonRpcProvider('rpc-url-of-the-node');
await provider.sendTransaction('0xSerializedTransaction'); Just wanted to make it clear that there is no role of Possible solutionsYou can extend ERC20 contract, by adding a method called I think I have read some proposals to get this done natively in ethereum so that no extra functionality is required in the contracts (each function would need a |
Beta Was this translation helpful? Give feedback.
-
No, you can't do that, if that would be possible, anyone could spend anyone else's tokens! The only way you could do that is if you 'APPROVE' AccountC to send the token from AccountA to AccountB (or approve AccountB to take it). However that would still need AccountA to make a transaction anyway (to approve account B or C), so that wouldn't really help you much. |
Beta Was this translation helpful? Give feedback.
ATM, tx fee is debited from the balance of the one who signs a transaction.
Sending doesn't require a wallet, just a URL of node (RPC URL). Ethers js has a handy way to to that.
Just wanted to make it clear that there is no role of
accountC
in the process of sending the transaction to the network.Possible solutions
You can extend ERC20 contract, by adding a method called
transferBySig
that takes receiver, amount and signature. Recently there was interest about the same idea in ethereum/EIPs#3055. But t…