Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
0 answers
35 views

What values for the global state variables does geth use for estimateGas?

What values for the global state variables does geth use for estimateGas? For example, block.timestamp.
out.eth's user avatar
  • 21
1 vote
0 answers
233 views

Low level question about how eth_estimateGas interacts with state changes

i'm new here, i have a pretty weird question. Do you guys know how eth_estimateGas works at low level? In particular, do you guys know how it interacts with state changes? Let's say for example i have ...
Davide Rossi's user avatar
1 vote
0 answers
88 views

Maximum gas estimate

eth_estimateGas provides estimated final gas consumed by transaction and accounts for gas refund in the end of transaction. However, is there a way to estimate maximum gas the transaction may consume ...
pokrovskyy's user avatar
2 votes
0 answers
123 views

how to estimate the gas cost of a contract function that will fail

I am trying to estimate the gas cost of a contract function that will fail. when i do that using standard web3.py's contract.function(args).estimateGas(txArgs) it ends up failing and raising an ...
Kaki Master Of Time's user avatar
1 vote
0 answers
482 views

Understanding eth_estimateGas with regards to gas price, and current mempool

Does anyone have a detailed understanding of how eth_estimateGas works with regards to gasPrice and the current mempool state? I have historically seen some really odd behavior when using ...
LampShade's user avatar
  • 640
2 votes
1 answer
798 views

how to use eth_estimateGas for erc20 tokens?

i wanna calculate estimate gas for BNB, PAX, LINK i have used geth 1.8 and web3.php my contract data that used (i found them from etherscan): <?php /** * @var array */ public ...
Farhad Jafari's user avatar
0 votes
1 answer
362 views

Smart contract transaction takes different amounts of gas on different platforms

I have an ERC-20 token contract on which I want to perform some testing on a local chain. I got my chain setup, contract deployment and testing scripts ready on my Windows machine. However, since I ...
Aleksi Daskalov's user avatar
0 votes
0 answers
155 views

Why does my private network transaction use a different amount of gas than my mainnet transaction performed immediately after?

I am forking the mainnet from my own geth node with ganache-cli --fork option. Immediately after the fork, I simulate a transaction to a contract on the forked, private network. I then immediately ...
python_crypto_questions's user avatar
1 vote
1 answer
4k views

Estimate Gas For Smart Contract Always Fails

I have deployed a very simple contract to the Ethereum blockchain to be able to split a payment across two different outputs. pragma solidity ^0.5.0; contract MoonTrade { function multiSendETH( ...
mocode10's user avatar
  • 143
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 ...
Hadar Keidar's user avatar
0 votes
1 answer
4k views

How to estimate gas cost for contract method using geth

I want to estimate a contract method gas cost using geth. I understand there is no direct way using geth as in the web3 libs. But I don't understand what is the second argument needed and how I can ...
sirodoht's user avatar
2 votes
1 answer
3k views

How to properly estimate gas costs of function calls with go-ethereum and golang?

I'm attempting to build out a program in golang to model ethereum gas costs of function calls for the smart contracts I write. I've successfully been able to estimate them using ethclient.EstimateGas ...
hextet's user avatar
  • 1,593
1 vote
2 answers
1k views

eth_estimateGas rpc is very slow. I'm using geth node. It worked fine a few days ago. Is network congestion the reason?

I'm using geth 1.7.2-stable. I noticed "eth_estimateGas" is very slow. It does not show the result. I confirmed that it worked a few days ago. Someone said the number of transaction is very high from ...
zono's user avatar
  • 1,493
1 vote
0 answers
815 views

my_contract,estimateGas() crashes and "eth_estimateGas" returns incorrect value

I'm trying to estimate Gas for a contract method (both using parity and geth - tried web3py and web3js). Contract is deployed and proven to be working. When I use: estimateGas and geth (providing: ...
JackinHouse's user avatar
0 votes
1 answer
231 views

Invalid argument after upgrading geth from 1.5.9 to 1.6.1

Once upgraded the geth node to 1.6.1 it is not accepting queries anymore, throwing the following error: Invalid argument 0: missing 0x prefix for hex data That's weird for a query like this, where ...
Juan Ignacio Pérez Sacristán's user avatar
23 votes
5 answers
29k views

How to estimate gas at contract creation/deployment to private ethereum blockchain

What I have done a) When I use web3.eth.estimateGas to estimate the cost of a contract creation constructor with no parameters, the estimate is correct. b) If the contract is already deployed then ...
Imroz's user avatar
  • 871
5 votes
1 answer
838 views

eth_gasPrice often returns 20,000 Babbages, but not always. Why?

According to https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_gasprice rpc-json method eth_gasPrice returns the current price per gas in wei. But I have several questions: What does exactly mean "...
Juan Ignacio Pérez Sacristán's user avatar
5 votes
1 answer
4k views

Gas, gas price, gas cost

I have read in the documentation that the miners set the gas cost. Does this means that gas cost varies from miner to miner? If not, how it is determined? Moreover, when a contract is referred in geth ...
Sukhmaninder's user avatar