Eugene Oz
Eugene Oz

Reputation: 39

How to create a ‘feeless’ ERC20 token?

Is it possible to create a feeless ERC20 token?

Or paying fees through another address?

I have a solution in mind, to refund the transaction fee amount to receiver’s adress from a central address.

Any ideas?

Upvotes: 3

Views: 631

Answers (1)

Adam Kipnis
Adam Kipnis

Reputation: 11001

You can't have another address pay for transaction fees. You have two options:

  1. Create a centralized server that your app makes calls to which will then delegate all of the activity to your contract. However, this approach is centralizing your app when one of the goals of the blockchain is decentralization. It's up to you to decide if you're ok with this (For example, MetaMask is a popular tool, but that centralizes your provider...is that wrong?).
  2. As you said, you can refund the transaction fee back to the user. Have your contract track individual balances and periodically issue refunds. Your contract can hold funds (which you can replenish through an ownersOnly payable fallback function) and process refunds when appropriate. Be sure to follow appropriate withdrawal patterns.

Upvotes: 1

Related Questions