Ethereum Smart Contract Development
eBook - ePub

Ethereum Smart Contract Development

Mayukh Mukhopadhyay

Partager le livre
  1. English
  2. ePUB (adapté aux mobiles)
  3. Disponible sur iOS et Android
eBook - ePub

Ethereum Smart Contract Development

Mayukh Mukhopadhyay

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Become an Ethereum Blockchain developer using a blend of concepts and hands-on implementationsAbout This Book‱ Understand the Ethereum Ecosystem and its differences from its rich cousin Bitcoin‱ Explore the Solidity programming language and smart contract optimizations‱ Get a developer's perspective of Blockchain-as-a-technology with exposure to common challenges faced while building decentralized applicationsWho This Book Is ForIf you want to know the ins and outs of the Ethereum network and build your own decentralized applications, then this book is what you need! This book is for anyone who is interested in blockchain and wants to become an Ethereum developer. It's ideal for existing Ethereum developers who want to develop Ethereum using smart contracts. Basic knowledge of cryptography is expected but is not mandatory.What You Will Learn‱ Know how to build your own smart contracts and cryptocurrencies‱ Understand the Solidity language‱ Find out about data types, control structure, functions, inheritance, mathematical operations, and much more‱ See the various types of forks and discover how they are related to Ethereum‱ Get to know the various concepts of web3.js and its APIs so you can build client-side apps‱ Build a DAO from scratch and acquire basic knowledge of DApps on Ethercast‱ Be guided through the project so you can optimize EVM for smart contracts‱ Build your own decentralized applications (DApps) by taking a practical approachIn DetailEthereum is a public, blockchain-based distributed computing platform featuring smart contract functionality. This book is your one-stop guide to blockchain and Ethereum smart contract development.We start by introducing you to the basics of blockchain. You'll learn about hash functions, Merkle trees, forking, mining, and much more. Then you'll learn about Ethereum and smart contracts, and we'll cover Ethereum virtual machine (EVM) in detail. Next, you'll get acquainted with DApps and DAOs and see how they work. We'll also delve into the mechanisms of advanced smart contracts, taking a practical approach.You'll also learn how to develop your own cryptocurrency from scratch in order to understand the business behind ICO. Further on, you'll get to know the key concepts of the Solidity programming language, enabling you to build decentralized blockchain-based applications. We'll also look at enterprise use cases, where you'll build a decentralized microblogging site.At the end of this book, we discuss blockchain-as-a-service, the dark web marketplace, and various advanced topics so you can get well versed with the blockchain principles and ecosystem.Style and approachThis comprehensive guide takes a practical approach by showing you how to implement Blockchain in different Enterprise use cases. You'll quickly brush up on the basics of the blockchain database, then learn the advanced intricacies of smart contract development.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Ethereum Smart Contract Development est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Ethereum Smart Contract Development par Mayukh Mukhopadhyay en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Databases. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2018
ISBN
9781788472623
Édition
1
Sous-sujet
Databases

Hello World of Smart Contracts

This chapter is a hands-on guide for developing our first smart contract. As an unspoken tradition of software developers since the days of Dennis Ritchie, the creator of C language, we will start with a Hello World program. We will then introduce some basic increment, decrement, and loop operations using smart contracts. We walk through the process of creating our own private blockchain, right from the genesis block, and mining our own ethers. After studying this chapter, you will be able to:
  • Write your first Hello World smart contract
  • Code a contract with basic increment and decrement operation
  • Code a loop
  • Raise an issue on GitHub
  • Create a private blockchain and mine ethers to run a smart contract

A smart contract in seven lines of code

In this section you will learn to code your first smart contract in just seven lines of code (Loc), no hidden terms and conditions. And did I say that you do not need any special software, apart from your web browser, or to spend any real ethers from your pocket? Let's see. I am using Windows 7 (64 bit OS) and a Google Chrome browser:
  1. Open your Google Chrome browser and type remix solidity in Google, as show in Figure 3.1:
Figure 3.1: Google search for remix solidity online compiler
  1. Click the highlighted link in Figure 3.2. You can also type the following in your browser URL box to get to the website directly: http://remix.ethereum.org:
The present remix ethereum webpage is going through rapid changes and version increments. Meanwhile, and older yet stable version is provided to Solidity users for practice in the following link:
https://yann300.github.io/remix04/
    Figure 3.2: Remix—Solidity IDE
    1. Click the plus sign as marked in Figure 3.3 to create a new untitled Solidity (.sol) file.
    Figure 3.3 Untitled Solidity file in remix IDE
    Rename it HelloWorld.sol and confirm the renaming, as shown in Figure 3.4:
    Figure 3.4: Untitled.sol renamed to HelloWorld.sol
    1. Write the following seven lines of code in the HelloWorld.sol file, as shown in Figure 3.5:
    Figure 3.5: HelloWorld.sol
    Choose the JavaScript VM Environment option, as shown in Figure 3.6:
    Figure 3.6: JavaScript VM acting as a blockchain simulator
    1. Click the Create button, as highlighted in Figure 3.7. Voila! You just created your smart contract. The only caveat is that we would be simulating it on our local machine using in-memory, which mimics an Ethereum blockchain:
    Figure 3.7: Our first smart contract of 368 bytes
    1. To execute this contract, we press that myFirstHelloWorld button, as shown in Figure 3.8. We get the desired output: Hello World !
    Figure 3.8: Execution of myFirstHelloWorld function using a smart contract
    1. We can also explore the byte codes, which are generated as a result of this smart contract execution, by pressing the Launch debugger | Instructions or just by clicking the Contract details (bytecode, interface etc) link. Figure 3.9 depicts the 368 bytes of virtual machine code generated by the hello world smart contract execution:
    Figure 3.9: 368 bytes [000 to 367] of machine code for Hello World smart contract

    Remix in a nutshell

    So, what is this remix? In simple words, it is a browser-based Integrated Development Environment (IDE) for writing smart contracts in Solidity. It has an integrated compiler, a runtime virtual environment without any server-side component, an integrated debugger, an integrated testing environment, and a static code analysis tool. Previously, it used to be called Browser-Solidity. It can not only simulate a blockchain, but also highlights syntax and errors, hosts multiple Solidity files, and deploys contracts along with visible byte codes and application binary interface (ABI), of which details can be found in later chapters.
    However, I promised less theory and more hands-...

    Table des matiĂšres