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

Creating interfaces

You can define interfaces in Solidity using the interface keyword. These interfaces are very similar to abstract contracts, and they must not have any function definitions. They also have the following restrictions:

  • All the functions that are defined in the interface must have external visibility.
  • The constructor is not allowed.
  • An interface cannot have any state variables defined.
  • The interfaces cannot inherit from any other contracts or interfaces.

There are some differences between the Solidity 0.4.25 and 0.5.0 version interfaces. In version 0.4.25, you cannot define enum and struct. However, with version 0.5.0 onward, you can define them.

The following example shows an interface that's been defined in Solidity version 0.4.25, having a function declared without the body:

pragma solidity ^0.4.25;

interface ExampleInterface {

function transfer...
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}