Questions tagged [out-of-gas]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 views

gas estimation error because of reverted

here is a situation I have: a user came to my platform to buy mytoken and he paid 44 matic for it and 266,087 | 263,663 (99.09%) which reverted because of the gas out. is there any solution to add gas ...
Helia Marami's user avatar
0 votes
1 answer
28 views

Gas griefing in "typed" external calls

I was wondering whether the "insufficient gas griefing attack" is possible in cases when the external call is a typed call rather than an inline call with lower level utility functions (i.e. ...
Mila A's user avatar
  • 264
0 votes
1 answer
22 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
3 votes
1 answer
50 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
0 votes
1 answer
32 views

MetaMask - failed transaction, maximum gas rate suggested is to low

I recently bought a code for a coin flip game and I have been modifying it while I learn to program. I have reached the point of launching the website but when I play and approve the transaction I ...
VelasTiger's user avatar
1 vote
2 answers
97 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
  • 205
0 votes
0 answers
34 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
12 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
0 answers
29 views

How to design a contract which has independent vesting period for each stake so that it won't run of out gas?

I have a game contract which users can send soldiers. The action of sending soldiers is pretty much identical to staking, and so I'm going to just call it staking for familiarity's sake. Each stake ...
xenon's user avatar
  • 447
1 vote
1 answer
36 views

How do RETURN and MLOAD work for high offsets?

When trying to load the 32 bytes of memory that follow a high offset (say 0x12345678), the RETURN and MLOAD opcodes give an out of gas error. Why is that ? Example PUSH1 0x20 PUSH4 0x12345678 RETURN ...
Sileo's user avatar
  • 139
0 votes
1 answer
31 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
0 answers
362 views

Please Help! Warning! Error encountered during contract execution [execution reverted]

After deploying Simple Arbitrage Contract I am trying to deposit eth but deposit is not happening and Debug is showing value 0 wei. While depositing only transaction fee is deducted from metamask not ...
Shakil Hasan's user avatar
1 vote
1 answer
50 views

Smart contract has stopped working well (runs out of gas)

I created an ERC20-compliant token with a tax and redistribution mechanism and deployed to the Bitgert chain and it has worked fine for days now. It stopped working well yesterday and efforts to ...
King Einsteinet's user avatar
0 votes
1 answer
112 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
1 vote
1 answer
121 views

Geth gas limit decreases over time in private PoA network

I have deployed a PoA network with geth, setting gaslimit to 0x1fffffffffffffff in genesis file. When starting mining and over the time, I have realized gaslimit in each new block decreases. I have ...
WakiApi's user avatar
  • 33
1 vote
1 answer
124 views

Out of gas ethernaut lvl 10 - reentrance

I'm trying to solve Ethernaut level 10 reentrancy task, but I'm getting "out of gas" error. https://ethernaut.openzeppelin.com/level/0xe6BA07257a9321e755184FB2F995e0600E78c16D This is my ...
GiorgiSh's user avatar
  • 109
1 vote
0 answers
213 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
  • 173
0 votes
2 answers
183 views

Error during Ethereum solidity NFT contract execution [Out of gas]?

We have a Rinkeby contract for minting NFTs. Occasionally, when it's in public-sale mode, if a person attempts to mint an NFT, the transaction fails and on the tx's etherscan it says: Warning! Error ...
DeeFisher's user avatar
  • 103
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
76 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
1 vote
1 answer
308 views

Can gas limit get increased while transaction is executing?

Suppose that we have a transaction that calls a contract method with an i.e. 200,000 gas limit. While the transaction is mining, the called contract finds out that it will run out of gas before ...
Ehsan Khodarahmi's user avatar
0 votes
1 answer
248 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
1 vote
0 answers
49 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
2 votes
0 answers
422 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
0 votes
2 answers
121 views

What if a dynamic call at the end of a function uses all the remaining gas of the caller?

Suppose we have a contact like this: contract x { function y() external { // do some magic! if (some_condition) { another_contract_address.call(abi.encodeWithSignature("...
Ehsan Khodarahmi's user avatar
1 vote
2 answers
358 views

Gnosis safe transfer from contract fails with EIP2930 "Out of gas"

I'm trying to transfer eth from a contract to multiple wallets + a gnosis safe and I'm using EIP2930, but the transaction is still failing due to out of gas. If we use type: 2 export const ...
Efesus's user avatar
  • 51
0 votes
0 answers
69 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
264 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
0 votes
0 answers
100 views

executeTransaction function's estimated gas limit was not enough to execute the transaction

When I executed a transaction with executeTransaction function then it failed on Ethereum Mainnet due to out of gas but when I tried again then it succeed. I compared the gas limits of both the ...
chakshu jain's user avatar
3 votes
2 answers
1k views

Cannot tranfer() ETH to Gnosis Safe

I'm praying to the blockchain gods that somebody answers us.   I'm with a NFT collection. We ran our pre-sale the last 2 days and collected 56.925 ETH. The smart contract address with the withdraw ...
jremi's user avatar
  • 141
0 votes
1 answer
40 views

Doubt regarding out of gas issue for large data sets

Will this function cause any issues on chain how ever large the mapping becomes? Thank you. mapping (uint256 => TradeHistory[]) public allTrades; //Trade details structure struct TradeHistory {...
Sundeep Kumar's user avatar
2 votes
1 answer
548 views

Transferring ETH from contract to Safe

I made a small oversight and didn't account for the Berlin hard fork which increased gas costs for transferring ETH between contracts. I reused a previously tested withdrawETH function that works with ...
Ape Toshi's user avatar
  • 311
0 votes
1 answer
89 views

Avoiding transaction failures in truffle migration to mainnet

I am trying to deploy my smart contract with truffle and an Infura HDWalletProvider. Here's my dry run (I edited/shortened it for brevity): Migrations dry-run (simulation) =============================...
wrightcode's user avatar
0 votes
1 answer
140 views

Sending ethers in bulk to an array of addresses - advise on gas price and execution

Would bulk transfers work without failure/revert even if the below for loop is for 50,000 to 100,000+ accounts in bidders array? mapping(address => uint) public bidderAmount; address[] public ...
toddash's user avatar
  • 92
1 vote
1 answer
40 views

If gas limit is too low is still part of the contract executed? [duplicate]

Basically my question is, let's say a smart contract requires 50k of gas and I set my gas limit to 25k, is it an atomic operation or does it execute part of the contract until gas runs out?
Pedro's user avatar
  • 55
1 vote
1 answer
1k views

What is the gas limit for a view function call *not made from a contract*?

So this question seems trivial but I can't find any comprehensive answer, though reading through: Is there a gas limit for view requests? Why view/pure functions need gas? Exceeds block gas limit ...
ClementWalter's user avatar
1 vote
1 answer
444 views

Transfer to gnosis safe through contract failing due to out of gas errors

We have a contract deployed on the mainnet at this address, we are trying to withdraw the ETH from it to a gnosis safe at this address which is failing due to out-of-gas exceptions tx1. We tried using ...
Doggo's user avatar
  • 41
0 votes
1 answer
175 views

Why does one transaction fail with "Out of gas" while another tx succeed with the same gas limit?

During a recent NFT mint (contract), approximately 50 out of 920 transactions failed with an "Out of gas" error. We discovered users with failed transactions used the same settings as others ...
Anonymous Aardvark'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
1 answer
145 views

Running out of gas before draining target completely using reentrancy exploit [closed]

Recreated the reentrancy exploit (somewhat) successfully on ganache. Unable to drain the target completely owing to out-of-gas error occuring midway. Hence have currently limited the drain. Though a ...
TaherBorsadwala's user avatar
0 votes
1 answer
534 views

Out of Gas error on deploying a contract on mainnet with enough ethers in account

I am facing issues while deploying my contract on the main net. I have tried the below contract deployment on rinkeby and ropsten without any issue. But when I am deploying this contract to the ...
wolvorinePk's user avatar
0 votes
0 answers
127 views

Same function gives different gas cost

I'm trying to run a function repeatedly and it sometimes fails and sometimes passes, it's almost 50-50. I have already read this but it doesn't help in my case. Putting the code for reference. struct ...
cyberhawk's user avatar
0 votes
0 answers
61 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
  • 1,964
1 vote
1 answer
1k views

Why is my contract so expensive to deploy?

I've tried to deploy a contract based on openzeppelin library (see below). The fee I paid is about $146 and the contract didn't even deploy(i.e it run out of gas ). I find this unbelievable high. It ...
goldish-boar's user avatar
1 vote
1 answer
398 views

mstore8 assembly instruction makes call goes out of gas

My solidity code example: // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.2; library TestLibrary { function sz_varint(uint256 i) internal pure returns (uint256) { uint256 ...
user84917's user avatar
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
0 votes
0 answers
164 views

Out of gas & Exceeds block gas limit, but contract size <24KB

I've 2 contracts I'm trying to deploy on mainnet-fork, but I keep getting this error: VirtualMachineError: out of gas When I try to increase the gas limit, I get this: ValueError: Exceeds block gas ...
Alexandre Martens's user avatar
0 votes
1 answer
121 views

"Migrations" ran out of gas after x blocks mainnet

I trying to deploy my contract but I cant. After deployed in ropsten and development, for some reason I can't deploy to mainnet. Truffle v5.3.3 (core: 5.3.3) deploying... after compilers compilers: {...
GIA's user avatar
  • 137
0 votes
1 answer
38 views

deploying dydxexchange/solo: '"OperationImpl" ran out of gas'

I'm trying to deploy the 'solo' (https://github.com/dydxprotocol/solo) After cloning [email protected]:dydxprotocol/solo.git and resolving all dependencies Contracts compilation is successful, however ...
Lior Koren's user avatar
4 votes
3 answers
636 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

1
2 3 4 5 6