Questions tagged [gas-price]

Questions dealing with the gas price of a transaction.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 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
1 vote
2 answers
21 views

How much gas does defining an error consume

I have written a contract with minimal declaration of errors; Hopping to achieve more readable and concise code. However, if I define more errors, would it cost more gas, if so how much per error? ...
Ibra's user avatar
  • 137
0 votes
0 answers
32 views

Why is Web3.js estimating 0 GWEI for gas price on Sepolia?

For some reason Web3.js cannot estimate gas correctly on Sepolia I have pulled in the Web3.js library via CDN <script src="https://cdn.jsdelivr.net/npm/[email protected]/web3.min.js">&...
Oscar Chambers's user avatar
0 votes
1 answer
26 views

How to change the gas price and gas limit in private blockchain

I wan to change the gas price and gas limit in the private blockchain as you know the currrent contract limit is 21000 so I want to change the default and also the gas limit I wan to cut more than 1 ...
Mustakbil Pakistan's user avatar
1 vote
1 answer
36 views

Why don't ETH transfers cost more when the recipient's balance is zero?

The SSTORE opcode has differential pricing depending on what the original, current, and new storage values are (see EIP-2200 for the full details). In short, the idea is that setting a zero value to a ...
Paul Razvan Berg's user avatar
2 votes
1 answer
32 views

What do original, current, and new value mean in the context of pricing storage updates?

I've heard these terms thrown around in discussions surrounding storage pricing in the EVM. But what do they mean, more precisely?
Paul Razvan Berg's user avatar
1 vote
0 answers
30 views

How to get transaction fees and minus it from balance

I created an auction exchange smart contract using solidity programming language and I am using ganache for testing this is a test file written in JavaScript. seller is the creator of auction and ...
Huzaifa Ahmed's user avatar
0 votes
0 answers
21 views

Eth::Client::ContractExecutionError - transaction underpriced

I am using the eth gem ruby library https://q9f.github.io/eth.rb/ to execute a function called from the ABI but it keeps getting the error transaction underpriced. I assume that it has something to do ...
javanoob2pro's user avatar
1 vote
0 answers
35 views

"ProviderError: transaction would cause overdraft" with gasPrice of 1 wei

I have a hardhat deployment script that has been working for months. But a few hours ago, it stopped working, and I keep getting gasPrice related errors. I tried: gasPrice: "auto" gasPrice: ...
António Gonçalves's user avatar
1 vote
1 answer
93 views

Optimizing Gas Costs in Solidity Smart Contracts: Best Practices?

I'm working on a Solidity smart contract and I'm concerned about the gas costs associated with its execution. I want to optimize my contract for gas efficiency to save on transaction fees and improve ...
Mehran Ra's user avatar
  • 481
1 vote
2 answers
99 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 ...
Dakata's user avatar
  • 205
0 votes
0 answers
9 views

How can l compare tx fee for main network and testnet

I have a contract on testnet and how can l learn how much tx fee will be on main network with same contract. Is there any way to get this information.
syringe92 e's user avatar
0 votes
1 answer
557 views

How accurately does sepolia gas/transaction price correlate with ETH

I'm currently using Sepolia testnet while learning how to mint nft's through javascript, and wondering how accurate the gas price/transaction fee's are for when I switch to using real ETH. I'm making ...
Alex T's user avatar
  • 1
1 vote
0 answers
22 views

Reduce gas price?

I'm working on a sniping bot on uniswap, and i have a little problem : the first ones to buy are those who pay the most. Pretty logical, but I don't really want to pay 300$ in priority gas to be the ...
Newly Sama's user avatar
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
288 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
1 vote
3 answers
1k views

Why gas fee on Uniswap is far far higher than normal gas fee

The transaction fee for swapping tokens on Uniswap is significantly higher than the normal Ethereum transaction fee. I wonder why? Note: You can obtain real-time gas fees from https://etherscan.io/...
user376830's user avatar
0 votes
1 answer
114 views

Cannot set gas price price to zero in Hardhat tests

