1 | | - | {-# STDLIB_VERSION 3 #-} |
---|
2 | | - | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | | - | let BANK = base58'3MwZruD3S5WyFbWoAHp8tyYixqMKxvt1V1K' |
---|
4 | | - | let TARGETHEIGHT = match getInteger(Address(BANK), (toBase58String(tx.sender.bytes) + "_target")) { |
---|
5 | | - | case x: Unit => |
---|
6 | | - | 0 |
---|
7 | | - | case x: Int => |
---|
8 | | - | x |
---|
9 | | - | case _ => |
---|
10 | | - | throw() |
---|
11 | | - | } |
---|
12 | | - | let status = match getString(Address(BANK), (toBase58String(tx.sender.bytes) + "_status")) { |
---|
13 | | - | case x: Unit => |
---|
14 | | - | "unset" |
---|
15 | | - | case x: String => |
---|
16 | | - | x |
---|
17 | | - | case _ => |
---|
18 | | - | throw() |
---|
19 | | - | } |
---|
20 | | - | if (if ((height > TARGETHEIGHT)) |
---|
21 | | - | then (status == "borrowed") |
---|
22 | | - | else false) |
---|
23 | | - | then match tx { |
---|
24 | | - | case t: InvokeScriptTransaction => |
---|
25 | | - | (addressFromRecipient(t.dApp).bytes == BANK) |
---|
26 | | - | case _ => |
---|
27 | | - | false |
---|
28 | | - | } |
---|
29 | | - | else if (if ((status == "returned")) |
---|
30 | | - | then true |
---|
31 | | - | else (status == "canceled")) |
---|
32 | | - | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
33 | | - | else match tx { |
---|
34 | | - | case t: SetScriptTransaction => |
---|
35 | | - | false |
---|
36 | | - | case _ => |
---|
37 | | - | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
38 | | - | } |
---|
| 1 | + | # no script |
---|