Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Blockchain Programming with Solidity

You're reading from   Mastering Blockchain Programming with Solidity Write production-ready smart contracts for Ethereum blockchain with Solidity

Arrow left icon
Product type Paperback
Published in Aug 2019
Publisher Packt
ISBN-13 9781839218262
Length 486 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Jitendra Chittoda Jitendra Chittoda
Author Profile Icon Jitendra Chittoda
Jitendra Chittoda
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Section 1: Getting Started with Blockchain, Ethereum, and Solidity
2. Introduction to Blockchain FREE CHAPTER 3. Getting Started with Solidity 4. Control Structures and Contracts 5. Section 2: Deep Dive into Development Tools
6. Learning MetaMask and Remix 7. Using Ganache and the Truffle Framework 8. Taking Advantage of Code Quality Tools 9. Section 3: Mastering ERC Standards and Libraries
10. ERC20 Token Standard 11. ERC721 Non-Fungible Token Standard 12. Deep Dive into the OpenZeppelin Library 13. Using Multisig Wallets 14. Upgradable Contracts Using ZeppelinOS 15. Building Your Own Token 16. Section 4: Design Patterns and Best Practices
17. Solidity Design Patterns 18. Tips, Tricks, and Security Best Practices 19. Assessments 20. Other Books You May Enjoy

What this book covers

Chapter 1, Introduction to Blockchain, starts with how blockchain technology came into existence through the innovation of Bitcoin. This chapter discusses the different properties of a blockchain. It also introduces Ethereum and how it is different from the Bitcoin blockchain. Later, this chapter introduces smart contracts.

Chapter 2, Getting Started with Solidity, starts with the basic Solidity language syntaxes and the structure of a contract. You will learn about the different data types available in Solidity. This chapter also discusses globally available variables present in the Solidity language that you can use while writing your smart contract.

Chapter 3, Control Structures and Contracts, deep dives into the control structures of Solidity contracts, the different types of functions supported, contract inheritance, and event logging. 

Chapter 4, Learning MetaMask and Remix, discusses setting up your MetaMask plugin and creating wallets using it. This chapter also discusses using the online Remix IDE to create, compile, deploy, and interact with your Solidity contracts.

Chapter 5, Using Ganache and the Truffle Framework, discusses installing and setting up your local blockchain instance using Ganache. This chapter also discusses installing and setting up the Truffle framework, learning how to use its commands, setting up your new Truffle project, writing migration scripts for the Truffle framework, and adding test cases to a project.

Chapter 6, Taking Advantage of Code Quality Tools, discusses improving the quality of your contracts by using open source tools such as surya, which helps in generating different kinds of reports. This chapter also discusses using Solidity linters to lint your code and fix common issues present in your contracts, as well as running Solidity coverage tools to generate code coverage reports.

Chapter 7, ERC20 Token Standard, covers the introduction of the ERC20 token standard. This chapter deep dives into its full implementation details, provides an in-depth study of each function of the standard, and covers different events, optional functions, and a number of advanced functions.

Chapter 8, ERC721 Non-Fungible Token Standard, starts with an introduction to the ERC721 standard and the difference between the ERC20 and ERC721 standards. This chapter deep dives into each of the state variables, functions, and events associated with ERC721 implementation. This chapter also discusses some other optional contracts that can be used with the ERC721 standard.

Chapter 9, Deep Dive into the OpenZeppelin Library, starts with an introduction to OpenZeppelin library contracts. This chapter will help you learn how to install and use OpenZeppelin library contracts in your Truffle project. It also provides in-depth studies of library contracts such as Ownable, Claimable, Roles, PauserRole, Pausable, ERC20, SafeERC20, DetailedERC20, ERC20Mintable, ERC20Burnable, ERC20Pausable, Math, SafeMath, Crowdsale, Address, and ReentrancyGuard.

Chapter 10, Using Multisig Wallets, The multisig wallets are special contracts that require multiple signatures to execute a transaction. This chapter provides an introduction to multisig contracts and their usage. This chapter also covers installing, creating, and setting up your own multisig wallet, as well as how to use and control it.

Chapter 11, Upgradable Contracts Using ZeppelinOS, provides an introduction to the ZeppelinOS development platform. Topics covered include creating a new project using zos commands, creating an upgradable contract, deploying, re-deploying to upgrade the contract, and some precautions to take when using ZeppelinOS for writing upgradable contracts.

Chapter 12, Building Your Own Token, helps you learn how to create your own ERC20 token contract from scratch. You will learn how to draft the specification of a contract, set up a Truffle project, create a contract, choose which OpenZeppelin libraries to use, write migration scripts, write test cases, execute migration scripts and test cases in Ganache, and finally, test your contracts on a testnet such as Rinkeby.

Chapter 13, Solidity Design Patterns, introduces different Solidity design patterns. These are divided into five categories: Security patterns: Withdrawal, Access restriction, and Emergency stop; Creational patterns: Factory pattern; Behavioral patterns: State machine, Iterable map, Indexed map, Address list, and Subscription; Gas economic patters: String comparison and Tight variable packing; and Life cycle patterns: Mortal and Auto deprecate pattern.

Chapter 14, Tips, Tricks, and Security Best Practices, helps you to learn different Solidity smart contract best practices, such as avoiding floating pragma, the 15-second blocktime rule, rounding errors, and gas consumption. It also helps you to learn about different security attacks, such as front-running, reentrancy, signature replay, integer overflow and underflow, and how to prevent these attack patterns.

lock icon The rest of the chapter is locked
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 €18.99/month. Cancel anytime