tx · HLY34fT7CAdnkN3xqaiPyMSyrab7y5c1VcFJPrWBFiup 3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito: -0.05000000 Waves 2021.09.09 21:22 [1695865] smart account 3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito > SELF 0.00000000 Waves
{ "type": 13, "id": "HLY34fT7CAdnkN3xqaiPyMSyrab7y5c1VcFJPrWBFiup", "fee": 5000000, "feeAssetId": null, "timestamp": 1631211731581, "version": 2, "chainId": 84, "sender": "3N6oaapvYkEryHUr4vAiPRXM3iS6kMYXito", "senderPublicKey": "7PMrxEzirv6h9Z2zqLE47qrZd6v1AbRZER5Aqfo95Eyr", "proofs": [ "dXHXHrgB1f8kD7zwqitXybmSXZADdVGs5bxbWxaHUdS6o66MqEXZr4gifd5mueiQG7pTg3h7z2RS6p5wtx2q1Hv" ], "script": "base64:AAIFAAAAAAAAACgIAhIGCgQBAQEBEgMKAQESAwoBARIFCgMICAgSAwoBCBIECgIICBIAAAAANAAAAAAQaW5jdWJhdG9yQWRkcmVzcwEAAAAaAVQu1YzRxAHn1ekAzs1AJJ6xFAc06V7PK6oAAAAADmJyZWVkZXJBZGRyZXNzAQAAABoBVIXmeysidPaPsP+lKHIt9Vw8rE+lS45bjgAAAAAVcmFyaXR5UHJvdmlkZXJBZGRyZXNzAQAAABoBVPqvXAIOK77VhJOb48rzK/MJjwrn6vR1pAAAAAALZWdnc0Fzc2V0SWQBAAAAICUCZcz3BGjIvgFZkXjlWFo4ZhQTrUpMSrf+BRdIFxaDAAAAAAVTTE9UUwAAAAAAAAAACgAAAAAHV0FJVElORwAAAAAAAAAACAAAAAAMc3RlcER1cmF0aW9uAAAAAAAAAAAFAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIA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cmF3CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkBAAAACmdldEJldEVnZ3MAAAABBQAAAAZnYW1lSWQFAAAAC2VnZ3NBc3NldElkBQAAAANuaWwJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAQAAABdnZXRQbGF5ZXJDdXJyZW50R2FtZUtleQAAAAEFAAAADWNhbGxlckFkZHJlc3MAAAAAAAAAAAAFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5+JaJng==", "height": 1695865, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 36mz51n2TdDLiidgd9yAoxygkhgXpmHgjoNUcbbR4QkC Next: HZvBf2he46ZpsPp6qeahb4pUuEwCFXx1oBk4XZdWYc4W Diff:
Old | New | Differences | |
---|---|---|---|
324 | 324 | } | |
325 | 325 | if ((gameId == 0)) | |
326 | 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) | |
327 | + | else if ((worstRarity != 13)) | |
328 | + | then throw("!=13") | |
329 | + | else if ((mediumRarity != 27)) | |
330 | + | then throw("!=27") | |
331 | + | else if ((bestRarity != 37)) | |
332 | + | then throw("!=37") | |
333 | + | else if ((getExpirationHeight(gameId) == 0)) | |
334 | + | then throw("Game is not started") | |
335 | + | else if (if ((gameStep == 0)) | |
336 | + | then (playerRole != "taker") | |
337 | + | else false) | |
338 | + | then throw("It is the taker's turn to pick now") | |
339 | + | else if (if ((gameStep == 1)) | |
340 | + | then (playerRole != "maker") | |
341 | + | else false) | |
342 | + | then throw("It is the maker's turn to pick now") | |
343 | + | else if ((gameStep > 1)) | |
344 | + | then throw("Ducks have already been picked") | |
345 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(worstDuckId)))) | |
346 | + | then throw((("Asset " + worstDuckId) + " doesn't belong to you")) | |
347 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(mediumDuckId)))) | |
348 | + | then throw((("Asset " + mediumDuckId) + " doesn't belong to you")) | |
349 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(bestDuckId)))) | |
350 | + | then throw((("Asset " + bestDuckId) + " doesn't belong to you")) | |
351 | + | else if (if ((5 > worstRarityRange)) | |
352 | + | then if ((worstRarity > (worstRarityRange * 10))) | |
353 | + | then true | |
354 | + | else (((worstRarityRange - 1) * 10) >= worstRarity) | |
365 | 355 | else false) | |
366 | 356 | then throw("Worst duck doesn't fit rarity range") | |
367 | - | else if (if ((mediumRarityRange == 5)) | |
368 | - | then (40 >= mediumRarity) | |
357 | + | else if (if ((5 > mediumRarityRange)) | |
358 | + | then if ((mediumRarity > (mediumRarityRange * 10))) | |
359 | + | then true | |
360 | + | else (((mediumRarityRange - 1) * 10) >= mediumRarity) | |
369 | 361 | else false) | |
370 | 362 | then throw("Medium duck doesn't fit rarity range") | |
371 | - | else if (if ((bestRarityRange == 5)) | |
372 | - | then (40 >= bestRarity) | |
363 | + | else if (if ((5 > bestRarityRange)) | |
364 | + | then if ((bestRarity > (bestRarityRange * 10))) | |
365 | + | then true | |
366 | + | else (((bestRarityRange - 1) * 10) >= bestRarity) | |
373 | 367 | else false) | |
374 | 368 | 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))] | |
369 | + | else if (if ((worstRarityRange == 5)) | |
370 | + | then (40 >= worstRarity) | |
371 | + | else false) | |
372 | + | then throw("Worst duck doesn't fit rarity range") | |
373 | + | else if (if ((mediumRarityRange == 5)) | |
374 | + | then (40 >= mediumRarity) | |
375 | + | else false) | |
376 | + | then throw("Medium duck doesn't fit rarity range") | |
377 | + | else if (if ((bestRarityRange == 5)) | |
378 | + | then (40 >= bestRarity) | |
379 | + | else false) | |
380 | + | then throw("Best duck doesn't fit rarity range") | |
381 | + | else if (if (if ((worstRarity == mediumRarity)) | |
382 | + | then true | |
383 | + | else (worstRarity == bestRarity)) | |
384 | + | then true | |
385 | + | else (mediumRarity == bestRarity)) | |
386 | + | then throw("Ducks must have different rarities") | |
387 | + | 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 | 388 | } | |
383 | 389 | else throw("Strict value is not equal to itself.") | |
384 | 390 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let incubatorAddress = base58'3MtBigTsaeevrcJAEwVcr4quwkqcrtnjoAh' | |
5 | 5 | ||
6 | 6 | let breederAddress = base58'3N285kYUMxPi6oZsdWrxhSY34dJHyu4kRN5' | |
7 | 7 | ||
8 | 8 | let rarityProviderAddress = base58'3NCman4dCzk1HWWU4DPTr5rsbhvuUCwwUZh' | |
9 | 9 | ||
10 | 10 | let eggsAssetId = base58'3VUCuh9dWqe54SdzzNUkXhFXpc8UQynnJVh42B7MjNzN' | |
11 | 11 | ||
12 | 12 | let SLOTS = 10 | |
13 | 13 | ||
14 | 14 | let WAITING = 8 | |
15 | 15 | ||
16 | 16 | let stepDuration = 5 | |
17 | 17 | ||
18 | 18 | func tryGetInteger (key) = match getInteger(this, key) { | |
19 | 19 | case b: Int => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | 0 | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func tryGetString (key) = match getString(this, key) { | |
27 | 27 | case a: String => | |
28 | 28 | a | |
29 | 29 | case _ => | |
30 | 30 | "" | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
35 | 35 | case b: Boolean => | |
36 | 36 | b | |
37 | 37 | case _ => | |
38 | 38 | false | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getNextGameId () = { | |
43 | 43 | let nextId = tryGetInteger("nextGameId") | |
44 | 44 | if ((nextId == 0)) | |
45 | 45 | then 1 | |
46 | 46 | else nextId | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func getPlayerCurrentGameKey (playerAddress) = (playerAddress + "_currentGame") | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func getPlayerCurrentGame (playerAddress) = tryGetInteger(getPlayerCurrentGameKey(playerAddress)) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func getSlotKey (slot) = ("slot" + toString(slot)) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func getSlot (slot) = tryGetInteger(getSlotKey(slot)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func getPlayerRoleKey (gameId,playerAddress) = ((("game" + toString(gameId)) + "_") + playerAddress) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func getPlayerRole (gameId,playerAddress) = tryGetString(getPlayerRoleKey(gameId, playerAddress)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getMakerKey (gameId) = (("game" + toString(gameId)) + "_maker") | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getMaker (gameId) = tryGetString(getMakerKey(gameId)) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getTakerKey (gameId) = (("game" + toString(gameId)) + "_taker") | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getTaker (gameId) = tryGetString(getTakerKey(gameId)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getBetEggsKey (gameId) = (("game" + toString(gameId)) + "_betEggs") | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getBetEggs (gameId) = tryGetInteger(getBetEggsKey(gameId)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getWaitingExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_waitingExpirationHeight") | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getWaitingExpirationHeight (gameId) = tryGetInteger(getWaitingExpirationHeightKey(gameId)) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getExpirationHeightKey (gameId) = (("game" + toString(gameId)) + "_expirationHeight") | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getExpirationHeight (gameId) = tryGetInteger(getExpirationHeightKey(gameId)) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getRarityRangeKey (gameId,rangePosition) = ((("game" + toString(gameId)) + "_rarityRange_") + rangePosition) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getRarityRange (gameId,rangePosition) = tryGetInteger(getRarityRangeKey(gameId, rangePosition)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getStepKey (gameId) = (("game" + toString(gameId)) + "_step") | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getStep (gameId) = tryGetInteger(getStepKey(gameId)) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getRarityKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "Rarity") | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getRarity (gameId,playerRole,rangePosition) = tryGetInteger(getRarityKey(gameId, playerRole, rangePosition)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getDuckIdKey (gameId,playerRole,rangePosition) = (((((("game" + toString(gameId)) + "_") + playerRole) + "_") + rangePosition) + "DuckId") | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getDuckId (gameId,playerRole,rangePosition) = tryGetString(getDuckIdKey(gameId, playerRole, rangePosition)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getCommitKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_commit") | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getCommit (gameId,playerRole) = tryGetString(getCommitKey(gameId, playerRole)) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func getDuckOrderKey (gameId,playerRole) = (((("game" + toString(gameId)) + "_") + playerRole) + "_duckOrder") | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func getDuckOrder (gameId,playerRole) = tryGetString(getDuckOrderKey(gameId, playerRole)) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func getGameResultKey (gameId,playerAddress) = (((("game" + toString(gameId)) + "_") + playerAddress) + "_result") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func getGameResult (gameId,playerAddress) = tryGetString(getGameResultKey(gameId, playerAddress)) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getPlayerWinsKey (playerAddress) = (playerAddress + "_wins") | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getPlayerWins (playerAddress) = tryGetInteger(getPlayerWinsKey(playerAddress)) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func getPlayerLosesKey (playerAddress) = (playerAddress + "_loses") | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func getPlayerLoses (playerAddress) = tryGetInteger(getPlayerLosesKey(playerAddress)) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func getPlayerDrawsKey (playerAddress) = (playerAddress + "_draws") | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func getPlayerDraws (playerAddress) = tryGetInteger(getPlayerDrawsKey(playerAddress)) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func getGamesPlayedKey () = "gamesPlayed" | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func getGamesPlayed () = tryGetInteger(getGamesPlayedKey()) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | func checkDuckOwner (ownerAddress,assetId) = (assetBalance(ownerAddress, assetId) > 0) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func getScore (a,b) = if ((a > b)) | |
168 | 168 | then 1 | |
169 | 169 | else if ((b > a)) | |
170 | 170 | then -1 | |
171 | 171 | else 0 | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func getWinner (gameId) = { | |
175 | 175 | let gameStep = getStep(gameId) | |
176 | 176 | if ((6 > gameStep)) | |
177 | 177 | then { | |
178 | 178 | let expirationHeight = getExpirationHeight(gameId) | |
179 | 179 | if ((expirationHeight == 0)) | |
180 | 180 | then throw("Game is not started") | |
181 | 181 | else if ((expirationHeight > height)) | |
182 | 182 | then throw("Game is not finished or expired") | |
183 | 183 | else if (((getStep(gameId) % 2) == 0)) | |
184 | 184 | then "maker" | |
185 | 185 | else "taker" | |
186 | 186 | } | |
187 | 187 | else { | |
188 | 188 | let makerDuckOrder = split(getDuckOrder(gameId, "maker"), ",") | |
189 | 189 | let takerDuckOrder = split(getDuckOrder(gameId, "taker"), ",") | |
190 | 190 | let makerRarity1 = getRarity(gameId, "maker", makerDuckOrder[0]) | |
191 | 191 | let makerRarity2 = getRarity(gameId, "maker", makerDuckOrder[1]) | |
192 | 192 | let makerRarity3 = getRarity(gameId, "maker", makerDuckOrder[2]) | |
193 | 193 | let takerRarity1 = getRarity(gameId, "taker", takerDuckOrder[0]) | |
194 | 194 | let takerRarity2 = getRarity(gameId, "taker", takerDuckOrder[1]) | |
195 | 195 | let takerRarity3 = getRarity(gameId, "taker", takerDuckOrder[2]) | |
196 | 196 | let makerScore = ((getScore(makerRarity1, takerRarity1) + getScore(makerRarity2, takerRarity2)) + getScore(makerRarity3, takerRarity3)) | |
197 | 197 | if ((makerScore > 0)) | |
198 | 198 | then "maker" | |
199 | 199 | else if ((0 > makerScore)) | |
200 | 200 | then "taker" | |
201 | 201 | else "draw" | |
202 | 202 | } | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | @Callable(i) | |
207 | 207 | func makeGame (slot,rarityRangeWorst,rarityRangeMedium,rarityRangeBest) = { | |
208 | 208 | let callerAddress = toBase58String(i.caller.bytes) | |
209 | 209 | let slotGameId = getSlot(slot) | |
210 | 210 | let payment = value(i.payments[0]) | |
211 | 211 | let eggs = payment.amount | |
212 | 212 | let gameId = getNextGameId() | |
213 | 213 | if ((getPlayerCurrentGame(callerAddress) != 0)) | |
214 | 214 | then throw("You already have an active game") | |
215 | 215 | else if (if ((0 > slot)) | |
216 | 216 | then true | |
217 | 217 | else (slot >= SLOTS)) | |
218 | 218 | then throw("Invalid slot") | |
219 | 219 | else if ((slotGameId != 0)) | |
220 | 220 | then throw("This slot is busy") | |
221 | 221 | else if ((payment.assetId != eggsAssetId)) | |
222 | 222 | then throw(("You can attach only EGGs with the following asset id: " + toBase58String(eggsAssetId))) | |
223 | 223 | else if ((eggs != 1)) | |
224 | 224 | then throw("Bet must be 0.01 EGG during beta test") | |
225 | 225 | else if (if ((1 > rarityRangeWorst)) | |
226 | 226 | then true | |
227 | 227 | else (rarityRangeWorst > 5)) | |
228 | 228 | then throw("Invalid rarity range for the worst duck") | |
229 | 229 | else if (if ((1 > rarityRangeMedium)) | |
230 | 230 | then true | |
231 | 231 | else (rarityRangeMedium > 5)) | |
232 | 232 | then throw("Invalid rarity range for the medium duck") | |
233 | 233 | else if (if ((1 > rarityRangeBest)) | |
234 | 234 | then true | |
235 | 235 | else (rarityRangeBest > 5)) | |
236 | 236 | then throw("Invalid rarity range for the best duck") | |
237 | 237 | else if ((rarityRangeWorst > rarityRangeMedium)) | |
238 | 238 | then throw("The medium range can't be less than the worst one") | |
239 | 239 | else if ((rarityRangeMedium > rarityRangeBest)) | |
240 | 240 | then throw("The best range can't be worse than the medium one") | |
241 | 241 | 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))] | |
242 | 242 | } | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | ||
246 | 246 | @Callable(i) | |
247 | 247 | func takeGame (slot) = { | |
248 | 248 | let callerAddress = toBase58String(i.caller.bytes) | |
249 | 249 | let gameId = getSlot(slot) | |
250 | 250 | let payment = value(i.payments[0]) | |
251 | 251 | if ((getPlayerCurrentGame(callerAddress) != 0)) | |
252 | 252 | then throw("You already have an active game") | |
253 | 253 | else if (if ((0 > slot)) | |
254 | 254 | then true | |
255 | 255 | else (slot >= SLOTS)) | |
256 | 256 | then throw("Invalid slot") | |
257 | 257 | else if ((getSlot(slot) == 0)) | |
258 | 258 | then throw("This slot is empty") | |
259 | 259 | else if ((payment.assetId != eggsAssetId)) | |
260 | 260 | then throw(("You can attach only EGG tokens with the following asset id: " + toBase58String(eggsAssetId))) | |
261 | 261 | else if ((payment.amount != getBetEggs(gameId))) | |
262 | 262 | then throw("Insufficient eggs amount") | |
263 | 263 | else if ((height >= getWaitingExpirationHeight(gameId))) | |
264 | 264 | then throw("This game is expired") | |
265 | 265 | 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))] | |
266 | 266 | } | |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | 270 | @Callable(i) | |
271 | 271 | func kickGame (slot) = { | |
272 | 272 | let gameId = getSlot(slot) | |
273 | 273 | if (if ((0 > slot)) | |
274 | 274 | then true | |
275 | 275 | else (slot >= SLOTS)) | |
276 | 276 | then throw("Invalid slot") | |
277 | 277 | else if ((gameId == 0)) | |
278 | 278 | then throw("Slot is empty") | |
279 | 279 | else if ((getWaitingExpirationHeight(gameId) > height)) | |
280 | 280 | then throw("Waiting is not finished yet") | |
281 | 281 | else { | |
282 | 282 | let maker = getMaker(gameId) | |
283 | 283 | [IntegerEntry(getPlayerCurrentGameKey(maker), 0), IntegerEntry(getSlotKey(slot), 0), ScriptTransfer(Address(fromBase58String(maker)), getBetEggs(gameId), eggsAssetId)] | |
284 | 284 | } | |
285 | 285 | } | |
286 | 286 | ||
287 | 287 | ||
288 | 288 | ||
289 | 289 | @Callable(i) | |
290 | 290 | func pickDucks (worstDuckId,mediumDuckId,bestDuckId) = { | |
291 | 291 | let callerAddress = toBase58String(i.caller.bytes) | |
292 | 292 | let gameId = getPlayerCurrentGame(callerAddress) | |
293 | 293 | let playerRole = getPlayerRole(gameId, callerAddress) | |
294 | 294 | let gameStep = getStep(gameId) | |
295 | 295 | let worstRarityRange = getRarityRange(gameId, "worst") | |
296 | 296 | let mediumRarityRange = getRarityRange(gameId, "medium") | |
297 | 297 | let bestRarityRange = getRarityRange(gameId, "best") | |
298 | 298 | let invokeWorstRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [worstDuckId], nil) | |
299 | 299 | if ((invokeWorstRes == invokeWorstRes)) | |
300 | 300 | then { | |
301 | 301 | let worstRarity = match invokeWorstRes { | |
302 | 302 | case r: Int => | |
303 | 303 | r | |
304 | 304 | case _ => | |
305 | 305 | throw("Incorrect invoke result") | |
306 | 306 | } | |
307 | 307 | let invokeMediumRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [mediumDuckId], nil) | |
308 | 308 | if ((invokeMediumRes == invokeMediumRes)) | |
309 | 309 | then { | |
310 | 310 | let mediumRarity = match invokeMediumRes { | |
311 | 311 | case r: Int => | |
312 | 312 | r | |
313 | 313 | case _ => | |
314 | 314 | throw("Incorrect invoke result") | |
315 | 315 | } | |
316 | 316 | let invokeBestRes = invoke(Address(rarityProviderAddress), "getAssetRarity", [bestDuckId], nil) | |
317 | 317 | if ((invokeBestRes == invokeBestRes)) | |
318 | 318 | then { | |
319 | 319 | let bestRarity = match invokeWorstRes { | |
320 | 320 | case r: Int => | |
321 | 321 | r | |
322 | 322 | case _ => | |
323 | 323 | throw("Incorrect invoke result") | |
324 | 324 | } | |
325 | 325 | if ((gameId == 0)) | |
326 | 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) | |
327 | + | else if ((worstRarity != 13)) | |
328 | + | then throw("!=13") | |
329 | + | else if ((mediumRarity != 27)) | |
330 | + | then throw("!=27") | |
331 | + | else if ((bestRarity != 37)) | |
332 | + | then throw("!=37") | |
333 | + | else if ((getExpirationHeight(gameId) == 0)) | |
334 | + | then throw("Game is not started") | |
335 | + | else if (if ((gameStep == 0)) | |
336 | + | then (playerRole != "taker") | |
337 | + | else false) | |
338 | + | then throw("It is the taker's turn to pick now") | |
339 | + | else if (if ((gameStep == 1)) | |
340 | + | then (playerRole != "maker") | |
341 | + | else false) | |
342 | + | then throw("It is the maker's turn to pick now") | |
343 | + | else if ((gameStep > 1)) | |
344 | + | then throw("Ducks have already been picked") | |
345 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(worstDuckId)))) | |
346 | + | then throw((("Asset " + worstDuckId) + " doesn't belong to you")) | |
347 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(mediumDuckId)))) | |
348 | + | then throw((("Asset " + mediumDuckId) + " doesn't belong to you")) | |
349 | + | else if (!(checkDuckOwner(i.caller, fromBase58String(bestDuckId)))) | |
350 | + | then throw((("Asset " + bestDuckId) + " doesn't belong to you")) | |
351 | + | else if (if ((5 > worstRarityRange)) | |
352 | + | then if ((worstRarity > (worstRarityRange * 10))) | |
353 | + | then true | |
354 | + | else (((worstRarityRange - 1) * 10) >= worstRarity) | |
365 | 355 | else false) | |
366 | 356 | then throw("Worst duck doesn't fit rarity range") | |
367 | - | else if (if ((mediumRarityRange == 5)) | |
368 | - | then (40 >= mediumRarity) | |
357 | + | else if (if ((5 > mediumRarityRange)) | |
358 | + | then if ((mediumRarity > (mediumRarityRange * 10))) | |
359 | + | then true | |
360 | + | else (((mediumRarityRange - 1) * 10) >= mediumRarity) | |
369 | 361 | else false) | |
370 | 362 | then throw("Medium duck doesn't fit rarity range") | |
371 | - | else if (if ((bestRarityRange == 5)) | |
372 | - | then (40 >= bestRarity) | |
363 | + | else if (if ((5 > bestRarityRange)) | |
364 | + | then if ((bestRarity > (bestRarityRange * 10))) | |
365 | + | then true | |
366 | + | else (((bestRarityRange - 1) * 10) >= bestRarity) | |
373 | 367 | else false) | |
374 | 368 | 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))] | |
369 | + | else if (if ((worstRarityRange == 5)) | |
370 | + | then (40 >= worstRarity) | |
371 | + | else false) | |
372 | + | then throw("Worst duck doesn't fit rarity range") | |
373 | + | else if (if ((mediumRarityRange == 5)) | |
374 | + | then (40 >= mediumRarity) | |
375 | + | else false) | |
376 | + | then throw("Medium duck doesn't fit rarity range") | |
377 | + | else if (if ((bestRarityRange == 5)) | |
378 | + | then (40 >= bestRarity) | |
379 | + | else false) | |
380 | + | then throw("Best duck doesn't fit rarity range") | |
381 | + | else if (if (if ((worstRarity == mediumRarity)) | |
382 | + | then true | |
383 | + | else (worstRarity == bestRarity)) | |
384 | + | then true | |
385 | + | else (mediumRarity == bestRarity)) | |
386 | + | then throw("Ducks must have different rarities") | |
387 | + | 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 | 388 | } | |
383 | 389 | else throw("Strict value is not equal to itself.") | |
384 | 390 | } | |
385 | 391 | else throw("Strict value is not equal to itself.") | |
386 | 392 | } | |
387 | 393 | else throw("Strict value is not equal to itself.") | |
388 | 394 | } | |
389 | 395 | ||
390 | 396 | ||
391 | 397 | ||
392 | 398 | @Callable(i) | |
393 | 399 | func commit (hash) = { | |
394 | 400 | let callerAddress = toBase58String(i.caller.bytes) | |
395 | 401 | let gameId = getPlayerCurrentGame(callerAddress) | |
396 | 402 | let playerRole = getPlayerRole(gameId, callerAddress) | |
397 | 403 | let gameStep = getStep(gameId) | |
398 | 404 | if ((gameId == 0)) | |
399 | 405 | then throw("You don't have an active game") | |
400 | 406 | else if ((2 > gameStep)) | |
401 | 407 | then throw("Commit is not started") | |
402 | 408 | else if (if ((gameStep == 2)) | |
403 | 409 | then (playerRole != "taker") | |
404 | 410 | else false) | |
405 | 411 | then throw("It is the taker's turn to pick now") | |
406 | 412 | else if (if ((gameStep == 3)) | |
407 | 413 | then (playerRole != "maker") | |
408 | 414 | else false) | |
409 | 415 | then throw("It is the maker's turn to pick now") | |
410 | 416 | else if ((gameStep > 3)) | |
411 | 417 | then throw("Commit is finished") | |
412 | 418 | else [StringEntry(getCommitKey(gameId, playerRole), hash), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))] | |
413 | 419 | } | |
414 | 420 | ||
415 | 421 | ||
416 | 422 | ||
417 | 423 | @Callable(i) | |
418 | 424 | func reveal (duckOrder,salt) = { | |
419 | 425 | let callerAddress = toBase58String(i.caller.bytes) | |
420 | 426 | let gameId = getPlayerCurrentGame(callerAddress) | |
421 | 427 | let playerRole = getPlayerRole(gameId, callerAddress) | |
422 | 428 | let gameStep = getStep(gameId) | |
423 | 429 | if ((gameId == 0)) | |
424 | 430 | then throw("You don't have an active game") | |
425 | 431 | else if ((4 > gameStep)) | |
426 | 432 | then throw("Reveal is not started") | |
427 | 433 | else if (if ((gameStep == 4)) | |
428 | 434 | then (playerRole != "taker") | |
429 | 435 | else false) | |
430 | 436 | then throw("It is the taker's turn to pick now") | |
431 | 437 | else if (if ((gameStep == 5)) | |
432 | 438 | then (playerRole != "maker") | |
433 | 439 | else false) | |
434 | 440 | then throw("It is the maker's turn to pick now") | |
435 | 441 | else if ((gameStep > 5)) | |
436 | 442 | then throw("Reveal is finished") | |
437 | 443 | else if (if (if (if (if (if ((duckOrder != "worst,medium,best")) | |
438 | 444 | then (duckOrder != "worst,best,medium") | |
439 | 445 | else false) | |
440 | 446 | then (duckOrder != "medium,worst,best") | |
441 | 447 | else false) | |
442 | 448 | then (duckOrder != "medium,best,worst") | |
443 | 449 | else false) | |
444 | 450 | then (duckOrder != "best,worst,medium") | |
445 | 451 | else false) | |
446 | 452 | then (duckOrder != "best,medium,worst") | |
447 | 453 | else false) | |
448 | 454 | then throw("Reveal data is not valid") | |
449 | 455 | else if ((toBase58String(sha256(toBytes((duckOrder + salt)))) != getCommit(gameId, playerRole))) | |
450 | 456 | then throw("Reveal doesn't match commit") | |
451 | 457 | else [StringEntry(getDuckOrderKey(gameId, playerRole), duckOrder), IntegerEntry(getStepKey(gameId), (gameStep + 1)), IntegerEntry(getExpirationHeightKey(gameId), (height + stepDuration))] | |
452 | 458 | } | |
453 | 459 | ||
454 | 460 | ||
455 | 461 | ||
456 | 462 | @Callable(i) | |
457 | 463 | func getPrize () = { | |
458 | 464 | let callerAddress = toBase58String(i.caller.bytes) | |
459 | 465 | let gameId = getPlayerCurrentGame(callerAddress) | |
460 | 466 | let playerRole = getPlayerRole(gameId, callerAddress) | |
461 | 467 | let anotherPlayerAddress = if ((playerRole == "maker")) | |
462 | 468 | then getTaker(gameId) | |
463 | 469 | else getMaker(gameId) | |
464 | 470 | let winner = getWinner(gameId) | |
465 | 471 | if ((gameId == 0)) | |
466 | 472 | then throw("You don't have an active game") | |
467 | 473 | else if ((winner == playerRole)) | |
468 | 474 | 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)] | |
469 | 475 | else if ((winner == "draw")) | |
470 | 476 | then [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0), IntegerEntry(getPlayerDrawsKey(callerAddress), (getPlayerDraws(callerAddress) + 1)), StringEntry(getGameResultKey(gameId, callerAddress), "draw"), ScriptTransfer(i.caller, getBetEggs(gameId), eggsAssetId)] | |
471 | 477 | else [IntegerEntry(getPlayerCurrentGameKey(callerAddress), 0)] | |
472 | 478 | } | |
473 | 479 | ||
474 | 480 | ||
475 | 481 | @Verifier(tx) | |
476 | 482 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
477 | 483 |
github/deemru/w8io/026f985 58.56 ms ◑