2

I tried making a eth transaction to poloniex. However, I keep getting the error that I ran out of gas. How can I avoid this? Do I have to keep increasing the GWEI? Until what number?

Here a screenshot from etherscan:

enter image description here

7
  • Could you provide some code?
    – user9402
    Jun 9, 2017 at 12:15
  • @Eric I added a screenshot form the error I am getting. Jun 9, 2017 at 12:19
  • Getting closer, could you show the actual contract/function code?
    – user9402
    Jun 9, 2017 at 12:37
  • @Eric where can I see this? Jun 9, 2017 at 12:55
  • what exactly you are trying to execute? Show us txid, contract function that you are trying to execute. What gas limit you are setting and gas price. Have u tried to estimate the current gas cost for the contract you are trying to execute.
    – rstormsf
    Jun 9, 2017 at 17:28

3 Answers 3

1

I found this whole "how much gas do I need?" issue very annoying as well.

I think I figured it out, and the amount is different depending on whether you are sending ether or sending tokens...

  1. Sending Ether to Another Address: It costs maximum 0.001 ether for gas fee when sending ether to another address, so always subtract 0.001 ether from the ether amount you are trying to send to ensure that you have enough ether for gas fee! It may not be exactly 0.001 ether that is eaten up in gas fee, but if you use 0.001 as a standard, you will find that if you are left over with any ether still in the sender address that it should be a very very small amount.

  2. Sending Tokens to Another Address: It costs 0.01 ether to send ERC-20 tokens. So when sending tokens, make sure that you have at least 0.01 ether lying around to pay your gas fee!

Hope this helps. It seems to work for me :)

Regards, Homer Simpson

2
  • 2
    Purely anecdotal and obviously no longer holds true.
    – Madbreaks
    Jan 15, 2018 at 20:21
  • 1
    Incorrect answer, with no supporting evidence. May 9, 2018 at 9:58
0

I am curious what could the transaction to Poloniex be, it seems not to be Ether transfer (gas is not 21000) nor ERC20 token transfer (ETH value is not zero).

Gas fees vary, so it is not forever safe to recommend a single constant, but at the time of writing this safe median gas price is considered 21 GWei, with confirmation expected within 2 blocks (about a minute). As per Eth Gas Station safe low (if you do not mind waiting for hours) is currently 1 GWei gas price (unsafe low, when you do not know if the transaction gets through in reasonable time or at all, is zero). In this view your gas price (~20 GWei) is more than enough.

What is too low and what caused the error in your case is gas limit (as indicated by the red "Out of gas"). It is the maximum value you are willing to pay for the transaction. If the actual gas consumed by the transaction surpasses this value, the transaction fails. Lowering this value does not save you money; it is only an insurance that the transaction does not get crazy and consume all your Ether. For Ether transfer the cost has been set to exactly 21000 gas, ERC20 token transfer takes maybe 100-150k gas, depending on the particular smart contract, so your gas limit should be above that.

0

use 100000 gwei the metamask man said and it solved my issue

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.