Questions tagged [gas]

Gas is a 'sub-currency' which enables the EVM and Ethereum's decentralised computer to run -- with each operation, an amount of gas (proportional to the computational effort required to perform the operation) is consumed.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

Reduce gas costs with longer block confirmation times (like in Bitcoin)

In Bitcoin, fees tend to decrease as you target longer block confirmation times. For example, a standard transaction with 1 input and 2 outputs has a fee of approx. $3.06 for confirmation within 6 ...
0
votes
0answers
16 views

Is minting gas through gastoken.io still efficient to reduce Ethereum gas costs?

A SE user suggested using https://gastoken.io to mint gas when fees are low in order to save on gas when fees are high. However, I'm wondering if there's any benefit of doing this today. According to ...
2
votes
1answer
24 views

Is there “auto-drop” or “auto-cancel” for a transaction that's not been processed for a long time?

I sent a transaction with relatively low gas and during several days it was pending. Eventually I managed to have it to get through by increasing a gas fee. Other time I send a transaction with a low ...
0
votes
1answer
22 views

How can the transactions to this address always adapt to have higher gas price than all the rest?

Looking at the transactions from: https://explorer-mainnet.maticvigil.com/address/0xfD0E9d3f4Eee056B49DF062B70f766cFB13fEb01/transactions Looking at every block that a transactions is sent to this ...
0
votes
0answers
24 views

Transaction has been reverted by the EVM - How to deduce the revert reason in this case?

