Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Solidity Programming Essentials

You're reading from  Solidity Programming Essentials

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788831383
Pages 222 pages
Edition 1st Edition
Languages

Table of Contents (17) Chapters

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Introduction to Blockchain, Ethereum, and Smart Contracts 2. Installing Ethereum and Solidity 3. Introducing Solidity 4. Global Variables and Functions 5. Expressions and Control Structures 6. Writing Smart Contracts 7. Functions, Modifiers, and Fallbacks 8. Exceptions, Events, and Logging 9. Truffle Basics and Unit Testing 10. Debugging Contracts 1. Other Books You May Enjoy Index

Gas


In the previous section, it was mentioned that fees are paid using Ether for any execution that changes state in Ethereum. Ether is traded on public exchanges and its price fluctuates daily. If Ether is used for paying fees, then the cost of using the same service could be very high on certain days and low on other days. People will wait for the price of Ether to fall to execute their transactions. This is not ideal for a platformsuch as Ethereum. Gas helps in alleviating this problem. Gas is the internal currency of Ethereum. The execution and resource utilization cost is predetermined in Ethereum in terms of gas units. This is also known as gas cost. There is also gas price that can be adjusted to a lower price when the price of Ether increases and a higher price when the price of Ether decreases. For example, to invoke a function in a contract that modifies a string will cost gas, which is predetermined, and users should pay in terms of gas to ensure smooth execution of this transaction.

You have been reading a chapter from
Solidity Programming Essentials
Published in: Apr 2018 Publisher: Packt ISBN-13: 9781788831383
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}