Smart Contracts: From Zero to Dapp Hero
Get started with smart contracts and the Solidity™ language. In this presentation, you’ll receive an introduction to Solidity, a programming language for creating smart contracts on platforms like Ethereum and Hedera Hashgraph. You will learn step-by-step procedures for creating simple smart contracts and explore best practices for testing and developing distributed applications (dapps).
John Gethoefer | Principal Software Engineer | Bumped, Inc.
Slides https://www.slideshare.net/HederaHashgraph/smart-contracts-from-zero-to-dapp-hero-hedera18 Speaker John Gethoefer | Principal Software Engineer | Bumped, Inc. Abstract Get started with Smart Contracts and the Solidity™ language. In this presentation, you’ll receive an introduction to Solidity, a programming language for creating smart contracts for Ethereum and Hedera Hashgraph.
Smart Contracts: From Zero to Dapp Hero
Distributed ledger technologies (DLTs) allow users to store information and complete transactions without the need for a trusted third-party. The infrastructure they provide enables exciting new possibilities. Using smart contracts, developers can harness the power of a public ledger to securely execute complicated transactions and build full-scale, decentralized applications (dapps).
In this presentation, Bumped Inc. Principal Software Engineer John Gethoefer gives us an introduction to smart contracts and decentralized applications. After defining these terms, he walks us through a basic smart contract written in the Solidity language and provides several tools to get started.
What is a Smart Contract? [1:11]
At their core, smart contracts are binding agreements between multiple parties. Whether they represent the exchange of a few coins or the purchasing of a multimillion dollar house, smart contracts establish and record the terms of a transaction. In this way, smart contracts fulfill the same role as traditional, written contracts.
However, unlike traditional contracts, smart contracts are self-executing and enforced by computation. While written contracts record the terms of an exchange, they hold no power in and of themselves. Traditional contracts must be executed and enforced in a traditional way, usually relying on a legal team or a governmental force; without an executive body behind these traditional contracts, they are simply stacks of paper.
In contrast, smart contracts can enforce and execute themselves. Written in code, smart contracts are programs which can carry out their own terms precisely, transparently, and without middlemen. In these exchanges, otherwise known as atomic swaps, a transaction is completed perfectly or not at all. Therefore, smart contracts not only record the terms of an exchange, but they also self-execute and enforce those terms to the letter.
While smart contracts alone can be a powerful tool, combined with other smart contracts and software they can provide novel and industry-disrupting functionalities. Alongside DLTs, smart contracts form the building blocks of decentralized applications.
What are Dapps? [2:44]
Dapps are applications that rely on distributed ledger technology, typically smart contracts. Unlike traditional applications, which are governed by a central authority (think Google or Facebook), dapps are distributed across users. As a result, users often enjoy higher transparency and freedom, all while maintaining greater control of their own user experience and data. Because of this limitation on central control, dapps have implications in areas such as free speech, open marketplaces, and supply chains.
Building Dapps with Solidity [10:14]
Tools for Solidity [12:33]
In the remainder of his presentation, John Gethoefer discusses several tools for Solidity that can help developers get started right away: Remix IDE, Truffle, and Embark.
Remix IDE is the easiest way to immediately get started writing smart contracts. Remix is a browser-based application which allows developers to write, compile, run, test, and analyze Solidity code. It is a great tool for newcomers to Solidity and smart contracts. You can begin using Remix IDE here.
Once you have the basics down, you can move to Truffle, a more powerful program than Remix IDE. Truffle is command-line client which supports unit testing, migration, deployment, and other advanced functions. With its wide variety of templates, Truffle lets you quickly get started on advanced smart contracts and even dapps.
If you want more of an end-to-end experience, you can use Embark. Embark is likely easier to pick up than Truffle, and provides similar functionality. In addition to providing templates and advanced development tools like Truffle, Embark supports testing and code generation.
Finally, when building decentralized applications or advanced smart contracts with Truffle or Embark, you may want to use other smart contracts as building blocks. The Open Zeppelin Project stores a large collection of smart contract templates. As a developer, you can use these templates to perform basic transactions or build more robust functionality on top of them. In addition to being a great tool for finding community-tested templates, the Open Zeppelin library is also a great place to discover what is possible with smart contracts. You can access these resources here: https://openzeppelin.org/.