1 | | - | {-# STDLIB_VERSION 2 #-} |
---|
2 | | - | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | | - | let Data = Address(base58'3MuXdKK8eFQDgt41Sberj6N4ZT3TvUk1Mvu') |
---|
4 | | - | let Bob = Address(base58'3MuXdKK8eFQDgt41Sberj6N4ZT3TvUk1Mvu') |
---|
5 | | - | let Alice = Address(base58'3N2ChrVZCRqa3ivKjNfMgyxPM9b8wL2AnaU') |
---|
6 | | - | let beforeHeight = 1647903 |
---|
7 | | - | let lock = extract(getBoolean(Data, "lock")) |
---|
8 | | - | if (lock) |
---|
9 | | - | then { |
---|
10 | | - | let secret = base58'895QVZgniVqUMxcg2oQjS2qFFVfsrAZkfjFXRYouktft' |
---|
11 | | - | match tx { |
---|
12 | | - | case t: TransferTransaction => |
---|
13 | | - | let txToBob = if (if ((t.recipient == Bob)) |
---|
14 | | - | then (sha256(t.proofs[0]) == secret) |
---|
15 | | - | else false) |
---|
16 | | - | then ((20 + beforeHeight) >= height) |
---|
17 | | - | else false |
---|
18 | | - | let backToAliceAfterHeight = if ((height >= (21 + beforeHeight))) |
---|
19 | | - | then (t.recipient == Alice) |
---|
20 | | - | else false |
---|
21 | | - | if (txToBob) |
---|
22 | | - | then true |
---|
23 | | - | else backToAliceAfterHeight |
---|
24 | | - | case _ => |
---|
25 | | - | false |
---|
26 | | - | } |
---|
27 | | - | } |
---|
28 | | - | else { |
---|
29 | | - | let secret = base58'895QVZgniVqUMxcg2oQjS2qFFVfsrAZkfjFXRYouktft' |
---|
30 | | - | match tx { |
---|
31 | | - | case t: TransferTransaction => |
---|
32 | | - | let txToBob = if (if ((t.recipient == Bob)) |
---|
33 | | - | then (sha256(t.proofs[0]) == secret) |
---|
34 | | - | else false) |
---|
35 | | - | then ((20 + beforeHeight) >= height) |
---|
36 | | - | else false |
---|
37 | | - | let backToAliceAfterHeight = if ((height >= (21 + beforeHeight))) |
---|
38 | | - | then (t.recipient == Alice) |
---|
39 | | - | else false |
---|
40 | | - | if (txToBob) |
---|
41 | | - | then true |
---|
42 | | - | else backToAliceAfterHeight |
---|
43 | | - | case _ => |
---|
44 | | - | true |
---|
45 | | - | } |
---|
46 | | - | } |
---|
| 1 | + | # no script |
---|