Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gas-price]

Questions dealing with the gas price of a transaction.

5
votes
1answer
81 views
+50

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
291 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
16 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
21 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
57 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
26 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",...
0
votes
1answer
92 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
42 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 ...
3
votes
1answer
83 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
82 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
29 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
55 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
14 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
20 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
25 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
63 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
54 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
97 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
147 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
248 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
91 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
50 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 ...
0
votes
2answers
241 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 ...
1
vote
1answer
100 views

How to caculate/estimate Gas Limit and Gas Price based on current state of the ether network?

Ethgasstation and similar websites estimate proper Gas Price based on current state of Ethereum network. Is there any way of using working with Geth/web3 to estimate proper Gas Price? and similar to ...
1
vote
2answers
195 views

Remix: how is gas price determined?

When I send a transaction from remix, how does it set the gas price for the transaction (not gas cost / limit)?
1
vote
1answer
143 views

How to get the historical Gas (Gwei) Price

I would like to get the historical Gas (Gwei) price in hourly or minutely with safelow, Standard, fast and fastest. I am aware of the etherscan.io which gives avg gas price for a day and also ...
1
vote
0answers
25 views

Does pooling make sense?

It seems that allocating storage elements is 4x as expensive in terms of gas cost than changing them. Does that mean it would make sense to pool structs and arrays, and maybe also strings, rather ...
1
vote
0answers
37 views

Why is my transaction not included into blocks with smaller gas prices in them?

I created a transaction with gas price 1.1 GWEI. It has been pending for 3 hours, and yet - during just the last 75 blocks - several 1 GWEI transactions have been included. In other words, gas price ...
0
votes
1answer
34 views

Who is paying for a transaction within a contract?

Let's assume I do a transaction to a contract function with my external account, then I have to pay gas for this transaction. If the function within the contracts makes now a transaction on his own ...
0
votes
1answer
199 views

Infura not broadcasting my transactions

I am using Infura with the mainnet and web3py to interact with smart contracts and send transactions. Last week this same code worked fine, but today, trying to send the transaction for the deployment ...
0
votes
1answer
53 views

Am I setting my gas price and gas limit correctly?

web3.TransactionManager.DefaultGas = 210000; // Gas limit? web3.TransactionManager.DefaultGasPrice = 10 * 1000000000; // Gas Price? I have intended to set the gas price at 10Gwei.
0
votes
1answer
53 views

What is the unit of measurement used in GasPrice and GasLimit?

I did a check, in ethgasstation the current safeLow = 15GWei, which is equal = 15,000,000,000 wei However, when I issue eth.getBlock("latest") what I get was: > eth.getBlock("latest") { ...
0
votes
2answers
682 views

How to calculate gas for contract deployment @_@

Refer to the following: rinkeby: { host: "localhost", port: 8545, from: "my address", network_id: 4, gas: 4800000, gaslimit: 2100000000000 } When I set the gas to 4700000, I received the ...
2
votes
1answer
508 views

what is difference between “gas” “gas price” and “fee”?

Can we say that gas is the unit of transaction fee ? And gas price is the same transaction fee ? If so, why we do not use ether and wei instead of gas ?
0
votes
1answer
31 views

Is it clear that for every “ether” transfering using “address.transfer(amount)” how much “fee” must be paid?

Is it clear that for every "ether" transfer using "address.transfer(amount)" how much "fee" must be paid? I mean how much is the cost of transferring ether by address.transfer(amount)? Is it a fix ...
0
votes
1answer
20 views

Function not marked as View and Pure but read only

I have a function: function test(uint value) { if (balances[msg.sender] < value) return; balances[msg.sender] -= value; } *note: the above is for illustrative purposes only. ...
0
votes
2answers
404 views

Recommended Gas Limit for Single Transaction

Current mainnet gas limit per block is 8M (7.99), that of Ropsten is 9M (which is actually rather surprising as it was 4.7M two months ago and I did complain about it...). Given the above, what's the ...
0
votes
1answer
42 views

What is the cheapest and most efficient way to send data to a struct, and why?

I'm struggling to find which way to send data to a struct is cheaper and most efficient. I came up with these 2 different styles: struct Database { string name; string addressPerson; } ...
1
vote
0answers
83 views

Gas SafeLow historical data

I am doing some gas analysis work and I really want to find or generate a dataset for historical SafeLow gas prices as defined by EthGasStation: “A price that at least 5% of the network hashpower ...
0
votes
1answer
91 views

Question about Gas and Gas Price

In my transaction: gasPrice: 210000 blockHash: "0x69bd71736f2a5d2c83919a0de81a7de0b6b690bb6bdda3acff254d5c68f634bc", blockNumber: 3178, from: "0xc8caa71c16299b40b8579742a27ee53162886040", gas: ...
3
votes
2answers
254 views

Why do miners not always “vote” to increase the block gas limit?

Miners can increase/decrease the block gas limit. I read that they can increase/decrease for about 0.01% per block. Why do miners not always want to increase the block limit? This would lead in more ...
9
votes
6answers
4k views

Why not mine my own transactions?

I have a contract which needs to be updated occasionally. So I create a transaction, sign it and send it to the network. When I do that, I state a gas-price. The higher the gas-price is, the faster ...
0
votes
2answers
224 views

How much gas does it cost to create and/or execute a smart contract? [duplicate]

Curious for any other good resources for this Q!
0
votes
0answers
53 views

GasPrice strategy - is automatic safe?

Is it okay to not set gasPrice in web3.eth.accounts.signTransaction or is it potentially dangerous if the automatic price is unreasonable? The Transaction is a basic ether transfer - no smart ...
1
vote
2answers
1k views

How to calcualate Ethereum transaction fee

I have got 1 Ether in a account, which I would like to empty the account by sending to some other account. May I know the calculation that how much have to be subtracted from 1 ether and send to some ...
1
vote
1answer
26 views

How do events influence a transaction's gas?

Since events are stored in the transaction receipts trie they should influence the gas a transaction costs since storage costs, right?
3
votes
3answers
712 views

How much gas and gasPrice to set when signing a transaction?

const params = { to: '0xdbC0d76Fb1f2399b618FB29922dBC5cf763dd3d7', from: dbDeposit.depositAddress, value: balance, gas: 2000000, gasPrice: '234567897654321', nonce: 0 }; ...
0
votes
1answer
1k views

Gas estimation errored with the following message… Error: gas required exceeds allowance or always failing transaction

I made a smart contract, but i got an error while deploying it , after i specified the Gas limit of 3000000 and a random value (wei) , and clicking on Create , i got the following error : ( i am ...
1
vote
1answer
127 views

Alternative for String type in smart contract and Solidity?

Regarding the fact using String in contract is expensive, is there any alternative type in Solidity ? The input value (Payload) I want to set is as follows : {"SQN":4,"Node_ID":"...