It is possible to design the smart contract as a state machine which is convenient for ease of read.
In this exercise, the machine has 4 states and 3 transitions as illustrated in the shcema below:
Transitions have conditions:
- goes in InProgress state if balance is greater than 3tz
- complete if internal
valueis strictly greater than 1 (requires calls to
Each transition is a contract entry point.
The following Completium CLI command deploys the contract on the Tezos network:
In this example it is necessary to call specific entry points. A contract's entrypoints may be listed with:
The goal here is to set the state machine to
Completed state. Use the following commands to transit the machine:
At this stage,
2, which allows transiting to
This last call may be replaced by the following command to go to
Open '7-assets.arl' and click on "Next: Assets" below.