2

I am new on smart contract development and trying to create my first smart contract on Remix IDE. As you can see below, there is 3 different cost types:

  • Gas
  • Transaction cost
  • Execution cost

So,

  1. May you explain me the differences between them, please?
  2. Which is the "final gas amount" should I pay?
  3. Why "gas" is greater than other twos?
gas               7824262 gas
transaction cost  6803706 gas 
execution cost    6803706 gas

Transaction cost and execution cost are equal...

Thank you for helps.

0

2 Answers 2

1

Hope you have got the answer from others, since it's past half a year. As I know, gas in remix is the gas limit the caller of the transaction function offered, the transaction cost is the blockchain actually cost.

For more information about the difference between transaction cost and execution cost, you can see this: What is the difference between transaction cost and execution cost in remix?

0

Gas is the fee required to pay to be able to conduct a transaction on the blockchain network

Think of execution Cost as the VM execution cost.

The Transaction Cost is the cost of sending the smart contract to the Ethereum blockchain and they vary depending on the size of the contract.

So, to further explain you will end up paying to the Transaction cost not the other twos.

But why gas is higher than the other twos? That is because that’s the actual quantity of gas you’re using. While Transaction cost is = Gas Units Used * Price per Gas Unit.

2
  • Umm, after publishing smart contract, can we say that we will pay the Gas (7824262 above - and not other twos), when we need to call the contract from off-chain? For example lets say we will call the transferBalance() function from JavaScript, will we pay the Transaction Cost(6803706) or Gas (7824262)? And one more question, you just said: Transaction cost is = Gas Units Used * Price per Gas Unit how can I learn the current Ethereum "price per gas unit" cost to calculate this formula correctly? Thanks for your answers!
    – daybreak
    Commented Jul 7, 2022 at 16:52
  • oh, im relatively new to smart contracts, I just wrote what I understood, Also to answer that question the price of gas is called Gwei and Gwei = 0.000000001 ether. So the price varies from the price of the actual ether. Commented Jul 7, 2022 at 17:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.