Wei-Meng Lee

Beginning Ethereum Smart Contracts Programming

With Examples in Python, Solidity, and JavaScript

Wei-Meng Lee
Ang Mo Kio, Singapore
ISBN 978-1-4842-5085-3e-ISBN 978-1-4842-5086-0
© Wei-Meng Lee 2019
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.

I dedicate this book with love to my dearest wife (Sze Wa) and daughter (Chloe), who have to endure my irregular work schedule, for their companionship when I am trying to meet writing deadlines!

Introduction

Welcome to Beginning Ethereum Smart Contracts Programming !

This book is a quick guide to getting started with Ethereum Smart Contracts programming. It first starts off with a discussion on blockchain and the motivations behind it. You will learn what is a blockchain, how blocks in a blockchain are chained together, and how blocks get added to a blockchain. You will also understand how mining works and discover the various types of nodes in a blockchain network.

Once that is out of the way, we will dive into the Ethereum blockchain. You will learn how to use an Ethereum client (Geth) to connect to the Ethereum blockchain and perform transactions such as sending ethers to another account. You will also learn how to create private blockchain networks so that you can test them internally within your own network.

The next part of this book will discuss Smart Contracts programming, a unique feature of the Ethereum blockchain. Readers will be able to get jumpstarted on Smart Contracts programming without needing to wade through tons of documentation. The learn-by-doing approach of this book makes you productive in the shortest amount of time. By the end of this book, you would be able to write smart contracts, test them, deploy them, and create web applications to interact with them.

The last part of this book will touch on tokens, something that has taken the cryptocurrency market by storm. You would be able to create your own tokens and launch your own ICO and would be able to write token contracts that allow buyers to buy tokens using Ethers.

This book is for those who want to get started quickly with Ethereum Smart Contracts programming. Basic programming knowledge and an understanding of Python or JavaScript are recommended.

I hope you will enjoy working on the sample projects as much as I have enjoyed working on them!

Acknowledgments

Writing a book is immensely exciting, but along with it comes long hours of hard work and responsibility, straining to get things done accurately and correctly. To make a book possible, a lot of unsung heroes work tirelessly behind the scenes.

For this, I would like to take this opportunity to thank a number of special people who made this book possible. First, I want to thank my acquisitions editor – Joan Murray, for giving me this opportunity. Thanks for attending my session at NDC Minnesota 2018, and for your trust in me!

Next, a huge thanks to Jill Balzano, my associate editor, who was always very patient with me, even though I have missed several of my deadlines for the book. Thanks, Jill, for your guidance. I could not finish the book without your encouragement and help!

Equally important is my technical editor – Chaim Krause. Chaim has been very eager-eyed editing and testing my code and never fails to let me know if things do not work the way I intended. Thanks for catching my errors and making the book a better read, Chaim!

Last, but not least, I want to thank my parents and my wife, Sze Wa, for all the support they have given me. They have selflessly adjusted their schedules to accommodate my busy schedule when I was working on this book. I love you all!

Table of Contents

Index 289

About the Author and About the Technical Reviewer

About the Author

Wei-Meng Lee
../images/471881_1_En_BookFrontmatter_Figb_HTML.png

is the founder of Developer Learning Solutions, a technology company specializing in hands-on training of blockchain and other emerging technologies. He has many years of training expertise, and his courses emphasize a learn-by-doing approach. He is a master at making learning a new programming language or technology less intimidating and fun. He can be found speaking at conferences worldwide such as NDC, and he regularly contributes to online and print publications such as DevX.com, MobiForge.com, and CoDe Magazine. He is active on social media on his blog learn2develop.net, on Facebook at DeveloperLearningSolutions, on Twitter @weimenglee, and on LinkedIn at leeweimeng.

 

About the Technical Reviewer

Chaim Krause
../images/471881_1_En_BookFrontmatter_Figc_HTML.jpg

is a lover of computers, electronics, animals, and electronic music. He’s tickled pink when he can combine two or more in some project. The vast majority of his knowledge is through self-learning. He jokes with everyone that the only difference between what he does at home and what he does at work is the logon he uses. As a lifelong learner, he is often frustrated with technical errors in documentation that waste valuable time and cause unnecessary stress. One of the reasons he works as the technical editor on books is to help others avoid those same pitfalls.

 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.98.148