tx · qMVN2FegXccAQ1cEi8DV5Gem5DxmPUYug7AGf9wT9DQ

3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ:  -0.01800000 Waves

2023.12.18 21:54 [2892549] smart account 3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ > SELF 0.00000000 Waves

{ "type": 13, "id": "qMVN2FegXccAQ1cEi8DV5Gem5DxmPUYug7AGf9wT9DQ", "fee": 1800000, "feeAssetId": null, "timestamp": 1702925756874, "version": 2, "chainId": 84, "sender": "3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ", "senderPublicKey": "CQoe8BRHR78TuPQLcK3Ykv39w9CeNLhjKdj6TNbJ5FrM", "proofs": [ "49YDD9ZSbS3NGQEB299EZu4pPhooqi3X5sbYd1fTQ4AJhtqBZgU1sGoAaXKT27SAZJNq1xwVUyZkuohQv1yPwSra" ], "script": "base64:BgIaCAISBgoECAgBCBIDCgEEEgMKAQgSBAoCCAJJAANTRVACAl9fAAdXQVZFU0lEAQQTq9kzAAZXQVZFU0QAgMLXLwAJR0FNRV9OQU1FAglYbWFzIFRyZWUADFJBTkRPTV9SQU5HRQAFAAhOVU1fQkVUUwABAA9NQVhfREVDT1JBVElPTlMAHAEMZ2V0U3RyT3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFB2FkZHJlc3MFA2tleQkAuQkCCQDMCAICCm1hbmRhdG9yeSAJAMwIAgkApQgBBQdhZGRyZXNzCQDMCAICAS4JAMwIAgUDa2V5CQDMCAICDyBpcyBub3QgZGVmaW5lZAUDbmlsAgABDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZ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cgIFAiRhCQCRAwIFAiRsBQIkaQoBBSRmMF8yAgIkYQIkaQMJAGcCBQIkaQUCJHMFAiRhCQACAQIUTGlzdCBzaXplIGV4Y2VlZHMgMTAJAQUkZjBfMgIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgMJAAECBQckbWF0Y2gwAhdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQDaXR4BQckbWF0Y2gwAwkAAAIIBQNpdHgEZEFwcAUEdGhpcwkAAAIIBQNpdHgIZnVuY3Rpb24CDWNvbnN0cnVjdG9yVjEHBwfI/IwG", "height": 2892549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DCyTDtDgSRnL2Sgkvcg3ikUrNe6z5QkA6aFRBPiYG9CP Next: none Diff:
OldNewDifferences
276276 let mx14 = ((top[1] + bottom[1]) * HALF)
277277 let h4 = ((bottom[2] - top[2]) * M4)
278278 let my4 = ((top[2] + bottom[2]) * HALF)
279- let randX4 = (mx04 + (toInt(sha256((rsaSign + toBytes(j)))) % (mx14 - mx04)))
280- let randY4 = ((top[2] * M4) + (toInt(sha256((rsaSign + toBytes(randX4)))) % h4))
279+ let xy4 = (toInt(sha256((rsaSign + toBytes(j)))) % areas[j])
280+ let width4 = (mx14 - mx04)
281+ let randX4 = (mx04 + (xy4 % width4))
282+ let randY4 = ((top[2] * M4) + fraction(xy4, M4, width4))
281283 let a4 = ((top[2] * M4) - randY4)
282284 let b4 = ((bottom[2] * M4) - randY4)
283285 let x04 = fraction(((top[0] * b4) - (bottom[0] * a4)), M4, h4)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let WAVESID = base58'WAVES'
77
88 let WAVESD = 100000000
99
1010 let GAME_NAME = "Xmas Tree"
1111
1212 let RANDOM_RANGE = 5
1313
1414 let NUM_BETS = 1
1515
1616 let MAX_DECORATIONS = 28
1717
1818 func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
1919
2020
2121 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2222
2323
2424 func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
2525
2626
2727 let allowedAssetsKey = "%s%s__cfg__allowedAssets"
2828
2929 let assetsDecimalsKey = "%s%s__cfg__assetsDecimals"
3030
3131 let betDividersKey = "%s%s__cfg__assetsBetDividers"
3232
3333 let RSAPUBLIC64KEY = "%s%s__cfg__rsaPublic64"
3434
3535 let SERVERADDRESSKEY = "%s%s__cfg__benzAddress"
3636
3737 let RANDTIMEFRAMEKEY = "%s%s__cfg__withdrawTimeFrame"
3838
3939 let GAMESCOUNTERKEY = "%s%s__runtime__gameNum"
4040
4141 let blockedKey = "%s%s__runtime__contractIsBlocked"
4242
4343 let reservedAmountsKey = "%s%s__runtime__reservedAmounts"
4444
4545 let historyKey = "%s%s__runtime__decorationsHistory"
4646
4747 func getIntArray (key) = {
4848 let a = getStrOrFail(this, key)
4949 func filler (acc,el) = (acc :+ parseIntValue(el))
5050
5151 let $l = split(a, SEP)
5252 let $s = size($l)
5353 let $acc0 = nil
5454 func $f0_1 ($a,$i) = if (($i >= $s))
5555 then $a
5656 else filler($a, $l[$i])
5757
5858 func $f0_2 ($a,$i) = if (($i >= $s))
5959 then $a
6060 else throw("List size exceeds 10")
6161
6262 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
6363 }
6464
6565
6666 let ASSETS = split(getStrOrFail(this, allowedAssetsKey), SEP)
6767
6868 let DECIMALS = getIntArray(assetsDecimalsKey)
6969
7070 let BETDIVIDERS = getIntArray(betDividersKey)
7171
7272 func keyReservationByAssetStr (assetStr) = ("$RESERVED_AMOUNT_" + assetStr)
7373
7474
7575 func keyReservationByAssetIdx (assetIdx) = keyReservationByAssetStr(ASSETS[assetIdx])
7676
7777
7878 let MINFEEWAVES = ((5 * WAVESD) / 1000)
7979
8080 let idxAssets = 0
8181
8282 let idxDecimals = 1
8383
8484 let idxDividers = 2
8585
8686 let BET1 = 1
8787
8888 let BET2 = 2
8989
9090 let BET4 = 4
9191
9292 let BET8 = 8
9393
9494 let BET14 = 14
9595
9696 let RATEMULT = 10000
9797
9898 let RATE = 30000
9999
100100 let BETS = [BET2]
101101
102102 let IdxGameState = 0
103103
104104 let IdxPlayerChoice = 1
105105
106106 let IdxPlayerPubKey58 = 2
107107
108108 let IdxStartedHeight = 3
109109
110110 let IdxWinAmount = 4
111111
112112 let IdxAssetId = 5
113113
114114 let STATESUBMITTED = "SUBMITTED"
115115
116116 let STATEWON = "WON"
117117
118118 let STATELOST = "LOST"
119119
120120 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " key is not specified in this.state"))
121121
122122
123123 let RSAPUBLIC = fromBase64String(getStringOrFail(RSAPUBLIC64KEY))
124124
125125 let SERVER = addressFromStringValue(getStringOrFail(SERVERADDRESSKEY))
126126
127127 let RANDORACLETIMEFRAME = valueOrElse(getInteger(this, RANDTIMEFRAMEKEY), 7200)
128128
129129 func getIntOr (key,default) = if (isDefined(getInteger(key)))
130130 then getIntegerValue(key)
131131 else default
132132
133133
134134 func setInt (key,value) = IntegerEntry(key, value)
135135
136136
137137 func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1))
138138
139139
140140 func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by))
141141
142142
143143 func assetIdToStr (assetIdOrUnit) = match assetIdOrUnit {
144144 case b: ByteVector =>
145145 toBase58String(b)
146146 case _ =>
147147 "WAVES"
148148 }
149149
150150
151151 func assetIdFromStr (assetIdStr) = if ((assetIdStr == "WAVES"))
152152 then unit
153153 else fromBase58String(assetIdStr)
154154
155155
156156 func getAssetBalance (assetIdOrUnit) = match assetIdOrUnit {
157157 case assetId: ByteVector =>
158158 assetBalance(this, assetId)
159159 case _ =>
160160 wavesBalance(this).available
161161 }
162162
163163
164164 func increaseReserveAmount (winAmount,assetIdx) = {
165165 let assetIdStr = ASSETS[assetIdx]
166166 let newReservedAmount = (getIntOr(keyReservationByAssetIdx(assetIdx), 0) + winAmount)
167167 if ((newReservedAmount > getAssetBalance(assetIdFromStr(assetIdStr))))
168168 then throw((("Insufficient funds on " + GAME_NAME) + " account. Transaction was rejected for your safety."))
169169 else newReservedAmount
170170 }
171171
172172
173173 func decreaseReservedAmount (gameId,assetIdx,winAmount) = if ((0 > (getIntOr(keyReservationByAssetIdx(assetIdx), 0) - winAmount)))
174174 then throw((("Invalid " + GAME_NAME) + " account state - reserved amount is less than 0"))
175175 else changeInt(keyReservationByAssetIdx(assetIdx), -(winAmount))
176176
177177
178178 func validateAndGetAssetIdx (assetIdStr) = {
179179 let idx = indexOf(ASSETS, assetIdStr)
180180 if (!(isDefined(idx)))
181181 then throw("Invalid payment asset")
182182 else value(idx)
183183 }
184184
185185
186186 func validateBetAndGetWinAmount (bet,internalAssetIdx,playerChoice) = {
187187 let dicesCount = size(playerChoice)
188188 func checkAmount (a,x) = if (a)
189189 then true
190190 else (bet == ((x * DECIMALS[internalAssetIdx]) / BETDIVIDERS[internalAssetIdx]))
191191
192192 if (!({
193193 let $l = BETS
194194 let $s = size($l)
195195 let $acc0 = false
196196 func $f0_1 ($a,$i) = if (($i >= $s))
197197 then $a
198198 else checkAmount($a, $l[$i])
199199
200200 func $f0_2 ($a,$i) = if (($i >= $s))
201201 then $a
202202 else throw("List size exceeds 5")
203203
204204 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
205205 }))
206206 then throw("Bet amount is not valid")
207207 else if ((parseInt(playerChoice) == unit))
208208 then throw("Invalid player's choice")
209209 else if ((dicesCount != NUM_BETS))
210210 then throw("Invalid length of player's choice")
211211 else fraction(bet, RATE, RATEMULT)
212212 }
213213
214214
215215 let HOR_LINES = [[491, 506, 44], [455, 542, 120], [404, 596, 166], [441, 556, 177], [387, 620, 232], [423, 620, 232], [410, 592, 244], [329, 665, 321], [370, 666, 337], [355, 645, 349], [313, 692, 384], [289, 682, 405], [324, 657, 461], [450, 575, 525], [505, 505, 532]]
216216
217217 let HALF = 5000
218218
219219 let M4 = 10000
220220
221221 func getCoords (gameId,rsaSign) = {
222222 func calcAreas (acc,ignored) = {
223223 let i = acc._3
224224 if ((i == 14))
225225 then acc
226226 else {
227227 let top = HOR_LINES[i]
228228 let bottom = HOR_LINES[(i + 1)]
229229 let area4 = (((((top[1] - top[0]) + bottom[1]) - bottom[0]) * (bottom[2] - top[2])) * 5000)
230230 $Tuple3((acc._1 :+ area4), (acc._2 + area4), (acc._3 + 1))
231231 }
232232 }
233233
234234 let $t080588125 = {
235235 let $l = HOR_LINES
236236 let $s = size($l)
237237 let $acc0 = $Tuple3(nil, 0, 0)
238238 func $f0_1 ($a,$i) = if (($i >= $s))
239239 then $a
240240 else calcAreas($a, $l[$i])
241241
242242 func $f0_2 ($a,$i) = if (($i >= $s))
243243 then $a
244244 else throw("List size exceeds 15")
245245
246246 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
247247 }
248248 let areas = $t080588125._1
249249 let totalArea = $t080588125._2
250250 let rand = (toInt(sha256((rsaSign + toBytes(gameId)))) % totalArea)
251251 func check (acc,area) = {
252252 let i = acc._1
253253 let newArea = (acc._2 + area)
254254 $Tuple3((i + 1), newArea, if (if ((0 > acc._3))
255255 then (newArea > rand)
256256 else false)
257257 then i
258258 else acc._3)
259259 }
260260
261261 let j = ( let $l = areas
262262 let $s = size($l)
263263 let $acc0 = $Tuple3(0, 0, -1)
264264 func $f1_1 ($a,$i) = if (($i >= $s))
265265 then $a
266266 else check($a, $l[$i])
267267
268268 func $f1_2 ($a,$i) = if (($i >= $s))
269269 then $a
270270 else throw("List size exceeds 14")
271271
272272 $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14))._3
273273 let top = HOR_LINES[j]
274274 let bottom = HOR_LINES[(j + 1)]
275275 let mx04 = ((top[0] + bottom[0]) * HALF)
276276 let mx14 = ((top[1] + bottom[1]) * HALF)
277277 let h4 = ((bottom[2] - top[2]) * M4)
278278 let my4 = ((top[2] + bottom[2]) * HALF)
279- let randX4 = (mx04 + (toInt(sha256((rsaSign + toBytes(j)))) % (mx14 - mx04)))
280- let randY4 = ((top[2] * M4) + (toInt(sha256((rsaSign + toBytes(randX4)))) % h4))
279+ let xy4 = (toInt(sha256((rsaSign + toBytes(j)))) % areas[j])
280+ let width4 = (mx14 - mx04)
281+ let randX4 = (mx04 + (xy4 % width4))
282+ let randY4 = ((top[2] * M4) + fraction(xy4, M4, width4))
281283 let a4 = ((top[2] * M4) - randY4)
282284 let b4 = ((bottom[2] * M4) - randY4)
283285 let x04 = fraction(((top[0] * b4) - (bottom[0] * a4)), M4, h4)
284286 let x14 = fraction(((top[1] * b4) - (bottom[1] * a4)), M4, h4)
285287 if ((x04 > randX4))
286288 then [((2 * mx04) - randX4), ((2 * my4) - randY4)]
287289 else if ((randX4 > x14))
288290 then [((2 * mx14) - randX4), ((2 * my4) - randY4)]
289291 else [randX4, randY4]
290292 }
291293
292294
293295 func getDecorationIndex (gameId,rsaSign) = (toInt(sha256((toBytes(gameId) + rsaSign))) % MAX_DECORATIONS)
294296
295297
296298 func generateRandChoice (gameId,rsaSign) = {
297299 let rsaSigValid = rsaVerify_16Kb(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
298300 if (!(rsaSigValid))
299301 then throw("Invalid RSA signature")
300302 else {
301303 let rand = (toInt(sha256(rsaSign)) % RANDOM_RANGE)
302304 toString((rand + 1))
303305 }
304306 }
305307
306308
307309 func isPlayerWin (playerChoice,randChoise) = {
308310 let s = size(playerChoice)
309311 func check (a,x) = if (a)
310312 then true
311313 else if ((s >= x))
312314 then (take(drop(playerChoice, (x - 1)), 1) == randChoise)
313315 else false
314316
315317 let $l = [1, 2, 3, 4, 5]
316318 let $s = size($l)
317319 let $acc0 = false
318320 func $f0_1 ($a,$i) = if (($i >= $s))
319321 then $a
320322 else check($a, $l[$i])
321323
322324 func $f0_2 ($a,$i) = if (($i >= $s))
323325 then $a
324326 else throw("List size exceeds 5")
325327
326328 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
327329 }
328330
329331
330332 func formatGameDataS (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty,xCoord,yCoord,prizeIndex) = makeString([gameStatus, playerChoice, playerPubKey58, startedHeight, winAmount, assetIdx, if ((randOrEmpty == ""))
331333 then ""
332334 else randOrEmpty, xCoord, yCoord, prizeIndex], "_")
333335
334336
335337 func formatGameData (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty,xCoord,yCoord,prizeIndex) = formatGameDataS(gameStatus, playerChoice, playerPubKey58, toString(startedHeight), toString(winAmount), toString(assetIdx), randOrEmpty, toString(xCoord), toString(yCoord), toString(prizeIndex))
336338
337339
338340 func finishGameData (origGameData,gameStatus,rand,winByTimeout,xCoord,yCoord,prizeIndex) = {
339341 let finishGameData = formatGameDataS(gameStatus, origGameData[IdxPlayerChoice], origGameData[IdxPlayerPubKey58], origGameData[IdxStartedHeight], origGameData[IdxWinAmount], origGameData[IdxAssetId], rand, toString(xCoord), toString(yCoord), toString(prizeIndex))
340342 if (winByTimeout)
341343 then (finishGameData + "_TIMEOUT")
342344 else finishGameData
343345 }
344346
345347
346348 func extractGameData (gameId) = split(match getString(this, gameId) {
347349 case str: String =>
348350 str
349351 case _ =>
350352 throw((("Game: " + gameId) + " not found."))
351353 }, "_")
352354
353355
354356 @Callable(i)
355357 func constructorV1 (rsaPublic64,benzAddress,randOracleTimeFrame,tokensDescriptor) = if ((i.caller != this))
356358 then throw("not authorized")
357359 else {
358360 func splitter (acc,elem) = {
359361 let tokList = split(elem, ":")
360362 if ((size(tokList) != 3))
361363 then throw("Invalid asset record")
362364 else $Tuple3((acc._1 :+ tokList[idxAssets]), (acc._2 :+ tokList[idxDecimals]), (acc._3 :+ tokList[idxDividers]))
363365 }
364366
365367 let r = {
366368 let $l = split_4C(tokensDescriptor, "_")
367369 let $s = size($l)
368370 let $acc0 = $Tuple3(nil, nil, nil)
369371 func $f0_1 ($a,$i) = if (($i >= $s))
370372 then $a
371373 else splitter($a, $l[$i])
372374
373375 func $f0_2 ($a,$i) = if (($i >= $s))
374376 then $a
375377 else throw("List size exceeds 10")
376378
377379 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
378380 }
379381 [StringEntry(RSAPUBLIC64KEY, rsaPublic64), StringEntry(SERVERADDRESSKEY, benzAddress), IntegerEntry(RANDTIMEFRAMEKEY, randOracleTimeFrame), StringEntry(allowedAssetsKey, makeString_2C(r._1, SEP)), StringEntry(assetsDecimalsKey, makeString(r._2, SEP)), StringEntry(betDividersKey, makeString(r._3, SEP))]
380382 }
381383
382384
383385
384386 @Callable(i)
385387 func maintenance (blocked) = if ((i.caller != SERVER))
386388 then throw("not authorized")
387389 else [BooleanEntry(blockedKey, blocked)]
388390
389391
390392
391393 @Callable(i)
392394 func bet (playerChoice) = if (valueOrElse(getBoolean(blockedKey), false))
393395 then throw("Game is stopped for maintenence")
394396 else {
395397 let gameId = toBase58String(i.transactionId)
396398 if ((1 >= size(i.payments)))
397399 then throw("2 payments must be attached")
398400 else if (isDefined(getString(this, gameId)))
399401 then throw((("Bet for: " + gameId) + " was already made."))
400402 else {
401403 let betPmt = value(i.payments[0])
402404 let feePmt = value(i.payments[1])
403405 if (isDefined(feePmt.assetId))
404406 then throw("feePmt (2nd payment) assetId must be in Waves")
405407 else if ((MINFEEWAVES > feePmt.amount))
406408 then throw("feePmt (2nd payment) must be >= 0.005 Waves")
407409 else {
408410 let assetIdStr = assetIdToStr(betPmt.assetId)
409411 let internalAssetIdx = validateAndGetAssetIdx(assetIdStr)
410412 let commission = feePmt.amount
411413 let winAmount = validateBetAndGetWinAmount(betPmt.amount, internalAssetIdx, playerChoice)
412414 let playerPubKey58 = toBase58String(i.callerPublicKey)
413415 let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, internalAssetIdx, "", -1, -1, -1)
414416 [IntegerEntry(keyReservationByAssetIdx(internalAssetIdx), increaseReserveAmount(winAmount, internalAssetIdx)), incrementInt(GAMESCOUNTERKEY), StringEntry(gameId, gameData), ScriptTransfer(SERVER, commission, feePmt.assetId)]
415417 }
416418 }
417419 }
418420
419421
420422
421423 @Callable(i)
422424 func withdraw (gameId,rsaSign) = {
423425 let gameData = extractGameData(gameId)
424426 let gameState = gameData[IdxGameState]
425427 let playerChoice = gameData[IdxPlayerChoice]
426428 let startedHeight = parseIntValue(gameData[IdxStartedHeight])
427429 let winAmount = parseIntValue(gameData[IdxWinAmount])
428430 let assetIdx = parseIntValue(gameData[IdxAssetId])
429431 let playerPubKey58 = gameData[IdxPlayerPubKey58]
430432 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
431433 if ((gameState != STATESUBMITTED))
432434 then throw("Invalid game state for passed gameId")
433435 else if ((i.caller != SERVER))
434436 then throw("Regular withdraw can be done by server only")
435437 else {
436438 let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME)
437439 let randChoice = if (winByTimeout)
438440 then take(playerChoice, 1)
439441 else generateRandChoice(gameId, rsaSign)
440442 let playerWin = isPlayerWin(playerChoice, randChoice)
441443 let newGameStatus = if (playerWin)
442444 then STATEWON
443445 else STATELOST
444446 let coords = if (playerWin)
445447 then [-(M4), -(M4)]
446448 else getCoords(gameId, rsaSign)
447449 let prizeIndex = if (playerWin)
448450 then -1
449451 else getDecorationIndex(gameId, rsaSign)
450452 let x = (coords[0] / M4)
451453 let y = (coords[1] / M4)
452454 let newGameData = finishGameData(gameData, newGameStatus, randChoice, winByTimeout, x, y, prizeIndex)
453455 let oldHistory = valueOrElse(getString(historyKey), "")
454456 let newHistory = ((if ((oldHistory == ""))
455457 then ""
456458 else (oldHistory + "_")) + makeString([toString(x), toString(y), toString(prizeIndex)], ":"))
457459 ([StringEntry(gameId, newGameData), decreaseReservedAmount(gameId, assetIdx, winAmount)] ++ (if (playerWin)
458460 then [ScriptTransfer(playerAddress, winAmount, assetIdFromStr(ASSETS[assetIdx]))]
459461 else [StringEntry(historyKey, newHistory)]))
460462 }
461463 }
462464
463465
464466 @Verifier(tx)
465467 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
466468 then match tx {
467469 case ttx: TransferTransaction =>
468470 let assetIdx = validateAndGetAssetIdx(assetIdToStr(ttx.assetId))
469471 ((getAssetBalance(ttx.assetId) - ttx.amount) >= getIntOr(keyReservationByAssetIdx(assetIdx), 0))
470472 case stx: SetScriptTransaction =>
471473 func checker (acc,asset) = if (acc)
472474 then (getIntOr(keyReservationByAssetStr(asset), 0) == 0)
473475 else false
474476
475477 let $l = ASSETS
476478 let $s = size($l)
477479 let $acc0 = true
478480 func $f0_1 ($a,$i) = if (($i >= $s))
479481 then $a
480482 else checker($a, $l[$i])
481483
482484 func $f0_2 ($a,$i) = if (($i >= $s))
483485 then $a
484486 else throw("List size exceeds 10")
485487
486488 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
487489 case itx: InvokeScriptTransaction =>
488490 if ((itx.dApp == this))
489491 then (itx.function == "constructorV1")
490492 else false
491493 case _ =>
492494 false
493495 }
494496 else false
495497

github/deemru/w8io/026f985 
54.84 ms