Gas - Reading Assignment

  1. Gas is calculated by the transaction fee + any additional gas used for smart contacts.
  2. The gas limit is the maximum amount of gas a user is willing to pay for a transaction or deployment of a smart contract.
  3. If the gas is too low, the gas will be spent and given to the miners but the transaction will not go through.
  4. If the gas is too high, any excess gas will be refunded back to the user.
  5. A gwei is one billion wei (the smallest metric used to measure the ether price).
1 Like
  1. How do we calculate the total gas cost for a transaction?

Answer: The cumulative sum of all the operations is the total gas cost for the transaction.

  1. What is gas limit?

Answer: the MAXIMUM amount of gas you are willing to spend on the transaction.

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

Answer: You will not get back ether spend on the gas used, but since the transaction did not complete, the blockchain does not reflect a transfer, so the main funds essentially never left the wallet.

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

Answer: You cannot exceed this amount if you wish for your transaction to be processed. Also, miners only get paid for the actual gas consumed by a transaction, so 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?

Answer: gwei is simply 1000000000 wei.

1 Like

1.How do we calculate the total gas cost for a transaction?
It depends on the operation’s complexity. The more complex, the more expensive and vice versa. The cumulative sum of all the operations is the total gas cost for a transaction.

2.What is gas limit?
Max amount of gas one is willing to spend on a transaction.

3.What happens if we specify a gas limit that is too low?
The transaction in question will start to be executed, but eventually run out of gas and be stopped, resulting in a failed transaction and fees kept by the miner.

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

5.What is a gwei?
Gas price measured in Ether. A gwei = 1000000000 wei (the smallest unit of Ether)

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. Gas limit is the maximum aomunt of gas allowed to spend on the transaction.
  3. The transaction will start to be executed, but will eventually run out it will be failled. As not complete transaction, are not a transfer and the fund remain in wallet.
  4. Miners only get paid for the actual gas consumed by a transaction, so putting a high value for the gas limit fills up the block gas limit, but isn’t computationally-dense enough for miners to want. Blocks have a gas limit that specifies the maximum amount of gas all transactions in the block can consume.
  5. Gas price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.
1 Like
  1. The total gas cost for a transaction will be the cost of each of the individual operations required to complete the transaction summed together to come up with a total gas figure.

  2. The gas limit is the maximum amount of gas that you are going to allow a given transaction to use up.

  3. If the gas limit is too low for all of the transaction’s operations to complete then the gas will be used up and paid to the miners but the transaction will fail. Transactions need to full complete or fail they cannot part complete.

  4. If the gas limit is too high then the amount of gas which is NOT consumed will be returned to the wallet requesting the transaction. However specifying a gas limit way too high is not ideal as due to a block having a fixed total gas limit (sum of all the transaction limits), adding a transaction with an excessive gas limit would use up space in the block that could be used for other fee paying transactions.

  5. Gwei is the unit usually used to specify the current cost of gas and is 1/1000000000 of an ETH (ie. there are one thousand, million gwei in ONE ETH. At the time of posting this message gas is 30 Gwei, according to etherscan.io

1 Like

How do we calculate the total gas cost for a transaction?
It is the sum of all the ETH operations costs in the transaction.
2. What is gas limit?
It is the maximum amount of gas available for for the transaction.
3. What happens if we specify a gas limit that is too low?
The operation fails and the fees are kept by the miner buts funds will never leave the wallet.
4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
The extra will be refunded automatically.
5. What is a gwei?
Gas price is usually measured in gwei.

2 Likes
  1. The cumulative sum of all the operations is the total gas cost for the transaction.**
  2. This corresponds the the MAXIMUM amount of gas you are willing to spend on the transaction.
  3. you will not get back ether spend on the gas used, but since the transaction did not complete, the blockchain does not reflect a transfer, so the main funds essentially never left the wallet.**
  4. Extra, unspent gas is refunded automatically
  5. Gas price measuring unit, gwei is simply 1000000000 wei
1 Like
  1. How do we calculate the total gas cost for a transaction?
    => Sum the individual actions in a contract, each costing a fixed amount of Gas, as it is the amount of computation required to complete the transaction.
  2. What is gas limit?
    => The maximum amount of Gas needed to complete the transaction
  3. What happens if we specify a gas limit that is too low?
    => Results in a failed transaction, without returning the Gas (lost), but the Ether remains in the wallet (not transferred) since the blockchain wasnever updated.
  4. What happens if we specify a gas limit that is too high and therefore not consumed fully?
    => Unspent Gas is refunded automatically
  5. What is a gwei?
    => WEI is smallest unit if Ether: 1 Ether = 1^18 WEI. G stands for Giga = 1^9, so 1 GWEI = 1^9 WEI = 1000000000 WEI.
1 Like

Adding up all the pre-determined costs per operation but the transaction cost is subject to a minimum of 21000 Gas plus the cost of any fall-back functions if it sent to a contract.

The maximum amount of gas you’re willing to spend on a transaction.

The miner gets the fee, but the transaction does not go through.

It will be returned to you as ether.

The measurement for Gas used on Ethereum network.

1 Like
  1. You would have to add up all the gas costs for executing each part of a transaction or use of a smart contract.
  1. The maximum cost of gas an user is willing to pay for a transaction or deployment of a smart contract.
  1. It basically will not be “mined” and added to the blockchain because the miners have more rewarding transactions to mine.
  2. The overspend will be refunded.
  3. Wei is the smallest unit of ether is Wei and Gwei is 1000000000 Wei. The gas price is usually some amount of Gwei.
1 Like
  1. Sum all of the gas from each operation in the smart contract

  2. Gas limit is the maximum amount of gas that we are willing to spend in the transaction

  3. There is a chance that the transaction can be failed and our gas is paid to the miner, somehow unspent gas and our funds are still in our wallet

  4. The transaction is not wanted by the miners since it’s not computionally dense enough

  5. Gwei is the unit of the gas price, it is another unit of ether. 1 ether is 1 billion gwei

1 Like

1.) Calculates by summing up each functions that are processed together and that they come at a different cost. Some cheaper than others some much more expensive, cost is dependant on the complexity of the function.

