The state machine pattern should be used in the following cases, when:
A contract needs to transition from different states
A contract needs to allow different functions and to behave differently during each of the intermediate states
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.