tx · E9hJi7AaGZh7frf4BBVbkESvnTxX6xN6rhWNzsHwNuPD 3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1: -0.01400000 Waves 2021.02.09 11:21 [1390395] smart account 3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1 > SELF 0.00000000 Waves
{ "type": 13, "id": "E9hJi7AaGZh7frf4BBVbkESvnTxX6xN6rhWNzsHwNuPD", "fee": 1400000, "feeAssetId": null, "timestamp": 1612858973140, "version": 2, "chainId": 84, "sender": "3N54JoRXk5QW3xx9xDpxUpUkoDzriibARu1", "senderPublicKey": "4ZSmQKKSEVi7FUZVartg8PJgDtovcTaKW3HWpdXKkjx2", "proofs": [ "4C57U3hzcz6Hg8aMBApZ9eEFj8qWRGrx77rk2HgFbdezjqFZrNaMd5qcyWHRdSkhH9jWjcDnF1EUaPBuFDC8BJkB" ], "script": "base64:AAIDAAAAAAAAAA0IARIHCgUBAQEBCBIAAAAAEAAAAAANbG90dGVyeWFtb3VudAIAAAAHX2Ftb3VudAAAAAASbG90dGVyeXByb2JhYmlsaXR5AgAAAAxfcHJvYmFiaWxpdHkAAAAAGWxvdHRlcnlwcm9iYWJpbGl0eWRlY2ltYWwCAAAAFF9wcm9iYWJpbGl0eV9kZWNpbWFsAAAAAAxsb3R0ZXJ5UHJpY2UCAAAABl9wcmljZQAAAAANbG90dGVyeVByaWNlcwIAAAAPX2xvdHRlcnlfcHJpY2VzAAAAAA5sb3R0ZXJ5QXNzZXRJZAIAAAARX2xvdHRlcnlfYXNzZXRfaWQAAAAADWNvdW50T2ZQcmljZXMCAAAADV9jb3VudF9wcmljZXMAAAAAFGxhc3RIYXNoUmFuZG9tTnVtYmVyAgAAABVsYXN0X3NwaW5fcmFuZG9tX2hhc2gAAAAAE2xhc3RUb2tlblJhbmRvbUhhc2gCAAAAFmxhc3RfdG9rZW5fcmFuZG9tX2hhc2gAAAAACmRBcHBBZGRyZXMCAAAALDNCS0ZRTGVvNUV4WjVZMXB0OUZ0enNubzd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RhVHJhbnNhY3Rpb24GAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V57iJwtw==", "height": 1390395, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HHnnA3EqUkGzpjv35mmtSKadGNjwfkDGTvoYC6nZroya Next: E9YJtjBZG5Wzm8G7om317X6MNFGwfce6Fu2C64C6Mhnr Diff:
Old | New | Differences | |
---|---|---|---|
394 | 394 | } | |
395 | 395 | else { | |
396 | 396 | let actualAssetId = fromBase64String(tokenAssetId) | |
397 | - | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, | |
397 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
398 | 398 | ScriptResult(writeSets, winTransfer) | |
399 | 399 | } | |
400 | 400 | } |
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) = if (isDefined(token)) | |
71 | 71 | then { | |
72 | 72 | let tokenProbability = getIntegerValue(this, (token + lotteryprobability)) | |
73 | 73 | let tokenProbabilityDecimal = getIntegerValue(this, (token + lotteryprobabilitydecimal)) | |
74 | 74 | let probabilityValue = (tokenProbabilityDecimal * 1000) | |
75 | 75 | let hash = (tokenProbabilityDecimal % probabilityValue) | |
76 | 76 | let sizeOfWin = size(win) | |
77 | 77 | if ((sizeOfWin == 1)) | |
78 | 78 | then { | |
79 | 79 | let randomNumber = win[0] | |
80 | 80 | if ((probabilityValue > hash)) | |
81 | 81 | then { | |
82 | 82 | let newList = token :: win | |
83 | 83 | newList | |
84 | 84 | } | |
85 | 85 | else win | |
86 | 86 | } | |
87 | 87 | else win | |
88 | 88 | } | |
89 | 89 | else win | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func updateprobability (probability,amount,poolprice,probDecimal,assetId) = { | |
94 | 94 | let token = toBase64String(generatorRandomHash(i)) | |
95 | 95 | let paymentIsDefined = if (!(isDefined(i.payment))) | |
96 | 96 | then false | |
97 | 97 | else true | |
98 | 98 | let lotteryAssetTN = if ((assetId == "")) | |
99 | 99 | then true | |
100 | 100 | else false | |
101 | 101 | let totalRequiredAmount = (amount * poolprice) | |
102 | 102 | if ((paymentIsDefined == true)) | |
103 | 103 | then { | |
104 | 104 | let payment = extract(i.payment) | |
105 | 105 | let paymentAssetId = match payment.assetId { | |
106 | 106 | case a: ByteVector => | |
107 | 107 | toBase64String(a) | |
108 | 108 | case _: Unit => | |
109 | 109 | "" | |
110 | 110 | case _ => | |
111 | 111 | throw("Match error") | |
112 | 112 | } | |
113 | 113 | let paymentAmount = payment.amount | |
114 | 114 | if ((paymentAssetId != assetId)) | |
115 | 115 | then throw("Asset Id not matching with Payment Asset Id") | |
116 | 116 | else if ((totalRequiredAmount > paymentAmount)) | |
117 | 117 | then throw("Not enough Asset Amount") | |
118 | 118 | else { | |
119 | 119 | let tempValue = match getString(this, lotteryPrices) { | |
120 | 120 | case a: String => | |
121 | 121 | a | |
122 | 122 | case _: Unit => | |
123 | 123 | "" | |
124 | 124 | case _ => | |
125 | 125 | throw("Match error") | |
126 | 126 | } | |
127 | 127 | let containKey = indexOf(tempValue, token) | |
128 | 128 | let storedTokensValues = match containKey { | |
129 | 129 | case _: Unit => | |
130 | 130 | ((tempValue + token) + ",") | |
131 | 131 | case x: Int => | |
132 | 132 | throw("Token is duplicated") | |
133 | 133 | case _ => | |
134 | 134 | throw("Match error") | |
135 | 135 | } | |
136 | 136 | let countTokens = match getInteger(this, countOfPrices) { | |
137 | 137 | case a: Int => | |
138 | 138 | a | |
139 | 139 | case _: Unit => | |
140 | 140 | 0 | |
141 | 141 | case _ => | |
142 | 142 | throw("Match error") | |
143 | 143 | } | |
144 | 144 | if ((allowSizeLottery > countTokens)) | |
145 | 145 | then { | |
146 | 146 | 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)]) | |
147 | 147 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
148 | 148 | } | |
149 | 149 | else throw(("Lottery prices has reached maximum " + toString(allowSizeLottery))) | |
150 | 150 | } | |
151 | 151 | } | |
152 | 152 | else { | |
153 | 153 | let tnBalance = if (lotteryAssetTN) | |
154 | 154 | then wavesBalance(this) | |
155 | 155 | else assetBalance(this, fromBase64String(assetId)) | |
156 | 156 | if ((totalRequiredAmount > tnBalance)) | |
157 | 157 | then throw("Not enough Asset Amount") | |
158 | 158 | else { | |
159 | 159 | let tempValue = match getString(this, lotteryPrices) { | |
160 | 160 | case a: String => | |
161 | 161 | a | |
162 | 162 | case _: Unit => | |
163 | 163 | "" | |
164 | 164 | case _ => | |
165 | 165 | throw("Match error") | |
166 | 166 | } | |
167 | 167 | let containKey = indexOf(tempValue, token) | |
168 | 168 | let storedTokensValues = match containKey { | |
169 | 169 | case _: Unit => | |
170 | 170 | ((tempValue + token) + ",") | |
171 | 171 | case x: Int => | |
172 | 172 | throw("Token is duplicated") | |
173 | 173 | case _ => | |
174 | 174 | throw("Match error") | |
175 | 175 | } | |
176 | 176 | let countTokens = match getInteger(this, countOfPrices) { | |
177 | 177 | case a: Int => | |
178 | 178 | a | |
179 | 179 | case _: Unit => | |
180 | 180 | 0 | |
181 | 181 | case _ => | |
182 | 182 | throw("Match error") | |
183 | 183 | } | |
184 | 184 | if ((allowSizeLottery >= countTokens)) | |
185 | 185 | then { | |
186 | 186 | 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)]) | |
187 | 187 | ScriptResult(updateLotteryPool, TransferSet(nil)) | |
188 | 188 | } | |
189 | 189 | else throw("Lottery prices has reached maximum 15") | |
190 | 190 | } | |
191 | 191 | } | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | ||
196 | 196 | @Callable(i) | |
197 | 197 | func startlotto () = { | |
198 | 198 | let currentKey = toBase58String(i.caller.bytes) | |
199 | 199 | let randhash = randomizer(i) | |
200 | 200 | let countTokens = match getInteger(this, countOfPrices) { | |
201 | 201 | case a: Int => | |
202 | 202 | a | |
203 | 203 | case _: Unit => | |
204 | 204 | 0 | |
205 | 205 | case _ => | |
206 | 206 | throw("Match error") | |
207 | 207 | } | |
208 | 208 | let priceList = getPriceArray() | |
209 | 209 | let randNumber = toInt(randhash) | |
210 | 210 | let winningToken = { | |
211 | 211 | let $list73937431 = priceList | |
212 | 212 | let $size73937431 = size($list73937431) | |
213 | 213 | let $acc073937431 = nil | |
214 | 214 | if (($size73937431 == 0)) | |
215 | 215 | then $acc073937431 | |
216 | 216 | else { | |
217 | 217 | let $acc173937431 = procedLottery($acc073937431, $list73937431[0]) | |
218 | 218 | if (($size73937431 == 1)) | |
219 | 219 | then $acc173937431 | |
220 | 220 | else { | |
221 | 221 | let $acc273937431 = procedLottery($acc173937431, $list73937431[1]) | |
222 | 222 | if (($size73937431 == 2)) | |
223 | 223 | then $acc273937431 | |
224 | 224 | else { | |
225 | 225 | let $acc373937431 = procedLottery($acc273937431, $list73937431[2]) | |
226 | 226 | if (($size73937431 == 3)) | |
227 | 227 | then $acc373937431 | |
228 | 228 | else { | |
229 | 229 | let $acc473937431 = procedLottery($acc373937431, $list73937431[3]) | |
230 | 230 | if (($size73937431 == 4)) | |
231 | 231 | then $acc473937431 | |
232 | 232 | else { | |
233 | 233 | let $acc573937431 = procedLottery($acc473937431, $list73937431[4]) | |
234 | 234 | if (($size73937431 == 5)) | |
235 | 235 | then $acc573937431 | |
236 | 236 | else { | |
237 | 237 | let $acc673937431 = procedLottery($acc573937431, $list73937431[5]) | |
238 | 238 | if (($size73937431 == 6)) | |
239 | 239 | then $acc673937431 | |
240 | 240 | else { | |
241 | 241 | let $acc773937431 = procedLottery($acc673937431, $list73937431[6]) | |
242 | 242 | if (($size73937431 == 7)) | |
243 | 243 | then $acc773937431 | |
244 | 244 | else { | |
245 | 245 | let $acc873937431 = procedLottery($acc773937431, $list73937431[7]) | |
246 | 246 | if (($size73937431 == 8)) | |
247 | 247 | then $acc873937431 | |
248 | 248 | else { | |
249 | 249 | let $acc973937431 = procedLottery($acc873937431, $list73937431[8]) | |
250 | 250 | if (($size73937431 == 9)) | |
251 | 251 | then $acc973937431 | |
252 | 252 | else { | |
253 | 253 | let $acc1073937431 = procedLottery($acc973937431, $list73937431[9]) | |
254 | 254 | if (($size73937431 == 10)) | |
255 | 255 | then $acc1073937431 | |
256 | 256 | else { | |
257 | 257 | let $acc1173937431 = procedLottery($acc1073937431, $list73937431[10]) | |
258 | 258 | if (($size73937431 == 11)) | |
259 | 259 | then $acc1173937431 | |
260 | 260 | else { | |
261 | 261 | let $acc1273937431 = procedLottery($acc1173937431, $list73937431[11]) | |
262 | 262 | if (($size73937431 == 12)) | |
263 | 263 | then $acc1273937431 | |
264 | 264 | else { | |
265 | 265 | let $acc1373937431 = procedLottery($acc1273937431, $list73937431[12]) | |
266 | 266 | if (($size73937431 == 13)) | |
267 | 267 | then $acc1373937431 | |
268 | 268 | else { | |
269 | 269 | let $acc1473937431 = procedLottery($acc1373937431, $list73937431[13]) | |
270 | 270 | if (($size73937431 == 14)) | |
271 | 271 | then $acc1473937431 | |
272 | 272 | else { | |
273 | 273 | let $acc1573937431 = procedLottery($acc1473937431, $list73937431[14]) | |
274 | 274 | throw("List size exceed 14") | |
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 | } | |
290 | 290 | } | |
291 | 291 | let sizeOfWinPrices = size(winningToken) | |
292 | 292 | if ((sizeOfWinPrices == 0)) | |
293 | 293 | then { | |
294 | 294 | let writeSets = WriteSet(nil) | |
295 | 295 | ScriptResult(writeSets, TransferSet(nil)) | |
296 | 296 | } | |
297 | 297 | else { | |
298 | 298 | let token = winningToken[1] | |
299 | 299 | let currentAmount = getIntegerValue(this, (token + lotteryamount)) | |
300 | 300 | if ((currentAmount == 0)) | |
301 | 301 | then throw("Amount exceeded") | |
302 | 302 | else { | |
303 | 303 | let actualAmount = (currentAmount - 1) | |
304 | 304 | let tokenPrice = getIntegerValue(this, (token + lotteryPrice)) | |
305 | 305 | let tokenAssetId = getStringValue(this, (token + lotteryAssetId)) | |
306 | 306 | if ((actualAmount == 0)) | |
307 | 307 | then { | |
308 | 308 | let storedTokensValues = { | |
309 | 309 | let $list82668317 = priceList | |
310 | 310 | let $size82668317 = size($list82668317) | |
311 | 311 | let $acc082668317 = token | |
312 | 312 | if (($size82668317 == 0)) | |
313 | 313 | then $acc082668317 | |
314 | 314 | else { | |
315 | 315 | let $acc182668317 = generateNewListOfPrices($acc082668317, $list82668317[0]) | |
316 | 316 | if (($size82668317 == 1)) | |
317 | 317 | then $acc182668317 | |
318 | 318 | else { | |
319 | 319 | let $acc282668317 = generateNewListOfPrices($acc182668317, $list82668317[1]) | |
320 | 320 | if (($size82668317 == 2)) | |
321 | 321 | then $acc282668317 | |
322 | 322 | else { | |
323 | 323 | let $acc382668317 = generateNewListOfPrices($acc282668317, $list82668317[2]) | |
324 | 324 | if (($size82668317 == 3)) | |
325 | 325 | then $acc382668317 | |
326 | 326 | else { | |
327 | 327 | let $acc482668317 = generateNewListOfPrices($acc382668317, $list82668317[3]) | |
328 | 328 | if (($size82668317 == 4)) | |
329 | 329 | then $acc482668317 | |
330 | 330 | else { | |
331 | 331 | let $acc582668317 = generateNewListOfPrices($acc482668317, $list82668317[4]) | |
332 | 332 | if (($size82668317 == 5)) | |
333 | 333 | then $acc582668317 | |
334 | 334 | else { | |
335 | 335 | let $acc682668317 = generateNewListOfPrices($acc582668317, $list82668317[5]) | |
336 | 336 | if (($size82668317 == 6)) | |
337 | 337 | then $acc682668317 | |
338 | 338 | else { | |
339 | 339 | let $acc782668317 = generateNewListOfPrices($acc682668317, $list82668317[6]) | |
340 | 340 | if (($size82668317 == 7)) | |
341 | 341 | then $acc782668317 | |
342 | 342 | else { | |
343 | 343 | let $acc882668317 = generateNewListOfPrices($acc782668317, $list82668317[7]) | |
344 | 344 | if (($size82668317 == 8)) | |
345 | 345 | then $acc882668317 | |
346 | 346 | else { | |
347 | 347 | let $acc982668317 = generateNewListOfPrices($acc882668317, $list82668317[8]) | |
348 | 348 | if (($size82668317 == 9)) | |
349 | 349 | then $acc982668317 | |
350 | 350 | else { | |
351 | 351 | let $acc1082668317 = generateNewListOfPrices($acc982668317, $list82668317[9]) | |
352 | 352 | if (($size82668317 == 10)) | |
353 | 353 | then $acc1082668317 | |
354 | 354 | else { | |
355 | 355 | let $acc1182668317 = generateNewListOfPrices($acc1082668317, $list82668317[10]) | |
356 | 356 | if (($size82668317 == 11)) | |
357 | 357 | then $acc1182668317 | |
358 | 358 | else { | |
359 | 359 | let $acc1282668317 = generateNewListOfPrices($acc1182668317, $list82668317[11]) | |
360 | 360 | if (($size82668317 == 12)) | |
361 | 361 | then $acc1282668317 | |
362 | 362 | else { | |
363 | 363 | let $acc1382668317 = generateNewListOfPrices($acc1282668317, $list82668317[12]) | |
364 | 364 | if (($size82668317 == 13)) | |
365 | 365 | then $acc1382668317 | |
366 | 366 | else { | |
367 | 367 | let $acc1482668317 = generateNewListOfPrices($acc1382668317, $list82668317[13]) | |
368 | 368 | if (($size82668317 == 14)) | |
369 | 369 | then $acc1482668317 | |
370 | 370 | else { | |
371 | 371 | let $acc1582668317 = generateNewListOfPrices($acc1482668317, $list82668317[14]) | |
372 | 372 | throw("List size exceed 14") | |
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 | } | |
388 | 388 | } | |
389 | 389 | let writeSets = WriteSet([DataEntry(("winning_token_" + token), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry(countOfPrices, (countTokens - 1)), DataEntry(lotteryPrices, storedTokensValues), DataEntry(lastHashRandomNumber, randNumber)]) | |
390 | 390 | if ((tokenAssetId == "")) | |
391 | 391 | then { | |
392 | 392 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
393 | 393 | ScriptResult(writeSets, winTransfer) | |
394 | 394 | } | |
395 | 395 | else { | |
396 | 396 | let actualAssetId = fromBase64String(tokenAssetId) | |
397 | - | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, | |
397 | + | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
398 | 398 | ScriptResult(writeSets, winTransfer) | |
399 | 399 | } | |
400 | 400 | } | |
401 | 401 | else { | |
402 | 402 | let writeSets = WriteSet([DataEntry((currentKey + "_winning_token_"), token), DataEntry((currentKey + "_wininning_address_"), currentKey), DataEntry((token + lotteryamount), actualAmount), DataEntry(lastHashRandomNumber, randNumber)]) | |
403 | 403 | if ((tokenAssetId == "")) | |
404 | 404 | then { | |
405 | 405 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, unit)]) | |
406 | 406 | ScriptResult(writeSets, winTransfer) | |
407 | 407 | } | |
408 | 408 | else { | |
409 | 409 | let actualAssetId = fromBase64String(tokenAssetId) | |
410 | 410 | let winTransfer = TransferSet([ScriptTransfer(i.caller, tokenPrice, actualAssetId)]) | |
411 | 411 | ScriptResult(writeSets, winTransfer) | |
412 | 412 | } | |
413 | 413 | } | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 | } | |
417 | 417 | ||
418 | 418 | ||
419 | 419 | @Verifier(tx) | |
420 | 420 | func verify () = match tx { | |
421 | 421 | case _: DataTransaction => | |
422 | 422 | true | |
423 | 423 | case _: SetScriptTransaction => | |
424 | 424 | true | |
425 | 425 | case _ => | |
426 | 426 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
427 | 427 | } | |
428 | 428 |
github/deemru/w8io/169f3d6 62.17 ms ◑