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
18 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 ...
user avatar
0 votes
0 answers
30 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 =>...
user avatar
1 vote
1 answer
27 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 ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
  • 636
0 votes
0 answers
12 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 ...
user avatar
  • 636
0 votes
0 answers
38 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, ...
user avatar
  • 636
0 votes
2 answers
44 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 majic! if (some_condition) { another_contract_address.call(abi.encodeWithSignature("...
user avatar
0 votes
0 answers
17 views

How many transferFrom function executions can be done in one transaction? (airdrop use case)

I'm developing a dApp, with an Smart Contract, to be able to send multiple tokens at once, in order to save gas (like https://cryptomultisender.com/). The tasks are pretty simple: Take an array of ...
user avatar
  • 636
0 votes
0 answers
9 views

Is it possible for a contract to subsidise gas costs for contract call execution?

Is it possible for a contract to increase gasleft() from its own ether balance to subsidise a contract call during runtime/execution? A contract could quasi-subsidise a call by transferring however ...
user avatar
  • 230
1 vote
2 answers
111 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 ...
user avatar
  • 41
0 votes
0 answers
33 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 ...
user avatar
0 votes
2 answers
50 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 ...
user avatar
0 votes
0 answers
34 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 ...
user avatar
2 votes
2 answers
507 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 ...
user avatar
  • 131
0 votes
1 answer
22 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 {...
user avatar
0 votes
0 answers
61 views

withdraw in Re-entrancy attack throws (Although one or more Error Occurred [out of gas] Contract Execution Completed)

I am a programming novice and was trying Re-entrancy attack on my own contract, but whenever I call withdraw, it makes a lot of internal trxs and each one of them fails with "out of gas", ...
user avatar
  • 1
1 vote
1 answer
205 views

Transferring ETH from contract to Safe

I made a sleep-deprived oversight and didn't account for the Berlin hard fork which increased gas costs for transferring ETH between contracts. I copy-pasted a previously tested withdrawETH function ...
user avatar
0 votes
1 answer
57 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) =============================...
user avatar
0 votes
1 answer
39 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 ...
user avatar
  • 62
1 vote
1 answer
23 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?
user avatar
  • 35
0 votes
0 answers
39 views

Testnet, "error: out of gas" when calling other contract's function within contract

so i tried to use address.call(abi.encodeWithSignature("function()")) in my caller contract to call the callee contract's function. It seems every time i deployed it into testnet and then i ...
user avatar
1 vote
1 answer
375 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 ...
user avatar
1 vote
1 answer
196 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 ...
user avatar
  • 41
0 votes
1 answer
100 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 ...
user avatar
1 vote
1 answer
15 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?
user avatar
1 vote
1 answer
71 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 ...
user avatar
0 votes
1 answer
168 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 ...
user avatar
0 votes
0 answers
67 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 ...
user avatar
0 votes
0 answers
33 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 ...
user avatar
  • 183
1 vote
1 answer
558 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 ...
user avatar
0 votes
0 answers
22 views

How to troubleshoot Out of gas transaction?

In a contract, sometimes the transaction passes and sometimes it fails. The gas limit and gas price is the same in both cases, yet sometimes it fails and sometimes it doesn't. How could i troubleshoot ...
user avatar
1 vote
1 answer
115 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 ...
user avatar
1 vote
0 answers
1k 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, ...
user avatar
  • 11
0 votes
0 answers
128 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 ...
user avatar
0 votes
1 answer
91 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: {...
user avatar
0 votes
1 answer
26 views

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

I'm trying to deploy the 'solo' (https://github.com/dydxprotocol/solo) After cloning git@github.com:dydxprotocol/solo.git and resolving all dependencies Contracts compilation is successful, however ...
user avatar
0 votes
0 answers
107 views

can I change loop logic to an alternative logic in this staking contract?

I built a staking contract that allows users to enroll in auto compounding through a function that is basically adding the user address to an array UserList Now for auto compounding I have these ...
user avatar
3 votes
2 answers
342 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 ...
user avatar
0 votes
1 answer
245 views

How to detect out of gas errors on internal transactions without a return?

I was working on the 13th level of Ethernaut when I discovered that calling a function of a contract with an explicit amount of gas results in a revert with no further description, even though the ...
user avatar
  • 111
0 votes
0 answers
33 views

Etherscan Show Fail out of gas. Eth deducted. But transaction not completed [duplicate]

I have enough ETH to pay the gas fee. After I click accept the transaction fail and it show out of gas on etherscan. Now the gas have been deducted but no transaction happen. Can someone help? The gas ...
user avatar
0 votes
2 answers
134 views

Ethereum gas fees

I am attempting to deploy a simple erc 20 token on the ethereum mainnet. I have tried twice now to deploy the contract each time paying around $20 in gas fees for contracts that would run out of gas ...
user avatar
3 votes
0 answers
31 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 ...
user avatar
0 votes
1 answer
445 views

Transaction out of gas with Remix and Metamask

I'm trying to deploy a contract with Remix and Metamask but I get this error every time I'm trying to do it. creation of ICODeployer errored: Error: [ethjs-query] while formatting outputs from RPC '{&...
user avatar
  • 5
2 votes
0 answers
173 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 ...
user avatar
  • 636
1 vote
1 answer
1k views

How do I identify the right gas to set in web3 send?

This is my send code: window.videoContract.methods .mint(account, 'https://ipfs.io/ipfs/QmRQC1...') .send({ from: account, gas: 20100000 }); If I set it too high, I get ...
user avatar
0 votes
1 answer
147 views

EVM:out of gas while executing send

I want to consider a scenario, lets suppose that a contract performs a transfer using send. At this point, out of gas occurs and send returns -1. Now the contract has no gas, and send does not revert,...
user avatar
  • 1,215
1 vote
1 answer
1k views

Gas limit issue when transfer USDT

i have been asking by my client to save ETH when transfer out his USDT, he hope there is no or very little ETH left in his new USDT address. Please assume that USDT address has no initial ETH and next ...
user avatar
0 votes
1 answer
456 views

How to estimate gas usage?

Please stop me if I am wrong. When we call any "state-changing" function of smart contract, this function will be run by all the miners of the mainnet. As a caller, I need to pay this using ...
user avatar
  • 915
0 votes
0 answers
207 views

is it possible to change block' gas limit?

I'm trying to execute some heavy transactions. Before execute it, Remix advises me about the gas limit: Ok, then I change my gas limit on Metamask to 9,000,000 (I'm on Ropsten network): And finally, ...
user avatar
  • 141
0 votes
1 answer
701 views

Transaction out of gas despite much higher gas price than almost identical transaction at same time that is fully mined

Two Uniswap txns calling swapExactETHForTokens that are almost identical (even same timestamp) except for the value and gas price, but the one with higher value and gas price runs out of gas and uses ...
user avatar
  • 159

1
2 3 4 5 6