All Questions
Tagged with gas-estimate gas-limit
65 questions
0
votes
0
answers
43
views
maxFeePerGas and maxPriorityFeePerGas for flashbot's
I'm trying to rescue my vesting rewards with flashbot's and my bundle has 3 transaction's but i'm always to late with this code.
const gasTransaction = {
transaction: {
from: "0xbc808B.....",...
0
votes
0
answers
56
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: ...
0
votes
2
answers
273
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
0
answers
14
views
Gas estimation failed in solidity leaseProperty function
i am creating smart contract for my property leasing problem
all function are work good in hedera network but the leaseProperty function is getting below error and transaction is failed if we ...
1
vote
1
answer
24
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
0
answers
24
views
Remix Gas Limit, Transaction Cost, Execution Cost calculation
As can be seen in the screenshot, I am trying to deploy an entirely empty smart contract locally. The gas limit is set to 3, so logically, this should revert the transaction, right? However, it ...
0
votes
2
answers
73
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 ...
0
votes
1
answer
43
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 ...
3
votes
3
answers
851
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 ...
0
votes
1
answer
173
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 ...
0
votes
1
answer
51
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 ...
0
votes
2
answers
38
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 ...
1
vote
0
answers
158
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;.
...
1
vote
0
answers
35
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 ...
2
votes
0
answers
523
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
1
answer
620
views
What is max amount of ETH that can be spent during a single transaction (theoretically)
I know users can set up a gas limit as not to spend too much.
I am also aware of the "gas block limit" (how much gas can be consumed in a single ETH block). However, the user can set the gas ...
0
votes
1
answer
461
views
Execution will likely fail Internal JSON-RPC error. { "code": -32000, "message": "stack limit reached 1024 (1023)" } On The Polygon Network
I have been working on this Flashloan arbitrage and when I call the execute operation function I get Gas estimation errored with the following message (see below). The transaction execution will ...
0
votes
0
answers
16
views
gas vs gasLimit in web3.js [duplicate]
I've seen a bunch of stackoverflow posts on this and want to make sure I've got it right. I'm running into an issue where on test networks I can do this:
contract.methods.mint(1).send({
from: ...
0
votes
2
answers
161
views
Do any one had a template API to display/show estimated gas price for a transaction?
Description of the issue: I do not have sufficient funds in my wallet to transfer a token from my wallet to an external wallet. So the transaction will fail and shows us an error message. Instead of ...
1
vote
1
answer
191
views
estimate gas usage for a contract
I'm trying to estimate the gas usage for a smart contract for an NFT token - is it possible to do before the actual sale?
contract is already published and all functions as well.
so I want to know how ...
1
vote
1
answer
1k
views
If Ethereum 2.0 won't reduce gas fees on mainnet, what will? [closed]
For much of 2021, people who buy and sell ERC-721s believed that Ethereum 2.0 would reduce gas costs, while knowing that the London Hard Fork that was released in summer would only help reduce gas ...
2
votes
2
answers
1k
views
How does metamask come up its suggested gas fees?
How does metamask come up its suggested gas fees? How does it come up with a certain amount?
What is it optimised for? Should you just use it or should you set your own?
0
votes
0
answers
676
views
Calculating Gas of A Uniswap Exchange With Web3js
I am trying to calculate the gas that a contract will use prior to executing it. I realize that it is not possible to get a 100% exact value but I would still like to calculate an estimate. I am new ...
0
votes
0
answers
33
views
Traded like 12$ of ethereum for husky at like 6 GWEI how long do those trades usually take?
I tried using "UniSwap" but 40$ prices for a 12$ trade seemed ridiculously high so I just went on a random site which allowed me to change "gwei" and I put it to 6 I think, I also ...
4
votes
2
answers
1k
views
Understanding Gas Fees for NFTs
I am going to mint a collection of 10,000 NFTs. However, I've become very concerned over the gas costs associated with such an endeavor. I was wondering if someone could help me understand the ...
0
votes
1
answer
276
views
Tx stuck even after using gasestimation for gas limit
I am trying to sign a manual transaction using ethereumjs-tx to interact with a smart contract.
This is how I am getting my gaslimit, nounce and data for the params
var GAS = await cont.methods....
0
votes
1
answer
58
views
Deciding Gas Pricing
Anyone know how curve fi and metamask fetch the average gas price for the transaction and how they provide the slow and fast option? I just want to know which third party they use to get these info.
0
votes
1
answer
312
views
Can gasLimit be infinite?
Assuming I have enough Ether, can smart contracts be executed no matter how complex they are as long as I specify a large enough gasLimit?
Hope you can give me some hope, thanks!
1
vote
1
answer
4k
views
Default gas limit set by web3 is unreasonably high?
I am trying to learn and understand solidity/defi by creating some copies of current popular protocols; I've created a small copy of the Curve Dai strategy from harvest finance, but I'm getting really ...
0
votes
0
answers
261
views
How to correctly account for transaction costs when swapping from one ERC-20 token to another using for example the Kyber network?
If I for example have 5 KNC (an ERC-20 token) and would like to swap them for x amount of DAI (another ERC-20), this would on the Kyber network, as far as I understand, be achieved via two conversions:...
1
vote
0
answers
493
views
Gas estimation errored with the following message (see below). The transaction execution will likely fail
When I try to excute the deposit function it shows Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
execution ...
8
votes
1
answer
361
views
Can I estimate the total gas limit of several dependent transactions?
Assume two dependent transactions A and B. Transaction B depends on transaction A and will fail if transaction A has failed.
I would like to estimate the gas limit required for the success of both ...
1
vote
1
answer
56
views
Explanation for small variation in gasUsed while recursively deploying same contract
https://github.com/christianlundkvist/simple-multisig/blob/master/contracts/SimpleMultiSig.sol
I'm deploying the above contract recursively and I find that the gasUsed varies by specifically 12 gas. ...
3
votes
2
answers
9k
views
ethers.js - estimating gas limit
Using the ethers.js library, how can I determine the gas limit when sending a transaction to a contract or deploying a new contract?
3
votes
2
answers
1k
views
Does using a very high gas limit somehow get your transactions executed slower?
I'm executing transactions on mainnet with a NodeJS script:
async function send(web3, transaction, destAddr, gasPrice, privateKey) {
const options = {
data : transaction.encodeABI(),
...
0
votes
1
answer
240
views
Get gas limit beforehand with Web3
I know that web3 exposes a function to estimate gas limit, but is it accurate when sending to a contract?
AFAIK the amount of gas I'm gonna need if sending to a contract depends on the contract code, ...
4
votes
0
answers
203
views
Does 'estimateGas' behave the same on Ganache and on mainnet?
I noticed that estimateGas behavior in Ganache has changed:
In version 6.4.1, it throws an exception if exceeding the gas-limit.
In version 6.5.1, it returns the estimation even if exceeding the gas-...
1
vote
1
answer
78
views
Different between gas and gasLimit keys when executing transactions
Below is the code that I'm running. When I entered "gas" and "gasLimit" as the keys, both worked. Why is that? What does "gas" represent? And what is the optimum amount of gasLimit should I use (...
1
vote
1
answer
67
views
Block Gas Limit Doubt
Suppose i have a loop.
Here user is a struct of which player is an address.
address[] memory addrs = new address[](n);
for(uint i=0;i<n;i++){
addrs[i] = user.player;
}
return addrs;
This is a ...
0
votes
0
answers
404
views
JSON RPC get this error "Request have return error: gas required exceeds allowance or always failing transaction"
i'm trying to do a simple transaction for a token but i keep getting following error for estimate gas limit :
"Request have return error: gas required exceeds allowance or always failing transaction"
...
2
votes
0
answers
156
views
What Web3JS method do I call to know what value to use for the gas price with sendSignedTransaction?
I am using Web3JS 1.0+ to send transactions to my smart contract.
I've been using the following constant for the gas price in my code that I got a long time ago from a tutorial. What is the "...
1
vote
1
answer
365
views
What should be optimal gas limit and gas price for 80 addresses airdrop?
This is my airdrop function:
mapping (address => bool) public airdrops;
function airdropTokens(address[] _recipient, uint256[] _tokens) public onlyOwner{
uint airdropped;
for(uint256 i = 0; i< ...
0
votes
1
answer
171
views
Smart contract's function work on testnet but don't work on private network
I have been created a smart contract (ERC20 implantation). The contract run great om testrpc, ropsten and rinkeby but i want to use it in a private network.
When the contract deployed in the private ...
1
vote
1
answer
42
views
Why aren't costs "advertised" or at least knowable so funds aren't lost?
I'm admittedly new to all of this, but as I learn about the transaction model, it seems to be a confusing business model at the very least. I can understand that the price of gas fluctuates or can be ...
2
votes
2
answers
2k
views
How to optimize the gasPrice and gas options in a contract send() function? [duplicate]
There are many questions and answers about estimating the amount of gas consumed. This question is about what to do with this estimate.
What values should we actually provide to gas and gasPrice in ...
2
votes
1
answer
2k
views
How to caculate/estimate Gas Limit and Gas Price based on current state of the ether network?
Ethgasstation and similar websites estimate proper Gas Price based on current state of Ethereum network. Is there any way of using working with Geth/web3 to estimate proper Gas Price? and similar to ...
1
vote
1
answer
89
views
Loop with upper bound of iterations / loop variant
Is it possible somehow to create a loop that solidity will recognize as having an upper bound of iterations for gas estimations?
Something like a loop variant in Eiffel (https://www.eiffel.org/doc/...
2
votes
1
answer
3k
views
Getting 'base fee exceeds gas limit' on a transaction which requires a small amount of gas
I have the following contract:
pragma solidity ^0.4.24;
contract MyContract {
address public owner;
bool public unlocked;
constructor() public {
owner = msg.sender;
...
1
vote
0
answers
231
views
What's the point in the 'gas' parameter passed to function 'signTransaction'? [duplicate]
I am using web3.js v1 in order to sign and send transactions:
async function signAndSend(transaction) {
let options = {
to : transaction._parent._address,
data: transaction....
2
votes
1
answer
76
views
How does ether transfer processed [duplicate]
I want to understand deeply how ether transfer processed and how 21000 of gas determined. Is this a simple constant fee of the transfer transaction or ether transfer transaction is the some predefined ...