Concordium / concordium-rust-smart-contracts

Libraries and tools for writing and testing smart contracts on Concordium
https://docs.rs/concordium-std/latest/concordium_std/
Mozilla Public License 2.0
58 stars 35 forks source link

Creating a track-and-trace contract using a state machine design #388

Closed DOBEN closed 10 months ago

DOBEN commented 10 months ago

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 status Produced. Each new item is assigned the next_item_id. The next_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. The ADMIN 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

abizjak commented 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.

DOBEN commented 10 months ago

Closing because PR is moved to: https://github.com/Concordium/concordium-dapp-examples/pull/46