Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
2 answers
5k views

How to calculate transaction fee using ethers.js

I am trying to calculate the transaction fee of a tx before prompting MetaMask using ethers.js. So for I have: const gasPrice = ethers.utils.formatUnits(await ethers.getDefaultProvider().getGasPrice(),...
abc's user avatar
  • 165
3 votes
2 answers
1k views

Unaffordable gas limit for my Ethereum based crypto-coin

The gas limit for single send transaction is about 21000 gas. Now I am creating my own Ethereum based crypto-coin, and I want to keep its conversion rate as 1 coin = 1 US$ and about 0.02 US$ as ...
PrashantNagawade's user avatar
2 votes
1 answer
449 views

Why estimateGas return 21001 instead 21000?

For example web3.eth.estimateGas({from: eth.coinbase, to: eth.accounts[1], amount: web3.toWei(1, "ether")}) return 21001, but not 21000, so why?
DeV1doR's user avatar
  • 637
5 votes
1 answer
609 views

Is it possible to deplete all funds in an Ethereum account?

I have an Ethereum account loaded with Ethers and I need to spend all of them, leaving account final balance at exactly zero Weis. Is that possible? I know using method eth_estimateGas() and ...
Juan Ignacio Pérez Sacristán's user avatar
5 votes
1 answer
1k views

Is it possible to calculate the gas costs of a transaction exactly upfront?

In the Ethereum wallet there are the estimated gas costs. Why is it only an estimate? Is is possible to calculate the gas costs precisely upfront?
mKoeppelmann's user avatar
  • 7,636