Skip to main content

Questions tagged [out-of-gas]

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

75 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
1 answer
1k views

Deploying on contract on main net - Error: insufficient funds for gas * price + value

Running geth v 1.7.3 truffle 4.0.5 truffle-config.js module.exports = { networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id ...
Michael O'Rourke's user avatar
4 votes
0 answers
187 views

Did the ripemd precompiled contract get deleted?

A bug "caused account 0000000000000000000000000000000000000003 to be deleted in block 2675119, even though the deletion should have been reverted due to an out of gas error." Source Did account 0..3 ...
eth's user avatar
  • 86k
4 votes
0 answers
536 views

What's reverted and not reverted during an Out of Gas exception?

A seemingly crucial question on EIP 158 was unanswered: Unless the empty accounts are deleted even in the case of an EVM exception, if that is the case would that not break the guarantee that ...
eth's user avatar
  • 86k
3 votes
1 answer
89 views

Smart Contract/Nextjs Error: Returned values aren't valid, did it run Out of Gas?

I'm having an error while calling one of the function of the deployed contract from Next.js Error: Parameter decoding error: Returned values aren't valid, did it run Out of Gas? You might also see ...
Mohsin's user avatar
  • 31
3 votes
0 answers
72 views

Is EVM vulnerable to denial of service with out of gas in call to other contract?

if I call a function in a sub-contract and it runs out of gas, the gas is not completely consumed. Instead, it is returned to the calling contract. Could that be a vulnerability for a denial of ...
Mario HSMW's user avatar
3 votes
0 answers
508 views

Catch Internal Out of Gas Exception in Solidity Code

I ran this transaction which executed correctly, but one of the internal calls gave me back an out of gas error. I had a try/catch mechanism to let my code terminate silently (to set some really ...
Jason Trump's user avatar
3 votes
0 answers
391 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 ...
Cristiano Paris's user avatar
3 votes
0 answers
514 views

Contract not stored and out of gas in migration at Truffle ganache

I am facing this issue regularly while trying to migrate bunch of contracts but it get failed because of this issue . I am running over testrpc , i tried lot of recommendations over stack exchange and ...
Satyam Agrawal's user avatar
3 votes
0 answers
131 views

Assuming EIP140, is remaining gas refunded when a called contract throws?

Under EIP140 (REVERT) and assuming Solidity ≥0.4.10. If I call from my contract to a function on an external contract, and this external function does an invalid jump, does my contract still call ...
Remco's user avatar
  • 413
3 votes
0 answers
119 views

Wallet on private chain not watching contracts?

I set up an ethereum private chain for testing smart contracts a while back. Recently, I've been unable to deploy and interact with contracts successfully. Here is what used to work: 1) I created a ...
JamesEverette's user avatar
3 votes
0 answers
111 views

How did the "state clearing" transactions run Out of Gas?

"Failing to revert empty account deletions when the transaction causing the deletions of empty accounts ended with an out-of-gas exception" caused issues with consensus on November 24 2016. Usually, ...
eth's user avatar
  • 86k
3 votes
0 answers
199 views

"Removed tx from pool: low tx nonce or out of funds" on deploy empty contract

First, I know that there is a similar question, but maybe we're talking about different problems. I'm running geth-1.4.3-stable. My account balance is: 1808.90008114 ether I want to deploy a ...
Henrique Barcelos's user avatar
2 votes
0 answers
496 views

Is gasleft() the best way to manage big loops in solidity?

I'm developing an Smart Contract that has to iterate through an undetermined size list of ERC20 tokens, and make a swap for each token. I'm aware that you cannot loop an undetermined size list, ...
Alexander Herranz's user avatar
2 votes
1 answer
363 views

1) "before all" hook: prepare suite for " "

I am trying to create an Integrated test (to test multiple smartContracts working together). I re-initialize them inside beforeEach() function. So I get the clean test for each test case. I have done ...
Sky's user avatar
  • 2,332
2 votes
1 answer
171 views

Is gas cost of external calls included in gas cost of the main call?

When I call external methods of other contracts from my contract, is the gas fee of these calls included in the gas fee displayed by MetaMask? My transaction reverts (execution reverted) for an ...
porton's user avatar
  • 1,804
2 votes
0 answers
147 views

Populus cannot deploy contract related to estimated gas is not enough error

I am using populus. Platform darwin -- Python 2.7.12, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 Plugins: populus-1.1.0 OS: Mac OS X I do face with following error: for the following line on my test.py ...
alper's user avatar
  • 8,394
1 vote
0 answers
23 views

Web3.js returning out-of-gas on local node with high --rpc.gascap

I have a local Fantom API node (lachesis) that I start with a really high --rpc.gascap (over 5 billion), which should not be hit in theory. However, when I make an eth_call using Web3.js, it always ...
tim's user avatar
  • 21
1 vote
2 answers
801 views

Transaction fails due to: Insufficient funds for gas * price + value

I am trying to make transactions on Polygon Mainnet, but unfortunately when I automatically try to calculate the transaction fees, the transaction gets reverted because I assume that the fees are to ...
Dakata's user avatar
  • 255
1 vote
0 answers
246 views

hardhat-chai-matchers: How to distinguish if a transaction was reverted because it ran out of gas or other reason?

I'm trying to force a ran out of gas error and test it using the new Hardhat's assertion library, @nomicfoundation/hardhat-chai-matchers. First I tried a very low gas of 1: await expect(_attack.attack(...
Fabiano's user avatar
  • 183
1 vote
0 answers
50 views

How do Enzyme or Tokensets manage big amount of tokens (Solidity loops)?

There are 2 big project (Enzyme and Tokensets) that allow user to create portfolios with big amounts of tokens. You can add as much tokens as you want, always linked to a portfolio token that ...
Alexander Herranz's user avatar
1 vote
1 answer
18 views

why did this transfer transaction fail on eth?

https://etherscan.io/tx/0x8ad822a326243e69c4d5bcd3fe07466a82c2c00edbc53cbc0a211c6efbdd7dd2 checked ethgasstation and doubled the gas but it still failed, any ideas why it would?
user89380's user avatar
1 vote
0 answers
72 views

Out of gas exception though only 99% was consumed

We know one of our transactions consumes always 62_599 of gas, once we have decided to set the gas limit to 63_000 the tx has failed with out of gas exception. Right after we have increased the gas ...
tenbits's user avatar
  • 2,428
1 vote
0 answers
2k views

Error: Returned values aren't valid, did it run Out of Gas? (truffle, web3js)

why this error can occur? Error: Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, ...
Karelin's user avatar
  • 11
1 vote
0 answers
423 views

Gas-efficient string concatenation

My use-case requires that I feed my contract with a long string (Base64 data), which requires to split it and send it over several transactions so as to not reach gas limit. Then the contract rebuilds ...
Pm Rivière's user avatar
1 vote
0 answers
24 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 ...
C. O Ceallaigh's user avatar
1 vote
1 answer
87 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/...
matthias_buehlmann's user avatar
1 vote
0 answers
127 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 ...
Jordan's user avatar
  • 45
1 vote
2 answers
147 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 ...
Luigi Cerone's user avatar
1 vote
0 answers
203 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. ...
Khai Minh Trieu's user avatar
1 vote
0 answers
255 views

Transaction runs out of gas with MetaMask on a simple function

MetaMask calculated automatically the gas needed for every transaction, but for one in particular, it always returns the error "out of gas" if I use the default amount. The function is really simple ...
Teleporting Goat's user avatar
1 vote
0 answers
941 views

Why can I deploy my contract to the testnet, but not to the mainnet?

I deployed my smart contract to the ropsten testnet and everything worked fine. Now I wand to deploy it to the mainnet and I always get an error. How is that possible? What can I do? Setup Truffle ...
Nina's user avatar
  • 11
1 vote
0 answers
295 views

Constantly out of gas on testprc

I am trying to connect remix to testrpc, but anything at all I run there gives me an "out of gas" message. I started the testrpc using testrpc -l 4500000000000 So I would have thought it would be ...
urbanespaceman's user avatar
1 vote
0 answers
135 views

Function consumes all gas using TestRPC, but is fine in JS VM

So here's the function that's causing trouble: function init() { require(! isInitialized); isInitialized = true; bytes32[] storage votableGroups; bytes32 fullTimeHash = keccak256('...
Zefram Lou's user avatar
1 vote
0 answers
339 views

Adding payable to my contract constructor causes the contract deployment cost to be really high ~100 Ether

Here is an abstract/interface contract I created because I want to call this contract which will be deployed before my other contracts. It just holds the addresses of all the contracts I have deployed....
The Nomad's user avatar
  • 399
1 vote
0 answers
240 views

testrpc throwing 'out of gas' if same number of parameters passed while deploying as constructor

When I'm trying to deploy my contract on testrpc with correct parameters, it's throwing 'VM Exception while processing transaction: out of gas' exception. I deployed same contract on Ropsten and it ...
Mayank's user avatar
  • 11
1 vote
0 answers
447 views

Avoiding out of gas errors when making Oraclize queries that have callbacks which trigger more queries

I have a contract that I want to automatically check the price of ethereum everyday. right now I have a method called startContract which calls a function setConversion which makes a query set for 1 ...
Daniel Kobe's user avatar
  • 1,591
0 votes
0 answers
32 views

Returned error: gas required exceeds allowance (448144)

Here is my code, would you please verify what causes the problem for deployment on Remix (only on the eth mainnet)? Returned error: gas required exceeds allowance (448144) // SPDX-License-Identifier: ...
Morty's user avatar
  • 3
0 votes
0 answers
45 views

Why am I getting transaction out of gas error in remix ide for all my smart contract function?

This is my Smart Contract Code. I have tried increasing the gas limit in remix but to no avail the same error comes again // SPDX-License-Identifier: MIT pragma solidity ^0.8.2; import "hardhat/...
Shreyas Keni's user avatar
0 votes
2 answers
30 views

Why out of gas if it doesn't consume that much in the end?

I tried modify gas limit to a number I checked it should be enough to run transfer on USDT (62,800) but failed with "out of gas" error. When I send another transaction without modifying ...
zklim's user avatar
  • 1
0 votes
0 answers
12 views

Friction costs of storing data in a second smart contract

Whats the difference in terms of Gas of the two Scenarios described below? How much are the friction costs of storing data in a second contract compared to storing the number in the contract in which ...
PupSt4r's user avatar
  • 61
0 votes
1 answer
30 views

Tx is a Success but it say warning out of gas "Although one or more Error Occurred [out of gas] Contract Execution Completed"

// SPDX-License-Identifier: MIT pragma solidity ^0.8.12; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@...
Naveen Kumar's user avatar
0 votes
0 answers
64 views

`gas` vs. `gasLimit` fields

I am trying to submit a transaction with a gas limit set. In the documentation, I find a field referred to as gasLimit with the following description gasLimit – the maximum amount of gas units that ...
davidsawyer's user avatar
0 votes
1 answer
38 views

What is the recommended gas limit when minting NFTs on Ethereum?

I was trying to mint 70 NFTs at once and I set a limit of 8,700,000 but ran out of gas (wasted $300). What is the max limit we should set?
ratib90486's user avatar
0 votes
1 answer
36 views

I need some contracts about the gas vulnerability

I am working on detecting gas-related vulnerabilities in smart contracts, out of gas caused by excessive iteration and malicious loops , etc. If you have such contracts, please provide them to me, ...
simin chen's user avatar
0 votes
1 answer
133 views

" Returned error: intrinsic gas too low" trying to deploy a contract on rinkeby

I'm trying to deploy a contract on rinkeby testnet and I receive this error message: "Returned error: intrinsic gas too low". This is my code: web3.eth.getTransactionCount(address1,(err,...
Sergio Manuel's user avatar
0 votes
1 answer
26 views

Max addresses that can be cleared from an array before breaking gas

I've been trying to properly test this for about two days with issues here and there. I got to 240, and it errored out bc of Gas when i attempted to clear.. Good thats what i wanted to see..but I have ...
Bobo From Florida's user avatar
0 votes
0 answers
84 views

view functions error : Returned values aren't valid, did it run Out of Gas?

I'm calling the methods in the deployed smart contracts in Ganache. Other methods are working fine, but the view functions returns an error. Here's the view function in Solidity: mapping (address =>...
fabricdev's user avatar
0 votes
1 answer
254 views

How ERC 1155 standard prevents from "out of gas" error in batch operations?

I was checking the implementation of Openzeppelin's implementation of ERC-1155 standard and I'm curious about the use of _safeBatchTransferFrom function to transfer multiple tokens at once. The ...
Alexander Herranz's user avatar
0 votes
0 answers
72 views

remix.ethereum.org Crashes and Gas consume

I'm new on Blockchain. I'm trying make a simple NFT Collection of random SVG. I got the Random part covered. My question is about the math within a contract and Gas consume, to be more specific, 'for ...
brunovjk's user avatar
  • 115
0 votes
2 answers
306 views

High gas cost, still fails

I'm trying to deploy a smart contract to the Ethereum mainnet. I paid about $161 in gas fees before the transaction failed, because it ran out of gas. I tried again with a higher gas limit, and it ran ...
Lucas Popp's user avatar