Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Blockchain Programming with Solidity

You're reading from  Mastering Blockchain Programming with Solidity

Product type Book
Published in Aug 2019
Publisher Packt
ISBN-13 9781839218262
Pages 486 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Jitendra Chittoda Jitendra Chittoda
Profile icon Jitendra Chittoda

Table of Contents (21) Chapters

Preface 1. Section 1: Getting Started with Blockchain, Ethereum, and Solidity
2. Introduction to Blockchain 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

Understanding types of Solidity functions

Solidity functions take arguments and can return multiple return values. The function definitions start with the function keyword. Every function should have its visibility specified. If this is not defined in version 0.4.25, it will default to public visibility. In Solidity version 0.5.0, you must have visibility defined for a function; otherwise, you will get compilation errors.

The syntax that's used to define a function definition is as follows:

function functionName(<parameter types>) {internal|external|public|private} [pure|view|payable] [returns (<return types>)]

The following is the syntax diagram for defining a function:

 Syntax diagram for function definition

As shown in the preceding syntax diagram, a function can return multiple values using the returns(value0, value1, ... , valueN) syntax.

...
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 $15.99/month. Cancel anytime}