Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Solidity Programming Essentials

You're reading from   Solidity Programming Essentials A beginner's guide to build smart contracts for Ethereum and blockchain

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher Packt
ISBN-13 9781788831383
Length 222 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Ritesh Modi Ritesh Modi
Author Profile Icon Ritesh Modi
Ritesh Modi
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Introduction to Blockchain, Ethereum, and Smart Contracts FREE CHAPTER 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 11. Other Books You May Enjoy

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 platform such 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 $19.99/month. Cancel anytime
Banner background image