Gas - Reading Assignment

1.We calculate the total gas cost in different ways. One way is to look at the contract code to determine what the exact cost for each unit is. The more complex the operation is the more expensive the gas is
2. Gas Limit is the maximum amount of gas allotted to the transaction
3. It will result in a failed transaction, the fee paid will be lost, but the ether transferred never leaves the wallet since the block chain was never updated.
4.Unspent gas is automatically refunded.
5. Gwei is the price of each gas unit measured in a fractional amount of ether,

1 Like
  1. How do we calculate the total gas cost for a transaction?
    —it is the “cumulative sum of all the operations”
  2. What is gas limit?
    —the maximum amount of gas a user is willing to spend on a transaction
  3. What happens if we specify a gas limit that is too low?
    —the transaction won’t be processed and you won’t be refunded for the low gas that was spent in attempting to execute the transaction
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    —since the block also has a gas limit for all the transactions within the block, opting for a high gas limit on a transaction contributes to filling up the block gas limit which isn’t “computationally dense enough for miners.” Therefore, you end up losing the gas fee if your transaction isn’t processed; essentially you’re wasting money.
  5. What is a gwei?
    —it is how the gas price is measured; wei is the smallest unit od ether and 1000000000 wei makes up a gwei
1 Like
  1. you pay a minimum of 21000+ if you are using a smart contract I usually double it because you pay for the execution of the contract, you also have a transaction cost maximum, you will actually only pay for your transaction and you will get the rest back, never happend to me
  2. minimum amount 21000
  3. transaction will come back
    4 get it back
    6.this is one ether: 1.000000000000000000
    and this is one gwei 1000000000

2. What is gas limit?

Thats the minimum amount sir, could you please describe gas limit in general terms?

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

  1. How do we calculate the total gas cost for a transaction? sum of all the operations
  2. What is gas limit?maximum amount of gas that you are willing to pay for a transaction
  3. What happens if we specify a gas limit that is too low?he transaction will start but then fail
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?transaction may not be completed - each block has a gas limit.
  5. What is a gwei?A Gwei is a fractional part of Ether - 1000000000 wei
1 Like
  1. How do we calculate the total gas cost for a transaction?
    you must add up the gas and it is predetermined per operation and is subject to the cost of any fall back function
  2. What is gas limit?
    Gas limit is the maximum amount of gas that you are willing to pay for a transaction
  3. What happens if we specify a gas limit that is too low?
    The transaction will not be confirmed and if it runs out of gas and you will not get back the gas spend
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    it will be returned as ether
  5. What is a gwei?
    Gwei = Gigawei a measurement of gas
1 Like
  • How do we calculate the total gas cost for a transaction?
  1. Simple tx’s require less gas. More complex operations to store a variable could cost 100 gas. The cumulative sum of all operations is the total gas cost for the tx.
  • What is gas limit?
  1. Is the maximum amount of gas you are willing to spend on a tx.
  • What happens if we specify a gas limit that is too low?
  1. tx will fail and fees burned up to the failure go to the miner while main funds never left the account.
  • What happens if we specify a gas limit that is too high and therefore not consumed fully?
  1. Extra funds are sent back to the account
  • What is a gwei?
  1. Smallest unit of ether used as a measurement for gas. 1 wei = 1 billion gwei
1 Like

Reading Assignment: Gas

1. How do we calculate the total gas cost for a transaction?

By checking on etherscan or in the metamask, or you can calculate it, if the gas price is 20 gwei and the gas limit is 31500 units then multipy the unit gas limit with the gwei 31500x20=0.000630 ETH

The more number of operations done a transaction, the more gas are consumed as the load on the miner is higher as it’s consumes more memory and CPU operations and that’s cost electricity that the miner have to pay.

2. What is gas limit?

The minimum gas limit for transaction is 21000 gwei + the amount to execute any fallback functions if it’s sent to a contract .

3. What happens if we specify a gas limit that is too low?

No miner will pick that transaction, or if it’s do it will stop the transaction when the gas runs out, the gas is lost or taken by the miner, but the transaction is never executed so you will still have your wallet sum intact the same minus the gas cost.

4. What happens if we specify a gas limit that is too high and therefore not consumed fully?

Any unspent gas is refunded automatically, as the actual blocks have a gas limit that specifies the maximum amount of gas all transactions in the block can consume, but ether miners have the option to increase or decrease the gas limit of blocks so that they are propagated quickly.

5. What is a gwei?

Measurement for gas price, a fractional amount of ether

Wei is the smallest unit of ether, and gwei is simply 1000000000 wei

1 Like
  1. The total cost of gas is determined by how many things were executed within the EVM. Simple things are cheap and complex things are more expensive

  2. The maximum amount of gas your willing to spend on a transaction

  3. Transaction will fail and gas that was sent will be kept by miners

  4. The balance will be refunded to you

  5. a unit a Wei which is the smallest amount of eth equal to 100000000gwei

