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 s: SetScriptTransaction => |
---|
56 | | - | true |
---|
57 | | - | case _ => |
---|
58 | | - | false |
---|
59 | | - | } |
---|
| 3 | + | let PubKey1 = base58'854p8BYzrj6yBPRPmfQur3oF1Rjc1AJ548qRp5FT5kDa' |
---|
| 4 | + | let PubKey2 = base58'DKGFPozLrsiR8NM4NJzqQaBYC8NyGYjuw2hDYicQVjco' |
---|
| 5 | + | let sig1 = if (sigVerify(tx.bodyBytes, tx.proofs[0], PubKey1)) |
---|
| 6 | + | then 1 |
---|
| 7 | + | else 0 |
---|
| 8 | + | let sig2 = if (sigVerify(tx.bodyBytes, tx.proofs[1], PubKey2)) |
---|
| 9 | + | then 1 |
---|
| 10 | + | else 0 |
---|
| 11 | + | ((sig1 + sig2) > 0) |
---|