0

I need some assistance. I am working on a smart contract that will allow a user to save a string (mapping(address=>string)). The only problem, I would like the contract to pay for the gas for the user to save the string. Any idea on how to

  • This is not very common. A way that you could do it would be to have the contract send the user the approximate amount of ETH used to run the transaction at the end of your function. – brad mcallister Jul 09 '19 at 18:31

2 Answers2

0

This is a proposed feature but not yet implemented: https://github.com/ethereum/EIPs/issues/1776

This feature is known as meta-transaction: the sender of the transaction doesn't pay for gas.

While there is no native way to conduct meta-transactions yet, there are third-party efforts to implement it, searching the web with meta-transaction keyword should yield useful stuff.

Ferit
  • 8,692
  • 8
  • 34
  • 59
0

Have a look at the Gas Station Network Alliance: https://blog.zeppelinos.org/gas-station-network-alliance/

Depending on your use case, if you don't need to save strings directly on chain, an alternative would be something like Peepeth - microblogging with a soul. Peepeth batches signed messages stored in IPFS and anchors the batched data on chain: https://peepeth.com/a/free

abcoathup
  • 456
  • 3
  • 7