The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [gas-price]

Questions dealing with the gas price of a transaction.

Filter by
Sorted by
Tagged with
1
vote
1answer
13 views

What is the unit for the tx.gasprice?

Is it a wei, kwei, mwei, gwei, ... Something else? The API doesn't say much.
0
votes
0answers
11 views

How to use oraclize fee from contract balance instead of sender's wallet? [duplicate]

I am using oraclize query. I have a function that user's invoke but I dont want users to pay the gas fee for oraclize query, I want that fee to be paid by my contract balance, and if my balance is not ...
0
votes
0answers
19 views

Is Gas consumed in boolean operations that do not change contract state?

Imagine I've created a voting contract, and I'm the owner of this contract. I'm going to deploy it and create a front end to interact with it. Within my contract i've everything secured to add ...
0
votes
2answers
46 views

How to reduce the gas price for complicated smart contracts?

This is my smart contract's calculateReward function: function calculateReward(uint256 _amount, address _sender) internal view returns (uint256) { uint256 reward = 0; for (uint256 i= ...
1
vote
1answer
30 views

Apparently some people send transactions with zero gas and positive gas limit, how do they do this? (and I am NOT planning to this but how)

Have a look at this transaction for example: https://etherscan.io/tx/0x11d96986d36240a5e5e7eab78879aa841631705370e707f15f1488a0b9d6704a 0 gas, 0 ether but plenty of tokens transferred. Obviously the ...
0
votes
0answers
14 views

How can I distribute funds to present stakers efficiently?

I am building a smart contract which keep the token holder's eths for a while and give them rewards when they withdraw. The reward is given from the ethers collected by early withdraw of people. If ...
1
vote
1answer
35 views

How can I reduce the gas price for the fallback function?

Below is my fallback function for ethereum. It currently require 91000 gaslimit which is way more than 21000. Metamask always starts the transaction with 21000 gas stipend due to which transaction ...
0
votes
1answer
79 views

Ethers js estimate gas offline?

Looking here in the docs it mentions I need to have the provider attached to estimate gas. But for formatting a transaction offline, I dont have access to the provider. Is there a way to estimate the ...
-1
votes
1answer
21 views

GAS price validation for transactions in OLD blocks

How does Ethereum verify GAS price stated within transaction, to be high enough for transactions stored in past blocks? Does each block include an average GAS-bid experienced by miner at the moment ...
0
votes
0answers
37 views

How Geth classify transaction as local or non-local? txpool validateTx skips gasPrice validation for local transactions

I see geth code skips the validation of the local transactions https://github.com/ethereum/go-ethereum/blob/master/core/tx_pool.go#L528 // Drop non-local transactions under our own minimal accepted ...
0
votes
1answer
22 views

What are the parameters for the ideal gas limit?

I am new to writing smart contracts, in recent times I am having trouble in deploying the smart contracts couple of times so I need a solution for that. I am using the truffle most of the time so ...
0
votes
2answers
22 views

Sending ethereum smart contract transactions to miners

We are building a decentralized document issuance application using the ethereum blockchain. For every transaction, some gas costs deduced in the form of ether. Is it possible to host ethereum miner ...
0
votes
2answers
34 views

Does price of smart contract execution raise with price of ethereum

I can't determine properly whether higher price of ETH means smart contracts will also cost higher(in fiat not eth) and is it reciprocal, like if we have a SC deployed and eth price raises 10x, will ...
0
votes
1answer
23 views

Different between gas and gasLimit keys when executing transactions

Below is the code that I'm running. When I entered "gas" and "gasLimit" as the keys, both worked. Why is that? What does "gas" represent? And what is the optimum amount of gasLimit should I use (...
1
vote
0answers
27 views

Gas usage difference between Remix and Ganache/public networks

I'm trying to integrate a contract into a front end with MetaMask and getting different gas amounts depending on the network and compile options I use. Remix ("Enable Optimization" checked): 90,410 ...
1
vote
0answers
21 views

Most precise website to estimate gas price for volatile days

I am trying to understand which website is the best way to estimate the gasprice for volatile days. There are some sites but they do not work out so well on a volatile day like today. I compared and ...
0
votes
2answers
32 views

Effective way to compare to arrays

What is the most cost effective way to compare to arrays eg. uint arrays in solidity. Running a for loop takes too much gas.
0
votes
1answer
15 views

