I’m a University student and I’m studying Haskell and Plutus in order to develop Smart Contracts for Cardano.
I’m trying to develop a smart contract similar to the Marlowe example but in Plutus: Bob sells a product, Alice wants to buy it and Carol decides who’s right between Bob and Alice if they don’t agree.
I understand that the Data Script (datum) is sent when the user pays to the contract and that the Redeemer Script is used by the user who tries to collect the money.
In this case, Alice starts with paying to the script the amount of money needed for buying the product. Then in any moment before the deadline she can say that she has received the product. In any moment Bob can say he has sent the product. If both agree, after the deadline Bob can collect the money.
I don’t understand how Alice could set the varibiable productReceived to True, ie. adding the variable to the data script belonging to the smart contract. Same problem with Bob setting the variable productSent to True.
Any explanation would be really appreciated!