8

It sounds like you are being front run. This means that a bot is watching you send a transaction, reading the input (specifically, _answer), and submitting a transaction with the correct answer but a higher gasPrice. A miner will accept their transaction before yours, causing theirs to succeed and yours to fail. You can see that this is, in fact, what is ...


5

60k - 80k pending transactions sounds like a normal situation and does not seem extensive. Currently, Ethereum does ~750k transactions daily. Assuming all transactions are processed at the same rate, the content of the pool is swapped in every 2.5 hours. However, my guess is that automated services send very low fee transactions that are not critical. ...


5

Block mining process in general looks like this: Miner picks transactions to be included into the block and validates them Miner organizes transactions, their receipts, resulting blockchain state into Merkle trees and calculates root hashes of them Miner chooses random nonce value Miner constructs block header from various information that, among other ...


4

I always use https://ethgasstation.info. They have an API. I have never used it but it looks very helpful. Just use a GET Request and query for their fast transaction type. Otherwise you can craft this algorithm yourself. Here is my take on this problem: Look through the latest ~50 blocks. Retrieve the gas price of all/most of the transactions from these ...


4

I think your situation is pretty similar, so you may try a method described in this article: https://medium.com/mycrypto/operation-cryptokitty-rescue-93fd8e00e4f8


4

Gas will never be free. It has a purpose and that is to create a cost for a computation. If there was no cost for computation it would be possible to do infinite loops (with each loop being free) that would cause problems for the miners and system.


3

As it sounds you do not need to interact with hashes from smart contracts, you could do something simpler. Ethereum blockchain that is designed for transfer-of-value is not good for store-of-hashes use case. Collect hashes to a single file Publish this file in a decentralised storage network like Storj, Sia or FileCoin Storj Tartigrade cost is $0.0045 per ...


3

First of all, you don't need to add the gas-price into your computation. This factor is chosen by you (the transaction sender), so there are no questions about it. The only part in question is the 64244 gas units used in the transaction. According to the white-paper, you have determined that it should be 21000 + 68 * 7 = 21476: 21000: Paid for every ...


3

Short answer: It is approproximately the sum of the cost of executing all called functions plus the cost of executing the wrapper which includes small gas expenditures to pack and unpack function arguments. Better answer: The cost difference isn't serious. The decision should probably be based on your intended flow and other factors. For example, if you need ...


3

Is the total cost gasUsed * gasPrice? Almost. It's gasUsed * gasPrice + value, where the latter indicates the amount of ether that you have passed (can be larger than 0 when executing a payable function, and must be 0 otherwise). Total = 249,118,200,000,000‬ (wei I think) Yes, since both gasPrice and value are in wei, hence both components in the sum (...


3