I get this error when I call a function that changes the state of the smart contract from the frontend: Error: Transaction has been reverted by the EVM: { "blockHash": "...
0
votes
1answer
33 views

Can't send a new transaction with a lower nonce while the previous one is still pending

Several days ago I sent a transcaction via MetaMask, to a different account of mine, with a gas fee of 30 gwei. It's still pending due to a fee being too low. A transaction contains all Eth in an ...
0
votes
0answers
5 views

What percentage of the transaction cost is related to persistent data storage?

Simple question I guess. Of the total transaction cost for a typical ethereum block, how much do people spend on storing data vs executing code? Where can this statistics be found for the chain as a ...
1
vote
1answer
18 views

What is the largest number that can be returned from a Chainlink Price Feed?

Is it safe to assume that chainlink oracles have an upper bound on the price feed, eg it fits into uint96, or perhaps a smaller or larger number? It would be great to know the absolute largest number ...
0
votes
0answers
22 views

What is the rationale behind lower minimum deposit & deposit fees for ECR20 Tokens vs Ethereum? [closed]

While examining the fee structure on Kraken I noticed the following peculiar pattern: Ethereum: Deposit Minimum: 0.05 ETH (approx. $61.99 at time of posting) Deposit Fee: Variable on-chain fee to ...
0
votes
0answers
10 views

The Real Cost to Foward Transaction to EOA via Smart Contract?

I'm creating a smart contract that does the following: Checks that a userID parameter is included as data field OR that the last 4 zeros of the amount being sent is not equal to zero (i.e, 0....
0
votes
1answer
9 views

Send Multiple ECR20 Tokens from a Single ETH Address in One Transaction?

Is it possible to send multiple ECR20 tokens (i.e, USDT and USDC) from a single Ethereum address (EOA) to another address (EOA) in a single transaction (either with or without a smart contract)? If ...
0
votes
1answer
27 views

Is 21,000 Gas Limit Fixed Only for Ethereum?

I was reading a comment on another post on Ethereum SE and found the following statement: 21,000 is for sending Ether, not anything else. The user suggested to "just set it to a large enough ...
0
votes
1answer
29 views

question about smart contract code possible vulnerability

I need help with one of my smart contracts. I wrote a smart contract that have functions that only emit events. The parameters of each event are some of the functions parameters. I want to ask if ...
1
vote
1answer
36 views

ERC20 optimization

I am studying popular Ethereum smartcontract's source code and there is something i do not understand on ERC20 standard. Let's took this example: https://github.com/OpenZeppelin/openzeppelin-contracts/...
0
votes
0answers
19 views

Consolidating “dust transactions” in account-based coins like Ethereum?

Suppose I have a marketplace where 100 buyers deposit 1 ETH each into 100 unique addresses and I know I will end up sending all 100 ETH to 1 vendor. Since the coins are originating from 100 ETH ...
1
vote
1answer
19 views

Maximum GAS price

When I launch an Ethereum transaction, I have to choose how much WEI I am able to pay for one GAS. This is a "bid" concept: If my transaction is very important and if I want to run it ...
0
votes
0answers
14 views

Multi transaction GAS

Let's suppose i have 5 customer. Each customer must give me 1 Ether. I have 2 solutions: I generate a single Ethereum Address and i give the same address to all my customers. I do not want to give ...
0
votes
0answers
22 views

Make transactions free of charge for the user

I involved in a project that aims to create a token for public use (non blockchain familiar users). User will have an ERC20 token, but I don't want they to have ETH to pay the gas. One obvious ...
0
votes
0answers
15 views

If you accidently set a very HIGH gas limit to purchase a smart contract for ETH can it be changed?

Ex. Gas limit was accidentally set to 5,000,000 & now when Trying to customize it keeps auto-populating to that causing me an INSANE gas fee of over $400. I don't want to cancel because I don't ...
0
votes
0answers
23 views

Why swapping some tokens require more gas fees than others?

I noticed that swapping some tokens in Uniswap to exactly the same amount of ETH, at the same time, has much higher gas fees than other tokens. Why is this? Aren't the swap transactions identical for ...
0
votes
1answer
16 views

Deciding Gas Pricing

Anyone know how curve fi and metamask fetch the average gas price for the transaction and how they provide the slow and fast option? I just want to know which third party they use to get these info.
0
votes
0answers
12 views

Too many request to node to get gas limit

When I need get gaslimit I call to node by web3j(java) by function ethEstimateGas to get gas amount used and I have cronjob to get ```gasPrice```` from etherscan. Follow by number of request can ...
0
votes
1answer
18 views

Estimate Solidity function gas cost

When i deploy a smartcontract with remix, i can call functions in order to test it. I do not really know if this is remix or metamask which is doing this job: Before validating the transaction, i have ...
0
votes
1answer
25 views

Contract pays for gas

Is there anything solidity in line that would let a contract with ETH assigned to, to pay gas. Say I want something simple. contract whatever { uint256 one; uint256 two; function execute() public { ...
0
votes
1answer
31 views

Is it Possible to Prove Who Sent Funds to Particular ETH Address?

I’m building a cryptocurrency marketplace where users mainly buy and sell small ticket items (worth $10 - $50) using cryptocurrency. Typically, the average user will deposit $100 at a time into a ...
0
votes
1answer
24 views

Gas for internal transactions (and transactions in general)

I am trying to design a SmartContract for a Token and I am having some issues with the gas calculations. When a user sends a token to someone, I would like there to be a fee. Where it gets fuzzy for ...
1
vote
1answer
62 views

Out of gas problem on contract call

Here ether scan links to failed transactions : last failed attempt : etherscan link others : etherscan link traced view of contract calls etherscan link (you may just change the tx hash on the URL to ...
1
vote
0answers
13 views

Will the tx fees of old contracts be greater or smaller than those of new contracts in ETH 2.0?

Will contracts that currently exist cost more or less to interact with after the ETH 2.0 upgrade? What about old contracts that call a new contract, or new contracts that call an old contract? Will ...
2
votes
1answer
98 views

How do I implement ERC20 billing?

I want to accept payments on my website. The idea is that for every user I create his own private key from a temporary address and when he sends some tokens to this address - I transfer money from ...
1
vote
0answers
39 views

Testing Gas Token on testnet failing transaction

I am trying to test my contract with gas token but I am getting fail txs which doesn't tell much the cause. This contract works properly if I do not include the parts related to gas token so i am ...
1
vote
2answers
69 views

How to divide BN by a decimal

I am trying to divide BN with a constant and I can't find the right function. Basically I wanted to divide 132876 by 1.30, 132876/1.30 for BN operations. Here is a snippet of what I tried. const ...
2
votes
1answer
118 views

SLOAD costs 800 gas - how is it possible?

I've got a very simple contract. It narrows down and measures cost of loading a storage variable: pragma solidity ^0.7.6; contract Bench { uint256 public data; function increment() ...
1
vote
1answer
14 views

Paying gas costs in custom cryptocurrency

Can you pay transaction fees in an ERC token you generate on a private chain? IE if I make ABC coin, can I pay gas costs in ABC instead of in ETH?
1
vote
1answer
15 views

Does a virtual function increase gas usage?

Suppose we replace every expression balances[user] with a call myBalance(user) where mapping(address => uint256) balances; function myBalance(address user) returns (uint256) virtual internal { ...
0
votes
1answer
57 views

How to estimate gas usage?

Please stop me if I am wrong. When we call any "state-changing" function of smart contract, this function will be run by all the miners of the mainnet. As a caller, I need to pay this using ...
0
votes
0answers
44 views

Can a single transaction use up all the block gas limit?

The current Ethereum block gas limit is ~12M, I see 100+ transactions are added per block on average. My question is can a single transaction use up all the Block gas limit (~12M) or miners will ...
0
votes
1answer
24 views

withdraw Ether from an exchange to a smart contract…!

ralated to this topic Can I withdraw Ether from exchanges to a contract wallet? I have a question that how exchange understand which address is a contract and how doesn't pay gas more than 21000...?
0
votes
1answer
19 views

what are benefits of creating tokens for creators

What are the benefits of tokens for their creators? and specially gas tokens? (like CHI Gas token or token with infinite supply) How their prices are determined in the first place? Thanks.
5
votes
0answers
28 views

Deploy gas issue for require reason string

I found a strange case and didn't find out why. ... modifier onlyMaster() { require(msg.sender == master || msg.sender == developer, "caller is not the master"); _; } ... ...
0
votes
1answer
116 views

How long can I expect to wait for a 20 gwei ERC20 launch? [duplicate]

Here's the transaction: https://etherscan.io/tx/0x9e34257bbb18e565a2154eb522085a30720e327b065342b5708c089d23e190cb I'm spending 20 gwei per unit of gas. This is all I could afford, I only have 10 ...
0
votes
1answer
192 views

5 gwei in gas, how long will this take?

I'm creating an erc20 contract and deploying with metamask. I only have 3 dollars in ether, so I could only afford 5 gwei for gas. It's been 3 hours, how long will it take? It looks like 40 gwei would ...
0
votes
0answers
7 views

Transaction Gas limit vs gas used vs start gas

I was inspecting one of my transactions on ropsten and I noticed something was off. The gas limit and gas spent as shown on etherscan and in metamask are 45666 and 29034 respectively so far so good. ...
0
votes
0answers
86 views

transfer Erc-20 tokens from an adress without Eth and pay the gas from another adress or destination adress

as the title completely explains I want to transfer some erc-20 tokens from one account that has no eth in it to another how can I do so without need to deposit some eth to that account? Is it ...
2
votes
1answer
48 views

Gas cost of setting a state-variable to the same value

According to this spec, setting a state-variable to the same value consumes 200 gas. However, I conducted a test over ganache-core v2.10.2, and the result was closer to 800 gas: Solidity Contract: ...
3
votes
3answers
153 views

Does an SSTORE where the new value is the same as the existing value cost gas?

For example (in Vyper): @external def foo(bar: uint256): self.baz = bar foo(3) foo(3) # Is the gas cost here still 5000? Is it better to do this instead? def foo(bar: uint256): if self.baz != ...
1
vote
1answer
18 views

Is there a gas cost incurred when creating a contract abstraction?

I have a smart contract in vyper (SomeContract) that gets called within another smart contract: some_contract: address = _some_contract SomeContract(some_contract).foo() # Is there a cost incurred ...
1
vote
1answer
41 views

Best Practices for Recommendation regarding Gas Price & Limit in a Dapp

I am developing a Dapp. I was wondering what are the best practices for user recommendation regarding gas price and limit in such a Dapp? Should I be using the following methods in my contract, or ...
0
votes
0answers
28 views

How can I have no gas fees in a private PoA network while avoiding spam attacks and the halting problem?

Complete noob here. I'm developing a dApp that functions on top of a private clique PoA blockchain (using geth). The project should be viable in a production environment and allow nodes to transact ...
0
votes
1answer
65 views

Transaction out of gas despite much higher gas price than almost identical transaction at same time that is fully mined

Two Uniswap txns calling swapExactETHForTokens that are almost identical (even same timestamp) except for the value and gas price, but the one with higher value and gas price runs out of gas and uses ...
1
vote
1answer
34 views

Gas estimation errored with the following message error upon contract deployment

I am trying to deploy my contract CoinFlip on Remix using Injected Web 3 (Ropsten, Metamask) but I am getting the gas estimation error. I'm not sure where the error is coming from. I also tried ...

1
2 3 4 5
21