-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plutus.lbf
46 lines (35 loc) · 966 Bytes
/
Plutus.lbf
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
-- Demo.Plutus contains all the protocol datums
module Demo.Plutus
import Prelude
import qualified Plutus.V1 as Plutus
import Plutus.V1 (PlutusData, AssetClass, Address)
record Record a = {
foo : AssetClass,
bar : Address,
baz : a
}
derive Eq (Record a)
derive Json (Record a)
derive PlutusData (Record a)
prod Product b = AssetClass Address b
derive Eq (Product a)
derive Json (Product a)
derive PlutusData (Product a)
sum Sum a = Foo AssetClass | Bar Address | Baz a
derive Eq (Sum a)
derive Json (Sum a)
derive PlutusData (Sum a)
-- EqDatum is stored at EqValidator UTxOs
record EqDatum = {
rec : Record Plutus.Bytes,
prod : Product Plutus.Bytes,
sum : Sum Plutus.Bytes
}
derive Eq EqDatum
derive Json EqDatum
derive PlutusData EqDatum
-- EqRedeemer denotes the type of validation performed by the EqValidator
sum EqRedeemer = IsEqual EqDatum | IsNotEqual EqDatum
derive Eq EqRedeemer
derive Json EqRedeemer
derive PlutusData EqRedeemer