I am trying to test a contract using Hardhat and want to set the gas price to zero. This will make it easier to see if my functions are working correctly, in that I can easily calculate the correct ...
Eric Falkenstein's user avatar
0 votes
0 answers
451 views

Getting "err: max fee per gas less than block base fee" when estimating gas cost of a transaction

For the last few days, I have some trouble using the eth_estimateGas function from the Quick Node provider. Indeed, after fetching a transaction from the mempool, I want to estimate the gas cost of ...
VeeN's user avatar
  • 101
0 votes
2 answers
30 views

Gas price error when minting a created token

I created the following token https://bscscan.com/address/0xb3497b2a0368e9b96ace9b6ad3033f440457d1b9. In addition to the written code, the imported calls were ERC20 such as import "@openzeppelin/...
Pablo Santos's user avatar
0 votes
1 answer
262 views

How to correctly specify maxPriorityFeePerGas?

I am trying to send a transaction quickly by adding a priority fee that is half the base fee with the following logic: const { baseFeePerGas } = await client.getBlock(); const priorityFee = ...
Sam Scolari's user avatar
2 votes
0 answers
190 views

Gas costs for contract deployment

Whenever I deploy a contract on Sepolia, there is an additional gas cost I haven't quite figured out. The flow as I understand is: 21,000 gas (base) 32,000 gas (contract creation) 4*(zero-value bytes ...
Peter's user avatar
  • 166
0 votes
1 answer
135 views

How much does it cost to clog the Ethereum Network exactly?

Currently the largest gas guzzler to clog the Ethereum network is the Mint contract below. Supposedly there are users purposely causing high gas prices using this function. Why would anyone do this ...
Patoshi パトシ's user avatar
0 votes
0 answers
21 views

How to calculate a tx's effectiveGasPrice within a block?

Let's say I query all transactions within a block. Assuming all transactions are already settled, how can I know what will be their effectiveGasPrice ? I'm confused that transactions specify a ...
Cizia's user avatar
  • 233
1 vote
0 answers
26 views

Post Merge transaction selection time

I was wondering if anyone has some historical data on how long the delay is from broadcasting a transaction to the Ethereum network before it is being picked up by a miner after The Merge? Preferably ...
JanseManse's user avatar
1 vote
1 answer
175 views

Prioritize Ethereum Transaction

What would be a good strategy to prioritize a transaction given the EIP-1559 definitions: Base Fee: minimum fee a transaction must pay to be a valid transaction. The Base Fee changes per block, ...
Kob3Bryant's user avatar
1 vote
1 answer
155 views

EtherJS calculates gas fee too low

