0

I can't quite find the answer I'm looking for.

The gas limit for the fallback function is 2300. Whether I call another method or set a variable, I blow WAY past the 2300 limit, rendering it useless.

Now, I've seen people suggest different ways to make the call and sending gas along with the call, etc., BUT I want someone to simply use the wallet.

Person A uses wallet to send the coin (presumably ether). Fallback function accepts the ether and returns some tokens.

At no point is there a specific call to send extra gas, because I simply want to make this as easy for the user as possible. Send ether via the wallet as they would normally send it to anyone. In this case, when they send to a contract address, they get something for it.

Is this possible or am I spinning my wheels for nothing?

Thanks!

  • 1
    Is there a specific tool/app you're testing that doesn't send enough gas? (Where/how do you see this failing?) – user19510 Aug 9 '18 at 23:40
  • I'm using remix.ethereum.org. When compiling, it's one of the warnings thrown. I'm no Solidity expert and I'm testing some bare-bones code, but it's a tad maddening. – Biffy McBiffy Aug 9 '18 at 23:57
  • I would ignore the warning and do some testing on your own of popular tools (wallets). I assume most send the right amount of gas. – user19510 Aug 9 '18 at 23:59
  • I do publish the contracts, but they don't work. Nothing about the amount sent suggests it goes toward gas, so it simply doesn't work. :/ – Biffy McBiffy Aug 10 '18 at 0:04
  • 1
    "They don't work" isn't a very good description of a problem. :-) If you're seeing an error message or failed transactions, please link to the transactions (if on a public network), share the source code, describe how you reproduce the bug, etc. – user19510 Aug 10 '18 at 0:05
0

I think you're spinning your wheels.

The fallback function and simple send is limited to 2,300 so it can't do very much, by design.

If you want to, say, set a state variable you must create a payable function that is explicitly invoked.

Hope it helps.

  • 1
    Thanks. I think this is the answer I need, even if it isn't the answer I want. – Biffy McBiffy Aug 11 '18 at 18:37

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.