Skip to main content

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
0 answers
31 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
2 answers
64 views

how to verify the minimum gas fee for deploying a contract on the mainnet?

how to verify the minimum gas fee for deploying a contract on the mainnet? my contract creation failed in Remix IDE, I choosed estimated gas fee and the process were not successfully finished, is it ...
Morty's user avatar
  • 3
1 vote
0 answers
22 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
0 votes
0 answers
44 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
1 vote
1 answer
19 views

Transaction within block gas limits: Will it possibly run out of gas?

Is there any risk in running a transaction that needs quite some gas, even if always within the borders of block gas limits? Let's say 20M, with block limit being 30M. The transaction runs complex ...
user130657's user avatar
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
17 views

Execute functions of external contracts through chainlink automation contracts

I have two contracts. One is a contract that implements chainlink to obtain off-chain data. Part of its code is function requestConfig() public returns (bytes32 id) { Chainlink.Request memory ...
Leo's user avatar
  • 1
0 votes
2 answers
40 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
75 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
  • 1,254
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
3 votes
1 answer
87 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
51 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
783 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
0 votes
0 answers
62 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
37 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
1 vote
1 answer
50 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
35 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
1 vote
1 answer
64 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
132 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
148 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
134 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
  • 119
1 vote
0 answers
245 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
0 votes
2 answers
242 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
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
1 vote
1 answer
395 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
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
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
2 votes
0 answers
494 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
141 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
413 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
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
0 votes
0 answers
114 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
43 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
624 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
96 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
144 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
476 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
180 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
183 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
618 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
131 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
1 vote
0 answers
70 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
1 answer
2k 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
2 3 4 5 6