1

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!

5
  • 1
    Is there a specific tool/app you're testing that doesn't send enough gas? (Where/how do you see this failing?)
    – user19510
    Commented Aug 9, 2018 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. Commented Aug 9, 2018 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
    Commented Aug 9, 2018 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. :/ Commented Aug 10, 2018 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
    Commented Aug 10, 2018 at 0:05

1 Answer 1

1

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
  • 2
    Thanks. I think this is the answer I need, even if it isn't the answer I want. Commented Aug 11, 2018 at 18:37

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.