-
Notifications
You must be signed in to change notification settings - Fork 0
/
Hello.daml
39 lines (33 loc) · 814 Bytes
/
Hello.daml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Hello where
type HelloBlockChainId = ContractId HelloBlockChain
data HelloStateType
= S0
| S1
| S2
| S3
deriving (Eq, Show)
template HelloBlockChain
with
owner : Party
state : HelloStateType
where
signatory owner
observer owner
choice Bid : HelloBlockChainId
controller owner
do
assertMsg "Invalid State" (this.state == S0)
create this with
state = S1
choice Withdraw : HelloBlockChainId
controller owner
do
assertMsg "Invalid State" (this.state == S1)
create this with
state = S0
choice End : HelloBlockChainId
controller owner
do
assertMsg "Invalid State" (this.state == S1)
create this with
state = S2