March 2019
Intermediate to advanced
636 pages
27h 50m
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