My recommendation: Configure gas-price according to user-input, allowing for the current price as default (you'll need to implement function scan): async function getGasPrice(web3) { while (true) { const nodeGasPrice = await web3.eth.getGasPrice(); const userGasPrice = await scan(`Enter gas-price or leave empty to use ${nodeGasPrice}: `); ...


2

Overall fee you pay for a transaction, counted in fiat currency (EUR, USD, etc), depends on the following things: Ether to fiat exchange rate (may change over time, out of your control) Gas price (set by you, but miners may reject mining your transaction if gas price is too low) Actual gas used, this depends on what smart contract actually do and how ...


2

Your best choice atm is to use coinmarketcap api. It gathers data from many different markets and provides an average price market. Alternatively, you can make use of markets APIs, like Kraken, Coinbase, etc .. Hope it helps.


2

Yes, miners include transactions in blocks from the most rewarded to the least rewarded. But after the transactions are selected, the entire process for mining the block remains the same(i.e choose a random nonce value and calculate the hash repetitively until the hash is good enough) no matter which transactions you include. So even if you configure your ...


2

Your calculations are correct. gasUsed = 68988 gasPrice = 11.1 gwei totalCost = gasUsed x gasPrice = 765,766.8 gwei Considering that 1 ether is 1,000,000,000 gwei and as of 2020-04-12 22:40 UTC 1 ether = 162 USD, then we have 1,000,000,000 gwei are valued 162 USD 765,766.8 gwei are valued 162 USD * 765,766.8 gwei / (1,000,000,000 gwei) = 0.1240542216 USD.


1

How can I minimize the gas fees when using metamask? It is possible to set custom gas fees when sending a transaction with Metamask (see here : https://metamask.zendesk.com/hc/en-us/articles/360015488771-How-to-Adjust-Gas-Price-and-Gas-Limit-). The Ethereum network is currently overloaded and the consequence is a higher gas cost. You can see the average gas ...


1

If the average gas price and the transaction flux stay as high as it is since a few months, it is very unlikely. If you want to replace your transaction you can send a new transaction with the same nonce and a gas price much higher.


1

If an event is indexed it means it can be (easily) searched for: What does the indexed keyword do? . All events are stored in the transaction (and therefore, in the blockchain) regardless if it's indexed or not. Emitting events is the about the cheapest way to store data in the blockchain. Here are some fast-googled calculations: https://www.reddit.com/r/...


1

Following the comments to your question, here is a working example (tested with web3.js v1.2.1): async function run() const web3 = new Web3(YOUR_NODE_URL); const contract = new web3.eth.Contract(YOUR_CONTRACT_ABI, YOUR_CONTRACT_ADDR); const account1 = web3.eth.accounts.privateKeyToAccount(ACCOUNT1_PRIVATE_KEY); const account2 = web3.eth....


1

Public key recovery of an ECDSA signature uses the ECRECOVER operation and costs 3000 gas. If you have the public key you can derive the address and afaik a keccak operation(sha3) costs 30 gas.


1

Since ether on the ropsten network virtually isn't worth anything, does the gas price for transactions affect the priority in which they're mined? Ropsten ether may be worthless in "the real world" (for example, if you ever try to convert it to dollars), but in the perspective of the Ropsten network participants, it is just as worth as it is on any other ...


1

But the fee is always gas price * gas limit No it's not. The fee is gas price * gas, where gas is the actual amount used during the transaction. Nevertheless, the amount of gas in your account prior to executing the transaction must be equal to or larger than gas price * gas limit, and not just equal to or larger than gas price * gas (see more details ...


1

Well it's not forbidden. If you think of it it kinda makes sense that a lot of 0-gas transactions are in a single block: a single miner (or a mining pool) for some reason includes lots of 0-gas transactions in the blocks he tries to mine. When he finally succeeds in mining a block all of those transactions finally go through. I'm not sure if you can find ...


1

If a transaction with the same nonce has already been broadcast, then the others will be cleared from the tx pool. This is a rule set by the clients that run nodes.


1

Don't know details about your exact case, but here are some tricks that could be used to reduce gas cost when sending tokens to may addresses: Do several transfers in one transaction. This will save you approximately 21000 gas per transfer. Make recipients pay for gas, e.g. by signing cheques for them off-chain, so they will redeem these cheques on-chain. ...


1

You'll need to implement something like this: pragma solidity 0.4.26; import './IERC20Token.sol'; contract Airdrop { address public owner; mapping(address => uint256) public balances; constructor() public { owner = msg.sender; } function transferBatch(IERC20Token _token, address[] _targets, uint256[] _amounts) external { ...


1

A you can see here, the Ethereum block time currently averages around 16 seconds as of today. A transaction is confirmed when a miner adds your transaction into their block and is also able to solve the mining puzzle and this block is then part of the longest chain. Again, to be sure that this block is part of the largest chain, you might have to wait for a ...


1

There is no way to get this 100% correct and especially not 100% optimized. The best you can get is an estimation and Ethgasstation provides their best estimate. There are simply too many variables in play. Which miner solves the mining puzzle? How many transactions will be waiting to be mined? How big gas prices do the transactions offer? And so on.


1

I am thinking if I could setup a miner client to mine ONLY very low-valued blocks, because, I hope, there is less people trying to solve them. Every miner is always trying to solve a different block. If two miners are not coordinated, they are each trying to mine blocks that reward them and not the other miner. So miners who aren't coordinating are trying ...


1

You can follow this website they have provided their API as well click here and you can get a lot of other detailed information as well


Only top voted, non community-wiki answers of a minimum length are eligible