How much gas does looking up block.timestamp consume?

Trying to get some insight as to whether or not it's more optimal to call block.timestamp repeatedly for comparisons or to set a (memory) variable to hold the value and use it instead. I've looked at ...
5
votes
1answer
100 views

Why does gas cost explode with more than 7 variables in a struct

I'm assuming this has to do with Ethereum's 7 variable stack limit but in the following code test struct TestStruct5 { uint8 m_nOther1; uint8 m_nOther2; uint8 m_nOther3; uint8 ...
0
votes
1answer
34 views

Does ERC-20 balanceOf function cost no gas?

Given that this is a sample balanceOf function code: function balanceOf(address tokenOwner) public view returns (uint balance) { return balances[tokenOwner]; } and this function is view function,...
0
votes
0answers
39 views

Issue in setting GasPrice when sending raw transaction

I am using web3 and infura node to send my raw transaction but I am having difficulty in setting gasprice. I constructed rawtransaction as follows web3js.eth.getTransactionCount(myAddress, 'pending')...
0
votes
1answer
56 views

What is the meaning of “Gas Used” on ethgasstation.info?

It's rather confusing cos when I googled "gas used" I don't get any exact result, NOT even from ethgasstation.info and most people are talking about transaction price, gas limit, etc. So, does "gas ...
1
vote
1answer
21 views

How to calculate “gas” and “gasPrice” when referring to ethgasstation.info when sending transaction via web3js?

I'm using web3js to issue token which has a name and description. I'm using ropsten testnet. Here's my tx. const tx = { from: walletAddress, to: contractAddress, gas: 4700000, ...
0
votes
1answer
38 views

Calculated Gas Costs of Contract execution

I have a smart contract that maps a string to a string value and stores it on the Blockchain. I want to analyse the Gas Used by Transaction. One time the execution consumes 92,843 Gas (https://rinkeby....
0
votes
0answers
50 views

How to create an ethereum private network with proof of authtority without gas cost or gas price zero?

I want to create a private network but I don't need to use ether or gas, only I want to run smart contracts and the blockchain using ethereum technology. I find this tutorial Private proof of ...
0
votes
1answer
52 views

How do I get the transaction fee used by a transaction in web3py

I am using web3py to do transactions for token and ether. Now I need to keep a track of transaction fee applied for each transcation. How can I get the transaction fee from transaction hash?
6
votes
2answers
238 views

Deploying contract with no cost (gasPrice 0) on private network

In order to achieve a no-coin bootstrapping of my private network I'm trying to deploy a first special contract having zero funds in owner wallet (every wallet of this private network should have zero ...
5
votes
2answers
629 views

How is it possible to pay 2,100 Ether ($309,267) for a transaction fee?

Here is the transaction details that has transaction fee for 2,100 Ether ($309,267.00) only for sending 0.1 Ether. There is no fairness for users, hence accidentally adding a zero might cause them ...
1
vote
1answer
21 views

Costs in gas of changing the value of a variable

Maybe a little bit weird question, but can the amount of gas, when: SSTORE is used(for changing an existing variable), be lesser than 5000 gas? If no, are there discussions in community to reduce ...
0
votes
1answer
48 views

How much does the gas prices in the main eth network differ from that in the ropsten test network

I'd like to know, to which degree does the Gas prices from the main eth network are comparable to the ropsten test network.
0
votes
1answer
270 views

Truffle and Ganache - do I need to set the same gas-price and gas-limit in both of them?

Or can I set different values? If I can set different values, then how will they be used in the system (i.e., what gas-price and gas-limit will apply in every transaction that I execute)? Here is my ...
0
votes
0answers
30 views

Why I can use a lower gasPrice than the node I set in --gasPrice

I established a private network recently and I use web3.eth.sendTransaction({from:"0x14ca04ff85747def87d6c6c566db84cc24e4643b",to:"0xa04fce8906c870a47a8a7f5f7547dfc4a62cae7a",value:"1000000000",...
2
votes
1answer
590 views

What's the default web3 gas price? [duplicate]

When sending a TX, there's an optional gasPrice field. If I don't set it, what's it default to? Does it look at other TXs going on or is it a fixed value that only changes when web3 gets updated to a ...
2
votes
0answers
53 views

Why account creation using CALL or SUICIDE costs 25000 gas? [duplicate]

CALL and SUICIDE both have additional cost of 25000 gas if it leads to account creation. At the same time, sending 1 wei in separate transaction costs only 21000 gas. Thereby if I am about to create ...
4
votes
2answers
304 views

web3.eth.getGasPrice() always return 1GWei

For estimate transaction cost, I use web3.eth.getGasPrice() function. The return callback value always 1Gwei(1,000,000,000) in ROPSTEN. web3.eth.getGasPrice(function(error, result){ console.log(...
3
votes
1answer
232 views

how to use web3j over infura to find exact gas price used for a successful transaction

my goal is to compute the cost of gas for a successful tx. I get a callback when a transaction succeeds and i retrieve gasUsed with transactionReceipt.getGasUsed(). Now I need to know the exact gas ...
0
votes
2answers
34 views

The cost of using Ethereum as a reference database

As stated in the documentation there are 3 types of storage in the Ethereum VM (EVM) The storage, the memory, and the stack Each account has a data area called storage, which is persistent ...
1
vote
0answers
86 views

Image and file storage in block chain

Is it possible to store a base64 image code as string in block chain? I know we can use IPFS or Swarm as a tool to store an image or a document, but if someone gets to know about the hash anyone can ...
1
vote
0answers
15 views

Ethereum Price - Transaction cost relation [duplicate]

The average transaction cost is around 0.0005ETH which is around 0.06$ right now. Does it mean that the transaction fee decreases whenever the price of Ethereum drops? Isn’t the price closely related ...
1
vote
0answers
24 views

function gas calculator and function gas padding

not sure if this is possible, but I was wondering if one function can calculate the gas cost of another function? Also can a function run a series of computations to match the gas cost of the ...
2
votes
0answers
27 views

What Web3JS method do I call to know what value to use for the gas price with sendSignedTransaction?

I am using Web3JS 1.0+ to send transactions to my smart contract. I've been using the following constant for the gas price in my code that I got a long time ago from a tutorial. What is the "...
1
vote
1answer
84 views

What should be optimal gas limit and gas price for 80 addresses airdrop?

This is my airdrop function: mapping (address => bool) public airdrops; function airdropTokens(address[] _recipient, uint256[] _tokens) public onlyOwner{ uint airdropped; for(uint256 i = 0; i< ...
2
votes
1answer
209 views

How to determine the gas price mathematically

The mathematical equation to define the gas price is gasprice = 1 gwei / gasused. The mathematical equation to define the tax to be paid for each transaction is tax = gasprice x gasused. Are these ...
0
votes
2answers
179 views

How to solve insufficient funds (Ropsten)?

I have tried adjusting the Gas Limit and GWEI and I get this error. I am using infura and Ropsten. Has anyone any ideas about this? Code - var rawTransaction = {"from":myAddress, "...
2
votes
2answers
330 views

weird transaction sending to self

see some weird txs calling self addresses, for example, the last 2(the first and second tx in this block) transactions, at https://etherscan.io/txs?block=6475251&p=2 https://etherscan.io/tx/...
1
vote
2answers
462 views

Explanation of Geth's Command Line option: targetgaslimit?

I have been trying to figure out what the targetgaslimit parameter does exactly for Geth, in the context of Private Blockchains. I have seen the following explanation but it never helped me: "Target ...
1
vote
1answer
26 views

Why aren't costs “advertised” or at least knowable so funds aren't lost?

I'm admittedly new to all of this, but as I learn about the transaction model, it seems to be a confusing business model at the very least. I can understand that the price of gas fluctuates or can be ...
3
votes
0answers
151 views

Denial attacks by submitting transactions with strategically calculated gas prices

As can be understood from the title, there is a specific form of denial attack where specific transactions are blocked by submitting transactions with strategically calculated gas prices. Example 1: ...
0
votes
1answer
53 views

Do i really need all these arrays and mapping? Gas usage issue

I've written a sample contract below. My question is, do i really need so much mappings and arrays? It's very gas hungry by storing a couple of times basically the same data. Could the same result be ...
1
vote
2answers
441 views

How to optimize the gasPrice and gas options in a contract send() function? [duplicate]

There are many questions and answers about estimating the amount of gas consumed. This question is about what to do with this estimate. What values should we actually provide to gas and gasPrice in ...