2.)The Gas Limit is the maximum amount of gas allotted to the transaction, 2100 being sufficient for simple transfers and much higher amounts for transfers to smart contracts like those in ICO’s

3.) Insufficient gas in the gas limit will result in a failed transaction, the fee paid will be lost, but the ether transferred never leaves the wallet since the blockchain was never updated .

4.)Miners are only payed for consumed gas. You set a maximum you are willing to pay in total and the gas that not are consumed will be refunded back to you.

5.) Gwei are a sub currency of Ether. There are several calculators you can use.

1 Like
  1. How do we calculate the total gas cost for transaction?
    By adding the cost for all operations that require a certain amount of gas within a smart contract.

  2. What is gas limit?
    The maximum fee I would accept for a transaction.

  3. What happens if we specify a gas limit that is too low?
    The transmission can fail. But the gas will be kept by the miner

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

  5. What is a gwei?
    Gwei is 1.000.000.000 time the smallest unit of Ether (wei)

1 Like
  1. By adding up the costs of individual calculations in the transaction.
  2. The max amount you are willing to spend on a transaction.
  3. The transaction will start and not complete, so you will lose the gas spent and your transaction will not be placed on the block.
  4. You will get refunded any unspent amounts, but a minor might not run your transaction because there is a gas limit on the block.
  5. A small fraction of eth
1 Like
  • How do we calculate the total gas cost for a transaction?
    The amount of Gas needed is dependant on the amount of computation needed to complete a transaction.

  • What is gas limit?
    Gas limit is the maximum amount of Gas set aside, or designated, for the transaction.

  • What happens if we specify a gas limit that is too low?
    The transaction will fail. The amount of Gas used towards the transaction will be lost, but the actual amount that was designated to be transferred will not be withdrawn from the wallet since the blockchain was never updated.

  • What happens if we specify a gas limit that is too high and therefore not consumed fully?
    Any extra Gas not used is refunded automatically.

  • What is a gwei?
    Gwei is the unit of measurement for Gas price.

1 Like
  1. Total gas cost for a transaction can be calculated by finding the contract code to determine the exact amount of each unit.

  2. The minimum gas limit for transaction is 21000 + the amount to execute any fallback functions. You cannot exceed this amount if you wish for your transaction to be processed.

  3. Your transaction will start to be executed, but will eventually run out of gas and be stopped.

  4. The blocks also have a gas limit that specifies the maximum amount of gas all transactions in the block can consume.

5.Wei is the smallest amount of Ether and gwei is 1000000000 wei.

1 Like

How do we calculate the total gas cost for a transaction?
ï»żThe cumulative cost for the gas for all operations for the transaction

What is gas limit?
Maximum amount of gas provided for the transaction

What happens if we specify a gas limit that is too low?
The transaction will run out of gas and not complete. The amount of gas consumed is kept by the miner.

What happens if we specify a gas limit that is too high and therefore not consumed fully?
Unused gas is refunded automatically

What is a gwei?
Wei is the smallest unit of ether and 1 gwei is 1.0 X 10^9 wei

1 Like
  1. The cumulative sum of all the operations in a smart contract is the total gas cost for the transaction.

  2. Gas limit imply the MAXIMUM amount of gas you are willing to spend on the transaction.

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

  4. Extra, unspent gas is refunded automatically.

  5. Gas price is usually some amount of gwei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.

1 Like
  1. The cumulative sum of all the operations is the total gas cost for the transaction.
  2. This corresponds the the MAXIMUM amount of gas you are willing to spend on the transaction.
  3. You will not get back ether spend on the gas used, but since the transaction did not complete, the blockchain does not reflect a transfer, so the main funds essentially never left the wallet.
  4. Extra, unspent gas is refunded automatically.
  5. Gas prices are expressed in ether which is measured in wei. Wei is the smallest unit of ether, and gwei is simply 1000000000 wei.
1 Like

Reading Assignment: Gas (Answers)

  1. The cumulative sum of all operations is the total.
  2. The maximum amount of gas your willing to spend.
  3. Transaction will run out of GAS and stop.
  4. Its a loss, miners will reject.
  5. A measurement used to determine the price of gas and maximum amount. (wei=== gwei)
    Gwass! right?! LOL :clown_face:
1 Like