Full Download Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript, 2nd Edition Wei-Meng Lee PDF DOCX
Full Download Beginning Ethereum Smart Contracts Programming: With Examples in Python, Solidity, and JavaScript, 2nd Edition Wei-Meng Lee PDF DOCX
com
https://ebookmeta.com/product/beginning-ethereum-smart-
contracts-programming-with-examples-in-python-solidity-and-
javascript-2nd-edition-wei-meng-lee/
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/beginning-swift-programming-1st-edition-
wei-meng-lee/
ebookmeta.com
https://ebookmeta.com/product/building-games-with-ethereum-smart-
contracts-intermediate-projects-for-solidity-developers-kedar-iyer/
ebookmeta.com
https://ebookmeta.com/product/fresh-produce-shipping-damages-and-
compensation-1st-edition-rex-c-tester/
ebookmeta.com
Emergency War Surgery Fifth Edition Borden Institute
https://ebookmeta.com/product/emergency-war-surgery-fifth-edition-
borden-institute/
ebookmeta.com
https://ebookmeta.com/product/wilkins-clinical-practice-of-the-dental-
hygienist-14th-edition-linda-d-boyd-lisa-f-mallonee/
ebookmeta.com
https://ebookmeta.com/product/flexible-electronics-volume-2-thin-film-
transistors-1st-edition-vinod-kumar-khanna/
ebookmeta.com
https://ebookmeta.com/product/hot-dog-summer-hot-h-e-a-summer-1st-
edition-lola-west/
ebookmeta.com
Machine Hallucinations Architecture and Artificial
Intelligence Architectural Design 1st Edition Neil Leach
(Editor)
https://ebookmeta.com/product/machine-hallucinations-architecture-and-
artificial-intelligence-architectural-design-1st-edition-neil-leach-
editor/
ebookmeta.com
Beginning Ethereum
Smart Contracts
Programming
With Examples in Python, Solidity,
and JavaScript
Second Edition
Wei-Meng Lee
Beginning Ethereum Smart Contracts Programming: With Examples in Python,
Solidity, and JavaScript
Wei-Meng Lee
Ang Mo Kio, Singapore
Introduction�����������������������������������������������������������������������������������������������������������xvii
iii
Table of Contents
iv
Table of Contents
v
Table of Contents
vi
Table of Contents
viii
Table of Contents
Index��������������������������������������������������������������������������������������������������������������������� 361
ix
About the Author
Wei-Meng Lee 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 more fun. He can be found speaking
at conferences worldwide such as NDC, and he regularly
contributes to online and print publications such as Medium
(https://weimenglee.medium.com) and CoDe Magazine.
He is active on social media, on his blog calendar.learn2develop.net, on Facebook
(www.facebook.com/DeveloperLearningSolutions), on Twitter as @weimenglee, and
on LinkedIn (linkedin.com/leeweimeng).
xi
About the Technical Reviewer
Prasanth Sahoo is a Blockchain Certified Professional,
Professional Scrum Master, and Microsoft Certified
Trainer who is passionate about helping others
learn how to use and gain benefits from the latest
technologies. He is a thought leader and practitioner
in blockchain, cloud, and Scrum. He also handles the
Agile methodology, cloud, and blockchain technology
community initiatives within TransUnion through
coaching, mentoring, and grooming techniques.
Prasanth is an adjunct professor and a technical speaker. He was selected as a speaker
at the China International Industry Big Data Expo 2018 by the Chinese government and
also to the International Blockchain Council by the governments of Telangana and Goa.
He also received accolades for his presentation at China International Industry Big Data
Expo 2018 by the Chinese government. Prasanth has published a patent titled "Digital
Educational Certificate Management System using IPFS Based Blockchain."
To date, Prasanth has reached over 50,000 students, mostly within the technical
domain. He is a working group member of the CryptoCurrency Certification
Consortium, Scrum Alliance, Scrum Organization, and International Institute of
Business Analysis.
xiii
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 suggesting that I update this book with the
latest happenings in the crypto world!
Next, a huge thanks to Jill Balzano, my associate editor, who was always very patient
with me, even though I missed several of my deadlines for the revision of this book.
Thanks, Jill, for your guidance. I could not finish the book without your encouragement
and help!
Equally important is my project coordinator, Shobana Srinivasan. Shobana has been
very patient with me during the whole project while I struggle between work and writing.
Thanks, Shobana, for the assistance rendered during the project!
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!
xv
Introduction
Welcome to Beginning Ethereum Smart Contracts Programming, Second Edition!
This book is a quick guide to getting started with Ethereum smart contracts
programming. It starts off with a discussion of blockchain and the motivations behind it.
You will learn what a blockchain is, 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. Since the publication of the
first edition of this book, a lot of things have changed. In particular, Ethereum has been
updated to use Proof of Stake (PoS) (instead of Proof of Work) as its consensus algorithm.
This book has been updated to include a discussion of how PoS works.
Once that is out of the way, you dive into the Ethereum blockchain. You will learn
how to use an Ethereum client (Geth) to create a private Ethereum blockchain and
perform simple transactions such as sending Ethers to another account.
The next part of this book discusses smart contract programming, a unique feature of
the Ethereum blockchain. You will jumpstart 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 should be able to write smart contracts, test them, deploy them, and create web
applications to interact with them. In this second edition, I have added more examples
to make it easy for you to explore more complex smart contracts.
The last part of this book touches on tokens and DeFi (decentralized finance),
something that has taken the cryptocurrency market by storm. You will be able to create
your own tokens, launch your own ICO, and write token contracts that allow buyers
to buy tokens using Ethers. As a bonus, I show you how to write a DEX (decentralized
exchange) smart contract to exchange two different tokens!
This book is designed 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 enjoy working on the sample projects as much as I enjoyed creating them!
xvii
CHAPTER 1
Understanding the
Science Behind
Blockchain: Cryptography
The reason you are reading this book is because you want to understand what a
blockchain is, how it works, and how you can write smart contracts on it to do cool
things. And while I perfectly understand that you are excited to get started in this first
chapter, we need to take a step back and look at one fundamental technology that makes
blockchain possible: cryptography.
In this chapter, I will explain what cryptography is, the different types of
cryptographic algorithms, how they work, and how they play a vital role in the world
of blockchain. I will also show you how to experiment with the various cryptographic
algorithms using the Python programming language. Even if you are familiar with
cryptography, I suggest scanning through this chapter so that you have a firm foundation
for the subsequent chapters.
What Is Cryptography?
Whether you are trying to build a web application to store users’ credentials or writing
a network application to securely transmit encrypted messages, or even trying to
understand how blockchain works, you need to understand one important topic:
cryptography.
So, what exactly is cryptography? Put simply, cryptography (or cryptology) is the
practice and study of hiding information. It is the science of keeping information secret
and safe.
1
© Wei-Meng Lee 2023
W.-M. Lee, Beginning Ethereum Smart Contracts Programming, https://doi.org/10.1007/978-1-4842-9271-6_1
Random documents with unrelated
content Scribd suggests to you:
APPENDIX A
PROTOCOL SIGNED FEBRUARY 23, 1904
Article I
For the purpose of maintaining a permanent and solid friendship
between Japan and Korea, and firmly establishing peace in the Far
East, the Imperial Government of Korea shall place full confidence in
the Imperial Government of Japan and adopt the advice of the latter
in regard to improvements in administration.
Article II
The Imperial Government of Japan shall in a spirit of firm
friendship ensure the safety and repose of the Imperial House of
Korea.
Article III
The Imperial Government of Japan definitely guarantees the
independence and territorial integrity of the Korean Empire.
Article IV
In case the welfare of the Imperial House of Korea or the territorial
integrity of Korea is endangered by aggression of a third Power or
internal disturbances, the Imperial Government of Japan shall
immediately take such necessary measures as the circumstances
require; and in such cases the Imperial Government of Korea shall
give full facilities to promote the action of the Imperial Japanese
Government.
The Imperial Government of Japan may, for the attainment of the
above-mentioned object, occupy, when the circumstances require it,
such places as may be necessary from strategical points of view.
Article V
The Governments of the two countries shall not in future, without
mutual consent, conclude with a third Power such an arrangement
as may be contrary to the principles of the present Protocol.
Article VI
Details in connection with the present Protocol shall be arranged
as the circumstances may require between the Representative of
Japan and the Minister of State for Foreign Affairs of Korea.
APPENDIX B
PROTOCOL SIGNED AUGUST 22, 1904
Article I
The Korean Government shall engage as Financial Adviser to the
Korean Government, a Japanese subject recommended by the
Japanese Government, and all matters concerning finance shall be
dealt with after his counsel being taken.
Article II
The Korean Government shall engage as diplomatic adviser to the
Department of Foreign Affairs, a foreigner recommended by the
Japanese Government, and all important matters concerning foreign
relations shall be dealt with after his counsel being taken.
Article III
The Korean Government shall previously consult the Japanese
Government in concluding treaties and conventions with foreign
Powers, and in dealing with other important diplomatic affairs, such
as the grant of concessions to, or contracts with, foreigners.
APPENDIX C
CONVENTION OF JULY 24, 1907