tx · 2BvuZQNmArSg1diGWtSCEEgums1fJ2FYFDiBVG5cZQSz 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu: -0.01400000 Waves 2019.01.30 21:34 [473372] smart account 3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu > SELF 0.00000000 Waves
{ "type": 13, "id": "2BvuZQNmArSg1diGWtSCEEgums1fJ2FYFDiBVG5cZQSz", "fee": 1400000, "feeAssetId": null, "timestamp": 1548873275086, "version": 1, "sender": "3N4Z7j4oSNfJVUtP4kmMKbhZD5n4xPFpPAu", "senderPublicKey": "F3DbYSfYZz6arcD6Mst8HdWScxTeWvTvatC7jp4DGryX", "proofs": [ "31N6noSH9DvCavjT1GX4RKcuPF24Jv3kj4S7qujQULoJDPGgQGazK35dGKi2fg6FJGfgEs2yCaPtQYcaFE4ogTQN" ], "script": "base64:AQQAAAACbWUIBQAAAAJ0eAAAAAZzZW5kZXIEAAAABm9yYWNsZQkBAAAAB2V4dHJhY3QAAAABCQEAAAARYWRkcmVzc0Zyb21TdHJpbmcAAAABAgAAACMzTkN6YVlUTkRHdFI4emY5eWZjcWVQRmpDcUZ4OVM1emhzNAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAACndpdGhkcmF3VHgFAAAAByRtYXRjaDAEAAAABHR4SWQJAQAAAAdleHRyYWN0AAAAAQkABB0AAAACBQAAAAJtZQkAAlgAAAABCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEEAAAAByRtYXRjaDEJAAPoAAAAAQkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABAwkAAAEAAAACBQAAAAckbWF0Y2gxAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAlwYXltZW50VHgFAAAAByRtYXRjaDEEAAAAEmlzUGF5bWVudFRvb2tQbGFjZQMJAAAAAA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AAAANkdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAAJcGF5bWVudFR4AAAAD3NlbmRlclB1YmxpY0tleQMDCQEAAAABIQAAAAEFAAAAGWlzUGF5bWVudEFscmVhZHlNZW50aW9uZWQGCQEAAAABIQAAAAEFAAAAD2lzV2l0aGRyYXdFeGlzdAUAAAASaXNEdHhTaWduZWRCeVBheWVyBwcJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5IULnMg==", "chainId": 84, "height": 473372, "spentComplexity": 0 } View: original | compacted Prev: 5MPmREgYBFWnjYdZsDL8UMFKyYGzXpUtw7Z3wfpwxRan Next: CkVUwKyDRZ9pUkyXwTxk4FQqEUS4zEWG1g4wZHuLLZPD Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 1 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let me = tx.sender | |
4 | + | let oracle = extract(addressFromString("3NCzaYTNDGtR8zf9yfcqePFjCqFx9S5zhs4")) | |
4 | 5 | match tx { | |
5 | - | case | |
6 | - | let | |
7 | - | | |
8 | - | | |
9 | - | let | |
10 | - | | |
11 | - | | |
12 | - | let | |
13 | - | let | |
14 | - | | |
15 | - | | |
16 | - | | |
17 | - | | |
18 | - | then | |
19 | - | else if ((type == drop(toBytes( | |
6 | + | case withdrawTx: TransferTransaction => | |
7 | + | let txId = extract(getString(me, toBase58String(tx.proofs[1]))) | |
8 | + | match transactionById(tx.proofs[1]) { | |
9 | + | case paymentTx: TransferTransaction => | |
10 | + | let isPaymentTookPlace = if ((txId == toBase58String(tx.id))) | |
11 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], paymentTx.senderPublicKey) | |
12 | + | else false | |
13 | + | let att = drop(paymentTx.attachment, 22) | |
14 | + | let key = take(att, 18) | |
15 | + | let type = drop(take(att, 19), 18) | |
16 | + | let val = drop(take(att, 20), 19) | |
17 | + | let valComplex = extract(getBinary(oracle, toBase58String(key))) | |
18 | + | let koeff = if ((type == drop(toBytes(0), 7))) | |
19 | + | then 35 | |
20 | + | else if ((type == drop(toBytes(1), 7))) | |
20 | 21 | then 1 | |
21 | - | else if ((type == drop(toBytes( | |
22 | - | then | |
23 | - | else if ((type == drop(toBytes( | |
24 | - | then | |
25 | - | else if ((type == drop(toBytes( | |
22 | + | else if ((type == drop(toBytes(2), 7))) | |
23 | + | then 1 | |
24 | + | else if ((type == drop(toBytes(3), 7))) | |
25 | + | then 1 | |
26 | + | else if ((type == drop(toBytes(4), 7))) | |
26 | 27 | then 2 | |
27 | - | else 0 | |
28 | - | let ver = take(valComplex, 1) | |
29 | - | let valReal = if ((type == drop(toBytes(0), 7))) | |
30 | - | then drop(take(valComplex, 2), 1) | |
31 | - | else if ((type == drop(toBytes(1), 7))) | |
32 | - | then drop(take(valComplex, 3), 2) | |
33 | - | else if ((type == drop(toBytes(2), 7))) | |
34 | - | then drop(take(valComplex, 4), 3) | |
35 | - | else if ((type == drop(toBytes(3), 7))) | |
36 | - | then drop(take(valComplex, 5), 4) | |
37 | - | else if ((type == drop(toBytes(4), 7))) | |
38 | - | then drop(take(valComplex, 6), 5) | |
39 | - | else if ((type == drop(toBytes(5), 7))) | |
40 | - | then drop(take(valComplex, 7), 5) | |
41 | - | else if ((type == drop(toBytes(6), 7))) | |
42 | - | then drop(take(valComplex, 8), 6) | |
43 | - | else toBytes(38) | |
44 | - | if ((val == valReal)) | |
45 | - | then (val != toBytes(38)) | |
46 | - | else false | |
28 | + | else if ((type == drop(toBytes(5), 7))) | |
29 | + | then 2 | |
30 | + | else if ((type == drop(toBytes(6), 7))) | |
31 | + | then 2 | |
32 | + | else 0 | |
33 | + | let ver = take(valComplex, 1) | |
34 | + | let valReal = if ((type == drop(toBytes(0), 7))) | |
35 | + | then drop(take(valComplex, 2), 1) | |
36 | + | else if ((type == drop(toBytes(1), 7))) | |
37 | + | then drop(take(valComplex, 3), 2) | |
38 | + | else if ((type == drop(toBytes(2), 7))) | |
39 | + | then drop(take(valComplex, 4), 3) | |
40 | + | else if ((type == drop(toBytes(3), 7))) | |
41 | + | then drop(take(valComplex, 5), 4) | |
42 | + | else if ((type == drop(toBytes(4), 7))) | |
43 | + | then drop(take(valComplex, 6), 5) | |
44 | + | else if ((type == drop(toBytes(5), 7))) | |
45 | + | then drop(take(valComplex, 7), 5) | |
46 | + | else if ((type == drop(toBytes(6), 7))) | |
47 | + | then drop(take(valComplex, 8), 6) | |
48 | + | else toBytes(38) | |
49 | + | let isWin = if ((val == valReal)) | |
50 | + | then (val != toBytes(38)) | |
51 | + | else false | |
52 | + | let isAmountOk = (withdrawTx.amount == (paymentTx.amount * koeff)) | |
53 | + | if (if (isPaymentTookPlace) | |
54 | + | then isWin | |
55 | + | else false) | |
56 | + | then isAmountOk | |
57 | + | else false | |
58 | + | case _ => | |
59 | + | false | |
60 | + | } | |
61 | + | case dtx: DataTransaction => | |
62 | + | let paymentTxIdStr = extract(dtx.data[0].key) | |
63 | + | let paymentTx = transactionById(fromBase58String(paymentTxIdStr)) | |
64 | + | let isPaymentAlreadyMentioned = isDefined(getString(me, paymentTxIdStr)) | |
65 | + | let withdrawTransactionId = fromBase58String(extract(getString(me, paymentTxIdStr))) | |
66 | + | let isWithdrawExist = isDefined(transactionById(withdrawTransactionId)) | |
67 | + | match paymentTx { | |
68 | + | case paymentTx: TransferTransaction => | |
69 | + | let isDtxSignedByPayer = sigVerify(dtx.bodyBytes, dtx.proofs[0], paymentTx.senderPublicKey) | |
70 | + | if (if (!(isPaymentAlreadyMentioned)) | |
71 | + | then true | |
72 | + | else !(isWithdrawExist)) | |
73 | + | then isDtxSignedByPayer | |
74 | + | else false | |
75 | + | case _ => | |
76 | + | false | |
77 | + | } | |
47 | 78 | case _ => | |
48 | - | | |
79 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
49 | 80 | } |
github/deemru/w8io/169f3d6 49.39 ms ◑