duration types are convenient to establish time related business logic.
The call to the entry point succeeds if the contract was created more than 5 minutes and 10 seconds ago; the contract balance must be transferred to caller:
We note that durations may be added or subtracted to dates, and can be compared.
There are several ways to initialize dates and durations:
The following Completium CLI command deploys the contract on the Tezos network:
Note here that the contract's balance is intialized to 5tz.
The following command calls the unique entry point:
If you try this command before valid timelapse of 5 minutes and 10 seconds, it returns an error displayed below:
Open '5-weekday.arl' and click on "Next: Dates arithmetic" below.