1 | | - | {-# STDLIB_VERSION 1 #-} |
---|
2 | | - | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | | - | let betAmount = 100000000 |
---|
4 | | - | let dataTxFee = 10000000 |
---|
5 | | - | let payoutFee = 500000 |
---|
6 | | - | let minHeightDiff = 55 |
---|
7 | | - | let maxHeightDiff = 65 |
---|
8 | | - | let me = tx.sender |
---|
9 | | - | let heightToGetMoney = extract(getInteger(me, "heightToGetMoney")) |
---|
10 | | - | match tx { |
---|
11 | | - | case t: DataTransaction => |
---|
12 | | - | let newHeightToGetMoney = extract(getInteger(t.data, "heightToGetMoney")) |
---|
13 | | - | let paymentTxId = extract(getString(t.data, "lastPayment")) |
---|
14 | | - | let paymentTx = transactionById(fromBase58String(paymentTxId)) |
---|
15 | | - | match paymentTx { |
---|
16 | | - | case paymentTx: TransferTransaction => |
---|
17 | | - | if (if (if (if (if (if (if (if (if (if ((heightToGetMoney > height)) |
---|
18 | | - | then !(isDefined(getString(me, paymentTxId))) |
---|
19 | | - | else false) |
---|
20 | | - | then (paymentTx.recipient == me) |
---|
21 | | - | else false) |
---|
22 | | - | then (paymentTx.amount >= (betAmount + dataTxFee)) |
---|
23 | | - | else false) |
---|
24 | | - | then !(isDefined(paymentTx.assetId)) |
---|
25 | | - | else false) |
---|
26 | | - | then ((newHeightToGetMoney - height) > minHeightDiff) |
---|
27 | | - | else false) |
---|
28 | | - | then (maxHeightDiff > (newHeightToGetMoney - height)) |
---|
29 | | - | else false) |
---|
30 | | - | then (size(t.data) == 3) |
---|
31 | | - | else false) |
---|
32 | | - | then isDefined(getString(t.data, paymentTxId)) |
---|
33 | | - | else false) |
---|
34 | | - | then sigVerify(t.bodyBytes, t.proofs[0], paymentTx.senderPublicKey) |
---|
35 | | - | else false) |
---|
36 | | - | then (t.fee == dataTxFee) |
---|
37 | | - | else false |
---|
38 | | - | case _ => |
---|
39 | | - | false |
---|
40 | | - | } |
---|
41 | | - | case payout: TransferTransaction => |
---|
42 | | - | let lastPaymentTx = transactionById(fromBase58String(extract(getString(me, "lastPayment")))) |
---|
43 | | - | match lastPaymentTx { |
---|
44 | | - | case lastPaymentTx: TransferTransaction => |
---|
45 | | - | if (if (if ((height >= heightToGetMoney)) |
---|
46 | | - | then (lastPaymentTx.sender == payout.recipient) |
---|
47 | | - | else false) |
---|
48 | | - | then (payout.fee == payoutFee) |
---|
49 | | - | else false) |
---|
50 | | - | then !(isDefined(payout.feeAssetId)) |
---|
51 | | - | else false |
---|
52 | | - | case _ => |
---|
53 | | - | false |
---|
54 | | - | } |
---|
55 | | - | case _ => |
---|
56 | | - | sigVerify(tx.bodyBytes, tx.proofs[0], base58'BVv1ZuE3gKFa6krwWJQwEmrLYUESuUabNCXgYTmCoBt6') |
---|
57 | | - | } |
---|
| 1 | + | # no script |
---|