PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, September 25, 2022

[FIXED] Why does the deployment of smart contracts on the private Ethereum blockchain need to consume gas fee, while the invocation does not?

 September 25, 2022     blockchain, ethereum     No comments   

Issue

Why does the deployment of smart contracts on the private Ethereum chain need to consume gasoline, while the invocation does not?


Solution

When you're deploying a contract, you're sending a transaction, effectively storing the contract bytecode in the network. All transactions cost gas fees as a reward for the miner/validator who executes it and publishes it to the network.

When you're invoking a contract function, you can do it two ways:

  • read-only gas-free call that is not processed by a miner/validator - only by a node that your app is connected to. You don't pay any gas fees, but also cannot store any changes (e.g. token transfers)
  • read-write transaction that costs gas fees as a reward for the miner/validator


Answered By - Petr Hejda
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing