Bitcoin Forum
May 13, 2024, 05:37:55 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [Need help] What should be done when the transaction fails due to "Out of Gas"?  (Read 207 times)
Henri Cartier (OP)
Full Member
***
Offline Offline

Activity: 236
Merit: 117



View Profile
February 20, 2020, 11:11:47 AM
 #1

Recently, I did a transaction and it got failed due to out of gas. So I increased the gas limit and resent many times but still, it did not go through. Below is the error I am getting on the blockchain -



The transaction id is - 0x3300f036d11577ca2e171f7fca295442c6344cb5e8fe9a68b0ae474c8a517bce

Please help me, what should I do in this case?

1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
1715621875
Hero Member
*
Offline Offline

Posts: 1715621875

View Profile Personal Message (Offline)

Ignore
1715621875
Reply with quote  #2

1715621875
Report to moderator
DdmrDdmr
Legendary
*
Offline Offline

Activity: 2310
Merit: 10759


There are lies, damned lies and statistics. MTwain


View Profile WWW
February 20, 2020, 12:05:56 PM
 #2

Take a look at the other TXs around the time you sent yours:
https://etherscan.io/txs?a=0xe0b7927c4af23765cb51314a0e0521a9645f0e2a&p=9 (find your TX here, or in the following pages, since more TXs may have been added since I wrote this post).

Check the Gas limit and Gwei they used (*) by those that passed as a commited TX. You’ll see that they use a larger gas limit (and way lower Gwei too, so you can lower your value). Tokens normally require higher gas limits, and your’s is below those I’ve seen.
The TX on some of those went through with around 37,467 Gas used (you used a limit of 34,693).

