I would like to create a contract that can be used without ether.

Is it possible to create a function in a contract that pays for its own gas?

I am aware that this leaves the door open to abuse and that a troll will probably call the function until there is no ETH left.

But for the sake of argument: is it technically possible?


Currently this isn't possible. The nearest to this you can get is a contract that refunds the cost of the transaction.


Not possible, today, but I have seen indications that it's contemplated for the future.


Should be part of the Metropolis release according to this post of Vitalik (last sentence)

EIP 86 (account security abstraction) – move the logic for verifying signatures and nonces into contracts, allowing developers to experiment with new signature schemes, privacy-preserving technologies and modifications to parts of the protocol without requiring further hard forks or support at the protocol level. Also allows contracts to pay for gas.


What you asked is going to be the part of the SERENITY. Currently, Ethereum is HOMESTEAD, then there shall be METROPOLIS, & later SERENITY. so at least a year, you should consider.

Please check this video: https://www.youtube.com/watch?v=OQtRzhgHEBg

In this video, Hudson is talking about self-paying contracts @10:18, exactly your requirement as I see.

Hope this helps.



AFAIR it's not possible. The one who calls contract method (unless it's constant) pays price of the gas that was used during the transaction.

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.