Stack Exchange Network

Stack Exchange network consists of 175 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
10 views

Metamask Failed transaction when sending out BAT tokens

I've been trying to send some BAT tokens out of my metamask wallet for quite awhile and it keeps eating up all my eth gas fees. I even increased the gwei fee to 100 and paid .50 USD as the fee. And it ...
1
vote
0answers
20 views

Why is one of my transactions using more gas when both carry out the same function of sending ether?

Below are two functions that I have in a simple lease smart contract. I am running a TestRPC node with Remix on version 0.5.1. When I call the terminate function, it executes and terminates the ...
0
votes
0answers
63 views

About gas limit and gas

I'm developing Dapp, In that app one function consuming a gas but I am providing sufficient ether at the time of initiating transaction by web3 for the Dapp Users,Then also it is showing out of gas ...
0
votes
1answer
23 views

Possible replay attack when paying to smart contract

I am afraid of a possible replay attack when paying to a smart contract. Given these 3 assumptions An action gas cost may change according to the state of the blockchain (even if its the same action)....
1
vote
1answer
34 views

why use up all the gasLimit when use assembly and revert together?

try to call erc20 token's transferFrom() using assembly(to save some gas), code like this: pragma solidity ^0.4.24; contract TestAssemblyAndRevert { function test(address from, address to, ...
1
vote
1answer
14 views

What is the advantage and disadvantage of deploying Erays on Ethereum?

I have read this paper, Erays: Reverse Engineering Ethereum's Opaque Smart Contracts. They proposed this reverse engineering tool for Ethereum smart contracts. it will take as input a compiled EVM ...
0
votes
1answer
19 views

Can transaction fail after being sent?

I wonder what would happen in following hyphotwtical scenario. Transaction is being sent with blockchain state A. In this state transaction consume 100_000 gas and sender has enough funds to pay for ...
0
votes
0answers
23 views

Matching inside my contract fails with multiple participants

my contract (can be found on my gist: https://gist.github.com/fabs993/e13fa6ecd9526d30c8a6d85c10180075) fails at more than 5+ participants. So in my use-case I have two kind of participants Producer ...
0
votes
1answer
20 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
321 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 ...
2
votes
1answer
196 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
68 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
63 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
551 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 ...
3
votes
2answers
711 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
26 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
26 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
22 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
94 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
41 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
73 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 ...
0
votes
0answers
30 views

Strange question about call triggering out of gas

pragma solidity ^0.4.23; contract hello{ uint time; function getInfo(address a, uint b, address c, bytes d) returns(bool){ time = now + b; return true; } } contract test{...
1
vote
0answers
85 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
54 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
92 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
469 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
26 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
45 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
214 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
31 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
33 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
73 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
69 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
127 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
194 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 = ...
5
votes
1answer
297 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
174 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
86 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
63 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
868 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
156 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
245 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
631 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
169 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
169 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
29 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
101 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
389 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
39 views

A transaction is stuck?

This transaction will reach the recipient? Or not? https://etherscan.io/tx/0x99fb756ea14c57989827e7c9a49c6aa68d5ff2a7b8fd3faecd3021c2dece3115