1 Like
  • How do we calculate the total gas cost for a transaction?
    Transactions require some amount of operations to perform. Each of these operations has an associated cost in gas.The total sum of all the operations is the total gas cost for the transaction.

  • What is gas limit?
    The maximum amount of gas a user is willing to spend on a transaction.

  • What happens if we specify a gas limit that is too low?
    This will result in a failed transaction. The fees incurred when the execution started are kept by the miner but the Funds that were to be transferred remain in the wallet.

  • What happens if we specify a gas limit that is too high and therefore not consumed fully?
    The actual blocks have a gas limit that specifies the maximum amount of gas all transactions in the block can consume. Although ether miners have the option to increase or decrease the gas limit of blocks to accelerate propagation, the user cannot exceed this amount at will. Unspent gas is refunded automatically.

  • What is a gwei?
    It is 1 000 000 000 wei, wei being the smallest unit of Ether.

1 Like
1. How do we calculate the total gas cost for a transaction?
	a.  The cumulative sum of all the operations is the total gas cost for the transaction.
	
2. What is gas limit?
	a. the max. Gas price you are willing to spend on a transaction
	
3. What happens if we specify a gas limit that is too low?
	a. tx runs out of gas and fails => fees are kept by the miner
	
4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
	a. the rest will be refunded
	
5. What is a gwei?
	a. wei is the smallest ammount of ether => g stands for giga
1 Like

1.- Sum of all operations
2.- Maximum amount of gas that you are willing to pay for a transaction
3.- The transaction will start but then run out of gas and get incomplete
4.- The miner define the gas limit for each block, excessing that the transaction will not be processed , the miner wants smooth and effective process
5.- its 1000000000 of a wei

1 Like
  1. It is the cumulative sum of all the operations involved.

  2. The maximum limit of gas one is willing to spend on any given transaction.

  3. The transaction will not go through and the gas spent will be lost.

  4. The amount of gas that was consumed will be paid by the wallet available ether.

  5. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. By calculating the total gas cost of the commands you want to initiate on the smart contract
  2. A maximum amount of gas you are willing to spend on a transaction
  3. The transaction will be executed but will fail as it will run out of gas. You do not get back the amount of gas you spent on the transaction.
  4. The gas spent will be taken and the rest refunded
  5. It is a measurement used for ether. Gwei is 1billion wei.
1 Like
  1. It’s calculated based on the types of operations. Some operations are free and some operations are very expensive.
  2. The maximum amount of gas you are wiling to spend on a transaction.
  3. The transaction will fail and gas spent lost.
  4. Only the consumed gas of the transaction is spent, unused is refunded.
  5. Measurement unit for gas in relation to ETH-1,000,000,000 wei.
1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.

  2. The maximum amount of gas all transactions in the block can consume

  3. This will result in a failed transaction and ether spent on gas will be lost/spent, main funds will not be touched

  4. Unspent gas is refunded automatically

  5. Gwei is equal to 1000000000 wei and wei is the smallest unit of ether

1 Like
  1. It is the cumulative sum of all he operations to be performed onchain.
  2. The maximum gas amount the user is willing to propose to the miners.
  3. The operation cannot be completed.
  4. The transaction may not be completed as there is a Gas limit.
  5. unit used to represent gas prices. 1 billion wei
1 Like

1. How do we calculate the total gas cost for a transaction?
Gas cost is calculated by the sum of costs for all of the operations in a transaction.
2. What is gas limit?
The maximum amount of gas that someone is willing to spend on a transaction.
3. What happens if we specify a gas limit that is too low?
The ether spent on the gas will not be returned, and the transaction will be stopped and uncompleted.
4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
The high gas limit won’t incentivize the miners to process the transaction, since their gain is only in proportion to the actual gas that is consumed by the transaction.
5. What is a gwei?
10^9 wei, which is a quantity of ether used in which gas prices are usually measured

1 Like
  1. The amount of gas depends on the amount of computation required to complete the transaction. The total cost of an Ethereum transactions is actually the amount of necessary gas multiplied by the price in gwei per gas unit.

  2. The maximum amount a user is willing to pay for a transaction.

  3. Providing too little gas will result in a failed transaction and the fees will be kept by the miner.

  4. Unspent gas is refunded automatically.

  5. Gwei is 1 billion wei and wei is the smallest unit of ether.

1 Like
  1. How do we calculate the total gas cost for a transaction?
  • add gas costs for all computations in the transaction
  1. What is gas limit?
  • The maximum gas we want to spend in the Tx
  1. What happens if we specify a gas limit that is too low?
  • Gas will be returned minus the miner fees
  1. What happens if we specify a gas limit that is too high and therefore not consumed fully?
  • putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want
  1. What is a gwei
    Giga wei as in 1.000.000.000 wei
1 Like