3 | | - | let Data = Address(base58'3N1QiPZL8f4DnT2EiupruWjM1meT9Y6SzWu') |
---|
4 | | - | let lock = extract(getBoolean(Data, "lock")) |
---|
5 | | - | let token = base58'2SR9voe2SPkQWc8ebK3sLwF8cqqR3DXrzE9H1CbRd2NX' |
---|
6 | | - | let startHeight = 384120 |
---|
7 | | - | let finishHeight = (startHeight + 3000) |
---|
8 | | - | let startPrice = 100000 |
---|
9 | | - | let this = extract(tx.sender) |
---|
10 | | - | if (lock) |
---|
11 | | - | then match tx { |
---|
12 | | - | case d: DataTransaction => |
---|
13 | | - | let currentPrice = if (isDefined(getInteger(this, "price"))) |
---|
14 | | - | then extract(getInteger(this, "price")) |
---|
15 | | - | else startPrice |
---|
16 | | - | let newPrice = extract(getInteger(d.data, "price")) |
---|
17 | | - | let priceIsBigger = (newPrice > currentPrice) |
---|
18 | | - | let fee = 700000 |
---|
19 | | - | let hasMoney = ((wavesBalance(tx.sender) + fee) >= newPrice) |
---|
20 | | - | let correctFields = if ((size(d.data) == 2)) |
---|
21 | | - | then (d.sender == addressFromString(extract(getString(d.data, "sender")))) |
---|
22 | | - | else false |
---|
23 | | - | if (if (if (if ((height >= startHeight)) |
---|
24 | | - | then (finishHeight >= height) |
---|
25 | | - | else false) |
---|
26 | | - | then priceIsBigger |
---|
27 | | - | else false) |
---|
28 | | - | then hasMoney |
---|
29 | | - | else false) |
---|
30 | | - | then correctFields |
---|
31 | | - | else false |
---|
32 | | - | case e: ExchangeTransaction => |
---|
33 | | - | let senderIsWinner = (e.sender == addressFromString(extract(getString(this, "sender")))) |
---|
34 | | - | let correctAssetPair = if ((e.sellOrder.assetPair.amountAsset == token)) |
---|
35 | | - | then !(isDefined(e.sellOrder.assetPair.priceAsset)) |
---|
36 | | - | else false |
---|
37 | | - | let correctAmount = (e.amount == 1) |
---|
38 | | - | let correctPrice = (e.price == extract(getInteger(this, "price"))) |
---|
39 | | - | if (if (if (if ((height > finishHeight)) |
---|
40 | | - | then senderIsWinner |
---|
41 | | - | else false) |
---|
42 | | - | then correctAssetPair |
---|
43 | | - | else false) |
---|
44 | | - | then correctAmount |
---|
45 | | - | else false) |
---|
46 | | - | then correctPrice |
---|
47 | | - | else false |
---|
48 | | - | case _ => |
---|
49 | | - | false |
---|
50 | | - | } |
---|
51 | | - | else match tx { |
---|
52 | | - | case _ => |
---|
53 | | - | true |
---|
54 | | - | } |
---|
| 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) |
---|