Chapter 6

Discovering Smart Contracts

IN THIS CHAPTER

Bullet Describing supply chain and its challenges

Bullet Exploring a blockchain solution to supply chain problems

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 described in Chapter 5 of this minibook, 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. Smart contracts, like the data, are stored in blocks on the blockchain. But smart contracts ...

Get Cryptocurrency All-in-One 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.