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
26 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
26 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
21 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
14 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
27 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
21 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
24 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
16 views

Why is metamask so far off in it's gas prediction? [closed]

Metamask predicts the gas cost will be 475,138 gas - The actual cost and total used gas is 1.478 million gas. I am using local javascript based EVM with hardhat. Why is metamask so far off in it's gas ...
0
votes
0answers
4 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
14 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 ...
1
vote
1answer
18 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
114 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
17 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
27 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
27 views

How does a malicious user behave in a private Ethereum blockchain running PoA and Clique? [closed]

The private network is using the PoA consensus algorithm with Clique protocol and gas price and limit are set. If all accounts had large amounts of ether granted to them on creation , how would a ...
0
votes
0answers
19 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
42 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
22 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
vote
1answer
79 views

Ropsten “exceeds block gas limit”

I am on GETH, 1.9.23 and I have had a smart contract running for more than 3 months now. Suddenly, all transaction failed with "exceeds block gas limit". I checked the Ropsten Testnet and ...
0
votes
0answers
13 views

Storage vs Memory in the context of Gas Cost

I have two snippets -- one using memory, the other referencing storage: function winnerName() public view returns (string memory winnerName_) { string memory winnerName_ = ...
0
votes
1answer
26 views

Is there any alternative for for loop?

I have used in burn() function of NFT Contract. function burn(address to, uint256 tokenId) external { require(_exists(tokenId), "Contract: operator query for nonexistent token"); ...
3
votes
1answer
34 views

Do miners undergo a sunken cost of attempting to verify an invalid transaction signature?

In the case of an 'invalid' transaction whereby the state transition of the execution is deemed to conflict in some way and reverts, the transaction itself is actually valid; gas is consumed, tx ...
0
votes
1answer
25 views

How to handle transferring ERC20 tokens (such as USDT) with delegation to pay the gas fees on behalf of users?

I am working on creating wallets and generating addresses to be provided to a number of users. I am wondering how can I enable them to transfer their ERC20 tokens(such as USDT) without having any Eth ...
0
votes
0answers
22 views

Transactions fails in rinkeby but succeeds on localhost, gas limit 1000000 is cited

http://lucidity-eth-r.surge.sh/ Rinkeby test for buying funding token (search Honduras Agriculture Project, may have to click submit a few times), then go to funder view, and type in any amount/tenor. ...
0
votes
1answer
19 views

Gas cost of multiple small transactions vs one large one

On the main ethereum network would the gas cost be the same to post several small transactions or one large transaction if the overall data size is the exact same?
1
vote
0answers
29 views

Private PoA deployment leads to 'invalid gas used' error

I'm trying to deploy a contract to a private clique chain running on two devices (laptop and raspi). Deploying the contract when running multiple nodes on a single device worked fine as per usual, ...
2
votes
2answers
116 views

ETH - Pre-Paid smart contract so users don't pay transactions

I'm developing a "corporate" DApp, therefore the employees don't have any reason to "spend" their ether/gas for interacting with the contract... Is there any way to enable each ...
0
votes
0answers
17 views

Hoe to get the gas used by each transaction in a block in a single API call?

I am working on service which monitors Ethereum based blockchains using web3 API calls. For each new mined block, it has to parse each of the transactions in the block. In addition, it needs to parse ...
0
votes
1answer
9 views

is gas cost affection on remix account's ethereum balance same as the real?

most of functions that i execute in remix affects a cost in my test ethereum's balance. Is this reduced amount equal to the actual cost in the real?
0
votes
1answer
22 views

Is it possible to get the gas fee before sending an ETH?

Is there a way or api endpoint to calculate the gas fee before sending the ETH? My client requirements is to calculate the gas fee before sending an ETH to other user. I can only get the gas price ...
0
votes
0answers
14 views

What determines how much gas is required when transferring an ECR-721 non-fungible token? [duplicate]

When transferring an ECR-721 token, what determines how much gas is required? Is it written into the contract of the ECR-721 token? Does it depend upon how it was transferred (e.g. cryptokitties.com ...
1
vote
1answer
21 views

Divide or not to divide in a smart contract?

I need my contract to create a ratio of two big integers (prices) output in an event. Which of two variants is better: divide in the contract using a math library; output two integers and let the ...
0
votes
0answers
32 views

Gas payment of the mint of ERC20 Token

I have the follow use case: There is an off-chain service, like a game, which will generate/mint new ERC20 tokens when some requirements are met by end-users. Since the users will get profit (in terms ...
0
votes
1answer
21 views

How to see the miner account that earned gas? Or how to know the account where gas goes?

I made a transaction to another account on rinkeby and then saw the record on Etherscan. There is Txn fee as gas. But how can I know where the gas went. I mean the account that gas was paid to. I ...
0
votes
0answers
20 views

How to add specific transaction in block using geth?

How to include own pending transaction in block will be mined? Some mining pools using this for payouts with low gas price to their miners.
1
vote
1answer
27 views

Can queue of pending transactions will be confirmed if send last transaction with high gas price?

I have several pending transactions from the same account with a low gas price. What if I send one more transaction with next nonce but high gas price? Can it help to mine all pending transactions ...
2
votes
0answers
29 views

ETH same transaction different amount of gas used

The two transactions: a) https://etherscan.io/tx/0x9227f7b00bf2c98a7e16eb5ab90c04df5b49698297ee7f52c765d5218af395ad b) https://etherscan.io/tx/...
0
votes
2answers
51 views

How to fix: Warning! Error encountered during contract execution [Out of gas]

I have sent ETH to a contract address, and it "failed" the transaction saying it is: Warning! Error encountered during contract execution [Reverted] contract address and transaction failure ...
0
votes
1answer
86 views

Transaction shows up on etherscan and metamask said it was sent, but my token balance is still the same

I made USDC transaction and metamask said it was sent and etherscan also say there was a transaction made as seen below. But my USDC balance is still the same as if it never left my account. And ...
0
votes
0answers
7 views

For Ganache and BuidlerEVM I have different estimated gas

For Ganache and BuidlerEVM I have different (several times) estimated (by Ethers.js) gas for the same computation. Is it a bug? Isn't the Ethereum standard specifying particular gas amount for every ...
1
vote
1answer
22 views

How do Miners get the GAS Used so close the GAS Limit?

Are the Miners calculating the actual GAS USED for each Transaction (specifically for contract execution) before they stuff it into the Candidate Block to get so close to the Block GAS Limit? The ...
1
vote
2answers
64 views

How can i send ether to multiple address in one transaction by paying one transaction fee?

How can i send ether to multiple address in one transaction by paying one transaction fee. Like i want to publish multiple transaction at one go so i can incur only one transaction fee.
0
votes
0answers
20 views

Why my function named SubmitHash shows in Etherscan input field but not PublishHash?

I deployed my contract in Ropsten Testnet with submitHash as a function name. I get function Name with value passed in Etherscan. function submitHash(bytes32 pHash) external onlyOwner() { emit ...
0
votes
1answer
19 views

Could someone explain Ethgasstation.info headers?

in TXN pool vision of https://ethgasstation.info/txPoolReport.php I am getting confused with the meaning of headers. What does the following headers mean? % of Last 200 Blocks Accepting % of total ...
1
vote
0answers
33 views

Huge gas cost for deleting an element of a map

As you can see with the code below the last person to call claimAuction cleans up the AuctionProposal but has to pay 383729 gas instead of 73846 for that cleanup, a 519% increase! My question is ...
0
votes
1answer
81 views

“Dropped & Replaced” tx - what should I do?

I requested a USDT withdrawal from Bilaxy exchange to my Binance USDT (ERC20) account. However, on etherscan, the transaction shows as "Dropped & Replaced". Do you guys think I shhould I ...
0
votes
0answers
18 views

Check all failed transactions in last 100 blocks

How do I get all the failed transactions in last 100 blocks using etherscan or some other service? Also the reason for failure and gas involved in the transaction Checked few similar questions that ...
0
votes
1answer
253 views

Fees are too Damn High to send $20 worth of USDC. How can one minimize these fees?

It's 2020 September 3. Fees to send 20 USDC to someone is about $10-15 worth of gas fees. How can I minimize the gas fees when using metamask? And is it true that if I set the gas fee too low, I would ...
0
votes
0answers
21 views

Making sure a string (input/output) is less then 64 characters

I'm working though some basic solidity tutorials using remix. I'm having trouble with the concept that there is no way to edit a string built into the language. In other programing languages I would ...
0
votes
0answers
27 views

hardening infinite loops

What is the best way to 'harden' an infinite loop, if you are in a scenario where you would find it necessary to iterate over an array, would it be a best practice to put an assert condition in ...

1
2 3 4 5
20