(*) Look at the parameters in the "click to see more" section of TXs (this is yours https://etherscan.io/tx/0x3300f036d11577ca2e171f7fca295442c6344cb5e8fe9a68b0ae474c8a517bce).
akhjob
Sr. Member
****
Offline Offline

Activity: 1050
Merit: 416


Buy Bitcoin


View Profile WWW
February 20, 2020, 12:57:34 PM
 #3

Either the gas limit and gwei are low as mentioned above or the tokens might have been locked.

Edit: Just checked your address 0x26cfe324f40817e9fe8c6d1262c82a74e010ff9a. Looks like the issue was fixing low gas limit and your have moved the tokens. Please close the topic as issue was resolved.
rosezionjohn
Sr. Member
****
Offline Offline

Activity: 882
Merit: 301


View Profile
February 20, 2020, 03:37:15 PM
 #4

A good way to avoid having this 'out of gas' error is to always check the allowable gas at a particular time or the 'safe low'. You can see it on sites like https://www.ethgasstation.info I usually add one or two more gwei to the safe low in case the gas fee suddenly increases while I'm trying to send. Sometimes I would just follow the standard for faster tx confirmation.
hosseinimr93
Legendary
*
Offline Offline

Activity: 2394
Merit: 5237



View Profile
February 20, 2020, 04:05:21 PM
Last edit: February 20, 2020, 04:28:38 PM by hosseinimr93
Merited by DdmrDdmr (1)
 #5

The best thing you can do to avoid such error in future is to use bigger amounts for gas limit.
Note that the extra gas will be sent back to your wallet. So you won't lose anything if you use bigger amounts than needed for the gas limit.

The transaction fee is calculated as follows:
Transactions fee = used gas * gas price

The confirmation time and fee depend on gas price and has nothing to do with gas limit.

If a transaction needs 50,000 gas to be made and you use 200,000 gas, the 150,000 extra gas will return to your wallet. So, I recommend you to use big amounts for the gas limit and use ETH Gas Station for gas price.

If you use bigger amounts than needed for gas price, you will waste your Ethereum. But you lose nothing if you use bigger amounts than needed for gas limit.

For making a transaction, you need to have gas limit * gas price in your wallet. But the amount finally deducted from your wallet is used gas * gas price.



.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
February 20, 2020, 04:48:25 PM
 #6

A good way to avoid having this 'out of gas' error is to always check the allowable gas at a particular time or the 'safe low'. You can see it on sites like https://www.ethgasstation.info I usually add one or two more gwei to the safe low in case the gas fee suddenly increases while I'm trying to send. Sometimes I would just follow the standard for faster tx confirmation.

Have no idea how ethereum works but I had to use dai and I just use 1 gwei every time I want to send something... Seems to confirm within an hour and I don't care about fast transactions so...
hosseinimr93
Legendary
*
Offline Offline

Activity: 2394
Merit: 5237



View Profile
February 20, 2020, 05:13:37 PM
Merited by o_e_l_e_o (1)
 #7

Have no idea how ethereum works but I had to use dai and I just use 1 gwei every time I want to send something... Seems to confirm within an hour and I don't care about fast transactions so...

1 Gwei is what you used for gas price. The transaction will finally be confirmed even if the gas price is 0.1 Gwei

1 Gwei = 10-9 Ethereum

The problem OP faced is not due to low gas price. That's due to low gas limit. If the gas limit is lower than gas needed to be used, the transaction will be failed even if the gas price is 1000 Gwei.

Gas price is something like Sat/byte in bitcoin transactions.

A big difference of Ethereum with bitcoin is in size of the transaction.
In bitcoin transactions, you don't need to enter the size of transaction. But in Ethereum you must do that.
Used gas is something like size of transaction.

In bitcoin transactions:
Fee = size (in byte) * (Sat/byte)

In Ethereum transactions:
Fee= used gas * gas price

For making a transaction in Ethereum blockchain, you must enter a value for gas limit. The gas limit must be bigger than gas needed to be used. Otherwise, the transaction will be failed.
The gas that is not used (extra gas) will be sent back to your wallet.

In most of Ethereum wallets, the gas limit is automatically entered by the wallet and that's why you haven't faced any problem till now.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bitmover
Legendary
*
Offline Offline

Activity: 2296
Merit: 5942


bitcoindata.science


View Profile WWW
February 20, 2020, 11:29:50 PM
 #8

I made this topic log ago about how to use the gas system I  ethereum

Take a look. You need to increase gas limit, but you can use a low gas price.

Some time ago I participated in an Initial Coin Offering (ICO) and they defined the following parameters for Eth contributions:
Maximum Gas Price: 50 Gwei
Gas Limit: 150 000
I made a little research to learn what these attributes means.

Gwei, Wei and Ether are different unit measures of the same thing.
1 Ether = 1.000.000.000.000.000.000 Wei
1 Wei is the smallest unit of Ether, as 1 Satoshi (0.00000001 BTC) is the smallest of Bitcoin.

All computational work of running Smartcontracts or transactions in the Ethereum Network are paid in Ether (Eth), which is the fuel of that network.
Gas is a unit of measuring this computation work, which is usually measured in Gwei.
Some amount of Gas is charged for every computational operation in the Etehreum Network. For example, and addition costs 5 Gas.

Gas Limit and Gas Price attributes define the total cost of your transactions, according to the formula below:
gas limit * gas price

Gas Price: Amount of Gwei you are willing to spend per unit of gas.
Gas Limit: Maximum amount of units of gas you are willing to spend on a transaction.

From my ICO example, if the Gas Price is 50 Gwei and the Gas Limit is 150.000, this transaction will cost 7.500.000 Gwei (or 0.0075 Eth).

To determine what is the gas price, just check out this website
https://ethgasstation.info/

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
LbtalkL
Full Member
***
Offline Offline

Activity: 1176
Merit: 162


View Profile
February 20, 2020, 11:59:21 PM
 #9

Take note Gas limit is different from Gas Price, Some tokens requires higher Gas limit enable to transfer their tokens.  If this will happen to you again or this problem is not fixed yet, try to search the contract address of the token on etherscan and look for successful transaction and look what gas limit and gas price they used and copy and try it. That should went through, there are some cases also that out of gas means the token are locked but with this case I guess your token is not locked you need to increase Gas Limit I have seen successful transfers on 80k Gas limit. and for gas price used recommended here ethgasstation.info
hosseinimr93
Legendary
*
Offline Offline

Activity: 2394
Merit: 5237



View Profile
February 21, 2020, 04:19:21 AM
Last edit: February 21, 2020, 04:58:23 AM by hosseinimr93
Merited by Henri Cartier (1)
 #10

-snip-

No, that's not how transaction fee is calculated.

Transaction fee is not gas limit * gas price. Transaction fee is used gas * gas price.

Given the amount of gas limit, there are two cases.

  • If the gas limit is lower than gas needed to be used, the transaction will be failed and gas limit * gas price will be wasted.
  • If the gas limit is bigger than gas needed to be used, the transaction will be made. Used gas * gas price will be deducted from your wallet and extra gas * gas price will return to your wallet.  
    (Extra gas = gas limit - used gas)
    In this case, the transaction speed only depends on gas price and has no relation with gas limit or used gas.

Take a look at the transaction OP made.
https://etherscan.io/tx/0x3300f036d11577ca2e171f7fca295442c6344cb5e8fe9a68b0ae474c8a517bce

In this transaction, gas limit is 34,693 and gas price is 0.00000075 Ether (750 Gwei). Gas limit was less than gas needed to be used and transaction was failed.  
34,693*0.00000075= 0.02601975 was wasted.

According to what is shown in etherscan, the OP increased the gas limit and finally made the transaction.

Take a look at this transaction.
https://etherscan.io/tx/0xf7c65f88608ae4ecf9e9277c6edb9eaf6a717a0c2c40c1e6b318431052f59a7d

In this transaction, gas limit is 65,817 and gas price is 0.0000000066 Ether (6.6 Gwei).
As the gas limit was bigger than gas used, the transaction was successfuly made.

The fee paid for this transaction is not gas limit * gas price. The fee is used gas * gas price = 43,878 * 0.0000000066 = 0.0002895948 Ether
In this transaction, the used gas was only 43,878 which is 66.67% of the gas limit and the extra gas was sent back to the wallet.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
libert19
Hero Member
*****
Offline Offline

Activity: 2492
Merit: 943



View Profile WWW
February 21, 2020, 04:26:57 AM
 #11

Use ethgasstation to estimate gas price (or use wallets like mew where they estimate automatically for you), 750 gwei way too much and unnecessary while the gas limit for token transfers should be 200k.

Repeat the transfer with 10 gwei gas price and 200k gas limit, it should go through.

███████████████████████████
███████▄████████████▄██████
████████▄████████▄████████
███▀█████▀▄███▄▀█████▀███
█████▀█▀▄██▀▀▀██▄▀█▀█████
███████▄███████████▄███████
███████████████████████████
███████▀███████████▀███████
████▄██▄▀██▄▄▄██▀▄██▄████
████▄████▄▀███▀▄████▄████
██▄███▀▀█▀██████▀█▀███▄███
██▀█▀████████████████▀█▀███
███████████████████████████
.
.Duelbits.
..........UNLEASH..........
THE ULTIMATE
GAMING EXPERIENCE
DUELBITS
FANTASY
SPORTS
████▄▄█████▄▄
░▄████
███████████▄
▐███
███████████████▄
███
████████████████
███
████████████████▌
███
██████████████████
████████████████▀▀▀
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
.
▬▬
VS
▬▬
████▄▄▄█████▄▄▄
░▄████████████████▄
▐██████████████████▄
████████████████████
████████████████████▌
█████████████████████
███████████████████
███████████████▌
███████████████▌
████████████████
████████████████
████████████████
████▀▀███████▀▀
/// PLAY FOR  FREE  ///
WIN FOR REAL
..PLAY NOW..
Henri Cartier (OP)
Full Member
***
Offline Offline

Activity: 236
Merit: 117



View Profile
February 21, 2020, 12:05:36 PM
 #12

Thanks, everyone for the help. The issue has been resolved.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!