Questions tagged [gas-limit]

Question related to either the transaction or block gas limit.

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
0 answers
14 views

Setting High Gas Limit

I hope you guys are doing well! I am new to the Web3 space, so please excuse my ignorance. After viewing numerous tutorials, many of the tutorials like to do this when setting the gas limit const ...
Matt Gates's user avatar
0 votes
1 answer
35 views

How to get rid of the gas estimation error in ethers.js

const fs = require("fs-extra"); const { ethers, JsonRpcProvider } = require("ethers"); async function main() { const provider = new ethers.providers.JsonRpcProvider( "...
Mahami's user avatar
  • 1
0 votes
1 answer
14 views

How to Determine the Optimal Gas Limit for Maximum Gas Refund without Excess?

I'm optimizing the gasLimit for transactions to ensure the maximum possible gas refund without leaving any unused gas. Given most web3 network's have a maximum gas refund policy where a portion of the ...
MShakeG's user avatar
  • 1,408
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
1 answer
58 views

Why does MetaMask cap the gasLimit for ERC20 transfers?

We have found that MetaMask doesn't appear to actually estimate gas for ERC20 transfers as it does for interactions with other contracts. Here, it appears to estimateGas when the interaction is with a ...
Rob Hitchens's user avatar
  • 54.7k
0 votes
0 answers
49 views

Is there anyway to reduce gas fee for uniswap v3 ExactOutputSingleParams?

Question is simple. Is there anyway to reduce gas fee for ExactOutputSingleParams ? function swapExactOutputSingle(uint256 amountOut, uint256 amountInMaximum) external returns (uint256 amountIn) { ...
xlogic land's user avatar
0 votes
0 answers
22 views

bug in the contract/I cant deploy but I dont see it it fails when I want to deploy it its not a gas problem

/** *Submitted for verification at Etherscan.io on 2023-04-24 */ /* Your Name Token is a cryptocurrency inspired by the popular anime movie "Your Name", which has gained the admiration ...
ocean's user avatar
  • 1
3 votes
3 answers
192 views

MetaMask incorrectly estimates 100,000 gas for ERC20 transfer. Why?

MetaMask is incorrectly limiting the gas limit estimate to 100,000. This is actually a rather complex "transfer" that will need about 145,000. Why does MetaMask limit ERC20 .transfer() to ...
Rob Hitchens's user avatar
  • 54.7k
0 votes
0 answers
14 views

Web3.py: 'intrinsic gas too low', how to select gasPrice and gas?

In previous question on the forum this issue was already discussed, but it does not address another one: how to select gas and gasPrice so that you wouldn't bet all wallet's money and transaction ...
EndOfTheGlory's user avatar
0 votes
1 answer
284 views

How to fix "Transaction was not mined within 50 blocks, please make sure you transaction was properly sent." error?

I'm here for your help. When I call the signTransaction function defined in web3.js, Transaction was not mined within 50 blocks, please make sure your transaction was properly sent error occurs. I ...
AresColin's user avatar
0 votes
0 answers
35 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
1 vote
1 answer
40 views

The simplest way to return a list of items + gas limits on long lists when using pragma experimental ABIEncoderV2?

This question has two parts. I would like to return a list of items from my smart contract in a simple way, ideally a one-liner solution, something that I consume on the front-end. I tried some of the ...
Mars Robertson's user avatar
0 votes
0 answers
17 views

Method call gets reverted when block gas limit setting of ganache is left of default

I deployed a T-REX token (version 3.9.4) to first Sepolia then also to a local ganache instance and my process (Token (and substructures) deployment -> Add Token agent -> Create Identity -> ...
András Ballai's user avatar
0 votes
1 answer
17 views

Getting error when I am trying to call the function listUser and the function listProductOnSale and also have some warning related to infinite gas

Getting the following error: revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than ...
Abhishek Bhagat's user avatar
0 votes
1 answer
26 views

Can OpenZeppelin Defender call nonReentrant functions?

I am getting this error running a transaction with a relayer in Open Zeppelin Defender: cannot estimate gas; transaction may fail or may require manual gas limit I know that you get this error when ...
Falcon Stakepool's user avatar
0 votes
1 answer
98 views

Error: cannot estimate gas

when calling the following code from a js script a get "Error: cannot estimate gas; transaction may fail or may require manual gas limit " , how to fix this error ? : function ...
adam mr's user avatar
  • 61
0 votes
1 answer
34 views

Why is MyCrypto is disabling the Sign Transaction button?

I'm using MyCrypto to execute a function of a smart contract but the sign Transaction button is disabled. I'm using the setting to auto calculate the Gas Limit and its suggesting a limit of 68908 with ...
TheLogicMan's user avatar
0 votes
0 answers
48 views

How do validators pick transactions to fill the gas usage per block?

I was looking through Etherscan and noticed blocks vary widely in gas usage from one to the other. I was wondering how do validators pick transactions that they'll include in their pending block, as ...
Stephen's user avatar
  • 101
1 vote
0 answers
47 views

Is in L2 gas limit much higher than in L1?

Naturally, in a blockchain gas per transaction is limited, because block place and distributed calculating power are scarce resources. Can you point me a Level 2 system, where the gas limit per ...
porton's user avatar
  • 1,744
1 vote
1 answer
147 views

increase the gas limit for read functions

hey guys this may be a broad question... I'm writing a smart contract that recursively builds an svg image given a seed number. the function that draws the image is a view function so it doesn't cost ...
Nolan Jannotta's user avatar
1 vote
0 answers
13 views

What is current block gas limit after Ethereum Merge update?

What is the current block gas limit after Ethereum Merge update?
Decode_me's user avatar
0 votes
0 answers
134 views

Error: cannot estimate gas; transaction may fail or may require manual gas limit in goerli testnet

I am Trying to send transaction to my smart contract and I get this error: I estimated the gas price with const gasPrice = await provider.getGasPrice(); got the error tried using gas price greater ...
user118535's user avatar
0 votes
0 answers
769 views

Gas required exceeds allowance(0)

I've seen a lot of posts on this error, but I can't figure out what's wrong with my contract and why this is happening. I have my contract code below: //SPDX-License-Identifier: MIT pragma solidity ^0....
src2012's user avatar
  • 11
1 vote
0 answers
21 views

Error message after contract interaction was successful

When calling a contract function, I am getting the common unable to estimate gaslimit error message: Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://...
Xing Li's user avatar
  • 33
0 votes
0 answers
150 views

ValueError: Gas estimation failed: 'execution reverted'. Gaslimit already set

I'm getting this error when I try to run my Brownie Python script: myAwesomeGasLimit = 200000 def enter_for_free(): account = get_account() lottery = Lottery[-1] tx = lottery....
Christopherus's user avatar
0 votes
0 answers
33 views

How to define gas Limit in typescript eth transaction?

I am currently working on my frist dApp with React and Typescript and come across the problem that MetaMask shows no value and gas limit when signing the transaction -> next step: transaction get ...
Christopherus's user avatar
0 votes
1 answer
21 views

What is the optimal way to estimate dependent transactions together?

I am looking for a solution to estimate multiple transactions together before submitting any of them. However some of these transaction depend on the other in the sense, if they are not submitted in ...
Sanjay S B's user avatar
  • 1,319
1 vote
0 answers
98 views

tx.gasprice gives wrong gas estimation

I am using tx.gasprice and block.basefee in my contract to calculate the used gas. The problem is that I can't estimate the gas correctly or sometimes not at all when the contract uses tx.gasprice;. ...
Marvin Daum's user avatar
0 votes
1 answer
132 views

Intrinsic Gas Too Low - Where Do I Add The Gas?

I've seen this question here a lot, but just to restate for my purposes, I'm using truffle and attempting to monitor the blockchain for price swaps. I do not currently have a contract deployed but, I ...
Trent Kennelly's user avatar
0 votes
2 answers
50 views

Issues with custodial and non custodial wallet smart contract interactions

We have smart contract for minting ERC721 tokens. The non custodial mints work fine through Javascript but custodial mints are always in pending state. We are using go-ethereum to make that smart ...
ethnoob'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
127 views

What is the default gas limit for low-level calls?

I deployed the following contracts where one of the low level functions writes to a state variable and the other does not. ''' //SPDX-License-Identifier: MIT pragma solidity <0.9.0; ...
GimmeGinNtonic's user avatar
2 votes
1 answer
29 views

How can I keep gas execution cost as close to gas limit as possible?

I notice that the percentage of total consumption varies across different functions on the blockchain. For example: this one uses 94%, while this one only uses 51%. From a developer perspective, how ...
Bandersnatch's user avatar
1 vote
0 answers
224 views

Why does the Polygon PoS Chain Average Gas Limit (per block) keep changing?

Most EVM chains have a fixed gas limit and gas target per block. For Ethereum, it's 30M and 15M: https://etherscan.io/chart/gaslimit For Polygon, the gas limit seems to change every single block. How ...
Mal Plankton's user avatar
1 vote
0 answers
29 views

Deterministic gas use

In ether, any pure ether transfer will always cost 21000 gas. However, due to the nature of the MPT used in the Balances tree, wouldn't some addresses have more layers of the tree to hop through and ...
Anton M's user avatar
  • 11
1 vote
0 answers
15 views

Can I use a function gas cost to calculate network utilisation?

I’m developing a governance DApp and need to research various blockchains and their scalability. One of the ways I’m doing this is by estimating the gas price of all the smart contract functions that'...
Furkan Öztürk's user avatar
0 votes
1 answer
503 views

What is the purpose of gasLimit in an EIP1559 transaction?

When rlp encoding an EIP1559 transaction 3 gas values are provided: maxPriorityFeePerGas,maxFeePerGas & gasLimit. maxFeePerGas = BaseFee + maxPriorityFeePerGas but what is the purpose of gasLimit ...
Andreas Dilaveris's user avatar
0 votes
1 answer
775 views

Why the BSC block gas limit change and what's the logic behind it?

The bsc block gas limit is always very close to 120,000,000. But it can be 119,529,427 or 119,996,337 for some blocks. It seems to stay between 118M and 120M Why does it change and what's the logic ...
Thiou's user avatar
  • 3
0 votes
2 answers
1k views

baseFeePerGas missing from block in python web3 for web3.eth.get_block

I am using the python web3 library to connect to the Binance Smart Chain at RPC=https://bsc-dataseed.binance.org. Since BSC is a POA chain, I am also using web3.middleware.geth_poa_middleware as ...
Marc's user avatar
  • 257
1 vote
1 answer
26 views

Gas adjustment of the smart contract function

I have function which uses for loops on the calldata array as following: mapping (address => bool) public userRegistered; function registerUsers(address[] calldata users) external { for (uint256 ...
Ahmet Yazıcı's user avatar
0 votes
1 answer
790 views

Gas estimation failed: execution reverted on goerli with brownie

I'm trying to test an onlyOwner function on goerli testnet which's expected to be passed with pytest.raises(exceptions.VirtualMachineError) but it keeps getting below error. I added priority_fee and ...
Shack's user avatar
  • 11
1 vote
1 answer
34 views

Why isn’t there more fluctuation in the gas used per block?

If you look at gas used per block, since EIP-1559 it has been almost exactly at targetGas for every block https://www.etherchain.org/charts/blockGasUsage Do miners have a disincentive to make blocks ...
Daniel Coffman's user avatar
1 vote
1 answer
122 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
2 votes
2 answers
1k views

Are Ethereum blocks flexible in terms of size or are they capped?

Many blockchains have block size limits. But I am confused when it comes to Ethereum. On one hand, I read that its block size is flexible. But on the other hand, I strongly suspect there must be a ...
SarahRinaldi_93's user avatar
0 votes
2 answers
167 views

msg.sender.call{value: 0.1 ether, gas: 1}(""): Why it doesn't fail? Shouldn't?

I'm making a simple test to force a transaction to be reverted, but it just doesn't happen. I have this function where I intend to limit the gas to just 1. contract MyContract { constructor() ...
Fabiano's user avatar
  • 173
1 vote
1 answer
243 views

Gas allowance geth

I have deployed an Ethereum private network PoA with geth connecting 3 nodes: 2 nodes in aws EC2 instances and my own laptop. My purpose is to store strings in the network, so therefore, i have ...
WakiApi's user avatar
  • 33
2 votes
1 answer
547 views

"contract x" ran out of gas. Something in the constructor (ex: infinite loop) caused gas estimation to fail ganache

i'm trying to deploy contracts on private network ganache using ganache application. but it threw an error because of its big size: "contract x" ran out of gas. Something in the constructor (...
Seif Khédija's user avatar
2 votes
0 answers
30 views

Using veiw functions to overload Blockchain node

Question: What is stopping me from creating view function with heavy computation (infinite loop). Deploying it on Blockchain and then calling it just so I could overload a Blockchain node that ...
Sky's user avatar
  • 2,204

1
2 3 4 5
9