tx · 74sxUfaGmRtAjjmjArHmpcNhEp4UEhR7jY75dVG2Z3VW 3N5ezXT9QVpBcxseKRkqbLdTRSUkbMJLzbD: -0.01400000 Waves 2019.03.20 14:49 [544577] smart account 3N5ezXT9QVpBcxseKRkqbLdTRSUkbMJLzbD > SELF 0.00000000 Waves
{ "type": 13, "id": "74sxUfaGmRtAjjmjArHmpcNhEp4UEhR7jY75dVG2Z3VW", "fee": 1400000, "feeAssetId": null, "timestamp": 1553082538354, "version": 1, "sender": "3N5ezXT9QVpBcxseKRkqbLdTRSUkbMJLzbD", "senderPublicKey": "HMMwXJWPUWM7VKP5hJaoazWJiLMZZSta2F9AaWkUk1FX", "proofs": [ "3zNVP3FWQgKUGCS1c4zCKCV8Ah17MfFTZaWequNzWvfnk5XPWzWXaXPzvZZyWa6Q7zXL65BfgrXCiwTqCE4EZQ2Y" ], "script": "base64:AgQAAAAKZmVlQWRkcmVzcwIAAAAjM045dkQ2R2RIc3BxcHJZMmRpNk44NTRmdVQ3dWdKUGtIbzUEAAAAAm1lCAUAAAACdHgAAAAGc2VuZGVyBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAJkdAUAAAAHJG1hdGNoMAQAAAAMc2VydmVyU2lnbmVkCQAB9AAAAAMIBQAAAAJkdAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmR0AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAQAAAAEhAAAAAQUAAAAMc2VydmVyU2lnbmVkCQAAAgAAAAECAAAAA2Q6MQQAAAAEdHlwZQkBAAAAB2V4dHJhY3QAAAABCQAEEwAAAAIIBQAAAAJkdAAAAARkYXRhAgAAAAR0eXBlBAAAAAZnYW1lSWQJAQAAAAdleHRyYWN0AAAAAQkABBMAAAACCAUAAAACZHQAAAAEZGF0YQIAAAAGZ2FtZUlkAwkAA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gAAAAV0OnI6MwYJAAACAAAAAQIAAAADdDoyAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAACc3QFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnN0AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACc3QAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5B9Rf0Iw=", "chainId": 84, "height": 544577, "spentComplexity": 0 } View: original | compacted Prev: 5TggrgtAeum7kAwsd2SVVc2H6wDGJnoVVrKrBxgezHgN Next: GVEQ4BGfHw7jeZu32EFKNfNkuSdCzF5aSbwSxb4dLBgf Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | - | let feeAddress = " | |
3 | + | let feeAddress = "3N9vD6GdHspqprY2di6N854fuT7ugJPkHo5" | |
4 | 4 | let me = tx.sender | |
5 | 5 | match tx { | |
6 | 6 | case dt: DataTransaction => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | - | let feeAddress = " | |
3 | + | let feeAddress = "3N9vD6GdHspqprY2di6N854fuT7ugJPkHo5" | |
4 | 4 | let me = tx.sender | |
5 | 5 | match tx { | |
6 | 6 | case dt: DataTransaction => | |
7 | 7 | let serverSigned = sigVerify(dt.bodyBytes, dt.proofs[0], tx.senderPublicKey) | |
8 | 8 | if (!(serverSigned)) | |
9 | 9 | then throw("d:1") | |
10 | 10 | else { | |
11 | 11 | let type = extract(getString(dt.data, "type")) | |
12 | 12 | let gameId = extract(getString(dt.data, "gameId")) | |
13 | 13 | if ((type == "init")) | |
14 | 14 | then { | |
15 | 15 | let player1 = extract(getString(dt.data, (gameId + "_player1"))) | |
16 | 16 | let player1TxId = extract(getString(dt.data, (gameId + "_tx1"))) | |
17 | 17 | let player2 = extract(getString(dt.data, (gameId + "_player2"))) | |
18 | 18 | let player2TxId = extract(getString(dt.data, (gameId + "_tx2"))) | |
19 | 19 | if (!(isDefined(getInteger(dt.data, (gameId + "_winAmount"))))) | |
20 | 20 | then throw("d:i:1") | |
21 | 21 | else if (!(isDefined(getInteger(dt.data, (gameId + "_fee_amount"))))) | |
22 | 22 | then throw("d:i:2") | |
23 | 23 | else if (!(isDefined(getBinary(dt.data, (gameId + "_squadronHash"))))) | |
24 | 24 | then throw("d:i:3") | |
25 | 25 | else if (!(isDefined(getBoolean(dt.data, ("used_tx_" + player1TxId))))) | |
26 | 26 | then throw("d:i:4") | |
27 | 27 | else if (!(isDefined(getBoolean(dt.data, ("used_tx_" + player2TxId))))) | |
28 | 28 | then throw("d:i:5") | |
29 | 29 | else if (isDefined(getBoolean(me, ("used_tx_" + player1TxId)))) | |
30 | 30 | then throw("d:i:6") | |
31 | 31 | else if (isDefined(getBoolean(me, ("used_tx_" + player2TxId)))) | |
32 | 32 | then throw("d:i:7") | |
33 | 33 | else true | |
34 | 34 | } | |
35 | 35 | else if ((type == "start")) | |
36 | 36 | then { | |
37 | 37 | let betAmount = extract(getInteger(dt.data, (gameId + "_amount"))) | |
38 | 38 | let player1 = extract(getString(dt.data, (gameId + "_player1"))) | |
39 | 39 | let player1TxId = extract(getString(dt.data, (gameId + "_tx1"))) | |
40 | 40 | let player2 = extract(getString(dt.data, (gameId + "_player2"))) | |
41 | 41 | let player2TxId = extract(getString(dt.data, (gameId + "_tx2"))) | |
42 | 42 | let startId = extract(getString(dt.data, (gameId + "_start_id"))) | |
43 | 43 | let player1Tx = transactionById(fromBase58String(player1TxId)) | |
44 | 44 | let player2Tx = transactionById(fromBase58String(player2TxId)) | |
45 | 45 | let tr1Ok = match player1Tx { | |
46 | 46 | case t: TransferTransaction => | |
47 | 47 | if (if (if (if ((t.amount == betAmount)) | |
48 | 48 | then !(isDefined(getString(me, ("used_tx_" + player1TxId)))) | |
49 | 49 | else false) | |
50 | 50 | then !(isDefined(t.assetId)) | |
51 | 51 | else false) | |
52 | 52 | then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player1)).bytes)))) == gameId) | |
53 | 53 | else false) | |
54 | 54 | then (t.recipient == me) | |
55 | 55 | else false | |
56 | 56 | case _ => | |
57 | 57 | false | |
58 | 58 | } | |
59 | 59 | let tr2Ok = match player2Tx { | |
60 | 60 | case t: TransferTransaction => | |
61 | 61 | if (if (if (if ((t.amount == betAmount)) | |
62 | 62 | then !(isDefined(getString(me, ("used_tx_" + player2TxId)))) | |
63 | 63 | else false) | |
64 | 64 | then !(isDefined(t.assetId)) | |
65 | 65 | else false) | |
66 | 66 | then (extract(getString(dt.data, ("game_" + toBase58String(addressFromPublicKey(fromBase58String(player2)).bytes)))) == gameId) | |
67 | 67 | else false) | |
68 | 68 | then (t.recipient == me) | |
69 | 69 | else false | |
70 | 70 | case _ => | |
71 | 71 | false | |
72 | 72 | } | |
73 | 73 | if (!(tr1Ok)) | |
74 | 74 | then throw("d:s:1") | |
75 | 75 | else if (!(tr2Ok)) | |
76 | 76 | then throw("d:s:2") | |
77 | 77 | else true | |
78 | 78 | } | |
79 | 79 | else if ((type == "finish")) | |
80 | 80 | then { | |
81 | 81 | let winner = extract(getString(dt.data, (gameId + "_winner"))) | |
82 | 82 | let correctWinner = if ((winner == extract(getString(me, (gameId + "_player1"))))) | |
83 | 83 | then true | |
84 | 84 | else (winner == extract(getString(me, (gameId + "_player2")))) | |
85 | 85 | let squadron1 = extract(getBinary(dt.data, (gameId + "_squadron1"))) | |
86 | 86 | let squadron2 = extract(getBinary(dt.data, (gameId + "_squadron2"))) | |
87 | 87 | let gameSalt = extract(getBinary(dt.data, (gameId + "_salt"))) | |
88 | 88 | let correctSquadrons = (sha256(((squadron1 + squadron2) + gameSalt)) == extract(getBinary(me, (gameId + "_squadronHash")))) | |
89 | 89 | let payoutTxId = extract(getString(dt.data, (gameId + "_payout_tx_id"))) | |
90 | 90 | let payoutKey = extract(getString(dt.data, (payoutTxId + "_payout"))) | |
91 | 91 | let feeTxId = extract(getString(dt.data, (gameId + "_fee_tx_id"))) | |
92 | 92 | let feeKey = extract(getString(dt.data, (feeTxId + "_fee"))) | |
93 | 93 | if (!(correctWinner)) | |
94 | 94 | then throw("d:f:1") | |
95 | 95 | else if (!(correctSquadrons)) | |
96 | 96 | then throw("d:f:2") | |
97 | 97 | else if ((payoutKey != (gameId + "_winAmount"))) | |
98 | 98 | then throw("d:f:3") | |
99 | 99 | else if ((feeKey != (gameId + "_fee_amount"))) | |
100 | 100 | then throw("d:f:4") | |
101 | 101 | else true | |
102 | 102 | } | |
103 | 103 | else if ((type == "refund")) | |
104 | 104 | then { | |
105 | 105 | let paymentTxId = extract(getString(dt.data, (gameId + "_payment_tx_id"))) | |
106 | 106 | if (isDefined(getBoolean(me, ("used_tx_" + paymentTxId)))) | |
107 | 107 | then throw("d:r:1") | |
108 | 108 | else if (!(isDefined(getBoolean(dt.data, ("used_tx_" + paymentTxId))))) | |
109 | 109 | then throw("d:r:2") | |
110 | 110 | else if (!(isDefined(getInteger(dt.data, (paymentTxId + "_refund_amount"))))) | |
111 | 111 | then throw("d:r:3") | |
112 | 112 | else if (!(isDefined(getInteger(dt.data, (paymentTxId + "_refund_recipient"))))) | |
113 | 113 | then throw("d:r:4") | |
114 | 114 | else true | |
115 | 115 | } | |
116 | 116 | else throw(("d:2:" + type)) | |
117 | 117 | } | |
118 | 118 | case tt: TransferTransaction => | |
119 | 119 | let serverSigned = sigVerify(tt.bodyBytes, tt.proofs[0], tx.senderPublicKey) | |
120 | 120 | let recipientAddr = toBase58String(addressFromRecipient(tt.recipient).bytes) | |
121 | 121 | if (!(serverSigned)) | |
122 | 122 | then throw("t:1") | |
123 | 123 | else if (isDefined(getString(me, (toBase58String(tt.id) + "_payout")))) | |
124 | 124 | then { | |
125 | 125 | let gameId = extract(getString(me, ("game_" + recipientAddr))) | |
126 | 126 | let winner = extract(getString(me, (gameId + "_winner"))) | |
127 | 127 | let winnerAddr = toBase58String(addressFromPublicKey(fromBase58String(winner)).bytes) | |
128 | 128 | let winAmountKey = extract(getString(me, (toBase58String(tt.id) + "_payout"))) | |
129 | 129 | let winAmount = extract(getInteger(me, winAmountKey)) | |
130 | 130 | if ((tt.amount != winAmount)) | |
131 | 131 | then throw("t:p:1") | |
132 | 132 | else if (isDefined(tt.assetId)) | |
133 | 133 | then throw("t:p:2") | |
134 | 134 | else if ((winnerAddr != recipientAddr)) | |
135 | 135 | then throw("t:p:3") | |
136 | 136 | else true | |
137 | 137 | } | |
138 | 138 | else if (isDefined(getString(me, (toBase58String(tt.id) + "_fee")))) | |
139 | 139 | then { | |
140 | 140 | let feeAmountKey = extract(getString(me, (toBase58String(tt.id) + "_fee"))) | |
141 | 141 | let feeAmount = extract(getInteger(me, feeAmountKey)) | |
142 | 142 | if ((tt.amount != feeAmount)) | |
143 | 143 | then throw("t:f:1") | |
144 | 144 | else if (isDefined(tt.assetId)) | |
145 | 145 | then throw("t:f:2") | |
146 | 146 | else if ((recipientAddr != feeAddress)) | |
147 | 147 | then throw("t:f:3") | |
148 | 148 | else true | |
149 | 149 | } | |
150 | 150 | else if (isDefined(getInteger(me, (toBase58String(tt.id) + "_refund_amount")))) | |
151 | 151 | then { | |
152 | 152 | let refundAmount = extract(getInteger(me, (toBase58String(tt.id) + "_refund_amount"))) | |
153 | 153 | let refundRecipient = extract(getString(me, (toBase58String(tt.id) + "_refund_recipient"))) | |
154 | 154 | if ((tt.amount != refundAmount)) | |
155 | 155 | then throw("t:r:1") | |
156 | 156 | else if (isDefined(tt.assetId)) | |
157 | 157 | then throw("t:r:2") | |
158 | 158 | else if ((recipientAddr != refundRecipient)) | |
159 | 159 | then throw("t:r:3") | |
160 | 160 | else true | |
161 | 161 | } | |
162 | 162 | else throw("t:2") | |
163 | 163 | case st: SetScriptTransaction => | |
164 | 164 | sigVerify(st.bodyBytes, st.proofs[0], tx.senderPublicKey) | |
165 | 165 | case _ => | |
166 | 166 | false | |
167 | 167 | } |
github/deemru/w8io/169f3d6 45.05 ms ◑