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
1 answer
459 views

Opcode for out of gas inside a message call

According to the Solidity documentation: A require-style exception is generated in the following situations: ... If you call a function via a message call but it does not finish properly (i.e. ...
0 votes
1 answer
2k views

Error encountered during contract execution - Out of gas

I try to create a smart contract (Simple TokenERC20) with sendRawTransaction(). var firstMainadress = '0x3c7B83E0Fa6f19B1B61e80A73630cB5Db48b700C'; var secondAdress = '...
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: ...
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 ...
0 votes
2 answers
69 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 ...
0 votes
1 answer
684 views

Error with wrong calculation of gas price and value after lots of iterations

I am trying to code something that empties an address and sends that amount to my main-wallet. In order to get familiar with sending raw transactions and manually setting the eth-amount, I've tried ...
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 ...
0 votes
1 answer
619 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
1 answer
603 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 ...
2 votes
1 answer
362 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 ...
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/...
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 ...
1 vote
2 answers
793 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 ...
0 votes
1 answer
310 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
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 ...
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 ...
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 ...
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 ...
1 vote
1 answer
459 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
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. ...
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 "@...
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 ...
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 ...
1 vote
1 answer
322 views

OUt of gas duringcreation of contract

I tried to create a smart contract (Token ERC20) with this web IDE : https://remix.ethereum.org Everything was good. I taked te same contract and i tried to deploy it with node application by using ...
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 ...
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?
27 votes
7 answers
21k views

Truffle deployment on test network says: Error: exceeds block gas limit

I'm trying to deploy a sample contract (following this guide) but I'm receiving an error of not enough gas. I changed the numbers a little but could not fix it. I saw this question in stack exchange ...
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 ...
1 vote
2 answers
415 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 ...
1 vote
2 answers
5k views

Warning! Error encountered during contract execution [Out of gas]

What is this ? I am trying to send a transaction from my Nano S Ledger to a Bittrex Account dont understand what is happening ? Do I need to purchase Gas as well ??? https://etherscan.io/tx/...
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, ...
4 votes
2 answers
4k views

Transaction "Failed", but it says "Although one or more errors occured [Out of gas] contract execution completed"

I sent ETH with MetaMask and it seems that the transaction ran out of gas. However, the ETH is gone. They don't show up in my wallet anymore. The receiving party says, that they did not get it either. ...
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 ...
2 votes
1 answer
627 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 ...
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 ...
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 ...
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,...
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 ...
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(...
0 votes
2 answers
142 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("...
4 votes
3 answers
705 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
2 answers
243 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 ...
0 votes
1 answer
202 views

Out of Gas exception on testnet but on JVM it works

I am trying to withdraw a contracts balance to the owner of that contracts account. It works perfectly on the JVM in solidity browser. But on TestRPC it has an out of gas exception. The account has a ...
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 ...
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 =>...
1 vote
1 answer
475 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
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 ...
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, ...
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 ...
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 ...

1
2 3 4 5 6