Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [out-of-gas]

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

0
votes
1answer
12 views

Sending funds to a possible smart-contract

When sending funds to an Ethereum address, Should my wallet check in the blockchain whether the address is associated with a smart contract? In order to choose the gas limit automatically. If someone ...
1
vote
1answer
77 views

Out of gas error for a view function

having a problem with calling a method of my deployed contract in the main Ethereum network. I have a 'view' function which returns user's refund balance, everything worked fine in my local ...
0
votes
0answers
14 views

Direct token invocation works, indirect invocation gives Transaction ran out of gas

When i invoke the function mint directly on the ERC20Token it works as expected. However when i invoke via the TokenManager.mint i receive an out of gas expection. I am running a local parity client, ...
1
vote
1answer
75 views

Running out of gas during a deploy due to a large number of require() statements?

I have a smart contract that has a fair number of functions, but a large number of require() statements because I carefully check every incoming parameter and some intermediate calculation results too....
1
vote
2answers
35 views

transaction fails due to out of gas in mainnet

Transaction fails due to out of gas though gas used by transaction is 22.32 % . What might be the reason ? I have give enough gas : 203000 wei. Here is the link of the transaction
1
vote
1answer
52 views

What should be optimal gas limit and gas price for 80 addresses airdrop?

This is my airdrop function: mapping (address => bool) public airdrops; function airdropTokens(address[] _recipient, uint256[] _tokens) public onlyOwner{ uint airdropped; for(uint256 i = 0; i< ...
1
vote
1answer
390 views

Truffle contract deployment either exceeds block gas limit or out of gas

I've been having the same issue when I was trying to deploy a contract using truffle develop console. The contract is not extremely big but does initiate two other contracts when called a certain ...
1
vote
1answer
26 views

Why aren't costs “advertised” or at least knowable so funds aren't lost?

I'm admittedly new to all of this, but as I learn about the transaction model, it seems to be a confusing business model at the very least. I can understand that the price of gas fluctuates or can be ...
2
votes
2answers
514 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 ...
3
votes
1answer
24 views

Contract design by contract -> correctness and maximum gas consumption

This question is a general design question that regards contract correctness and the functions I list here are just examples. As I develop on Ethereum, it becomes aparent to me that it might be ...
1
vote
1answer
22 views

Supply gas from contract to execution of function

let's say I have something like this function usuallyCheapFunction() external { ... do something cheap... if(rareCondition == true) { expensiveCleanupFunction(); } } function ...
1
vote
1answer
21 views

Loop with upper bound of iterations / loop variant

Is it possible somehow to create a loop that solidity will recognize as having an upper bound of iterations for gas estimations? Something like a loop variant in Eiffel (https://www.eiffel.org/doc/...
3
votes
2answers
73 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 ...
0
votes
1answer
37 views

Contract deployment out of gas, but was created anyway?

I have deployed a contract with Parity on Kovan, which did not show up in the contracts menu after contract deployment was done. I had to watch it manually to be able to see it in the contracts menu. ...
0
votes
1answer
63 views

The contract code couldn't be stored when deploying to rinkeby

I was finally able to get some ether funded and geth/mist working and now i am getting the following error when attempting to deploy my contracts to the rinkeby test network. My project is based on ...
1
vote
0answers
67 views

Gas requirement of contract deployment

I've recently been running into issues with contract deployment (receiving "Error: VM Exception while processing transaction: out of gas" during migration). It's been my understanding that the ...
1
vote
2answers
46 views

Returning dynamic arrays: out of gas

I'm trying to return a dynamic array of structures from a Solidity function to a client. Since I need to build the result, I'm declaring a storage variable and add elements to it: function ...
2
votes
1answer
84 views

Unable to deploy contract that uses Oraclize. Out of gas

I'm trying to deploy a smart contract that uses Oraclize on the Ropsten TestNet using truffle. It seems that deploy the Oraclize api contract (imported by my contract) it's too costly and causes the ...
0
votes
2answers
269 views

“The transaction execution will likely fail. Do you want to force sending? VM Exception while processing transaction: out of gas”

When I want to deploy a contract using testRPC and remix, I receive the following error message: Gas estimation errored with the following message (see below). The transaction execution will ...
0
votes
2answers
25 views

Analize gas usage and contract design

Suppose that I've the following contract code: pragma solidity ^0.4.23; contract pensCollection{ struct Pen{ uint productCode; address ownerAddress; } address public ...
0
votes
1answer
40 views

Reverted tx on Ropsten but gas limit not reached

This is a timed crowed sale contract https://ropsten.etherscan.io/tx/0xaa3fa69a32060ad578cb9bc2a94fcc4cf7109f4e743f54c527c18f764f634ebb Error encountered, bailing. Network state unknown. Review ...
0
votes
0answers
154 views

Not enough gas while gas used is less than gasLimit

I got a problem while sending erc20 tokens. After the transactions is signed and sent, it returns "please provide more gas" error. The "gasUsed" is 28814 but gas limit is set to 150k. I'm using web3....
0
votes
0answers
25 views

initialising and accessing 2D memory array in solidity

I am working on a piece of code that looks like function doSomething(uint someNumber, uint numberofRows){ uint[][numberofRows] some2dArray; // declaration is opposite ...
0
votes
0answers
31 views

How do i get to return value form one smart contract function into another smart contract on private ethereum network?

Here it is my called function. pragma solidity ^0.4.19; contract Called{ string public name; function set(string _var) { name = _var; } function get() view returns (...
0
votes
2answers
68 views

mapping with struct array, gas or performance issue?

I have a question regarding iterating a mapping with struct array. There is a for loop that iterates over a few thousands times trying to find a matching properties inside the struct. Ex: struct ...
0
votes
0answers
66 views

why this simple function cause out of gas error on TestRPC?

thanks for any suggestions. function withdraw() public { if(votes[msg.sender].voteRound == curRound){ numTotalVotes = numTotalVotes - votes[msg.sender].numVotes; numVoteAddrs--; ...
2
votes
0answers
105 views

delegatecall on library always run out of gas

I'm trying to replicate the Dynamic Library attack of this paper under a recent version of solidity and the EVM. Streamlining down the code, I've created this very simple contract (which is, in ...
1
vote
1answer
165 views

Calling external contract leads to infinite gas need

I'm trying to implement this pattern: contract Producer { uint8 public SOME_VALUE=12; } contract Consumer { Producter currentProducer; function setProducer(address addr) { currentProducer = ...
4
votes
1answer
266 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(...
0
votes
1answer
131 views

How to fill a big array of structs

I'm quite new to Solidity and want to fill an array with 240 structs. I have a struct: struct Country { string name; uint level; uint attackPower; uint defensePower; ...
0
votes
1answer
77 views

Out of gas transaction is included in the blockchain even if it is reversed?

In my private testnet, I sent a transaction that runs out of gas before completion, which can be seen from gasUsed: 28666 = gas: 28666 and failure status: "0x0",. I thought it would not be ...
0
votes
1answer
55 views

Is it possible to run out of gas in a method before reaching the self-destruct call?

I'd like to implement a self-destruct method for a smart contract that pools money from people as a last resort. Before calling self-destruct, I'd like to refund all the money to the users and send ...
0
votes
2answers
708 views

vm exception while processing transaction : out of gas

I already read the other topics with the same error, but that didn't solve my problem ... When I try to communicate with test rpc between my web interface with my smart contract I have always error "...
0
votes
0answers
141 views

How to see log of an event?

I set the entire of a payload via an event as follows and i get transaction hash. However in transaction hash I cannot see the value of payload. How can I see that? event setPayloadEvent(uint256 ...
1
vote
1answer
242 views

Transaction failed due to “out of gas”

I sent Ether to a contract but the transaction failed due to "out of gas". How do I complete the transaction I am trying to make? I sent the ether from my NanoS wallet to the XYO contract.
0
votes
1answer
560 views

how to solve VM Exception while processing transaction: out of gas

i am trying to call this function with help of web3.js in ganache testrpc but it is giving me error of VM Exception while processing transaction: out of gas i have tried to increas gas of ganache to ...
1
vote
0answers
164 views

Showing “We couldn't estimate the gas” error in estimated fee consumption field while executing a contract in ethereum wallet

i don't know what is the problem sins it is my first time. and i just took and test just how it works but then it say that “We couldn't estimate the gas” error so i don't know what is the problem is. ...
0
votes
0answers
159 views

Fallback function requires too much gas (infinite)

Here a simplified example which reproduces the issue with the minimal code pragma solidity ^0.4.19; contract Forwarder { address owner; function Forwarder() public { owner = msg....
0
votes
1answer
28 views

Calling a function to zero out struct data in a mapping costing more gas than other calls, causing out of gas error

I am working with the following function and state vars: struct TimeRestriction { uint256 fromTime; uint256 toTime; } mapping (address => TimeRestriction) public whitelist; function ...
1
vote
1answer
85 views

What is the general cause for out-of-gas with MetaMask?

This seems like a trivial question, but I can't find an answer. When you try to send a transaction with MetaMask, it calculates the amount of gas needed. Most of the time if there's an error in your ...
0
votes
1answer
355 views

Remix IDE - transact to ___ errored: VM Exception while processing transaction: out of gas

pragma solidity ^0.4.18; contract Testing { address public owner; function Testing() public { owner = msg.sender; } function() public payable { } function withdrawAll() public { ...
0
votes
1answer
38 views

A transaction is stuck?

This transaction will reach the recipient? Or not? https://etherscan.io/tx/0x99fb756ea14c57989827e7c9a49c6aa68d5ff2a7b8fd3faecd3021c2dece3115
1
vote
1answer
474 views

`ecrecover` throwing out of gas error on Ropsten

Here : http://solidity.readthedocs.io/en/v0.4.21/units-and-global-variables.html , It states It might be that you run into Out-of-Gas for sha256, ripemd160 or ecrecover on a private blockchain. The ...
0
votes
0answers
62 views

Sending ether from contract cause error

Hi In my contract I send ether from my contract to other address like address.transfer(winnerAmount);. It transfer ether successfully if my array have one address. If I have more than one address it ...
0
votes
0answers
131 views

Web3 estimateGas and solidity gas requirement differs

hi in my web3 js I calculated gas requirement using MyContract.myFunction.estimateGas and the result is 29031. Then I do the transaction by setting that much amount of gas but it throws out of gas ...
1
vote
1answer
48 views

Cannot get out of gas exception when calling external contract

I'm trying to move storage of my contract into Storage contract with this code contract Storage { struct Block { address landlord; uint sellPrice; } Block[101][101] ...
1
vote
1answer
174 views

OUt of gas duringcreation of contract

I tried to create a smart contract (Token ERC20) with this web IDE : https://remix.ethereum.org Everything was good. I taked te same contract and i tried to deploy it with node application by using ...
0
votes
1answer
62 views

Error with wrong calculation of gas price and value after lots of iterations

I am trying to code something that empties an address and sends that amount to my main-wallet. In order to get familiar with sending raw transactions and manually setting the eth-amount, I've tried ...
0
votes
1answer
149 views

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 my Bittrex wallet via my Jaxx wallet. Below is the transaction id. Could someone please help me out, ...
0
votes
1answer
153 views

Can a contract run out of gas?

If a contract is to send a given amount of tokens or ether to lets say, 10,000 different addresses, will it run out of gas? If so, what will happen?