Questions tagged [gas-price]
Questions dealing with the gas price of a transaction.
470
questions
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 ...
1
vote
1
answer
28
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, ...
1
vote
1
answer
97
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 ...
0
votes
0
answers
41
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 ...
1
vote
1
answer
44
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 ...
1
vote
0
answers
15
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 ...
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 ...
0
votes
0
answers
24
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"
"...
1
vote
0
answers
31
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 ...
0
votes
1
answer
22
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
30
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 ...
1
vote
1
answer
50
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 = ...
0
votes
0
answers
51
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://...
0
votes
1
answer
19
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?
1
vote
0
answers
34
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 ...
0
votes
0
answers
78
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 ...
0
votes
1
answer
118
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 ...
1
vote
0
answers
17
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://...
1
vote
1
answer
54
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....
0
votes
1
answer
27
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 ...
0
votes
1
answer
30
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 ...
0
votes
0
answers
25
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 = {
...
0
votes
0
answers
202
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, ...
0
votes
0
answers
29
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:
...
0
votes
1
answer
83
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 ...
0
votes
1
answer
49
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 ...
0
votes
0
answers
48
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;.
...
0
votes
1
answer
72
views
Wrong gas estimation when using tx.gasprice
I use tx.gasprice and block.basefee in my Smart Contract to calculate how much eth the User spent, to send the spent amount back to the Relayer, because I am using meta Transactions.
Now I wanted to ...
1
vote
1
answer
686
views
How to get gas estimate and gas price on Polygon Mumbai Chain using web3.py?
I have deployed a contract on Goerli test net and used the following to get the estimated gas and current gas price.
contract = web3.eth.contract(address=contract_address, abi=contract_abi)
...
0
votes
2
answers
20
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 ...
0
votes
1
answer
69
views
Why isn't calldata used in this function's argument? (OpenZeppelin/OwnableUpgradeable.sol)
Solidity noob here; reading about data locations i've learned that whenever you don't need to store or modify a function's input value it's actually more gas efficient to set its location to calldata (...
0
votes
1
answer
84
views
Transaction gas problem
I wanna send transaction and before that i wanna calculate the gas fee and input value as much as : finalAmount = value - gasFee
For doing this i get gas price from provider this way:
const gasP = ...
0
votes
0
answers
38
views
Mapping or Struct to store data in NFT : gas fee and best practice
What is the best practice and gas less to store data inside the nft, not in metadata.
First exemple with 3 writes and second with 1 write.
But it seems Struct is more expensive. And when it will be ...
0
votes
1
answer
262
views
HttpProviderError when trying to send a tx with lower gasPrice
I am trying to send a tx to Ethereum mainnet with a lower gas price than the current gas price to have it in pending state until the gas price drops and it is picked up. I am using ethers.js for my ...
0
votes
1
answer
84
views
Mysterious self transaction erased my funds on Metamask
I wanted to withdraw some ETH from Binance to my Metamask wallet via Ethereum ERC-20 protocol and some "self" transaction erased all of the amount via gas fees. Can you please help me out?
...
0
votes
2
answers
37
views
Gas settings when sending a tx
I currently have several txs stuck on Pending even after passing them 100 gwei of gasPrice while current baseFee is 0.000001086 gwei (on Goerli and using ethers.js).
const ops = {
gasLimit: ethers....
1
vote
0
answers
57
views
What are the specifics of the base fee formula?
Looking at the ethereum.org page on Gas I see that post-London upgrade base fees are calculated according to the size of the previous block relative the target gas limit of 15 million. Then I read:
...
0
votes
0
answers
33
views
How many addresses would I be able to loop through before crossing block gas limit?
I'm developing my dapp on the polyogon blockchain and I'd like to know how many addresses I'd be able to loop through before exceeding the block gas limit.
The will also be a feature which allows ...
0
votes
1
answer
93
views
unit of tx.gasprice and block.basefee
I'm querying tx.gasprice and block.basefee on a mainnet fork pinned to block 15823986 -kind of recent one at the time of writing- and I'm getting 1991927019 and 991927019 respectively.
If these values ...
0
votes
0
answers
201
views
How to calculate the estimated gas of a smart contract method like MetaMask?
I deployed a smart contract on testnet and used the following method to estimate the gas of a method:
web3.eth.getGasPrice((err, gasPrice) => {
if (err) {
// Error handler
}
...
0
votes
1
answer
43
views
Decode Ethereum Gas Price Golang
I needed to get gas data from a transaction, I did it with the code below. The received data has been converted to a string. Now I need to decode the received value. How can I do this?
import (
&...
0
votes
0
answers
65
views
Node module for dynamic gas price calculation
Are there any modules written in JS/TS to dynamically adjust the gas price to ensure transactions are included?
I.e. if the transaction is not included after a while, the gas price should be increased ...
0
votes
0
answers
26
views
State variable ignored by function with higher gas price
I found an issue with this contract, when I execute setValue and then requireValue functions in 1 block : if I use same gas price for both, I don't get any error.
contract test {
uint value = 0;
...
1
vote
0
answers
45
views
What is the right way to round the suggestBaseFee value from Etherscan Gas Tracker API?
We are currently trying to calculate the correct priority gas value in GWEI as displayed on the Gas Tracker page on Etherscan using this API: https://api.etherscan.io/api?module=gastracker&action=...
0
votes
1
answer
51
views
Is the all of Gas Fee refunded if the transaction fails?
function burn(uint256 _value) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
...
0
votes
1
answer
65
views
Do gas prices for NFTs depend on file size?
If I am minting NFT does the file size and type affect gas price, i.e. if that's 5 GB video or just a small 15 digits number?
Thanks,
Yury
0
votes
1
answer
31
views
Remix Static Analysis: Why gas cost message?
I am doing the static analysis of the following smart contract (SC) on Remix:
pragma solidity 0.5.1;
contract TxUserWallet {
address owner;
constructor() public {
owner = msg.sender;
...
0
votes
0
answers
191
views
Error: Cannot estimate gas; transaction may fail UNPREDICTABLE_GAS_LIMIT
I have this error when I try to deploy with Fuji and also with a Subnet, but using Hardhat local node I have no problems. I have tried different options. Here is my hardhat.config.js with the ...
3
votes
4
answers
3k
views
Goerli more expensive than Ethereum Mainnet
Currently, a transaction on Goerli is more expensive than the Ethereum mainnet.
Why is that the case?
Here is the contract:
contract Test {
uint x;
function test() external {
x += 1;
}
}
...
0
votes
2
answers
497
views
How can I set Gas Price in Solidity?
Can I set gas price in internal transactions, of my functions?
For example:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
interface Itest {
function sendToken(address to) external;
}
...