Can a contract somehow buy more gas from its own funds to make a method call cheaper for the user?

javjav Member Posts: 3
I haven't seen anything like that in the documentation, so I'm assuming that's not possible, correct?

Alternatively: Are there any instructions which actually cost negative gas, like freeing up memory? Then one could allocate a bunch of memory in an earlier call and free it up in the current call to lower the gas cost of this later call. Would be pretty inefficient though, I guess. Or aren't there any such instructions?

Best Answer

Answers

  • javjav Member Posts: 3
    I was more thinking of not needing the user to specify a higher gas limit when calling a contract. Sending them ether back afterwards doesn't really help with that, but you are right, it would of course reimburse them.

    Total negative gas costs isn't what I'm after either, so that's not a problem. I played around a little bit with freeing up storage and it seems to offset gas cost somewhat, but I couldn't really get gas costs to below 90000 even when freeing up large amounts of storage. Not quite sure how the mechanics of that work. So I'm giving up on this workaround for now, I guess users will just have to pay the gas costs.
Sign In or Register to comment.