Solidity is a contract-oriented language whose syntax is highly influenced by JavaScript, and is designed to compile code for the Ethereum Virtual Machine. <em>Solidity Programming Essentials</em> will be your guide to understanding Solidity programming to build smart contracts for Ethereum and bloc
Solidity programming essentials: a beginner's guide to build smart contracts for Ethereum and blockchain
β Scribed by Modi, Ritesh
- Publisher
- Packt Publishing
- Year
- 2018
- Tongue
- English
- Leaves
- 376
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
Learn the most powerful and primary programming language for writing smart contracts and find out how to write, deploy, consume, test smart contracts in Ethereum.Key Features Get you up and running with Solidity Programming language Build Ethereum Smart Contracts with Solidity as your scripting language Learn to test and deploy the smart contract to your private Blockchain Book DescriptionSolidity is a high-level language whose syntax is similar to that of JavaScript and it is designed to compile to code for the Ethereum Virtual Machine. This book will be your guide to understand Solidity Programming to build Smart Contracts for Ethereum and Blockchain.You will begin with a brief understanding of Blockchain, Ethereum and the Ethereum virtual machine. From here you will be taken through topics that will help you understand the Solidity programming language. You will install all necessary tools to write, test, deploy and debug solidity contracts on Ethereum. You will learn the layout of a Solidity source file and will learn to work with the different data types with Solidity. You will then be taken through solutions while working with the Globally available functions with Solidity. The next set of recipes will help you work with Operators, Control Structures, and Data Structures while building your Smart Contracts. In detain, you will be taken through Function calls, Return types, and Function Modifiers. You will then be taken through recipes in Object Oriented Programming with Solidity. You will then learn to Import, and deploy your smart contracts into your private Blockchain. Furthermore, you will be taken through recipes on Event Logging and Exception Handling and finally, you will be taken through recipes to test and debug your Smart contracts.What you will learn Learn the basics and foundational concepts of Solidity and Ethereum to write smart contract Find out how to write, deploy, consume, test smart contracts in Ethereum. Learn the security best practices while writing smart contracts Learn to create new accounts submit transactions to Blockchain Get to know the complete language in detail to write smart contracts. Learn major tools to develop, test and deploy smart contracts Write defensive code using exception handling and error checking Understand debugging process and details for smart contracts Who This Book Is ForThis book is for anyone who would like to get started with Solidity Programming for developing an Ethereum Smart Contract. No knowledge of the EVM is assumed.
β¦ Table of Contents
Title Page......Page 2
Copyright and Credits......Page 3
Solidity Programming Essentials......Page 4
Packt Upsell......Page 5
Why subscribe?......Page 6
PacktPub.com......Page 7
Contributors......Page 8
About the author......Page 9
About the reviewer......Page 10
Packt is searching for authors like you......Page 14
Preface......Page 25
Who this book is for......Page 27
What this book covers......Page 11
To get the most out of this book......Page 28
Download the example code files......Page 29
Conventions used......Page 31
Get in touch......Page 33
Reviews......Page 34
Introduction to Blockchain, Ethereum, and Smart Contracts......Page 35
What is a blockchain?......Page 37
Why blockchains?......Page 40
Cryptography......Page 42
Symmetric encryption and decryption......Page 43
Asymmetric encryption and decryption......Page 44
Hashing......Page 45
Digital signatures......Page 49
Ether......Page 50
Gas......Page 52
Blockchain and Ethereum architecture......Page 53
How are blocks related to each other?......Page 56
How are transactions and blocks related to each other?......Page 58
Ethereum nodes......Page 60
EVM......Page 61
Ethereum mining nodes......Page 62
How does mining work?......Page 64
Ethereum accounts......Page 67
Externally owned accounts......Page 68
Contract accounts......Page 69
Transactions......Page 70
Blocks......Page 76
An end-to-end transaction......Page 79
What is a contract?......Page 81
What is a smart contract?......Page 82
How to write smart contracts?......Page 83
How are contracts deployed?......Page 90
Summary......Page 92
Installing Ethereum and Solidity......Page 93
Ethereum networks......Page 95
Main network......Page 96
Test network......Page 97
Ropsten......Page 98
Rinkeby......Page 99
Kovan......Page 100
Private network......Page 101
Consortium network......Page 102
Geth......Page 103
Installing Geth on Windows......Page 104
Creating a private network......Page 109
ganache-cli......Page 119
Solidity compiler......Page 124
The web3 JavaScript library......Page 125
Mist wallet......Page 128
MetaMask......Page 132
Summary......Page 140
Introducing Solidity......Page 141
Ethereum Virtual Machine......Page 143
Solidity and Solidity files......Page 144
Pragma......Page 145
Comments......Page 147
The import statement......Page 149
Contracts......Page 150
Structure of a contract......Page 152
State variables......Page 154
Structure......Page 157
Modifiers......Page 159
Events......Page 161
Enumeration......Page 163
Functions......Page 164
Data types in Solidity......Page 167
Value types......Page 168
Passing by value......Page 170
Reference types......Page 171
Passing by reference......Page 173
Storage and memory data locations......Page 174
Rule 1......Page 176
Rule 2......Page 177
Rule 3......Page 178
Rule 4......Page 179
Rule 5......Page 180
Rule 6......Page 182
Rule 7......Page 184
Rule 8......Page 186
Literals......Page 188
Integers......Page 189
Boolean......Page 192
The byte data type......Page 194
Arrays......Page 197
Fixed arrays......Page 198
Dynamic arrays......Page 199
Special arrays......Page 200
The bytes array......Page 201
The String array......Page 203
Array properties......Page 204
Structure of an array......Page 205
Enumerations......Page 207
Address......Page 209
Mappings......Page 210
Summary......Page 216
Global Variables and Functions......Page 217
The var type variables......Page 218
Variables hoisting......Page 220
Variable scoping......Page 222
Type conversion......Page 224
Implicit conversion......Page 225
Explicit conversion......Page 226
Block and transaction global variables......Page 229
Transaction and message global variables......Page 231
Difference between tx.origin and msg.sender......Page 234
Cryptography global variables......Page 235
Address global variables......Page 237
Contract global variables......Page 238
Summary......Page 239
Expressions and Control Structures......Page 240
Solidity expressions......Page 241
The if decision control......Page 247
The while loop......Page 249
The for loop......Page 251
The do...while loop......Page 253
The break statement......Page 255
The continue statement......Page 257
The return statement......Page 259
Summary......Page 261
Writing Smart Contracts......Page 262
Smart contracts......Page 263
Writing a simple contract......Page 264
Creating contracts......Page 266
Using the new keyword......Page 267
Using address of a contract......Page 269
Constructors......Page 271
Contract composition......Page 273
Inheritance......Page 274
Single inheritance......Page 275
Multi-level inheritance......Page 277
Hierarchical inheritance......Page 278
Multiple inheritance......Page 279
Encapsulation......Page 283
Polymorphism......Page 284
Function polymorphism......Page 285
Contract polymorphism......Page 287
Method overriding......Page 289
Abstract contracts......Page 291
Interfaces......Page 293
Summary......Page 295
Functions, Modifiers, and Fallbacks......Page 296
Function input and output......Page 298
Modifiers......Page 301
The view, constant, and pure functions......Page 305
The address functions......Page 309
The send method......Page 310
The transfer method......Page 312
The call method......Page 313
The callcode method......Page 317
The delegatecall method......Page 318
The fallback function......Page 319
Summary......Page 323
Exceptions, Events, and Logging......Page 324
Error handling......Page 326
The require statement......Page 327
The assert statement......Page 329
The revert statement......Page 331
Events and logging......Page 332
Summary......Page 338
Truffle Basics and Unit Testing......Page 339
Application development life cycle management......Page 340
Truffle......Page 341
Development with Truffle......Page 344
Testing with Truffle......Page 352
Summary......Page 356
Debugging Contracts......Page 357
Debugging......Page 358
The Remix editor......Page 359
Using events......Page 365
Using a Block Explorer......Page 366
Summary......Page 372
Other Books You May Enjoy......Page 373
Leave a review - let other readers know what you think......Page 376
π SIMILAR VOLUMES
<font> <font><h1> Learn Solidity And How To Create Smart Contracts With This Book!</h1></font>For the past couple of years, there hasn't been a bigger breakthrough in the IT world than the one that Blockchain technology has made. The extremely fast growth of the industry, market and the technology i
<p><b>Understand the Ethereum platform to build distributed applications that are secured and decentralized using blockchain technology</b></p><h4>Key Features</h4><ul><li>Build your own decentralized applications using real-world blockchain examples</li><li>Implement Ethereum for building smart con
<p><span>Understand the Ethereum platform to build distributed applications that are secured and decentralized using blockchain technology</span></p><h4><span>Key Features</span></h4><ul><li><span><span>Build your own decentralized applications using real-world blockchain examples </span></span></li
<p><b>Discover the advanced features of Solidity that will help you write high-quality code and develop secure smart contracts with the latest ERC standards</b></p> Key Features <li>Delve into Solidity and understand control structures, function calls, and variable scopes </li> <li>Explore tools for