All Questions
Tagged with gas-estimate javascript
8 questions
0
votes
0
answers
1k
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 ...
0
votes
1
answer
180
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 = ...
1
vote
0
answers
573
views
Ethersjs estimateGas bypassing insufficient funds
I am using ethersjs to call my contract methods. The problem stems from trying to making the Metamask popup despite the account has insufficient funds in the first place. I am trying to do the popup ...
3
votes
2
answers
5k
views
Ethers js estimateGas() without needing ETH in account
I am trying to estimate the gas used for a uniswap transaction. I am able to perform this on the Kovan testnet however when I try and run the same script on the mainnet it raises an error, "Error:...
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 ...
2
votes
2
answers
2k
views
web3 estimateGas() from fallback function
When I sign and send raw transactions with web3 in javascipt , to call a method from Smart Contract, I always pass the transaction gas variable after getting it with estimateGas function, from Smart ...
0
votes
0
answers
258
views
How to handle estimate gas cost error?
I am programming a button for a transaction which shall only appear if the transaction is possible. Therefore, I am using the following code
contract.methods.function(parameters)
.estimateGas({...},...
3
votes
2
answers
4k
views
Estimate Gas Cost before SendTransaction [duplicate]
How meta estimating gas cost before broadcasting.
How can I calculate gas cost for myfunc() in web3js?
function myfunc(){
require(msg.sender == owner)
...
}
await contractInstance.myfunc....