Skip to main content

Questions tagged [out-of-gas]

exception generated when computations consume all the gas available to a transaction

Filter by
Sorted by
Tagged with
40 votes
2 answers
18k views

How do I detect a failed transaction after the Byzantium fork as the REVERT opcode does not consume all gas?

Pre Byzantium fork, I could use gas == gasUsed to detect when a transaction has failed (further details in How can the transaction status from a thrown error be detected when gas can be exactly the ...
BokkyPooBah's user avatar
  • 40.3k
27 votes
4 answers
6k views

Why does a Solidity throw consume all gas?

When you throw an exception, all gas is consumed. What is the rationale for this design decision?
Peter Hall's user avatar
27 votes
7 answers
21k views

Truffle deployment on test network says: Error: exceeds block gas limit

I'm trying to deploy a sample contract (following this guide) but I'm receiving an error of not enough gas. I changed the numbers a little but could not fix it. I saw this question in stack exchange ...
Bush's user avatar
  • 445
22 votes
5 answers
42k views

How to know if a transaction went through or not? (out of gas)

Apparently when sending transactions from an Account instead of a Wallet, the gas spent is small (21K), and not enough to send ether to a Contract Wallet (out of gas, so to speak). When this happens, ...
knocte's user avatar
  • 1,949
21 votes
3 answers
5k views

Does an entire transaction revert when throw occurs?

I have a contract that calls another contract that calls another. If there is a throw (or out-of-gas error) that occurs somewhere in the second contract, does the entire transaction get reverted or is ...
ZMitton's user avatar
  • 2,770
21 votes
1 answer
846 views

Out of Gas invoking precompiled contracts on private blockchains

Why do precompiled contracts lead to Out of Gas on private blockchains? Some tidbits are provided in the Solidity docs but can it be explained more? It might be that you run into Out-of-Gas for ...
eth's user avatar
  • 85.9k
19 votes
1 answer
8k views

How to clear large arrays without blowing the gas limit?

As posted by redditor ethererik in the post GovernMental's 1100 ETH jackpot payout is stuck because it uses too much gas, 1,100 ethers are stuck in limbo because the payout of this GovernMental ...
BokkyPooBah's user avatar
  • 40.3k
18 votes
1 answer
8k views

What happens if transaction runs out of gas before transaction completes?

As gas cost can only be estimated until the transaction is executed against the actual contract state at the time of execution on the blockchain, what happens if transaction runs out of gas before the ...
zanzu's user avatar
  • 5,360
15 votes
5 answers
5k views

How do I know when I've run out of gas programmatically?

This keeps coming up on the gitter forums so I thought I'd ask and answer this question: How do you know when you've run out of gas?
Paul S's user avatar
  • 4,281
15 votes
3 answers
2k views

How come I need to specify a higher gasLimit than estimateGas?

If a contract call predictably requires 41043 of gas to be processed as estimated by estimateGas, how come I need to specify gasLimit of ~70000 to be processed?
Ales's user avatar
  • 915
15 votes
2 answers
19k views

Error: VM Exception while processing transaction: out of gas

I am running into out of gas exception while calling this function : contractInstance.createProposal("ADHD", "Foo", 2, {from: web3.eth.accounts[1]}) . I'm super new to ethereum and I would really ...
itachi's user avatar
  • 153
13 votes
2 answers
5k views

What does a "bad JUMPDEST" error mean?

When I send a transaction to call my contract, it's causing a bad JUMPDEST error. The Ethereum wiki says this error is caused when a JUMP instruction jumps to a location that wasn't marked as a jump ...
Niran Babalola's user avatar
13 votes
1 answer
3k views

Out of gas during contract creation

A few days ago, several attempts at creating a contract failed with out of gas errors (confirmed by etherscan/ethercamp and getBalance API), however it is not clear to me what failed exactly, and how ...
fair glu's user avatar
  • 365
11 votes
4 answers
10k views

simulate transaction without sending to blockchain

Is there any way to simulate a transaction without sending it to the blockchain and find the exact error (or line of code), in case it fails if its mined?
Sowmay Jain's user avatar
11 votes
1 answer
1k views

How to avoid/detect multiple internal transaction out-of-gas side effects?

Following an issue I opened in github, this bothers me. The operation described in the issue, which happened during following avsa's tutorial on creating a DAO, generated two internals transactions as ...
kobigurk's user avatar
  • 413
9 votes
2 answers
3k views

Who gets the fee from contract call?

Basically you don't need to pay fee for contract call, but if a contract method does lots of work, you need to add gas in contract call to prevent DoS attack like this: contract.method.call({gas: ...
Satoshi Nakanishi's user avatar
9 votes
2 answers
591 views

Why doesn't the Ethereum protocol have an indicator for a transaction that failed?

Why doesn't the Ethereum protocol have a clear indicator for a transaction that is reverted? There's a heuristic here as well as a workaround using Geth. But there are probably ways that the ...
eth's user avatar
  • 85.9k
8 votes
2 answers
3k views

All cases when Solidity compiles to invalid jump destination

Solidity generates EVM bytecode that leads to an invalid jump destination when: throw is used ... ? ... ? Can the above list be completed, with examples? To explain the first item, throw in ...
eth's user avatar
  • 85.9k
8 votes
2 answers
1k views

Why is an account not accepting the Ether sent to it?

If you check out the account 0xe358b3b9f29c67cb810c5184e6fde27d66ce036c you will see several incoming transactions with 100 Finney each. Yet the overall balance is 31 Finney. How is that possible? If ...
q9f's user avatar
  • 32.9k
8 votes
1 answer
828 views

Why is my TX failing due to lack of gas even though the correct amount of gas was supplied?

Caveat: I tried to provide links to my transactions and addresses in etherscan.io, but I "need at least 10 reputation to post more than 2 links." I have an account that I want to sweep. I want to ...
vogelito's user avatar
  • 211
8 votes
1 answer
17k views

What to do if I get "Warning! Error encountered during contract execution [Out of gas]"

Hoping someone can help me,I(ve sent some ETH from my Nano S to Poloniex, and it didn't go through. Etherscan says: Warning! Error encountered during contract execution [Out of gas]. The value ...
cdribbe's user avatar
  • 81
7 votes
3 answers
5k views

Out of gas when calling contract method - Browser Solidity & Metamask

Trying to call sendFundsToFriend() method on the testnet contract https://testnet.etherscan.io/address/0xce8efd03766a309af57ddeb9c79f3e7cd23da0df (contract code at https://gist.github.com/anonymous/...
Juan Ignacio Pérez Sacristán's user avatar
7 votes
3 answers
498 views

How do I handle the last step in getting more gas in The DAO withdraw process?

I've gone through he entire process here and am hung up on this last step; it says I don't have enough gas to execute the withdrawal. What do I do here? step by step would be super helpful!! thanks!! ...
Johnny Be ReallyGood's user avatar
7 votes
2 answers
6k views

Token transfer: Intrinsic gas too low

I have created a cryptocurrency by following this link .I have deployed the contract in Mist. I am using transferFrom() function in Ethereum wallet to transfer currency from one account to other but ...
Prashant Prabhakar Singh's user avatar
6 votes
3 answers
5k views

Truffle solidity tests: out of gas & exceeds block gas limit

I am trying to run some basic test w/ my contract, written with Truffle's Solidity tests (tests written in Solidity). When runninng truffle test, I get Error: VM Exception while processing ...
lajarre's user avatar
  • 375
6 votes
1 answer
578 views

What happens when I send a transaction that exceeds the gas limit of 3,141,592?

What happens when I send a transaction that exceeds the gas limit of 3,141,592? Will the transaction be transmitted to the network but never confirmed? If my gas cost is 4,141,592 for example can 3,...
Enricho Abato's user avatar
6 votes
2 answers
4k views

How does a Smart Contract know the gas/fees needed to execute a transaction?

I installed recently Solidity for Visual Studio and they have this Smart Contract sample there: contract Payout { address Victor; address Jim; address Kieren; mapping (address => uint) ...
Resten's user avatar
  • 533
6 votes
1 answer
640 views

Is it possible that the block gas limit will drop below its current level?

As I found here (What is Gas Limit in Ethereum?) and here (The Ethereum gas limit seems prohibitively low. Will it ever be raised? If so, when and how?), the gas limit is gradually growing (as the ...
takeshi's user avatar
  • 1,760
6 votes
2 answers
1k views

Should correct transaction nonce be one less than account transaction count?

I am trying to solve the 'Why am i getting “removed tx from pool: low tx nonce or out of funds”?' problem on my private test net. I seem to have enough funds however the rejected transaction nonce ...
Jack Thorp's user avatar
6 votes
2 answers
593 views

Transaction Gas Payment - Out-of-Gas Exception

When a function in a contract is called, if the gas limit is not enough, the out-of-gas exception occurs and the sender loses his gas. How to know in advance how much gas enough for any arguments ...
Chan Ngo's user avatar
5 votes
4 answers
43k views

My transaction failed due to running out of gas. Can I recoup this money?

My transaction failed due to running out of gas. Can I recoup this money? I was trying to send to Monaco card via my token wallet. Below is the transaction id. For some reason, it charged me £159 for ...
J ROSWELL's user avatar
5 votes
2 answers
669 views

How do you implement PubSub without running out of gas (attack vector)?

A simple PubSub pattern involves an array of subscribers. Anyone can subscribe. A publish function will do something for each subscriber. Can you spot the attack vector...? contract PubSub { ...
Raine Revere's user avatar
  • 3,610
5 votes
1 answer
491 views

Do nodes by default relay transactions that fail and spend all gas (e.g. Solidity throw)?

How do nodes (not necessarily miners) treat transactions that result in Solidity throw (i.e. Out Of Gas error, transaction reverted)? Such transactions' only effect is gas (ether) transfer from the ...
mazi's user avatar
  • 443
5 votes
1 answer
419 views

Out of gas and atomicity

I am reading the Solidity by example voting example. I am interested in the vote contract function: function vote(uint proposal) { Voter sender = voters[msg.sender]; require(!sender.voted); ...
Randomblue's user avatar
  • 2,620
5 votes
1 answer
184 views

How can I see the payouts of this Ponzi scheme dapp?

Towards the very beginning of the Ethereum release, a friend participated in a Ponzi scheme dapp by sending 1 ETH here. He was among the first! For some reason, it seems he has not received any ...
Randomblue's user avatar
  • 2,620
5 votes
3 answers
4k views

ERC20 :: Transferring tokens without sender gas

Let's assume we have 50 ERC20 tokens that we would like to support (deposits) on our website. People are depositing tokens to the ETH adresses we've generated for them. In the end of the day, we want ...
susanoo's user avatar
  • 51
5 votes
1 answer
2k views

How to minimize gas consumption during contract creation

I have trouble deploying a contract to the main network and I believe this is due to high gas consumption. An earlier version of the contract worked on the main network. The current version works in ...
Max Binnewies's user avatar
5 votes
2 answers
1k views

calling a contract function from another contract [out of gas]

Consider the following two contracts A and B. Suppose I store these in a and b. Then when I make a call and try to pass two addresses as follows: a.reqswap(b.address,eth.accounts[0],eth.accounts[1]) ...
user813's user avatar
  • 331
5 votes
1 answer
712 views

Transaction out of gas but gas used less than gas limit

I have this method on a contract that I'm testing on rinkeby function addMatch(string _name, uint _fixtureId, uint8 _home, uint8 away, uint _start) public onlyOwner returns (uint8) { require(...
InfinityCounter's user avatar
5 votes
1 answer
88 views

Is the Ethereum Subtleties page correct about value transfers under exceptions?

On the Ethereum Subtleties page (largely maintained by VB) it states the following under Exceptional Conditions: If a transaction triggers an exception, then: The value transfer from ...
benjaminion's user avatar
  • 9,297
5 votes
3 answers
389 views

Trying to get a refund from my DAO results in "out of gas"

I'm trying to get the ETH refund from my DAO, following the instructions here (but with Parity 1.4.4). The approve transaction is here. But I already tried to send the withdraw transaction twice, in ...
knocte's user avatar
  • 1,949
5 votes
1 answer
617 views

Out of gas exception: error when using GUI/JS but not within truffle

I'm trying something with Ethereum and my current testing environment is Truffle. In the smart contract I have a struct with 5 fields (bytes32, bytes32, bytes32, address, bool). If a call a function (...
gatb27's user avatar
  • 350
4 votes
2 answers
4k views

If Metamask Gas calculations are nearly perfect why do we still get out of Gas error?

Pardon me if this question seems a bit naive. I have written a smart contract (for proof of existence) and simulating it in Ganache. Inside it I have logic to store data in a mapping created between ...
tanmay's user avatar
  • 428
4 votes
1 answer
6k views

Out of gas problem with transaction

I had some small amount of ether remaining in one of my accounts so I decided to send everything to the DAO. But the contract execution failed with an exception - out of gas. I was trying to ...
Jiri Peinlich's user avatar
4 votes
1 answer
2k views

Specifying gas amount for contract call from JavaScript

I'm making this call from JavaScript to the contract function. contracts['CrowdFunder'].contract.contribute({value: web3.toWei(0.000000000000000005, 'ether')}); The function is called, but the error ...
Bogdan's user avatar
  • 397
4 votes
3 answers
704 views

Ethernaut level 20 Denial probably no longer solvable. Why?

I solved all levels of Ethernaut game except level 20 Denial: https://ethernaut.openzeppelin.com/level/0xcE1BB92eeb71AF5Fec09D38B0c854d55285f6e04 Eventually, I gave up and looked up the solution on ...
SmilingHeretic's user avatar
4 votes
1 answer
406 views

How to simulate out of gas events on a private blockchain?

I want to get the error message "Intrinsic gas too low" during a eth.sendTransaction call. Is it possible to simulate the condition of having run out of gas in a private blockchain scenario? Can ...
erictsang's user avatar
4 votes
1 answer
528 views

Buy function not working with solidity 0.4.2

I don't know if there is any such change in latest Solidity version that is preventing execution of this function: function buy() returns (uint amount){ amount = msg.value / buyPrice; ...
Prashant Prabhakar Singh's user avatar
4 votes
1 answer
435 views

Out of gas in subcontract

If I send ether from contractB to contractA, then get error "out of gas". Increase the amount of gas does not help. In "VM Trace Transaction" http://testnet.etherscan.io/vmtrace?txhash=...
SkyN's user avatar
  • 175
4 votes
1 answer
1k views

Can't deploy a contract that calls another contract

When I run the below code when connected to geth --dev --mine, the output is: A transmitted, waiting for mining... aAddress: 0xbaxxxxx4ae42d B transmitted, waiting for mining... bAddress: ...
redsquirrel's user avatar

1
2 3 4 5 6