0

I would like to send some tokens (ERC20) and I was wondering is there some kind of way (command line, programmable way?) so that the receiver of tokens pays the gas in ETH? If not do you think that something like would be possible in the future?

Thanks very, very much.

-1

Short answer is no.

Detailed answer here: Ethereum gas explained

I am not aware of your idea, but you can calculate gas and request it back from the contract.

| improve this answer | |
  • Thanks but how do I request gas price back from the contract? – Tomesupp Jan 22 '18 at 17:25
  • Hello @Tomesupp. Sorry, I meant to calculate estimated gas (no reason to calculate gas price.) So, you can: 1. calculate estimated gas - gas estimation 2. send tx -> get tx receipt -> get gas spent -> send tx with gas request – Vanja Dev Jan 24 '18 at 9:45
2

Or, alternatively what you can do is to have a withdraw function that can be called by the recipient. By this, the Gas will be consumed by the recipient, and the token distribution also will be done accordingly.

EDIT

The high-level steps are outlined as below.

  1. Create Contract that has the state variable of address => value mapping.
  2. Assign values of which address to receive how many tokens.
  3. Create a function in which you validate the sender address is present in the mapped variable.
  4. If the person is assigned already (eligible), then call the token.transfer function to transfer the tokens from the token owner to the message sender.
  5. You will have to create a page which may use web3 service provider (preferably metamask) to execute the function call. When metamask used, the gas required to execute the transaction can be modified by the person that calls it and the transaction price will be of them.
| improve this answer | |
  • Thanks for the answer, but how do I do that? What kind of withdraw function has to be called by recipient? – Tomesupp Jan 22 '18 at 17:24
  • Have edited the answer with outline steps. Check and let me know if you need further info. – Rajesh Jan 23 '18 at 5:03

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.