Standard arithmetic operations are available on dates.
Convert a date to a day of week, so that:
- 0 if sunday
- 1 if monday
- 2 if tuesday
- 3 if wednesday
- 4 if thursday
- 5 if friday
- 6 if saturday
The formula to implement is:
- d is the date to compute the day of
- 4d is the duration of four days
- 1w is the duration of one week
- mod is the modulo operator: it translates to
- ⌊ X ⌋ is the floor function
The euclidean division
div will efficiently implement the floor and division operations.
The following Completium CLI command deploys the contract on the Tezos network:
Call entry point
The following command calls the unique entry point:
Open '6-state_machine.arl' and click on "Next: State Machine" below.