0

Is there anything solidity in line that would let a contract with ETH assigned to, to pay gas.

Say I want something simple.

contract whatever {
uint256 one;
uint256 two;

function execute() public {
one = one + two;
//execute contract side
}
}

Does something like that exist? I checked the solidity docs, couldn't find anything to my knowledge.

5
  • No (and it's probably one of the most common questions on this website). Jan 2, 2021 at 10:33
  • It's really not and you can check for yourself. Jan 2, 2021 at 10:38
  • I must have seen in here it like 20 times before (one of them was actually yesterday if I remember correctly). Jan 2, 2021 at 10:46
  • 1
    You could set the contract to send back some ETH after a successful TX but you will never be able to perfectly match the gas 1:1
    – D3l_Gato
    Jan 2, 2021 at 15:22
  • Related: ethereum.stackexchange.com/questions/144/…
    – eth
    Feb 15, 2021 at 10:19

1 Answer 1

0

It seems the only way to have "gasless" txs go through contract side is through the implementation of OpenGSN - https://docs.opengsn.org/

Some of their examples are totally broken and I will update the answer with more relevant information on how to easily do it in a code snippet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.