tx · 5NXBvXDpLiVQxJNNx2rEuwAtuqVkc3XZZAcNMh9PNGfr

3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito:  -0.05000000 Waves

2021.09.09 17:08 [1695610] smart account 3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito > SELF 0.00000000 Waves

{ "type": 13, "id": "5NXBvXDpLiVQxJNNx2rEuwAtuqVkc3XZZAcNMh9PNGfr", "fee": 5000000, "feeAssetId": null, "timestamp": 1631196553677, "version": 2, "chainId": 84, "sender": "3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito", "senderPublicKey": "7PMrxEzirv6h9Z2zqLE47qrZd6v1AbRZER5Aqfo95Eyr", "proofs": [ "5jzmXiraskr8y7Gpt82rVcVRjMNJN7jwo7XMgFnJpfYQznk52d2aF26Dyg5eDmUinjMe3gT9md8XbHPURKRVfATm" ], "script": "base64:AAIFAAAAAAAAACgIAhIGCgQBAQEBEgMKAQESAwoBARIFCgMICAgSAwoBCBIECgIICBIAAAAANAAAAAAQaW5jdWJhdG9yQWRkcmVzcwEAAAAaAVQu1YzRxAHn1ekAzs1AJJ6xFAc06V7PK6oAAAAADmJyZWVkZXJBZGRyZXNzAQAAABoBVIXmeysidPaPsP+lKHIt9Vw8rE+lS45bjgAAAAAVcmFyaXR5UHJvdmlkZXJBZGRyZXNzAQAAABoBVPqvXAIOK77VhJOb48rzK/MJjwrn6vR1pAAAAAALZWdnc0Fzc2V0SWQBAAAAICUCZcz3BGjIvgFZkXjlWFo4ZhQTrUpMSrf+BRdIFxaDAAAAAAVTTE9UUwAAAAAAAAAACgAAAAAHV0FJVElORwAAAAAAAAAACAAAAAAMc3RlcER1cmF0aW9uAAAAAAAAAAAFAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAA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AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleaF4Ff4=", "height": 1695610, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C79JPnYjxsGb6TbtibisTo5i1U9enaLp5PiZmrGcXYth Next: 36mz51n2TdDLiidgd9yAoxygkhgXpmHgjoNUcbbR4QkC Diff:
OldNewDifferences
44 let incubatorAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
55
66 let breederAddress = base58'3N285kYUMxPi6oZsdWrxhSY34dJHyu4kRN5'
7+
8+let rarityProviderAddress = base58'3NCman4dCzk1HWWU4DPTr5rsbhvuUCwwUZh'
79
810 let eggsAssetId = base58'3VUCuh9dWqe54SdzzNUkXhFXpc8UQynnJVh42B7MjNzN'
911
129131 func getDuckOrder (gameId,playerRole) = tryGetString(getDuckOrderKey(gameId, playerRole))
130132
131133
134+func getGameResultKey (gameId,playerAddress) = (((("game" + toString(gameId)) + "_") + playerAddress) + "_result")
135+
136+
137+func getGameResult (gameId,playerAddress) = tryGetString(getGameResultKey(gameId, playerAddress))
138+
139+
132140 func getPlayerWinsKey (playerAddress) = (playerAddress + "_wins")
133141
134142
153161 func getGamesPlayed () = tryGetInteger(getGamesPlayedKey())
154162
155163
156-func isSymbolA (accumulated,sym) = if ((sym == "A"))
157- then (accumulated + 1)
158- else (accumulated + 0)
159-
160-
161-func isSymbolB (accumulated,sym) = if ((sym == "B"))
162- then (accumulated + 1)
163- else (accumulated + 0)
164-
165-
166-func isSymbolC (accumulated,sym) = if ((sym == "C"))
167- then (accumulated + 1)
168- else (accumulated + 0)
169-
170-
171-func isSymbolD (accumulated,sym) = if ((sym == "D"))
172- then (accumulated + 1)
173- else (accumulated + 0)
174-
175-
176-func isSymbolE (accumulated,sym) = if ((sym == "E"))
177- then (accumulated + 1)
178- else (accumulated + 0)
179-
180-
181-func isSymbolF (accumulated,sym) = if ((sym == "F"))
182- then (accumulated + 1)
183- else (accumulated + 0)
184-
185-
186-func isSymbolG (accumulated,sym) = if ((sym == "G"))
187- then (accumulated + 1)
188- else (accumulated + 0)
189-
190-
191-func isSymbolH (accumulated,sym) = if ((sym == "H"))
192- then (accumulated + 1)
193- else (accumulated + 0)
194-
195-
196-func getAmountOrClear (amount) = if (contains(amount, "0"))
197- then ""
198- else amount
199-
200-
201-func getGen (assetName) = {
202- let genotype = split(dropRight(drop(assetName, 5), 3), "")
203- (((((((getAmountOrClear((toString({
204- let $list59405971 = genotype
205- let $size59405971 = size($list59405971)
206- let $acc059405971 = 0
207- if (($size59405971 == 0))
208- then $acc059405971
209- else {
210- let $acc159405971 = isSymbolA($acc059405971, $list59405971[0])
211- if (($size59405971 == 1))
212- then $acc159405971
213- else {
214- let $acc259405971 = isSymbolA($acc159405971, $list59405971[1])
215- if (($size59405971 == 2))
216- then $acc259405971
217- else {
218- let $acc359405971 = isSymbolA($acc259405971, $list59405971[2])
219- if (($size59405971 == 3))
220- then $acc359405971
221- else {
222- let $acc459405971 = isSymbolA($acc359405971, $list59405971[3])
223- if (($size59405971 == 4))
224- then $acc459405971
225- else {
226- let $acc559405971 = isSymbolA($acc459405971, $list59405971[4])
227- if (($size59405971 == 5))
228- then $acc559405971
229- else {
230- let $acc659405971 = isSymbolA($acc559405971, $list59405971[5])
231- if (($size59405971 == 6))
232- then $acc659405971
233- else {
234- let $acc759405971 = isSymbolA($acc659405971, $list59405971[6])
235- if (($size59405971 == 7))
236- then $acc759405971
237- else {
238- let $acc859405971 = isSymbolA($acc759405971, $list59405971[7])
239- if (($size59405971 == 8))
240- then $acc859405971
241- else {
242- let $acc959405971 = isSymbolA($acc859405971, $list59405971[8])
243- throw("List size exceed 8")
244- }
245- }
246- }
247- }
248- }
249- }
250- }
251- }
252- }
253- }) + "A")) + getAmountOrClear((toString({
254- let $list60086039 = genotype
255- let $size60086039 = size($list60086039)
256- let $acc060086039 = 0
257- if (($size60086039 == 0))
258- then $acc060086039
259- else {
260- let $acc160086039 = isSymbolB($acc060086039, $list60086039[0])
261- if (($size60086039 == 1))
262- then $acc160086039
263- else {
264- let $acc260086039 = isSymbolB($acc160086039, $list60086039[1])
265- if (($size60086039 == 2))
266- then $acc260086039
267- else {
268- let $acc360086039 = isSymbolB($acc260086039, $list60086039[2])
269- if (($size60086039 == 3))
270- then $acc360086039
271- else {
272- let $acc460086039 = isSymbolB($acc360086039, $list60086039[3])
273- if (($size60086039 == 4))
274- then $acc460086039
275- else {
276- let $acc560086039 = isSymbolB($acc460086039, $list60086039[4])
277- if (($size60086039 == 5))
278- then $acc560086039
279- else {
280- let $acc660086039 = isSymbolB($acc560086039, $list60086039[5])
281- if (($size60086039 == 6))
282- then $acc660086039
283- else {
284- let $acc760086039 = isSymbolB($acc660086039, $list60086039[6])
285- if (($size60086039 == 7))
286- then $acc760086039
287- else {
288- let $acc860086039 = isSymbolB($acc760086039, $list60086039[7])
289- if (($size60086039 == 8))
290- then $acc860086039
291- else {
292- let $acc960086039 = isSymbolB($acc860086039, $list60086039[8])
293- throw("List size exceed 8")
294- }
295- }
296- }
297- }
298- }
299- }
300- }
301- }
302- }
303- }) + "B"))) + getAmountOrClear((toString({
304- let $list60766107 = genotype
305- let $size60766107 = size($list60766107)
306- let $acc060766107 = 0
307- if (($size60766107 == 0))
308- then $acc060766107
309- else {
310- let $acc160766107 = isSymbolC($acc060766107, $list60766107[0])
311- if (($size60766107 == 1))
312- then $acc160766107
313- else {
314- let $acc260766107 = isSymbolC($acc160766107, $list60766107[1])
315- if (($size60766107 == 2))
316- then $acc260766107
317- else {
318- let $acc360766107 = isSymbolC($acc260766107, $list60766107[2])
319- if (($size60766107 == 3))
320- then $acc360766107
321- else {
322- let $acc460766107 = isSymbolC($acc360766107, $list60766107[3])
323- if (($size60766107 == 4))
324- then $acc460766107
325- else {
326- let $acc560766107 = isSymbolC($acc460766107, $list60766107[4])
327- if (($size60766107 == 5))
328- then $acc560766107
329- else {
330- let $acc660766107 = isSymbolC($acc560766107, $list60766107[5])
331- if (($size60766107 == 6))
332- then $acc660766107
333- else {
334- let $acc760766107 = isSymbolC($acc660766107, $list60766107[6])
335- if (($size60766107 == 7))
336- then $acc760766107
337- else {
338- let $acc860766107 = isSymbolC($acc760766107, $list60766107[7])
339- if (($size60766107 == 8))
340- then $acc860766107
341- else {
342- let $acc960766107 = isSymbolC($acc860766107, $list60766107[8])
343- throw("List size exceed 8")
344- }
345- }
346- }
347- }
348- }
349- }
350- }
351- }
352- }
353- }) + "C"))) + getAmountOrClear((toString({
354- let $list61466177 = genotype
355- let $size61466177 = size($list61466177)
356- let $acc061466177 = 0
357- if (($size61466177 == 0))
358- then $acc061466177
359- else {
360- let $acc161466177 = isSymbolD($acc061466177, $list61466177[0])
361- if (($size61466177 == 1))
362- then $acc161466177
363- else {
364- let $acc261466177 = isSymbolD($acc161466177, $list61466177[1])
365- if (($size61466177 == 2))
366- then $acc261466177
367- else {
368- let $acc361466177 = isSymbolD($acc261466177, $list61466177[2])
369- if (($size61466177 == 3))
370- then $acc361466177
371- else {
372- let $acc461466177 = isSymbolD($acc361466177, $list61466177[3])
373- if (($size61466177 == 4))
374- then $acc461466177
375- else {
376- let $acc561466177 = isSymbolD($acc461466177, $list61466177[4])
377- if (($size61466177 == 5))
378- then $acc561466177
379- else {
380- let $acc661466177 = isSymbolD($acc561466177, $list61466177[5])
381- if (($size61466177 == 6))
382- then $acc661466177
383- else {
384- let $acc761466177 = isSymbolD($acc661466177, $list61466177[6])
385- if (($size61466177 == 7))
386- then $acc761466177
387- else {
388- let $acc861466177 = isSymbolD($acc761466177, $list61466177[7])
389- if (($size61466177 == 8))
390- then $acc861466177
391- else {
392- let $acc961466177 = isSymbolD($acc861466177, $list61466177[8])
393- throw("List size exceed 8")
394- }
395- }
396- }
397- }
398- }
399- }
400- }
401- }
402- }
403- }) + "D"))) + getAmountOrClear((toString({
404- let $list62146245 = genotype
405- let $size62146245 = size($list62146245)
406- let $acc062146245 = 0
407- if (($size62146245 == 0))
408- then $acc062146245
409- else {
410- let $acc162146245 = isSymbolE($acc062146245, $list62146245[0])
411- if (($size62146245 == 1))
412- then $acc162146245
413- else {
414- let $acc262146245 = isSymbolE($acc162146245, $list62146245[1])
415- if (($size62146245 == 2))
416- then $acc262146245
417- else {
418- let $acc362146245 = isSymbolE($acc262146245, $list62146245[2])
419- if (($size62146245 == 3))
420- then $acc362146245
421- else {
422- let $acc462146245 = isSymbolE($acc362146245, $list62146245[3])
423- if (($size62146245 == 4))
424- then $acc462146245
425- else {
426- let $acc562146245 = isSymbolE($acc462146245, $list62146245[4])
427- if (($size62146245 == 5))
428- then $acc562146245
429- else {
430- let $acc662146245 = isSymbolE($acc562146245, $list62146245[5])
431- if (($size62146245 == 6))
432- then $acc662146245
433- else {
434- let $acc762146245 = isSymbolE($acc662146245, $list62146245[6])
435- if (($size62146245 == 7))
436- then $acc762146245
437- else {
438- let $acc862146245 = isSymbolE($acc762146245, $list62146245[7])
439- if (($size62146245 == 8))
440- then $acc862146245
441- else {
442- let $acc962146245 = isSymbolE($acc862146245, $list62146245[8])
443- throw("List size exceed 8")
444- }
445- }
446- }
447- }
448- }
449- }
450- }
451- }
452- }
453- }) + "E"))) + getAmountOrClear((toString({
454- let $list62826313 = genotype
455- let $size62826313 = size($list62826313)
456- let $acc062826313 = 0
457- if (($size62826313 == 0))
458- then $acc062826313
459- else {
460- let $acc162826313 = isSymbolF($acc062826313, $list62826313[0])
461- if (($size62826313 == 1))
462- then $acc162826313
463- else {
464- let $acc262826313 = isSymbolF($acc162826313, $list62826313[1])
465- if (($size62826313 == 2))
466- then $acc262826313
467- else {
468- let $acc362826313 = isSymbolF($acc262826313, $list62826313[2])
469- if (($size62826313 == 3))
470- then $acc362826313
471- else {
472- let $acc462826313 = isSymbolF($acc362826313, $list62826313[3])
473- if (($size62826313 == 4))
474- then $acc462826313
475- else {
476- let $acc562826313 = isSymbolF($acc462826313, $list62826313[4])
477- if (($size62826313 == 5))
478- then $acc562826313
479- else {
480- let $acc662826313 = isSymbolF($acc562826313, $list62826313[5])
481- if (($size62826313 == 6))
482- then $acc662826313
483- else {
484- let $acc762826313 = isSymbolF($acc662826313, $list62826313[6])
485- if (($size62826313 == 7))
486- then $acc762826313
487- else {
488- let $acc862826313 = isSymbolF($acc762826313, $list62826313[7])
489- if (($size62826313 == 8))
490- then $acc862826313
491- else {
492- let $acc962826313 = isSymbolF($acc862826313, $list62826313[8])
493- throw("List size exceed 8")
494- }
495- }
496- }
497- }
498- }
499- }
500- }
501- }
502- }
503- }) + "F"))) + getAmountOrClear((toString({
504- let $list63526383 = genotype
505- let $size63526383 = size($list63526383)
506- let $acc063526383 = 0
507- if (($size63526383 == 0))
508- then $acc063526383
509- else {
510- let $acc163526383 = isSymbolG($acc063526383, $list63526383[0])
511- if (($size63526383 == 1))
512- then $acc163526383
513- else {
514- let $acc263526383 = isSymbolG($acc163526383, $list63526383[1])
515- if (($size63526383 == 2))
516- then $acc263526383
517- else {
518- let $acc363526383 = isSymbolG($acc263526383, $list63526383[2])
519- if (($size63526383 == 3))
520- then $acc363526383
521- else {
522- let $acc463526383 = isSymbolG($acc363526383, $list63526383[3])
523- if (($size63526383 == 4))
524- then $acc463526383
525- else {
526- let $acc563526383 = isSymbolG($acc463526383, $list63526383[4])
527- if (($size63526383 == 5))
528- then $acc563526383
529- else {
530- let $acc663526383 = isSymbolG($acc563526383, $list63526383[5])
531- if (($size63526383 == 6))
532- then $acc663526383
533- else {
534- let $acc763526383 = isSymbolG($acc663526383, $list63526383[6])
535- if (($size63526383 == 7))
536- then $acc763526383
537- else {
538- let $acc863526383 = isSymbolG($acc763526383, $list63526383[7])
539- if (($size63526383 == 8))
540- then $acc863526383
541- else {
542- let $acc963526383 = isSymbolG($acc863526383, $list63526383[8])
543- throw("List size exceed 8")
544- }
545- }
546- }
547- }
548- }
549- }
550- }
551- }
552- }
553- }) + "G"))) + getAmountOrClear((toString({
554- let $list64206451 = genotype
555- let $size64206451 = size($list64206451)
556- let $acc064206451 = 0
557- if (($size64206451 == 0))
558- then $acc064206451
559- else {
560- let $acc164206451 = isSymbolH($acc064206451, $list64206451[0])
561- if (($size64206451 == 1))
562- then $acc164206451
563- else {
564- let $acc264206451 = isSymbolH($acc164206451, $list64206451[1])
565- if (($size64206451 == 2))
566- then $acc264206451
567- else {
568- let $acc364206451 = isSymbolH($acc264206451, $list64206451[2])
569- if (($size64206451 == 3))
570- then $acc364206451
571- else {
572- let $acc464206451 = isSymbolH($acc364206451, $list64206451[3])
573- if (($size64206451 == 4))
574- then $acc464206451
575- else {
576- let $acc564206451 = isSymbolH($acc464206451, $list64206451[4])
577- if (($size64206451 == 5))
578- then $acc564206451
579- else {
580- let $acc664206451 = isSymbolH($acc564206451, $list64206451[5])
581- if (($size64206451 == 6))
582- then $acc664206451
583- else {
584- let $acc764206451 = isSymbolH($acc664206451, $list64206451[6])
585- if (($size64206451 == 7))
586- then $acc764206451
587- else {
588- let $acc864206451 = isSymbolH($acc764206451, $list64206451[7])
589- if (($size64206451 == 8))
590- then $acc864206451
591- else {
592- let $acc964206451 = isSymbolH($acc864206451, $list64206451[8])
593- throw("List size exceed 8")
594- }
595- }
596- }
597- }
598- }
599- }
600- }
601- }
602- }
603- }) + "H")))
604- }
605-
606-
607-func getAssetOrigin (generation) = if ((generation == "G"))
608- then incubatorAddress
609- else breederAddress
610-
611-
612-func getAssetRarity (assetId) = if (if ((value(assetInfo(assetId)).issuer == Address(breederAddress)))
613- then true
614- else (value(assetInfo(assetId)).issuer == Address(incubatorAddress)))
615- then {
616- let assetName = value(assetInfo(assetId)).name
617- let generation = take(takeRight(assetName, 2), 1)
618- let gen = ((getGen(assetName) + "-") + generation)
619- let quantity = getIntegerValue(Address(getAssetOrigin(generation)), (("stats_" + gen) + "_quantity"))
620- let power = pow((10000 / quantity), 4, 5, 1, 2, FLOOR)
621- if ((power > 0))
622- then power
623- else 2
624- }
625- else throw("not valid NFT")
164+func checkDuckOwner (ownerAddress,assetId) = (assetBalance(ownerAddress, assetId) > 0)
626165
627166
628167 func getScore (a,b) = if ((a > b))
695234 then true
696235 else (rarityRangeBest > 5))
697236 then throw("Invalid rarity range for the best duck")
698- else if ((rarityRangeWorst >= rarityRangeMedium))
699- then throw("The medium duck must be better than the worst one")
700- else if ((rarityRangeMedium >= rarityRangeBest))
701- then throw("The best duck must be better than the medium one")
237+ else if ((rarityRangeWorst > rarityRangeMedium))
238+ then throw("The medium range can't be less than the worst one")
239+ else if ((rarityRangeMedium > rarityRangeBest))
240+ then throw("The best range can't be worse than the medium one")
702241 else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "maker"), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
703242 }
704243
748287
749288
750289 @Callable(i)
751-func pickDucks () = {
290+func pickDucks (worstDuckId,mediumDuckId,bestDuckId) = {
752291 let callerAddress = toBase58String(i.caller.bytes)
753292 let gameId = getPlayerCurrentGame(callerAddress)
754293 let playerRole = getPlayerRole(gameId, callerAddress)
756295 let worstRarityRange = getRarityRange(gameId, "worst")
757296 let mediumRarityRange = getRarityRange(gameId, "medium")
758297 let bestRarityRange = getRarityRange(gameId, "best")
759- let worstDuckId = value(value(i.payments[0]).assetId)
760- let mediumDuckId = value(value(i.payments[1]).assetId)
761- let bestDuckId = value(value(i.payments[2]).assetId)
762- let worstRarity = getAssetRarity(worstDuckId)
763- let mediumRarity = getAssetRarity(mediumDuckId)
764- let bestRarity = getAssetRarity(bestDuckId)
765- if ((gameId == 0))
766- then throw("You don't have an active game")
767- else if ((getExpirationHeight(gameId) == 0))
768- then throw("Game is not started")
769- else if (if ((gameStep == 0))
770- then (playerRole != "taker")
771- else false)
772- then throw("It is the taker's turn to pick now")
773- else if (if ((gameStep == 1))
774- then (playerRole != "maker")
775- else false)
776- then throw("It is the maker's turn to pick now")
777- else if ((gameStep > 1))
778- then throw("Ducks have already been picked")
779- else if (if ((worstRarity > (worstRarityRange * 10)))
780- then true
781- else (((worstRarityRange - 1) * 10) >= worstRarity))
782- then throw("Worst duck doesn't fit rarity range")
783- else if (if ((mediumRarity > (mediumRarityRange * 10)))
784- then true
785- else (((mediumRarityRange - 1) * 10) >= mediumRarity))
786- then throw("Medium duck doesn't fit rarity range")
787- else if (if (if (if ((bestRarityRange == 5))
788- then (40 >= bestRarity)
789- else false)
790- then true
791- else (bestRarity > (bestRarityRange * 10)))
792- then true
793- else (((bestRarityRange - 1) * 10) >= bestRarity))
794- then throw("Best duck doesn't fit rarity range")
795- else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), StringEntry(getDuckIdKey(gameId, playerRole, "worst"), toBase58String(worstDuckId)), StringEntry(getDuckIdKey(gameId, playerRole, "medium"), toBase58String(mediumDuckId)), StringEntry(getDuckIdKey(gameId, playerRole, "best"), toBase58String(bestDuckId)), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
298+ let invokeWorstRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [worstDuckId], nil)
299+ if ((invokeWorstRes == invokeWorstRes))
300+ then {
301+ let worstRarity = match invokeWorstRes {
302+ case r: Int =>
303+ r
304+ case _ =>
305+ throw("Incorrect invoke result")
306+ }
307+ let invokeMediumRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [mediumDuckId], nil)
308+ if ((invokeMediumRes == invokeMediumRes))
309+ then {
310+ let mediumRarity = match invokeMediumRes {
311+ case r: Int =>
312+ r
313+ case _ =>
314+ throw("Incorrect invoke result")
315+ }
316+ let invokeBestRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [bestDuckId], nil)
317+ if ((invokeBestRes == invokeBestRes))
318+ then {
319+ let bestRarity = match invokeWorstRes {
320+ case r: Int =>
321+ r
322+ case _ =>
323+ throw("Incorrect invoke result")
324+ }
325+ if ((gameId == 0))
326+ then throw("You don't have an active game")
327+ else if ((getExpirationHeight(gameId) == 0))
328+ then throw("Game is not started")
329+ else if (if ((gameStep == 0))
330+ then (playerRole != "taker")
331+ else false)
332+ then throw("It is the taker's turn to pick now")
333+ else if (if ((gameStep == 1))
334+ then (playerRole != "maker")
335+ else false)
336+ then throw("It is the maker's turn to pick now")
337+ else if ((gameStep > 1))
338+ then throw("Ducks have already been picked")
339+ else if (checkDuckOwner(i.caller, fromBase58String(worstDuckId)))
340+ then throw((("Asset " + worstDuckId) + " doesn't belong to you"))
341+ else if (checkDuckOwner(i.caller, fromBase58String(mediumDuckId)))
342+ then throw((("Asset " + mediumDuckId) + " doesn't belong to you"))
343+ else if (checkDuckOwner(i.caller, fromBase58String(bestDuckId)))
344+ then throw((("Asset " + bestDuckId) + " doesn't belong to you"))
345+ else if (if ((5 > worstRarityRange))
346+ then if ((worstRarity > (worstRarityRange * 10)))
347+ then true
348+ else (((worstRarityRange - 1) * 10) >= worstRarity)
349+ else false)
350+ then throw("Worst duck doesn't fit rarity range")
351+ else if (if ((5 > mediumRarityRange))
352+ then if ((mediumRarity > (mediumRarityRange * 10)))
353+ then true
354+ else (((mediumRarityRange - 1) * 10) >= mediumRarity)
355+ else false)
356+ then throw("Medium duck doesn't fit rarity range")
357+ else if (if ((5 > bestRarityRange))
358+ then if ((bestRarity > (bestRarityRange * 10)))
359+ then true
360+ else (((bestRarityRange - 1) * 10) >= bestRarity)
361+ else false)
362+ then throw("Best duck doesn't fit rarity range")
363+ else if (if ((worstRarityRange == 5))
364+ then (40 >= worstRarity)
365+ else false)
366+ then throw("Worst duck doesn't fit rarity range")
367+ else if (if ((mediumRarityRange == 5))
368+ then (40 >= mediumRarity)
369+ else false)
370+ then throw("Medium duck doesn't fit rarity range")
371+ else if (if ((bestRarityRange == 5))
372+ then (40 >= bestRarity)
373+ else false)
374+ then throw("Best duck doesn't fit rarity range")
375+ else if (if (if ((worstRarity == mediumRarity))
376+ then true
377+ else (worstRarity == bestRarity))
378+ then true
379+ else (mediumRarity == bestRarity))
380+ then throw("Ducks of the same rarity can't play")
381+ else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), StringEntry(getDuckIdKey(gameId, playerRole, "worst"), worstDuckId), StringEntry(getDuckIdKey(gameId, playerRole, "medium"), mediumDuckId), StringEntry(getDuckIdKey(gameId, playerRole, "best"), bestDuckId), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
382+ }
383+ else throw("Strict value is not equal to itself.")
384+ }
385+ else throw("Strict value is not equal to itself.")
386+ }
387+ else throw("Strict value is not equal to itself.")
796388 }
797389
798390
873465 if ((gameId == 0))
874466 then throw("You don't have an active game")
875467 else if ((winner == playerRole))
876- then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(anotherPlayerAddress), 0), IntegerEntry(getPlayerWinsKey(callerAddress), (getPlayerWins(callerAddress) + 1)), IntegerEntry(getPlayerLosesKey(anotherPlayerAddress), (getPlayerLoses(anotherPlayerAddress) + 1)), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
468+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(anotherPlayerAddress), 0), IntegerEntry(getPlayerWinsKey(callerAddress), (getPlayerWins(callerAddress) + 1)), IntegerEntry(getPlayerLosesKey(anotherPlayerAddress), (getPlayerLoses(anotherPlayerAddress) + 1)), StringEntry(getGameResultKey(gameId, callerAddress), "win"), StringEntry(getGameResultKey(gameId, anotherPlayerAddress), "lose"), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
877469 else if ((winner == "draw"))
878- then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerDrawsKey(callerAddress), (getPlayerDraws(callerAddress) + 1)), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
470+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerDrawsKey(callerAddress), (getPlayerDraws(callerAddress) + 1)), StringEntry(getGameResultKey(gameId, callerAddress), "draw"), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
879471 else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0)]
880472 }
881473
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let incubatorAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh'
55
66 let breederAddress = base58'3N285kYUMxPi6oZsdWrxhSY34dJHyu4kRN5'
7+
8+let rarityProviderAddress = base58'3NCman4dCzk1HWWU4DPTr5rsbhvuUCwwUZh'
79
810 let eggsAssetId = base58'3VUCuh9dWqe54SdzzNUkXhFXpc8UQynnJVh42B7MjNzN'
911
1012 let SLOTS = 10
1113
1214 let WAITING = 8
1315
1416 let stepDuration = 5
1517
1618 func tryGetInteger (key) = match getInteger(this, key) {
1719 case b: Int =>
1820 b
1921 case _ =>
2022 0
2123 }
2224
2325
2426 func tryGetString (key) = match getString(this, key) {
2527 case a: String =>
2628 a
2729 case _ =>
2830 ""
2931 }
3032
3133
3234 func tryGetBoolean (key) = match getBoolean(this, key) {
3335 case b: Boolean =>
3436 b
3537 case _ =>
3638 false
3739 }
3840
3941
4042 func getNextGameId () = {
4143 let nextId = tryGetInteger("nextGameId")
4244 if ((nextId == 0))
4345 then 1
4446 else nextId
4547 }
4648
4749
4850 func getPlayerCurrentGameKey (playerAddress) = (playerAddress + "_currentGame")
4951
5052
5153 func getPlayerCurrentGame (playerAddress) = tryGetInteger(getPlayerCurrentGameKey(playerAddress))
5254
5355
5456 func getSlotKey (slot) = ("slot" + toString(slot))
5557
5658
5759 func getSlot (slot) = tryGetInteger(getSlotKey(slot))
5860
5961
6062 func getPlayerRoleKey (gameId,playerAddress) = ((("game" + toString(gameId)) + "_") + playerAddress)
6163
6264
6365 func getPlayerRole (gameId,playerAddress) = tryGetString(getPlayerRoleKey(gameId, playerAddress))
6466
6567
6668 func getMakerKey (gameId) = (("game" + toString(gameId)) + "_maker")
6769
6870
6971 func getMaker (gameId) = tryGetString(getMakerKey(gameId))
7072
7173
7274 func getTakerKey (gameId) = (("game" + toString(gameId)) + "_taker")
7375
7476
7577 func getTaker (gameId) = tryGetString(getTakerKey(gameId))
7678
7779
7880 func getBetEggsKey (gameId) = (("game" + toString(gameId)) + "_betEggs")
7981
8082
8183 func getBetEggs (gameId) = tryGetInteger(getBetEggsKey(gameId))
8284
8385
8486 func getWaitingExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_waitingExpirationHeight")
8587
8688
8789 func getWaitingExpirationHeight (gameId) = tryGetInteger(getWaitingExpirationHeightKey(gameId))
8890
8991
9092 func getExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_expirationHeight")
9193
9294
9395 func getExpirationHeight (gameId) = tryGetInteger(getExpirationHeightKey(gameId))
9496
9597
9698 func getRarityRangeKey (gameId,rangePosition) = ((("game" + toString(gameId)) + "_rarityRange_") + rangePosition)
9799
98100
99101 func getRarityRange (gameId,rangePosition) = tryGetInteger(getRarityRangeKey(gameId, rangePosition))
100102
101103
102104 func getStepKey (gameId) = (("game" + toString(gameId)) + "_step")
103105
104106
105107 func getStep (gameId) = tryGetInteger(getStepKey(gameId))
106108
107109
108110 func getRarityKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity")
109111
110112
111113 func getRarity (gameId,playerRole,rangePosition) = tryGetInteger(getRarityKey(gameId, playerRole, rangePosition))
112114
113115
114116 func getDuckIdKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "DuckId")
115117
116118
117119 func getDuckId (gameId,playerRole,rangePosition) = tryGetString(getDuckIdKey(gameId, playerRole, rangePosition))
118120
119121
120122 func getCommitKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_commit")
121123
122124
123125 func getCommit (gameId,playerRole) = tryGetString(getCommitKey(gameId, playerRole))
124126
125127
126128 func getDuckOrderKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_duckOrder")
127129
128130
129131 func getDuckOrder (gameId,playerRole) = tryGetString(getDuckOrderKey(gameId, playerRole))
130132
131133
134+func getGameResultKey (gameId,playerAddress) = (((("game" + toString(gameId)) + "_") + playerAddress) + "_result")
135+
136+
137+func getGameResult (gameId,playerAddress) = tryGetString(getGameResultKey(gameId, playerAddress))
138+
139+
132140 func getPlayerWinsKey (playerAddress) = (playerAddress + "_wins")
133141
134142
135143 func getPlayerWins (playerAddress) = tryGetInteger(getPlayerWinsKey(playerAddress))
136144
137145
138146 func getPlayerLosesKey (playerAddress) = (playerAddress + "_loses")
139147
140148
141149 func getPlayerLoses (playerAddress) = tryGetInteger(getPlayerLosesKey(playerAddress))
142150
143151
144152 func getPlayerDrawsKey (playerAddress) = (playerAddress + "_draws")
145153
146154
147155 func getPlayerDraws (playerAddress) = tryGetInteger(getPlayerDrawsKey(playerAddress))
148156
149157
150158 func getGamesPlayedKey () = "gamesPlayed"
151159
152160
153161 func getGamesPlayed () = tryGetInteger(getGamesPlayedKey())
154162
155163
156-func isSymbolA (accumulated,sym) = if ((sym == "A"))
157- then (accumulated + 1)
158- else (accumulated + 0)
159-
160-
161-func isSymbolB (accumulated,sym) = if ((sym == "B"))
162- then (accumulated + 1)
163- else (accumulated + 0)
164-
165-
166-func isSymbolC (accumulated,sym) = if ((sym == "C"))
167- then (accumulated + 1)
168- else (accumulated + 0)
169-
170-
171-func isSymbolD (accumulated,sym) = if ((sym == "D"))
172- then (accumulated + 1)
173- else (accumulated + 0)
174-
175-
176-func isSymbolE (accumulated,sym) = if ((sym == "E"))
177- then (accumulated + 1)
178- else (accumulated + 0)
179-
180-
181-func isSymbolF (accumulated,sym) = if ((sym == "F"))
182- then (accumulated + 1)
183- else (accumulated + 0)
184-
185-
186-func isSymbolG (accumulated,sym) = if ((sym == "G"))
187- then (accumulated + 1)
188- else (accumulated + 0)
189-
190-
191-func isSymbolH (accumulated,sym) = if ((sym == "H"))
192- then (accumulated + 1)
193- else (accumulated + 0)
194-
195-
196-func getAmountOrClear (amount) = if (contains(amount, "0"))
197- then ""
198- else amount
199-
200-
201-func getGen (assetName) = {
202- let genotype = split(dropRight(drop(assetName, 5), 3), "")
203- (((((((getAmountOrClear((toString({
204- let $list59405971 = genotype
205- let $size59405971 = size($list59405971)
206- let $acc059405971 = 0
207- if (($size59405971 == 0))
208- then $acc059405971
209- else {
210- let $acc159405971 = isSymbolA($acc059405971, $list59405971[0])
211- if (($size59405971 == 1))
212- then $acc159405971
213- else {
214- let $acc259405971 = isSymbolA($acc159405971, $list59405971[1])
215- if (($size59405971 == 2))
216- then $acc259405971
217- else {
218- let $acc359405971 = isSymbolA($acc259405971, $list59405971[2])
219- if (($size59405971 == 3))
220- then $acc359405971
221- else {
222- let $acc459405971 = isSymbolA($acc359405971, $list59405971[3])
223- if (($size59405971 == 4))
224- then $acc459405971
225- else {
226- let $acc559405971 = isSymbolA($acc459405971, $list59405971[4])
227- if (($size59405971 == 5))
228- then $acc559405971
229- else {
230- let $acc659405971 = isSymbolA($acc559405971, $list59405971[5])
231- if (($size59405971 == 6))
232- then $acc659405971
233- else {
234- let $acc759405971 = isSymbolA($acc659405971, $list59405971[6])
235- if (($size59405971 == 7))
236- then $acc759405971
237- else {
238- let $acc859405971 = isSymbolA($acc759405971, $list59405971[7])
239- if (($size59405971 == 8))
240- then $acc859405971
241- else {
242- let $acc959405971 = isSymbolA($acc859405971, $list59405971[8])
243- throw("List size exceed 8")
244- }
245- }
246- }
247- }
248- }
249- }
250- }
251- }
252- }
253- }) + "A")) + getAmountOrClear((toString({
254- let $list60086039 = genotype
255- let $size60086039 = size($list60086039)
256- let $acc060086039 = 0
257- if (($size60086039 == 0))
258- then $acc060086039
259- else {
260- let $acc160086039 = isSymbolB($acc060086039, $list60086039[0])
261- if (($size60086039 == 1))
262- then $acc160086039
263- else {
264- let $acc260086039 = isSymbolB($acc160086039, $list60086039[1])
265- if (($size60086039 == 2))
266- then $acc260086039
267- else {
268- let $acc360086039 = isSymbolB($acc260086039, $list60086039[2])
269- if (($size60086039 == 3))
270- then $acc360086039
271- else {
272- let $acc460086039 = isSymbolB($acc360086039, $list60086039[3])
273- if (($size60086039 == 4))
274- then $acc460086039
275- else {
276- let $acc560086039 = isSymbolB($acc460086039, $list60086039[4])
277- if (($size60086039 == 5))
278- then $acc560086039
279- else {
280- let $acc660086039 = isSymbolB($acc560086039, $list60086039[5])
281- if (($size60086039 == 6))
282- then $acc660086039
283- else {
284- let $acc760086039 = isSymbolB($acc660086039, $list60086039[6])
285- if (($size60086039 == 7))
286- then $acc760086039
287- else {
288- let $acc860086039 = isSymbolB($acc760086039, $list60086039[7])
289- if (($size60086039 == 8))
290- then $acc860086039
291- else {
292- let $acc960086039 = isSymbolB($acc860086039, $list60086039[8])
293- throw("List size exceed 8")
294- }
295- }
296- }
297- }
298- }
299- }
300- }
301- }
302- }
303- }) + "B"))) + getAmountOrClear((toString({
304- let $list60766107 = genotype
305- let $size60766107 = size($list60766107)
306- let $acc060766107 = 0
307- if (($size60766107 == 0))
308- then $acc060766107
309- else {
310- let $acc160766107 = isSymbolC($acc060766107, $list60766107[0])
311- if (($size60766107 == 1))
312- then $acc160766107
313- else {
314- let $acc260766107 = isSymbolC($acc160766107, $list60766107[1])
315- if (($size60766107 == 2))
316- then $acc260766107
317- else {
318- let $acc360766107 = isSymbolC($acc260766107, $list60766107[2])
319- if (($size60766107 == 3))
320- then $acc360766107
321- else {
322- let $acc460766107 = isSymbolC($acc360766107, $list60766107[3])
323- if (($size60766107 == 4))
324- then $acc460766107
325- else {
326- let $acc560766107 = isSymbolC($acc460766107, $list60766107[4])
327- if (($size60766107 == 5))
328- then $acc560766107
329- else {
330- let $acc660766107 = isSymbolC($acc560766107, $list60766107[5])
331- if (($size60766107 == 6))
332- then $acc660766107
333- else {
334- let $acc760766107 = isSymbolC($acc660766107, $list60766107[6])
335- if (($size60766107 == 7))
336- then $acc760766107
337- else {
338- let $acc860766107 = isSymbolC($acc760766107, $list60766107[7])
339- if (($size60766107 == 8))
340- then $acc860766107
341- else {
342- let $acc960766107 = isSymbolC($acc860766107, $list60766107[8])
343- throw("List size exceed 8")
344- }
345- }
346- }
347- }
348- }
349- }
350- }
351- }
352- }
353- }) + "C"))) + getAmountOrClear((toString({
354- let $list61466177 = genotype
355- let $size61466177 = size($list61466177)
356- let $acc061466177 = 0
357- if (($size61466177 == 0))
358- then $acc061466177
359- else {
360- let $acc161466177 = isSymbolD($acc061466177, $list61466177[0])
361- if (($size61466177 == 1))
362- then $acc161466177
363- else {
364- let $acc261466177 = isSymbolD($acc161466177, $list61466177[1])
365- if (($size61466177 == 2))
366- then $acc261466177
367- else {
368- let $acc361466177 = isSymbolD($acc261466177, $list61466177[2])
369- if (($size61466177 == 3))
370- then $acc361466177
371- else {
372- let $acc461466177 = isSymbolD($acc361466177, $list61466177[3])
373- if (($size61466177 == 4))
374- then $acc461466177
375- else {
376- let $acc561466177 = isSymbolD($acc461466177, $list61466177[4])
377- if (($size61466177 == 5))
378- then $acc561466177
379- else {
380- let $acc661466177 = isSymbolD($acc561466177, $list61466177[5])
381- if (($size61466177 == 6))
382- then $acc661466177
383- else {
384- let $acc761466177 = isSymbolD($acc661466177, $list61466177[6])
385- if (($size61466177 == 7))
386- then $acc761466177
387- else {
388- let $acc861466177 = isSymbolD($acc761466177, $list61466177[7])
389- if (($size61466177 == 8))
390- then $acc861466177
391- else {
392- let $acc961466177 = isSymbolD($acc861466177, $list61466177[8])
393- throw("List size exceed 8")
394- }
395- }
396- }
397- }
398- }
399- }
400- }
401- }
402- }
403- }) + "D"))) + getAmountOrClear((toString({
404- let $list62146245 = genotype
405- let $size62146245 = size($list62146245)
406- let $acc062146245 = 0
407- if (($size62146245 == 0))
408- then $acc062146245
409- else {
410- let $acc162146245 = isSymbolE($acc062146245, $list62146245[0])
411- if (($size62146245 == 1))
412- then $acc162146245
413- else {
414- let $acc262146245 = isSymbolE($acc162146245, $list62146245[1])
415- if (($size62146245 == 2))
416- then $acc262146245
417- else {
418- let $acc362146245 = isSymbolE($acc262146245, $list62146245[2])
419- if (($size62146245 == 3))
420- then $acc362146245
421- else {
422- let $acc462146245 = isSymbolE($acc362146245, $list62146245[3])
423- if (($size62146245 == 4))
424- then $acc462146245
425- else {
426- let $acc562146245 = isSymbolE($acc462146245, $list62146245[4])
427- if (($size62146245 == 5))
428- then $acc562146245
429- else {
430- let $acc662146245 = isSymbolE($acc562146245, $list62146245[5])
431- if (($size62146245 == 6))
432- then $acc662146245
433- else {
434- let $acc762146245 = isSymbolE($acc662146245, $list62146245[6])
435- if (($size62146245 == 7))
436- then $acc762146245
437- else {
438- let $acc862146245 = isSymbolE($acc762146245, $list62146245[7])
439- if (($size62146245 == 8))
440- then $acc862146245
441- else {
442- let $acc962146245 = isSymbolE($acc862146245, $list62146245[8])
443- throw("List size exceed 8")
444- }
445- }
446- }
447- }
448- }
449- }
450- }
451- }
452- }
453- }) + "E"))) + getAmountOrClear((toString({
454- let $list62826313 = genotype
455- let $size62826313 = size($list62826313)
456- let $acc062826313 = 0
457- if (($size62826313 == 0))
458- then $acc062826313
459- else {
460- let $acc162826313 = isSymbolF($acc062826313, $list62826313[0])
461- if (($size62826313 == 1))
462- then $acc162826313
463- else {
464- let $acc262826313 = isSymbolF($acc162826313, $list62826313[1])
465- if (($size62826313 == 2))
466- then $acc262826313
467- else {
468- let $acc362826313 = isSymbolF($acc262826313, $list62826313[2])
469- if (($size62826313 == 3))
470- then $acc362826313
471- else {
472- let $acc462826313 = isSymbolF($acc362826313, $list62826313[3])
473- if (($size62826313 == 4))
474- then $acc462826313
475- else {
476- let $acc562826313 = isSymbolF($acc462826313, $list62826313[4])
477- if (($size62826313 == 5))
478- then $acc562826313
479- else {
480- let $acc662826313 = isSymbolF($acc562826313, $list62826313[5])
481- if (($size62826313 == 6))
482- then $acc662826313
483- else {
484- let $acc762826313 = isSymbolF($acc662826313, $list62826313[6])
485- if (($size62826313 == 7))
486- then $acc762826313
487- else {
488- let $acc862826313 = isSymbolF($acc762826313, $list62826313[7])
489- if (($size62826313 == 8))
490- then $acc862826313
491- else {
492- let $acc962826313 = isSymbolF($acc862826313, $list62826313[8])
493- throw("List size exceed 8")
494- }
495- }
496- }
497- }
498- }
499- }
500- }
501- }
502- }
503- }) + "F"))) + getAmountOrClear((toString({
504- let $list63526383 = genotype
505- let $size63526383 = size($list63526383)
506- let $acc063526383 = 0
507- if (($size63526383 == 0))
508- then $acc063526383
509- else {
510- let $acc163526383 = isSymbolG($acc063526383, $list63526383[0])
511- if (($size63526383 == 1))
512- then $acc163526383
513- else {
514- let $acc263526383 = isSymbolG($acc163526383, $list63526383[1])
515- if (($size63526383 == 2))
516- then $acc263526383
517- else {
518- let $acc363526383 = isSymbolG($acc263526383, $list63526383[2])
519- if (($size63526383 == 3))
520- then $acc363526383
521- else {
522- let $acc463526383 = isSymbolG($acc363526383, $list63526383[3])
523- if (($size63526383 == 4))
524- then $acc463526383
525- else {
526- let $acc563526383 = isSymbolG($acc463526383, $list63526383[4])
527- if (($size63526383 == 5))
528- then $acc563526383
529- else {
530- let $acc663526383 = isSymbolG($acc563526383, $list63526383[5])
531- if (($size63526383 == 6))
532- then $acc663526383
533- else {
534- let $acc763526383 = isSymbolG($acc663526383, $list63526383[6])
535- if (($size63526383 == 7))
536- then $acc763526383
537- else {
538- let $acc863526383 = isSymbolG($acc763526383, $list63526383[7])
539- if (($size63526383 == 8))
540- then $acc863526383
541- else {
542- let $acc963526383 = isSymbolG($acc863526383, $list63526383[8])
543- throw("List size exceed 8")
544- }
545- }
546- }
547- }
548- }
549- }
550- }
551- }
552- }
553- }) + "G"))) + getAmountOrClear((toString({
554- let $list64206451 = genotype
555- let $size64206451 = size($list64206451)
556- let $acc064206451 = 0
557- if (($size64206451 == 0))
558- then $acc064206451
559- else {
560- let $acc164206451 = isSymbolH($acc064206451, $list64206451[0])
561- if (($size64206451 == 1))
562- then $acc164206451
563- else {
564- let $acc264206451 = isSymbolH($acc164206451, $list64206451[1])
565- if (($size64206451 == 2))
566- then $acc264206451
567- else {
568- let $acc364206451 = isSymbolH($acc264206451, $list64206451[2])
569- if (($size64206451 == 3))
570- then $acc364206451
571- else {
572- let $acc464206451 = isSymbolH($acc364206451, $list64206451[3])
573- if (($size64206451 == 4))
574- then $acc464206451
575- else {
576- let $acc564206451 = isSymbolH($acc464206451, $list64206451[4])
577- if (($size64206451 == 5))
578- then $acc564206451
579- else {
580- let $acc664206451 = isSymbolH($acc564206451, $list64206451[5])
581- if (($size64206451 == 6))
582- then $acc664206451
583- else {
584- let $acc764206451 = isSymbolH($acc664206451, $list64206451[6])
585- if (($size64206451 == 7))
586- then $acc764206451
587- else {
588- let $acc864206451 = isSymbolH($acc764206451, $list64206451[7])
589- if (($size64206451 == 8))
590- then $acc864206451
591- else {
592- let $acc964206451 = isSymbolH($acc864206451, $list64206451[8])
593- throw("List size exceed 8")
594- }
595- }
596- }
597- }
598- }
599- }
600- }
601- }
602- }
603- }) + "H")))
604- }
605-
606-
607-func getAssetOrigin (generation) = if ((generation == "G"))
608- then incubatorAddress
609- else breederAddress
610-
611-
612-func getAssetRarity (assetId) = if (if ((value(assetInfo(assetId)).issuer == Address(breederAddress)))
613- then true
614- else (value(assetInfo(assetId)).issuer == Address(incubatorAddress)))
615- then {
616- let assetName = value(assetInfo(assetId)).name
617- let generation = take(takeRight(assetName, 2), 1)
618- let gen = ((getGen(assetName) + "-") + generation)
619- let quantity = getIntegerValue(Address(getAssetOrigin(generation)), (("stats_" + gen) + "_quantity"))
620- let power = pow((10000 / quantity), 4, 5, 1, 2, FLOOR)
621- if ((power > 0))
622- then power
623- else 2
624- }
625- else throw("not valid NFT")
164+func checkDuckOwner (ownerAddress,assetId) = (assetBalance(ownerAddress, assetId) > 0)
626165
627166
628167 func getScore (a,b) = if ((a > b))
629168 then 1
630169 else if ((b > a))
631170 then -1
632171 else 0
633172
634173
635174 func getWinner (gameId) = {
636175 let gameStep = getStep(gameId)
637176 if ((6 > gameStep))
638177 then {
639178 let expirationHeight = getExpirationHeight(gameId)
640179 if ((expirationHeight == 0))
641180 then throw("Game is not started")
642181 else if ((expirationHeight > height))
643182 then throw("Game is not finished or expired")
644183 else if (((getStep(gameId) % 2) == 0))
645184 then "maker"
646185 else "taker"
647186 }
648187 else {
649188 let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",")
650189 let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",")
651190 let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0])
652191 let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1])
653192 let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2])
654193 let takerRarity1 = getRarity(gameId, "taker", takerDuckOrder[0])
655194 let takerRarity2 = getRarity(gameId, "taker", takerDuckOrder[1])
656195 let takerRarity3 = getRarity(gameId, "taker", takerDuckOrder[2])
657196 let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3))
658197 if ((makerScore > 0))
659198 then "maker"
660199 else if ((0 > makerScore))
661200 then "taker"
662201 else "draw"
663202 }
664203 }
665204
666205
667206 @Callable(i)
668207 func makeGame (slot,rarityRangeWorst,rarityRangeMedium,rarityRangeBest) = {
669208 let callerAddress = toBase58String(i.caller.bytes)
670209 let slotGameId = getSlot(slot)
671210 let payment = value(i.payments[0])
672211 let eggs = payment.amount
673212 let gameId = getNextGameId()
674213 if ((getPlayerCurrentGame(callerAddress) != 0))
675214 then throw("You already have an active game")
676215 else if (if ((0 > slot))
677216 then true
678217 else (slot >= SLOTS))
679218 then throw("Invalid slot")
680219 else if ((slotGameId != 0))
681220 then throw("This slot is busy")
682221 else if ((payment.assetId != eggsAssetId))
683222 then throw(("You can attach only EGGs with the following asset id: " + toBase58String(eggsAssetId)))
684223 else if ((eggs != 1))
685224 then throw("Bet must be 0.01 EGG during beta test")
686225 else if (if ((1 > rarityRangeWorst))
687226 then true
688227 else (rarityRangeWorst > 5))
689228 then throw("Invalid rarity range for the worst duck")
690229 else if (if ((1 > rarityRangeMedium))
691230 then true
692231 else (rarityRangeMedium > 5))
693232 then throw("Invalid rarity range for the medium duck")
694233 else if (if ((1 > rarityRangeBest))
695234 then true
696235 else (rarityRangeBest > 5))
697236 then throw("Invalid rarity range for the best duck")
698- else if ((rarityRangeWorst >= rarityRangeMedium))
699- then throw("The medium duck must be better than the worst one")
700- else if ((rarityRangeMedium >= rarityRangeBest))
701- then throw("The best duck must be better than the medium one")
237+ else if ((rarityRangeWorst > rarityRangeMedium))
238+ then throw("The medium range can't be less than the worst one")
239+ else if ((rarityRangeMedium > rarityRangeBest))
240+ then throw("The best range can't be worse than the medium one")
702241 else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getMakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "maker"), IntegerEntry(getBetEggsKey(gameId), eggs), IntegerEntry(getRarityRangeKey(gameId, "worst"), rarityRangeWorst), IntegerEntry(getRarityRangeKey(gameId, "medium"), rarityRangeMedium), IntegerEntry(getRarityRangeKey(gameId, "best"), rarityRangeBest), IntegerEntry(getWaitingExpirationHeightKey(gameId), (height + WAITING)), IntegerEntry(getSlotKey(slot), gameId), IntegerEntry("nextGameId", (gameId + 1))]
703242 }
704243
705244
706245
707246 @Callable(i)
708247 func takeGame (slot) = {
709248 let callerAddress = toBase58String(i.caller.bytes)
710249 let gameId = getSlot(slot)
711250 let payment = value(i.payments[0])
712251 if ((getPlayerCurrentGame(callerAddress) != 0))
713252 then throw("You already have an active game")
714253 else if (if ((0 > slot))
715254 then true
716255 else (slot >= SLOTS))
717256 then throw("Invalid slot")
718257 else if ((getSlot(slot) == 0))
719258 then throw("This slot is empty")
720259 else if ((payment.assetId != eggsAssetId))
721260 then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(eggsAssetId)))
722261 else if ((payment.amount != getBetEggs(gameId)))
723262 then throw("Insufficient eggs amount")
724263 else if ((height >= getWaitingExpirationHeight(gameId)))
725264 then throw("This game is expired")
726265 else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), gameId), StringEntry(getTakerKey(gameId), callerAddress), StringEntry(getPlayerRoleKey(gameId, callerAddress), "taker"), IntegerEntry(getStepKey(gameId), 0), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), IntegerEntry(getSlotKey(slot), 0), IntegerEntry("gamesPlayed", (getGamesPlayed() + 1))]
727266 }
728267
729268
730269
731270 @Callable(i)
732271 func kickGame (slot) = {
733272 let gameId = getSlot(slot)
734273 if (if ((0 > slot))
735274 then true
736275 else (slot >= SLOTS))
737276 then throw("Invalid slot")
738277 else if ((gameId == 0))
739278 then throw("Slot is empty")
740279 else if ((getWaitingExpirationHeight(gameId) > height))
741280 then throw("Waiting is not finished yet")
742281 else {
743282 let maker = getMaker(gameId)
744283 [IntegerEntry(getPlayerCurrentGameKey(maker), 0), IntegerEntry(getSlotKey(slot), 0), ScriptTransfer(Address(fromBase58String(maker)), getBetEggs(gameId), eggsAssetId)]
745284 }
746285 }
747286
748287
749288
750289 @Callable(i)
751-func pickDucks () = {
290+func pickDucks (worstDuckId,mediumDuckId,bestDuckId) = {
752291 let callerAddress = toBase58String(i.caller.bytes)
753292 let gameId = getPlayerCurrentGame(callerAddress)
754293 let playerRole = getPlayerRole(gameId, callerAddress)
755294 let gameStep = getStep(gameId)
756295 let worstRarityRange = getRarityRange(gameId, "worst")
757296 let mediumRarityRange = getRarityRange(gameId, "medium")
758297 let bestRarityRange = getRarityRange(gameId, "best")
759- let worstDuckId = value(value(i.payments[0]).assetId)
760- let mediumDuckId = value(value(i.payments[1]).assetId)
761- let bestDuckId = value(value(i.payments[2]).assetId)
762- let worstRarity = getAssetRarity(worstDuckId)
763- let mediumRarity = getAssetRarity(mediumDuckId)
764- let bestRarity = getAssetRarity(bestDuckId)
765- if ((gameId == 0))
766- then throw("You don't have an active game")
767- else if ((getExpirationHeight(gameId) == 0))
768- then throw("Game is not started")
769- else if (if ((gameStep == 0))
770- then (playerRole != "taker")
771- else false)
772- then throw("It is the taker's turn to pick now")
773- else if (if ((gameStep == 1))
774- then (playerRole != "maker")
775- else false)
776- then throw("It is the maker's turn to pick now")
777- else if ((gameStep > 1))
778- then throw("Ducks have already been picked")
779- else if (if ((worstRarity > (worstRarityRange * 10)))
780- then true
781- else (((worstRarityRange - 1) * 10) >= worstRarity))
782- then throw("Worst duck doesn't fit rarity range")
783- else if (if ((mediumRarity > (mediumRarityRange * 10)))
784- then true
785- else (((mediumRarityRange - 1) * 10) >= mediumRarity))
786- then throw("Medium duck doesn't fit rarity range")
787- else if (if (if (if ((bestRarityRange == 5))
788- then (40 >= bestRarity)
789- else false)
790- then true
791- else (bestRarity > (bestRarityRange * 10)))
792- then true
793- else (((bestRarityRange - 1) * 10) >= bestRarity))
794- then throw("Best duck doesn't fit rarity range")
795- else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), StringEntry(getDuckIdKey(gameId, playerRole, "worst"), toBase58String(worstDuckId)), StringEntry(getDuckIdKey(gameId, playerRole, "medium"), toBase58String(mediumDuckId)), StringEntry(getDuckIdKey(gameId, playerRole, "best"), toBase58String(bestDuckId)), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration)), ScriptTransfer(i.caller, 1, worstDuckId), ScriptTransfer(i.caller, 1, mediumDuckId), ScriptTransfer(i.caller, 1, bestDuckId)]
298+ let invokeWorstRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [worstDuckId], nil)
299+ if ((invokeWorstRes == invokeWorstRes))
300+ then {
301+ let worstRarity = match invokeWorstRes {
302+ case r: Int =>
303+ r
304+ case _ =>
305+ throw("Incorrect invoke result")
306+ }
307+ let invokeMediumRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [mediumDuckId], nil)
308+ if ((invokeMediumRes == invokeMediumRes))
309+ then {
310+ let mediumRarity = match invokeMediumRes {
311+ case r: Int =>
312+ r
313+ case _ =>
314+ throw("Incorrect invoke result")
315+ }
316+ let invokeBestRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [bestDuckId], nil)
317+ if ((invokeBestRes == invokeBestRes))
318+ then {
319+ let bestRarity = match invokeWorstRes {
320+ case r: Int =>
321+ r
322+ case _ =>
323+ throw("Incorrect invoke result")
324+ }
325+ if ((gameId == 0))
326+ then throw("You don't have an active game")
327+ else if ((getExpirationHeight(gameId) == 0))
328+ then throw("Game is not started")
329+ else if (if ((gameStep == 0))
330+ then (playerRole != "taker")
331+ else false)
332+ then throw("It is the taker's turn to pick now")
333+ else if (if ((gameStep == 1))
334+ then (playerRole != "maker")
335+ else false)
336+ then throw("It is the maker's turn to pick now")
337+ else if ((gameStep > 1))
338+ then throw("Ducks have already been picked")
339+ else if (checkDuckOwner(i.caller, fromBase58String(worstDuckId)))
340+ then throw((("Asset " + worstDuckId) + " doesn't belong to you"))
341+ else if (checkDuckOwner(i.caller, fromBase58String(mediumDuckId)))
342+ then throw((("Asset " + mediumDuckId) + " doesn't belong to you"))
343+ else if (checkDuckOwner(i.caller, fromBase58String(bestDuckId)))
344+ then throw((("Asset " + bestDuckId) + " doesn't belong to you"))
345+ else if (if ((5 > worstRarityRange))
346+ then if ((worstRarity > (worstRarityRange * 10)))
347+ then true
348+ else (((worstRarityRange - 1) * 10) >= worstRarity)
349+ else false)
350+ then throw("Worst duck doesn't fit rarity range")
351+ else if (if ((5 > mediumRarityRange))
352+ then if ((mediumRarity > (mediumRarityRange * 10)))
353+ then true
354+ else (((mediumRarityRange - 1) * 10) >= mediumRarity)
355+ else false)
356+ then throw("Medium duck doesn't fit rarity range")
357+ else if (if ((5 > bestRarityRange))
358+ then if ((bestRarity > (bestRarityRange * 10)))
359+ then true
360+ else (((bestRarityRange - 1) * 10) >= bestRarity)
361+ else false)
362+ then throw("Best duck doesn't fit rarity range")
363+ else if (if ((worstRarityRange == 5))
364+ then (40 >= worstRarity)
365+ else false)
366+ then throw("Worst duck doesn't fit rarity range")
367+ else if (if ((mediumRarityRange == 5))
368+ then (40 >= mediumRarity)
369+ else false)
370+ then throw("Medium duck doesn't fit rarity range")
371+ else if (if ((bestRarityRange == 5))
372+ then (40 >= bestRarity)
373+ else false)
374+ then throw("Best duck doesn't fit rarity range")
375+ else if (if (if ((worstRarity == mediumRarity))
376+ then true
377+ else (worstRarity == bestRarity))
378+ then true
379+ else (mediumRarity == bestRarity))
380+ then throw("Ducks of the same rarity can't play")
381+ else [IntegerEntry(getRarityKey(gameId, playerRole, "worst"), worstRarity), IntegerEntry(getRarityKey(gameId, playerRole, "medium"), mediumRarity), IntegerEntry(getRarityKey(gameId, playerRole, "best"), bestRarity), StringEntry(getDuckIdKey(gameId, playerRole, "worst"), worstDuckId), StringEntry(getDuckIdKey(gameId, playerRole, "medium"), mediumDuckId), StringEntry(getDuckIdKey(gameId, playerRole, "best"), bestDuckId), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
382+ }
383+ else throw("Strict value is not equal to itself.")
384+ }
385+ else throw("Strict value is not equal to itself.")
386+ }
387+ else throw("Strict value is not equal to itself.")
796388 }
797389
798390
799391
800392 @Callable(i)
801393 func commit (hash) = {
802394 let callerAddress = toBase58String(i.caller.bytes)
803395 let gameId = getPlayerCurrentGame(callerAddress)
804396 let playerRole = getPlayerRole(gameId, callerAddress)
805397 let gameStep = getStep(gameId)
806398 if ((gameId == 0))
807399 then throw("You don't have an active game")
808400 else if ((2 > gameStep))
809401 then throw("Commit is not started")
810402 else if (if ((gameStep == 2))
811403 then (playerRole != "taker")
812404 else false)
813405 then throw("It is the taker's turn to pick now")
814406 else if (if ((gameStep == 3))
815407 then (playerRole != "maker")
816408 else false)
817409 then throw("It is the maker's turn to pick now")
818410 else if ((gameStep > 3))
819411 then throw("Commit is finished")
820412 else [StringEntry(getCommitKey(gameId, playerRole), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
821413 }
822414
823415
824416
825417 @Callable(i)
826418 func reveal (duckOrder,salt) = {
827419 let callerAddress = toBase58String(i.caller.bytes)
828420 let gameId = getPlayerCurrentGame(callerAddress)
829421 let playerRole = getPlayerRole(gameId, callerAddress)
830422 let gameStep = getStep(gameId)
831423 if ((gameId == 0))
832424 then throw("You don't have an active game")
833425 else if ((4 > gameStep))
834426 then throw("Reveal is not started")
835427 else if (if ((gameStep == 4))
836428 then (playerRole != "taker")
837429 else false)
838430 then throw("It is the taker's turn to pick now")
839431 else if (if ((gameStep == 5))
840432 then (playerRole != "maker")
841433 else false)
842434 then throw("It is the maker's turn to pick now")
843435 else if ((gameStep > 5))
844436 then throw("Reveal is finished")
845437 else if (if (if (if (if (if ((duckOrder != "worst,medium,best"))
846438 then (duckOrder != "worst,best,medium")
847439 else false)
848440 then (duckOrder != "medium,worst,best")
849441 else false)
850442 then (duckOrder != "medium,best,worst")
851443 else false)
852444 then (duckOrder != "best,worst,medium")
853445 else false)
854446 then (duckOrder != "best,medium,worst")
855447 else false)
856448 then throw("Reveal data is not valid")
857449 else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, playerRole)))
858450 then throw("Reveal doesn't match commit")
859451 else [StringEntry(getDuckOrderKey(gameId, playerRole), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))]
860452 }
861453
862454
863455
864456 @Callable(i)
865457 func getPrize () = {
866458 let callerAddress = toBase58String(i.caller.bytes)
867459 let gameId = getPlayerCurrentGame(callerAddress)
868460 let playerRole = getPlayerRole(gameId, callerAddress)
869461 let anotherPlayerAddress = if ((playerRole == "maker"))
870462 then getTaker(gameId)
871463 else getMaker(gameId)
872464 let winner = getWinner(gameId)
873465 if ((gameId == 0))
874466 then throw("You don't have an active game")
875467 else if ((winner == playerRole))
876- then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(anotherPlayerAddress), 0), IntegerEntry(getPlayerWinsKey(callerAddress), (getPlayerWins(callerAddress) + 1)), IntegerEntry(getPlayerLosesKey(anotherPlayerAddress), (getPlayerLoses(anotherPlayerAddress) + 1)), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
468+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerCurrentGameKey(anotherPlayerAddress), 0), IntegerEntry(getPlayerWinsKey(callerAddress), (getPlayerWins(callerAddress) + 1)), IntegerEntry(getPlayerLosesKey(anotherPlayerAddress), (getPlayerLoses(anotherPlayerAddress) + 1)), StringEntry(getGameResultKey(gameId, callerAddress), "win"), StringEntry(getGameResultKey(gameId, anotherPlayerAddress), "lose"), ScriptTransfer(i.caller, (getBetEggs(gameId) * 2), eggsAssetId)]
877469 else if ((winner == "draw"))
878- then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerDrawsKey(callerAddress), (getPlayerDraws(callerAddress) + 1)), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
470+ then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerDrawsKey(callerAddress), (getPlayerDraws(callerAddress) + 1)), StringEntry(getGameResultKey(gameId, callerAddress), "draw"), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)]
879471 else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0)]
880472 }
881473
882474
883475 @Verifier(tx)
884476 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
885477

github/deemru/w8io/026f985 
91.83 ms