3 | | - | let deposit = 100000000 |
---|
4 | | - | let dataFee = 10000000 |
---|
5 | | - | let payoutFee = 500000 |
---|
6 | | - | let me = tx.sender |
---|
7 | | - | let adminPublicKey = base58'22GEgQRoT3xuSPQTTBNofWLnYQsn2ZTwAzd5f51CMFeb' |
---|
8 | | - | let answer = extract(getBinary(me, "answer")) |
---|
9 | | - | let startHeight = extract(getInteger(me, "height")) |
---|
10 | | - | match tx { |
---|
11 | | - | case a: DataTransaction => |
---|
12 | | - | if ((size(a.data) != 2)) |
---|
13 | | - | then throw("data incorrect") |
---|
14 | | - | else if (!(sigVerify(a.bodyBytes, a.proofs[0], adminPublicKey))) |
---|
15 | | - | then { |
---|
16 | | - | let paymentTxId = extract(getString(a.data, 0)) |
---|
17 | | - | let paymentTx = transactionById(fromBase58String(paymentTxId)) |
---|
18 | | - | match paymentTx { |
---|
19 | | - | case b: TransferTransaction => |
---|
20 | | - | let sender = getString(a.data, toBase58String(b.sender.bytes)) |
---|
21 | | - | if (if (if (if (if (if (if (if (if (isDefined(sender)) |
---|
22 | | - | then (b.recipient == me) |
---|
23 | | - | else false) |
---|
24 | | - | then (extract(sender) == paymentTxId) |
---|
25 | | - | else false) |
---|
26 | | - | then sigVerify(a.bodyBytes, a.proofs[0], b.senderPublicKey) |
---|
27 | | - | else false) |
---|
28 | | - | then (a.fee == dataFee) |
---|
29 | | - | else false) |
---|
30 | | - | then (b.amount >= (deposit + dataFee)) |
---|
31 | | - | else false) |
---|
32 | | - | then !(isDefined(b.assetId)) |
---|
33 | | - | else false) |
---|
34 | | - | then !(isDefined(getString(me, paymentTxId))) |
---|
35 | | - | else false) |
---|
36 | | - | then isDefined(getString(a.data, paymentTxId)) |
---|
37 | | - | else false) |
---|
38 | | - | then (extract(transactionHeightById(b.id)) >= startHeight) |
---|
39 | | - | else false |
---|
40 | | - | case _ => |
---|
41 | | - | false |
---|
42 | | - | } |
---|
43 | | - | } |
---|
44 | | - | else if (if (isDefined(getBinary(a.data, "answer"))) |
---|
45 | | - | then isDefined(getInteger(a.data, "height")) |
---|
46 | | - | else false) |
---|
47 | | - | then (a.fee == dataFee) |
---|
48 | | - | else false |
---|
49 | | - | case c: MassTransferTransaction => |
---|
50 | | - | let partTxId = getString(me, toBase58String(addressFromRecipient(c.transfers[1].recipient).bytes)) |
---|
51 | | - | let participated = if (isDefined(partTxId)) |
---|
52 | | - | then (extract(transactionHeightById(fromBase58String(extract(partTxId)))) >= startHeight) |
---|
53 | | - | else false |
---|
54 | | - | let correct = (sha256(toBytes(extract(getString(c.transfers[1].recipient, "answer")))) == answer) |
---|
55 | | - | if (if (if (if (if (if (participated) |
---|
56 | | - | then correct |
---|
57 | | - | else false) |
---|
58 | | - | then (c.transfers[0].recipient == addressFromPublicKey(adminPublicKey)) |
---|
59 | | - | else false) |
---|
60 | | - | then (c.transfers[0].amount >= (c.transfers[1].amount / 10)) |
---|
61 | | - | else false) |
---|
62 | | - | then (size(c.transfers) == 2) |
---|
63 | | - | else false) |
---|
64 | | - | then (c.fee == payoutFee) |
---|
65 | | - | else false) |
---|
66 | | - | then !(isDefined(c.feeAssetId)) |
---|
67 | | - | else false |
---|
68 | | - | case _ => |
---|
69 | | - | true |
---|
70 | | - | } |
---|
| 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) |
---|