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:
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
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...
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.
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
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.