-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathToken.hs
55 lines (45 loc) · 1.07 KB
/
Token.hs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{-# LANGUAGE DamlSyntax #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
module Example where
import DA.Internal.Desugar
import GHC.Types
interface Token where
{-
getAmount : Decimal
-}
choice Split : (ContractId Token, ContractId Token)
with
splitAmount : Int
choice Transfer : ContractId Token
with
newOwner : Party
template Asset
with
amount : Decimal
issuer : Party
owner : Party
where
signatory issuer, owner
implements Token where
choice Split : (ContractId Token, ContractId Token)
with
splitAmount : Int
controller owner
do error "not implemented"
choice Transfer : ContractId Token
with
newOwner : Int
controller newOwner, owner
do error "not implemented"
{-
let getAmount = amount
-}
choice OtherChoice : ()
controller owner
do pure ()