Questions tagged [gas-price]

Questions dealing with the gas price of a transaction.

Filter by
Sorted by
Tagged with
0
votes
1answer
54 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
466 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
212 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
362 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
316 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
29 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
41 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
42 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
289 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
106 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
120 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
1k 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 ...
3
votes
1answer
663 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
40 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
21 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
686 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
48 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
97 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
114 views

Question about Gas and Gas Price

In my transaction: gasPrice: 210000 blockHash: "0x69bd71736f2a5d2c83919a0de81a7de0b6b690bb6bdda3acff254d5c68f634bc", blockNumber: 3178, from: "0xc8caa71c16299b40b8579742a27ee53162886040", gas: ...
3
votes
2answers
416 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 ...
10
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
455 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!
1
vote
2answers
2k 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
43 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?
4
votes
3answers
1k 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
176 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":"...
0
votes
1answer
143 views

Offline signed contract throws 'exceeds block gas limit'. Why can't I deploy?

I'm trying to deploy a smart contract onto the Ethereum blockchain by signing the transaction on an offline computer and then transferring the byte code to an online system for deployment. Because of ...
0
votes
1answer
256 views

How to store 25 char string on erc20 token and cost?

I’m wanting to be able to create an ERC20 token that stores a 25 character long string with it. Just wondering if this is actually possible? Also if it is possible I’m gathering from the posts I’ve ...
0
votes
1answer
1k views

reliable way to get gas price [duplicate]

I've read that eth.gasPrice isn't reliable, because sometimes it suggests gas prices too low. Is there some API or something similar where I can get the current gas price? This is for an automated ...
1
vote
0answers
30 views

Miss aligned state loading/storing gas costs

For a smart contract idea that spins around in my head, I have the situation where I have to conserve the old values of a variable (no storage refund or cheaper SSTORE updates). As the value I write ...
0
votes
1answer
143 views

Block reward from transaction regarding block's gas limit

maybe it's a silly question or remark, but given that the current block gas limit is about 8,000,000 and the average gasPrice is about '15Gwei' ( I roughly looked at the chart "Transaction Count by ...
5
votes
2answers
2k views

How to get the transaction cost in a Truffle unit test?

How can I get the actual gas consumed by a sendTransaction inside a truffle test? In the following test, buyer sends an amount of 50 ETH to a contract: const EmptyContract = artifacts.require("...
0
votes
1answer
83 views

Error with wrong calculation of gas price and value after lots of iterations

I am trying to code something that empties an address and sends that amount to my main-wallet. In order to get familiar with sending raw transactions and manually setting the eth-amount, I've tried ...
0
votes
1answer
108 views

Who pays for gas in each interaction?

I am thinking of a scenario where there is a user (U) that wants to upload a smart contract to the Ethereum network to be run later by multiple users {U1,U2,...,Un}. For example, assume we have a ...
3
votes
3answers
4k views

How can I set the gas price while deploying a contract with web3.js?

I set up a Geth node on the Rinkeby network recently. And while I can send ordinary transactions in seconds without a problem, I can't seem to get a contract creation to happen in less than an hour. ...
1
vote
0answers
67 views

Estimating gas costs for large batch of transactions

I noticed on EthGasStation the following below the estimated gas prices: Note: Estimates not valid when multiple transactions are batched from the same address or for transactions sent to addresses ...
0
votes
1answer
182 views

Can't send ether to crowdsale contract (fail) + infinite gas bug on Remix

I'm a newbie trying to make a crowdsale contract in Ropsten (deployed a token contract very well before) but i meet some problems : I can't send ether to crowdsale contract, returning a fail status ...
1
vote
1answer
730 views

Understanding “eth_estimateGas” results estimating gas

I have been playing around with parity's "eth_estimateGas" call to determine different tokens gas requirements. Generally using this code: let transfer_data = contract.transfer.getData("<...
4
votes
2answers
3k views

How can I estimate price of data storage? [duplicate]

I'd like to make estimations of the cost of an application, and one of the things I need is the price to store n kB of data on a contract. In ether and in USD. Where could I find rates or prices of ...
0
votes
2answers
86 views

Is it feasible to perform signing with a private key inside a smart contract?

Is it possible/feasible to have a private key stored inside a smart contract and sign transactions with it or would the calculations be to pricey in gas? For example a smart contract should create ...
2
votes
2answers
629 views

Is gas consumed per contract call or during contract creation?

I know that there is a calculation about how much gas a script consumes. My question is is this consumption per contract call (i.e. by an Ethereum client) or does it only apply when the contract is ...
2
votes
1answer
50 views

Reducing storage write operations

Storage operations are very expensive and everything pales in comparison as soon as you start using them. So I was wondering, what clever way one could use to reduce the following storage write ...
2
votes
1answer
3k views

Send ethereum tokens with zero gas price

I have seen the following transaction: https://etherscan.io/tx/0x173fd250d63a62bb407f214ff924b49e1c90593572eab1a8c523783f2aa58ba3 And I've seen that the gas price is 0. How could I do the same? When ...
2
votes
1answer
933 views

What is the actual gasPrice used in a Truffle + Ganache environment?

It doesn't seem to match the Ganache UI, nor web3 gas price.
0
votes
1answer
305 views

Use full ethereum balance for token transaction

I want to use whatever ethereum is available in my account as transaction fee to send a token transaction. I know the gas I need, so in theory I thought the following formula would work: gasPrice = ...
2
votes
1answer
500 views

Is it ok to Use Javascript VM in remix IDE to know the Gas values?

Just wanted to know that using the Gas values generated for a contract in Remix IDE when Javascript VM option, does the Gas values are useful when deploying contracts to testnet or live, does the ...
0
votes
2answers
116 views

Sending ETH to ICO

How much ETH should I deposit in a wallet to send 1 ETH nett to an ICO considering gas and fees. I have already viewed an answer which confirms that it needs to be more than 1 ETH but the answer ...
3
votes
2answers
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 ...
1
vote
1answer
123 views

Is there anyway a smart contract creator can put a limit on the gasPrice(gwei) for a transaction?

I am looking at the possibility of creating a custom token on the Ethereum network & wanted to know if there is a way if i can put an limit on the gasPrice in order to prevent the so called "gas ...