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