Chapter 8

Learning about Smart Contracts

IN THIS CHAPTER

Bullet Describing Supply Chain and its challenges

Bullet Exploring a blockchain solution to supply chain

Bullet Handling data and computation in Solidity

Bullet Coding to limit gas cost

Bullet Controlling execution flow and responding to errors

Smart contracts are the functional part of any blockchain solution. Just like the objects you learn about in Chapter 7, a blockchain solution is a combination of data and actions on that data. The data is the content of the blocks on the blockchain. You already know that after data is added, it stays there forever. (Although you could technically change blockchain data, doing so without any other node detecting your change is next to impossible.) Because blockchain data is immutable, it is important to carefully control how that data is added.

The actions that operate on the blockchain data are the smart contracts. You already know that smart contracts, like the data, are stored in blocks on the blockchain. But smart ...

Get Ethereum For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.