Questions tagged [out-of-gas]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
13 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?
0
votes
0answers
29 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 ...
1
vote
1answer
47 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 ...
0
votes
1answer
30 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 ...
0
votes
1answer
21 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 ...
1
vote
1answer
13 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?
1
vote
1answer
24 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 ...
0
votes
1answer
56 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 ...
0
votes
0answers
33 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 ...
0
votes
0answers
22 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 ...
1
vote
1answer
114 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 ...
0
votes
0answers
21 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 ...
1
vote
1answer
52 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 ...
0
votes
0answers
429 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, ...
0
votes
0answers
80 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 ...
0
votes
1answer
47 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: {...
0
votes
1answer
18 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 ...
0
votes
0answers
38 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 ...
3
votes
1answer
180 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 ...
0
votes
1answer
69 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 ...
0
votes
0answers
29 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 ...
0
votes
1answer
104 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 ...
3
votes
0answers
20 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 ...
0
votes
1answer
206 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 '{&...
2
votes
0answers
77 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 ...
1
vote
1answer
595 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 ...
0
votes
0answers
29 views

Why must gas limit be set to 900 more than actual gas usage?

I have a contract which a specific function call will always cost x gas. However, setting the gas limit of the transaction to anything less than x + 900 will result in an out of gas error. What is ...
0
votes
1answer
91 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,...
0
votes
0answers
45 views

Why do wallets consistently underestimate gas for our smart contract?

We made a smart contract where you send it ETH, it checks the current price of ETH/USD using a chainlink oracle and then sends back our token at 12 cents a token until March 1, then 15 cents etc. All ...
1
vote
1answer
986 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 ...
0
votes
1answer
359 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 ...
0
votes
0answers
154 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, ...
0
votes
1answer
598 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 ...
0
votes
1answer
130 views

"out of gas" when trying to send back ETH from a contract to tx.origin

(UPDATED) The contract should have more than enough ETH. I deploy the contract with 0.1 ETH: https://git.io/JUBdy const consumerExample = await ConsumerExampleFactory.deploy(process.env....
0
votes
0answers
45 views

"in Process" Ran out of gas

Kyrptono Exchange Customer Support has refused to respond to my problem. The transaction failed, because it ran out of gas, I can still see a shadow of my DGX on Kyrptono account, but after 7 months ...
2
votes
1answer
1k views

What is the right way to calculate gas price and limit for contract deployment?

I have tried several times and reached up to a gasPrice of 65 Gwei and a gasLimit of 500,000 which is $7.6 and still the deployment fails with error "Out of gas". After spending tens of USD ...
2
votes
0answers
72 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 ...
0
votes
1answer
213 views

Status is Successful but got internal transaction out of gas?

I call a function with the transaction like this https://ropsten.etherscan.io/tx/0x7d4dec3c0db2b700efae63ef3ffb5a33fc2335bd992fd37c48aa10560eb8156e this fuction is a call from other contract,I wrote ...
1
vote
0answers
146 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 ...
2
votes
0answers
236 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 ...
1
vote
1answer
55 views

Do other blockchain have gas concepts? [closed]

I understand that Ethereum have gas mechanism to avoid infinite loop and network abuse, but I was wondering whether other blockchain platforms also have gas concepts? Say Cardano, Hyperledger,...
0
votes
2answers
257 views

gas exceeds allowance

I'm testing my smart contract on ropsten and I have written an async function that lets me send TRANSACTION transactions from TRANSACTION different accounts. For some reason when TRANSACTION > 20 i ...
2
votes
3answers
3k views

simulate transaction without sending to blockchain

Is there any way to simulate a transaction without sending it to the blockchain and find the exact error (or line of code), in case it fails if its mined?
2
votes
2answers
478 views

Gas cost for Ether transfer to Smart Contract from EOA

It is pretty clear that Ether transfer between accounts is 21,000 gas. Does the same apply for transferring Ether to Smart contract address, or does transfer from EOA to Smartcontract cost more gas? I ...
0
votes
1answer
166 views

find the exact error in solidity transaction programmatically

I know we can detect that the transaction is going to be failed with the "Out of gas" warning beforehand but is it possible to find the exact error before sending it to the blockchain. How can we ...
1
vote
1answer
947 views

Ganache: out-of-gas during deployment

I have a bunch of contracts which deploy just fine. Deployment of one of the contracts, XBRNetwork takes exactly 5418911 gas - no problems with that. However, once I add another trivial (public) ...
-1
votes
1answer
471 views

Unable to test a smart contract on ropsten test network

I launch and verify an ERC20 based smart contract on a ropsten test network which allows user to interact with the contract (send eth to it and the contract automatically send token in returns as in ...
0
votes
1answer
94 views

Why do I always get “Returned values are not valid, did it run Out of Gas”?

I'm new on Ethereum blockchain and I'm working on deploy and using smart contract using truffle on my private blockchain. I have followed exactly this guide https://www.trufflesuite.com/docs/...
2
votes
1answer
103 views

How to avoid an error caused by wrong determining of gas consumption

I have a function that is being called by multiple users (say 3). That value is set by owner earlier as a constant. Inside this function there's a check whether it's the last user (3) or not. If yes ...
2
votes
1answer
302 views

How to divide and allocate the amount to token holders without loops?

I have a smart contract that keeps record of the people holding the tokens in form of array of addresses. An owner of the smart contract, whenever, sends some ethers to the contract these ethers shall ...

1
2 3 4 5