Closed DOBEN closed 10 months ago
Why is this PR in the rust-smart-contracts repository?
Should it not be in the dapp-examples instead. This is not an example of a standard that we need to keep here. It is tightly coupled to the dapp, so to me it makes much more sense to keep it there, along with other scripts and tools.
Closing because PR is moved to: https://github.com/Concordium/concordium-dapp-examples/pull/46
Purpose
closes #387
The track-and-trace contract is modeled based on a state machine. The flow of the state machine is as follows: The
ADMIN
creates a new item with statusProduced
. Each new item is assigned thenext_item_id
. Thenext_item_id
value is sequentially increased by 1 in the contract's state. The different roles (PRODUCER
,TRANSPORTER
,SELLER
) can update the item's status based on the rules of the state machine as follows:Produced -> InTransit -> InStore -> Sold
. TheADMIN
role is an exception and can set an item's status to any value at any time ignoring the state machine rules.Changes
Creating a track-and-trace contract using a state machine design