[Ethereum] To pay for the gas for ERC20 token holders’ transactions

contract-developmentecrecovererc-20gas

I would like to make a ERC20 contract in which the contract owner will pay the gas for clients transactions (for example, to allow to transfer tokens between clients for free).

There is an excellent post about how to make a contract when a receiver of ethers pays for the gas: https://programtheblockchain.com/posts/2018/02/17/signing-and-verifying-messages-in-ethereum/
The idea in it is that the contract owner sends a signed transaction off-chain to receiver of ethers, and receiver calls some contract function passing the signature there and paying for gas actually. This function checks the transaction signature with ecrecover function, the owner address and transfers the appointed amount of ethers to receiver.

What if to add a similar new function to a ERC20 contract, which will accept both tokens sender's and receiver's address, the amount of tokens and sender's signature. This function will be called by the contract owner (who pays blockchain fee). The function will recreate the transaction, check sender's signature and address and transfer tokens from the sender to receiver (if verification is OK). Senders can send signed transactions to the contract owner off-chain.
I think it will work, but what about ERC20 compatibility?
Will it violate ERC20 standard rules or have any other security issues?

Best Answer

It might be little complicated, esp. if current EIP-20 interface needs to be honoured.

Currently Ethereum does not have a feature where a contract can pay for gas, which would make this more clean.

It is planned in the future:

https://github.com/ethereum/EIPs/pull/208

https://github.com/ethereum/EIPs/issues/865

Related Topic