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

1
vote
1answer
32 views

TX fails in private blockchain when trying to access an ERC20 contract from another contract

I have an ERC20 contract and I am trying to access it from another contract, which is a Faucet. In the Faucet I have a function to query an account's balance, and another one to transfer some tokens ...
0
votes
2answers
31 views

Out of Gas Exception on Tobalaba

I deployed the same contract to Rinkeby, Ropsten and Tobalaba networks. Rinkeby and Ropsten work fine, but the contract execution on Tobalaba fails because of an out-of-gas exception: https://tobalaba....
0
votes
0answers
26 views

Transaction to Smart Contract runs out of gas on Ropsten but not on Rinkeby

the following execution of my smart contract function runs out of Gas on the Ropsten network, but works fine on Rinkeby, do you have an idea why this happens? struct vehicleData{ string ...
1
vote
1answer
65 views

Error set address/adding data, error: “gas required exceeds allowance or always failing transaction and the function doesn't work”

I'm trying to do a data access control system with smart contract. I have 3 entity: Client: who can get data and set address of Oracle Oracle: who can add data and have getData() function RBAC: Role ...
1
vote
1answer
58 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
72 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
32 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
38 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
16 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
20 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
24 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
21 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
444 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
301 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
116 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
68 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
725 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
891 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
27 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
2answers
41 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
100 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
46 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
80 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
93 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
68 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
101 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
602 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 ...
1
vote
2answers
31 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
51 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
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
80 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
73 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
138 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
196 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
326 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
221 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
95 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
70 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
992 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 "...
1
vote
1answer
280 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
680 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
171 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
1answer
30 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
119 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
418 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
1
vote
1answer
491 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 ...