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
Blockchain Developer's Guide

You're reading from   Blockchain Developer's Guide Develop smart applications with Blockchain technologies - Ethereum, JavaScript, Hyperledger Fabric, and Corda

Arrow left icon
Product type Course
Published in Dec 2018
Publisher
ISBN-13 9781789954722
Length 564 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (4):
Arrow left icon
Paul Valencourt Paul Valencourt
Author Profile Icon Paul Valencourt
Paul Valencourt
Brenn Hill Brenn Hill
Author Profile Icon Brenn Hill
Brenn Hill
Narayan Prusty Narayan Prusty
Author Profile Icon Narayan Prusty
Narayan Prusty
Samanyu Chopra Samanyu Chopra
Author Profile Icon Samanyu Chopra
Samanyu Chopra
Arrow right icon
View More author details
Toc

Table of Contents (37) Chapters Close

Title Page
Copyright
About Packt
Contributors
Preface
1. Blockchain 101 FREE CHAPTER 2. Components and Structure of Blockchain 3. Decentralization Versus Distributed Systems 4. Cryptography and Mechanics Behind Blockchain 5. Bitcoin 6. Altcoins 7. Achieving Consensus 8. Advanced Blockchain Concepts 9. Cryptocurrency Wallets 10. Alternate Blockchains 11. Hyperledger and Enterprise Blockchains 12. Ethereum 101 13. Solidity 101 14. Smart Contracts 15. Ethereum Accounts and Ether Tokens 16. Decentralized Applications 17. Mining 18. ICO 101 19. Creating Your Own Currency 20. Scalability and Other Challenges 21. Future of Blockchain 22. Understanding Decentralized Applications 23. Understanding How Ethereum Works 24. Writing Smart Contracts 25. Getting Started with web3.js 26. Building a Wallet Service 27. Building a Smart Contract Deployment Platform 28. Building a Betting App 29. Building Enterprise Level Smart Contracts 30. Building a Consortium Blockchain 1. Other Books You May Enjoy Index

Features of contracts


Now it's time to get deeper into contracts. We will look at some new features and also get deeper into the features we have already seen.

Visibility

The visibility of a state variable or a function defines who can see it. There are four kinds of visibilities for function and state variables: external, public, internal, and private.

By default, the visibility of functions is public and the visibility of state variables is internal. Let's look at what each of these visibility functions mean:

  • external: External functions can be called only from other contracts or via transactions. An external function f cannot be called internally; that is, f() will not work, but this.f() works. You cannot apply the external visibility to state variables.
  • public: Public functions and state variables can be accessed in all ways possible. The compiler generated accessor functions are all public state variables. You cannot create your own accessors. Actually, it generates only getters, not setters...
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 $19.99/month. Cancel anytime