newbie here so please bear with me. I am using EthersJS latest v5 in order to interact with our contracts, which works great so far. However, I spotted that for a certain period of time (around 1st ...
supersize's user avatar
0 votes
0 answers
298 views

SEPOLIA / ETHEREUM BEHAVIOR Problem with Gas

For a customer I've created a smart contract that run very well on SEPOLIA(without any problems). The contract has been deployed then on the Ethereum mainnet. Both compiled with solidity 0.8.18 But ...
Julien L's user avatar
1 vote
1 answer
86 views

Not understanding gas calculation on an EVM network [Fantom]

This is a question about Gas fees for transactions. The bottom line is I can't understand the price (in gas units) of transaction - And I will walk you through a specific transaction to show you my ...
Michael Rabinovich's user avatar
1 vote
0 answers
53 views

Prevent/Wait for sending transaction if gas price is too high

I am implementing a smart contract function to work from my backend using the owner wallet. This function will be called when user does some kind of activation in frontend so this function can be ...
Bengican Altunsu's user avatar
0 votes
0 answers
14 views

Gas fees differ for updating different values?

I've did some gas efficiency tests on the testnet and wonder why the following is the case... Updating values can be done with both of these methods: x += y; /// or /// x = x + y; For mappings, like ...
Andy's user avatar
  • 185
0 votes
0 answers
85 views

replacement transaction underpriced while deploying

I am attempting to deploy a contract to an address that I generated. I use https://sepolia.infura.io/v3/ as my test net. This is my code. package main import ( "context" "...
pigfox's user avatar
  • 125
1 vote
0 answers
34 views

Why is the price of the `call` is not linear to the contract's length?

If I understand correctly, the price of the far call to a new address is ~2300 gas. Source: https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-call-operations. There are some other costs ...
Stanislav Breadless'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
1 vote
1 answer
201 views

How to transfer the whole balance of ERC20 token?

At the moment I have this code: //............ const contract = new ethers.Contract(smartContractAddress, ERC20_ABI, provider); const signer = new ethers.Wallet(prKey, provider); const txSigner = ...
Kyell's user avatar
  • 91
0 votes
0 answers
79 views

How to estimate fee price for exact address using quicknode and web3?

I have this contract: 0x32400084C286CF3E17e7B677ea9583e60a000324 How could I get fee price which is recommended by the contract? So that it gives the same fee price as per MetaMask. This is https://...
Oleksandr Tserkovnyi's user avatar
0 votes
1 answer
86 views

Smart contract gas costs

What is the gas cost of deploying a Solidity contract, and how can I estimate it before deploying? Are there any strategies for minimizing deployment costs?
PSS's user avatar
  • 529
1 vote
0 answers
65 views

How to set gas price to zero?

I set Nethermind to zero gas price: "Blocks": { "MinGasPrice": 0 }, Nevertheless, MetaMask for this network shows rather big positive gas prices and does not allow ...
porton's user avatar
  • 1,744
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
1 answer
211 views

Contract deployment on Polygon mainnet being stuck

So I've been trying to deploy the simplest contract on Polygon mainnet for hours now with no luck. The transaction is stuck on pending. I tried with many different contracts and I tried changing the ...
Hasan Khadra's user avatar
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
1 vote
1 answer
87 views

0x swap api gas is doubled when adding feeRecipient and buyTokenPercentageFee

I would like to collect fees on trade using 0x API. But the gas in the quote response is doubled or more when adding feeRecipient and buyTokenPercentageFee which doubles the gas price users are paying....
mtx dev's user avatar
  • 11
0 votes
1 answer
44 views

reactjs get contract call fees

Chain used: Poylgon/mainnet or mumbai I am trying to get gas fees for a contract call. I should be able to let user chose if : Medium or High Same as metamask does it: but this should be done on user ...
heustfd gehsgd's user avatar
0 votes
1 answer
45 views

Ethereum Mainnet Error: "Migrations" could not deploy due to insufficient funds

Newbie to Ethereum NFT contract deployment here. So please bear with my questions. I am trying to deploy a ERC-721 contract to ETH Mainnet and I have 0.285 ETH in my wallet. But I am still getting ...
j7coder's user avatar
0 votes
0 answers
35 views

Change actual gasPrice for transaction

I'm using web3js & ethereumjs/tx I have some problem: get and calc gasPrice: fixedGasPrice = Math.round((await web3.eth.getGasPrice()) * 1.2); forming data for tx: const rawTx = { ...
kiruxaspb's user avatar
0 votes
0 answers
427 views

transfer all ether from one account to a smart contract with ethers.js

i want to transfer ALL the ether in my account to the smart contract. I am calculating the gasEstimate and then subtracting it from my total ether balance...but i get an ERROR saying code: -32000, ...
Sukirat Warring's user avatar
0 votes
0 answers
49 views

Gas cost of calling a function

I have two cases here : CASE 1: Let's say i have a conract A with three functions myFunctionA(), myFunctionB() and myFunctionC(), and when i call myFunctionB from myFunctionA, it calls myFunctionC: ...
noro meb's user avatar
  • 328
0 votes
1 answer
161 views

How to transfer all the coins that an account may have?

I have a system where there'll be dozens of accounts, for ETH and tokens. I'll have access to the private keys of those. From time to time I'll need to withdraw all of the coins in each account, in ...
Camila326's user avatar
0 votes
1 answer
97 views

Who pays gas when one transaction triggers functions from multiple smart contracts

The scenario is when an EOA interacted with Function 1 from smart contract A. But in a single transaction, function 1 also makes calls to contract B, which makes calls to contract C. Question 1: Would ...
bzpassersby's user avatar

1
2 3 4 5
10