December 2018
Intermediate to advanced
222 pages
6h 6m
English
State machine is a behavior design pattern. It allows a contract to alter its behavior when it's internal state changes. A smart contract function call typically moves a contract state from one stage to the next stage. The basic operation of a state machine has two parts:
To illustrate this, let's develop a simple state machine. We will use washing dishes as an example. The process typically is scrub, rinse, dry, scrub, rinse, dry. We defined state machine stages as an enumerated type. As this is an extensive use case, only the state machine ...
Read now
Unlock full access