tx · 4yLMeuyAKdxM6saKsTQpVddYmJAVyHvPFi1ktCcAWZBk 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b: -0.01400000 Waves 2021.02.09 10:53 [1390370] smart account 3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b > SELF 0.00000000 Waves
{ "type": 13, "id": "4yLMeuyAKdxM6saKsTQpVddYmJAVyHvPFi1ktCcAWZBk", "fee": 1400000, "feeAssetId": null, "timestamp": 1612857291486, "version": 2, "chainId": 84, "sender": "3Mt71RiSbWYENDmeyndvwjoJZwUsXfUkR6b", "senderPublicKey": "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV", "proofs": [ "3WBtdcXdxg515bwUpPTZVTHHdgjuHwGBgkrBpt3MUpQa9napuuSgdKabkTcZnek6Vy2CGzyf5JzbypFidAXL3Uvu" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OUZ0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gYqX", "height": 1390370, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EY2chYmDhjCb4LEzpoZ2bVx1mjftDWb8jgo9McAZA99A Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let lotteryamount = "_amount" | |
5 | 5 | ||
6 | 6 | let lotteryprobability = "_probability" | |
7 | 7 | ||
8 | 8 | let lotteryprobabilitydecimal = "_probability_decimal" | |
9 | 9 | ||
10 | 10 | let lotteryPrice = "_price" | |
11 | 11 | ||
12 | 12 | let lotteryPrices = "_lottery_prices" | |
13 | 13 | ||
14 | 14 | let lotteryAssetId = "_lottery_asset_id" | |
15 | 15 | ||
16 | 16 | let countOfPrices = "_count_prices" | |
17 | 17 | ||
18 | 18 | let lastHashRandomNumber = "last_spin_random_hash" | |
19 | 19 | ||
20 | 20 | let lastTokenRandomHash = "last_token_random_hash" | |
21 | 21 | ||
22 | 22 | let dAppAddres = "3BKFQLeo5ExZ5Y1pt9Ftzsno7aRwzD96zoYVHP3tcLgV" | |
23 | 23 | ||
24 | 24 | let allowSizeLottery = 14 | |
25 | 25 | ||
26 | 26 | func randomizer (inv) = { | |
27 | 27 | let lastPlay = match getBinary(this, lastHashRandomNumber) { | |
28 | 28 | case s: ByteVector => | |
29 | 29 | s | |
30 | 30 | case _: Unit => | |
31 | 31 | base58'2ee4oFDYriWJ9EMeR' | |
32 | 32 | case _ => | |
33 | 33 | throw("Match error") | |
34 | 34 | } | |
35 | 35 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
36 | 36 | sha256(rand) | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func generatorRandomHash (inv) = { | |
41 | 41 | let lastHashForToken = match getBinary(this, lastTokenRandomHash) { | |
42 | 42 | case s: ByteVector => | |
43 | 43 | s | |
44 | 44 | case _: Unit => | |
45 | 45 | base58'4dD7osCQzvuXJdTiGfKvTwnKT' | |
46 | 46 | case _ => | |
47 | 47 | throw("Match error") | |
48 | 48 | } | |
49 | 49 | let rand = (((((lastHashForToken + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
50 | 50 | sha256(rand) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getPriceArray () = { | |
55 | 55 | let tempPrices = getStringValue(this, lotteryPrices) | |
56 | 56 | let trimPrices = take(tempPrices, (size(tempPrices) - 1)) | |
57 | 57 | let newArray = split(trimPrices, ",") | |
58 | 58 | newArray | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func generateNewListOfPrices (token,val) = { | |
63 | 63 | let indexOfComma = indexOf(token, ",") | |
64 | 64 | if ((indexOfComma == unit)) | |
65 | 65 | then (val + ",") | |
66 | 66 | else ((token + val) + ",") | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func procedLottery (win,token) = { | |
71 | 71 | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
72 | 72 | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
73 | 73 | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
74 | 74 | let hash = (tokenProbabilityDecimal % probabilityValue) | |
75 | 75 | let sizeOfWin = size(win) | |
76 | 76 | if ((sizeOfWin == 1)) | |
77 | 77 | then { | |
78 | 78 | let randomNumber = win[0] | |
79 | 79 | if ((probabilityValue > hash)) | |
80 | 80 | then { | |
81 | 81 | let newList = token :: win | |
82 | 82 | newList | |
83 | 83 | } | |
84 | 84 | else win | |
85 | 85 | } | |
86 | 86 | else win | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(i) | |
91 | 91 | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
92 | 92 | let token = toBase64String(generatorRandomHash(i)) | |
93 | 93 | let paymentIsDefined = if (!(isDefined(i.payment))) | |
94 | 94 | then false | |
95 | 95 | else true | |
96 | 96 | let lotteryAssetTN = if ((assetId == "")) | |
97 | 97 | then true | |
98 | 98 | else false | |
99 | 99 | let totalRequiredAmount = (amount * poolprice) | |
100 | 100 | if ((paymentIsDefined == true)) | |
101 | 101 | then { | |
102 | 102 | let payment = extract(i.payment) | |
103 | 103 | let paymentAssetId = match payment.assetId { | |
104 | 104 | case a: ByteVector => | |
105 | 105 | toBase64String(a) | |
106 | 106 | case _: Unit => | |
107 | 107 | "" | |
108 | 108 | case _ => | |
109 | 109 | throw("Match error") | |
110 | 110 | } | |
111 | 111 | let paymentAmount = payment.amount | |
112 | 112 | if ((paymentAssetId != assetId)) | |
113 | 113 | then throw("Asset Id not matching with Payment Asset Id") | |
114 | 114 | else if ((totalRequiredAmount > paymentAmount)) | |
115 | 115 | then throw("Not enough Asset Amount") | |
116 | 116 | else { | |
117 | 117 | let tempValue = match getString(this, lotteryPrices) { | |
118 | 118 | case a: String => | |
119 | 119 | a | |
120 | 120 | case _: Unit => | |
121 | 121 | "" | |
122 | 122 | case _ => | |
123 | 123 | throw("Match error") | |
124 | 124 | } | |
125 | 125 | let containKey = indexOf(tempValue, token) | |
126 | 126 | let storedTokensValues = match containKey { | |
127 | 127 | case _: Unit => | |
128 | 128 | ((tempValue + token) + ",") | |
129 | 129 | case x: Int => | |
130 | 130 | throw("Token is duplicated") | |
131 | 131 | case _ => | |
132 | 132 | throw("Match error") | |
133 | 133 | } | |
134 | 134 | let countTokens = match getInteger(this, countOfPrices) { | |
135 | 135 | case a: Int => | |
136 | 136 | a | |
137 | 137 | case _: Unit => | |
138 | 138 | 0 | |
139 | 139 | case _ => | |
140 | 140 | throw("Match error") | |
141 | 141 | } | |
142 | 142 | if ((allowSizeLottery >= countTokens)) | |
143 | 143 | then { | |
144 | 144 | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
145 | 145 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
146 | 146 | } | |
147 | 147 | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
148 | 148 | } | |
149 | 149 | } | |
150 | 150 | else { | |
151 | 151 | let tnBalance = if (lotteryAssetTN) | |
152 | 152 | then wavesBalance(this) | |
153 | 153 | else assetBalance(this, fromBase64String(assetId)) | |
154 | 154 | if ((totalRequiredAmount > tnBalance)) | |
155 | 155 | then throw("Not enough Asset Amount") | |
156 | 156 | else { | |
157 | 157 | let tempValue = match getString(this, lotteryPrices) { | |
158 | 158 | case a: String => | |
159 | 159 | a | |
160 | 160 | case _: Unit => | |
161 | 161 | "" | |
162 | 162 | case _ => | |
163 | 163 | throw("Match error") | |
164 | 164 | } | |
165 | 165 | let containKey = indexOf(tempValue, token) | |
166 | 166 | let storedTokensValues = match containKey { | |
167 | 167 | case _: Unit => | |
168 | 168 | ((tempValue + token) + ",") | |
169 | 169 | case x: Int => | |
170 | 170 | throw("Token is duplicated") | |
171 | 171 | case _ => | |
172 | 172 | throw("Match error") | |
173 | 173 | } | |
174 | 174 | let countTokens = match getInteger(this, countOfPrices) { | |
175 | 175 | case a: Int => | |
176 | 176 | a | |
177 | 177 | case _: Unit => | |
178 | 178 | 0 | |
179 | 179 | case _ => | |
180 | 180 | throw("Match error") | |
181 | 181 | } | |
182 | 182 | if ((allowSizeLottery >= countTokens)) | |
183 | 183 | then { | |
184 | 184 | let updateLotteryPool = WriteSet([DataEntry((token + lotteryamount), amount), DataEntry((token + lotteryprobability), probability), DataEntry((token + lotteryPrice), poolprice), DataEntry(lotteryPrices, storedTokensValues), DataEntry(countOfPrices, (countTokens + 1)), DataEntry((token + lotteryprobabilitydecimal), probDecimal), DataEntry((token + lotteryAssetId), assetId), DataEntry(lastTokenRandomHash, token)]) | |
185 | 185 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
186 | 186 | } | |
187 | 187 | else throw("Lottery prices has reached maximum 15") | |
188 | 188 | } | |
189 | 189 | } | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(i) | |
195 | 195 | func startlotto () = { | |
196 | 196 | let currentKey = toBase58String(i.caller.bytes) | |
197 | 197 | let randhash = randomizer(i) | |
198 | 198 | let countTokens = match getInteger(this, countOfPrices) { | |
199 | 199 | case a: Int => | |
200 | 200 | a | |
201 | 201 | case _: Unit => | |
202 | 202 | 0 | |
203 | 203 | case _ => | |
204 | 204 | throw("Match error") | |
205 | 205 | } | |
206 | 206 | let priceList = getPriceArray() | |
207 | 207 | let randNumber = toInt(randhash) | |
208 | 208 | let winningToken = { | |
209 | 209 | let $list72517289 = priceList | |
210 | 210 | let $size72517289 = size($list72517289) | |
211 | 211 | let $acc072517289 = nil | |
212 | 212 | if (($size72517289 == 0)) | |
213 | 213 | then $acc072517289 | |
214 | 214 | else { | |
215 | 215 | let $acc172517289 = procedLottery($acc072517289, $list72517289[0]) | |
216 | 216 | if (($size72517289 == 1)) | |
217 | 217 | then $acc172517289 | |
218 | 218 | else { | |
219 | 219 | let $acc272517289 = procedLottery($acc172517289, $list72517289[1]) | |
220 | 220 | if (($size72517289 == 2)) | |
221 | 221 | then $acc272517289 | |
222 | 222 | else { | |
223 | 223 | let $acc372517289 = procedLottery($acc272517289, $list72517289[2]) | |
224 | 224 | if (($size72517289 == 3)) | |
225 | 225 | then $acc372517289 | |
226 | 226 | else { | |
227 | 227 | let $acc472517289 = procedLottery($acc372517289, $list72517289[3]) | |
228 | 228 | if (($size72517289 == 4)) | |
229 | 229 | then $acc472517289 | |
230 | 230 | else { | |
231 | 231 | let $acc572517289 = procedLottery($acc472517289, $list72517289[4]) | |
232 | 232 | if (($size72517289 == 5)) | |
233 | 233 | then $acc572517289 | |
234 | 234 | else { | |
235 | 235 | let $acc672517289 = procedLottery($acc572517289, $list72517289[5]) | |
236 | 236 | if (($size72517289 == 6)) | |
237 | 237 | then $acc672517289 | |
238 | 238 | else { | |
239 | 239 | let $acc772517289 = procedLottery($acc672517289, $list72517289[6]) | |
240 | 240 | if (($size72517289 == 7)) | |
241 | 241 | then $acc772517289 | |
242 | 242 | else { | |
243 | 243 | let $acc872517289 = procedLottery($acc772517289, $list72517289[7]) | |
244 | 244 | if (($size72517289 == 8)) | |
245 | 245 | then $acc872517289 | |
246 | 246 | else { | |
247 | 247 | let $acc972517289 = procedLottery($acc872517289, $list72517289[8]) | |
248 | 248 | if (($size72517289 == 9)) | |
249 | 249 | then $acc972517289 | |
250 | 250 | else { | |
251 | 251 | let $acc1072517289 = procedLottery($acc972517289, $list72517289[9]) | |
252 | 252 | if (($size72517289 == 10)) | |
253 | 253 | then $acc1072517289 | |
254 | 254 | else { | |
255 | 255 | let $acc1172517289 = procedLottery($acc1072517289, $list72517289[10]) | |
256 | 256 | if (($size72517289 == 11)) | |
257 | 257 | then $acc1172517289 | |
258 | 258 | else { | |
259 | 259 | let $acc1272517289 = procedLottery($acc1172517289, $list72517289[11]) | |
260 | 260 | if (($size72517289 == 12)) | |
261 | 261 | then $acc1272517289 | |
262 | 262 | else { | |
263 | 263 | let $acc1372517289 = procedLottery($acc1272517289, $list72517289[12]) | |
264 | 264 | if (($size72517289 == 13)) | |
265 | 265 | then $acc1372517289 | |
266 | 266 | else { | |
267 | 267 | let $acc1472517289 = procedLottery($acc1372517289, $list72517289[13]) | |
268 | 268 | if (($size72517289 == 14)) | |
269 | 269 | then $acc1472517289 | |
270 | 270 | else { | |
271 | 271 | let $acc1572517289 = procedLottery($acc1472517289, $list72517289[14]) | |
272 | 272 | throw("List size exceed 14") | |
273 | 273 | } | |
274 | 274 | } | |
275 | 275 | } | |
276 | 276 | } | |
277 | 277 | } | |
278 | 278 | } | |
279 | 279 | } | |
280 | 280 | } | |
281 | 281 | } | |
282 | 282 | } | |
283 | 283 | } | |
284 | 284 | } | |
285 | 285 | } | |
286 | 286 | } | |
287 | 287 | } | |
288 | 288 | } | |
289 | 289 | let sizeOfWinPrices = size(winningToken) | |
290 | 290 | if ((sizeOfWinPrices == 1)) | |
291 | 291 | then { | |
292 | 292 | let writeSets = WriteSet(nil) | |
293 | 293 | ScriptResult(writeSets, TransferSet(nil)) | |
294 | 294 | } | |
295 | 295 | else { | |
296 | 296 | let token = winningToken[1] | |
297 | 297 | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
298 | 298 | if ((currentAmount == 0)) | |
299 | 299 | then throw("Amount exceeded") | |
300 | 300 | else { | |
301 | 301 | let actualAmount = (currentAmount - 1) | |
302 | 302 | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
303 | 303 | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
304 | 304 | if ((actualAmount == 0)) | |
305 | 305 | then { | |
306 | 306 | let storedTokensValues = { | |
307 | 307 | let $list81098160 = priceList | |
308 | 308 | let $size81098160 = size($list81098160) | |
309 | 309 | let $acc081098160 = token | |
310 | 310 | if (($size81098160 == 0)) | |
311 | 311 | then $acc081098160 | |
312 | 312 | else { | |
313 | 313 | let $acc181098160 = generateNewListOfPrices($acc081098160, $list81098160[0]) | |
314 | 314 | if (($size81098160 == 1)) | |
315 | 315 | then $acc181098160 | |
316 | 316 | else { | |
317 | 317 | let $acc281098160 = generateNewListOfPrices($acc181098160, $list81098160[1]) | |
318 | 318 | if (($size81098160 == 2)) | |
319 | 319 | then $acc281098160 | |
320 | 320 | else { | |
321 | 321 | let $acc381098160 = generateNewListOfPrices($acc281098160, $list81098160[2]) | |
322 | 322 | if (($size81098160 == 3)) | |
323 | 323 | then $acc381098160 | |
324 | 324 | else { | |
325 | 325 | let $acc481098160 = generateNewListOfPrices($acc381098160, $list81098160[3]) | |
326 | 326 | if (($size81098160 == 4)) | |
327 | 327 | then $acc481098160 | |
328 | 328 | else { | |
329 | 329 | let $acc581098160 = generateNewListOfPrices($acc481098160, $list81098160[4]) | |
330 | 330 | if (($size81098160 == 5)) | |
331 | 331 | then $acc581098160 | |
332 | 332 | else { | |
333 | 333 | let $acc681098160 = generateNewListOfPrices($acc581098160, $list81098160[5]) | |
334 | 334 | if (($size81098160 == 6)) | |
335 | 335 | then $acc681098160 | |
336 | 336 | else { | |
337 | 337 | let $acc781098160 = generateNewListOfPrices($acc681098160, $list81098160[6]) | |
338 | 338 | if (($size81098160 == 7)) | |
339 | 339 | then $acc781098160 | |
340 | 340 | else { | |
341 | 341 | let $acc881098160 = generateNewListOfPrices($acc781098160, $list81098160[7]) | |
342 | 342 | if (($size81098160 == 8)) | |
343 | 343 | then $acc881098160 | |
344 | 344 | else { | |
345 | 345 | let $acc981098160 = generateNewListOfPrices($acc881098160, $list81098160[8]) | |
346 | 346 | if (($size81098160 == 9)) | |
347 | 347 | then $acc981098160 | |
348 | 348 | else { | |
349 | 349 | let $acc1081098160 = generateNewListOfPrices($acc981098160, $list81098160[9]) | |
350 | 350 | if (($size81098160 == 10)) | |
351 | 351 | then $acc1081098160 | |
352 | 352 | else { | |
353 | 353 | let $acc1181098160 = generateNewListOfPrices($acc1081098160, $list81098160[10]) | |
354 | 354 | if (($size81098160 == 11)) | |
355 | 355 | then $acc1181098160 | |
356 | 356 | else { | |
357 | 357 | let $acc1281098160 = generateNewListOfPrices($acc1181098160, $list81098160[11]) | |
358 | 358 | if (($size81098160 == 12)) | |
359 | 359 | then $acc1281098160 | |
360 | 360 | else { | |
361 | 361 | let $acc1381098160 = generateNewListOfPrices($acc1281098160, $list81098160[12]) | |
362 | 362 | if (($size81098160 == 13)) | |
363 | 363 | then $acc1381098160 | |
364 | 364 | else { | |
365 | 365 | let $acc1481098160 = generateNewListOfPrices($acc1381098160, $list81098160[13]) | |
366 | 366 | if (($size81098160 == 14)) | |
367 | 367 | then $acc1481098160 | |
368 | 368 | else { | |
369 | 369 | let $acc1581098160 = generateNewListOfPrices($acc1481098160, $list81098160[14]) | |
370 | 370 | throw("List size exceed 14") | |
371 | 371 | } | |
372 | 372 | } | |
373 | 373 | } | |
374 | 374 | } | |
375 | 375 | } | |
376 | 376 | } | |
377 | 377 | } | |
378 | 378 | } | |
379 | 379 | } | |
380 | 380 | } | |
381 | 381 | } | |
382 | 382 | } | |
383 | 383 | } | |
384 | 384 | } | |
385 | 385 | } | |
386 | 386 | } | |
387 | 387 | let writeSets = WriteSet([DataEntry(("winning_token_" + token), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry(countOfPrices, (countTokens - 1)), DataEntry(lotteryPrices, storedTokensValues), DataEntry(lastHashRandomNumber, randNumber)]) | |
388 | 388 | if ((tokenAssetId == "")) | |
389 | 389 | then { | |
390 | 390 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
391 | 391 | ScriptResult(writeSets, winTransfer) | |
392 | 392 | } | |
393 | 393 | else { | |
394 | 394 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
395 | 395 | ScriptResult(writeSets, winTransfer) | |
396 | 396 | } | |
397 | 397 | } | |
398 | 398 | else { | |
399 | 399 | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
400 | 400 | if ((tokenAssetId == "")) | |
401 | 401 | then { | |
402 | 402 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
403 | 403 | ScriptResult(writeSets, winTransfer) | |
404 | 404 | } | |
405 | 405 | else { | |
406 | 406 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
407 | 407 | ScriptResult(writeSets, winTransfer) | |
408 | 408 | } | |
409 | 409 | } | |
410 | 410 | } | |
411 | 411 | } | |
412 | 412 | } | |
413 | 413 | ||
414 | 414 | ||
415 | 415 | @Verifier(tx) | |
416 | 416 | func verify () = match tx { | |
417 | 417 | case _: DataTransaction => | |
418 | 418 | true | |
419 | 419 | case _: SetScriptTransaction => | |
420 | 420 | true | |
421 | 421 | case _ => | |
422 | 422 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
423 | 423 | } | |
424 | 424 |
github/deemru/w8io/026f985 63.86 ms ◑