tx · 8xh42kktAgjFWFNQXm2y4Nm3zpvCwAJry7zUqhZj7RnX

3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ:  -0.01700000 Waves

2023.12.14 18:06 [2886546] smart account 3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ > SELF 0.00000000 Waves

{ "type": 13, "id": "8xh42kktAgjFWFNQXm2y4Nm3zpvCwAJry7zUqhZj7RnX", "fee": 1700000, "feeAssetId": null, "timestamp": 1702566400847, "version": 2, "chainId": 84, "sender": "3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ", "senderPublicKey": "CQoe8BRHR78TuPQLcK3Ykv39w9CeNLhjKdj6TNbJ5FrM", "proofs": [ "5dnmftW3wHkcTdmxL4wrCgR4iQtQU7nR6HmxkjD8SjswpYPkcRc8ohmWMC4iKBFoRfxYMfcFjJdXvNC6Z5LRzkjm" ], "script": "base64:BgIaCAISBgoECAgBCBIDCgEEEgMKAQgSBAoCCAJIAANTRVACAl9fAAdXQVZFU0lEAQQTq9kzAAZXQVZFU0QAgMLXLwAJR0FNRV9OQU1FAglYbWFzIFRyZWUADFJBTkRPTV9SQU5HRQAFAAhOVU1fQkVUUwABAA9NQVhfREVDT1JBVElPTlMADwEMZ2V0U3RyT3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFB2FkZHJlc3MFA2tleQkAuQkCCQDMCAICCm1hbmRhdG9yeSAJAMwIAgkApQgBBQdhZGRyZXNzCQDMCAICAS4JAMwIAgUDa2V5CQDMCAICDyBpcyBub3QgZGVmaW5lZAUDbmlsAgABDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90I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"succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCAiMj8rGMrTfSuT3YTSsNhpWeBMudoTzZzdCGTscLRG Next: Epfv8RHBQi7FyqT8xu6bCQEy22g4BJ44wUtZo6f4keXa Diff:
OldNewDifferences
9393
9494 let RATEMULT = 10000
9595
96-let RATE = 40000
96+let RATE = 30000
9797
9898 let BETS = [BET2]
9999
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 = 15
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 func getIntArray (key) = {
4646 let a = getStrOrFail(this, key)
4747 func filler (acc,el) = (acc :+ parseIntValue(el))
4848
4949 let $l = split(a, SEP)
5050 let $s = size($l)
5151 let $acc0 = nil
5252 func $f0_1 ($a,$i) = if (($i >= $s))
5353 then $a
5454 else filler($a, $l[$i])
5555
5656 func $f0_2 ($a,$i) = if (($i >= $s))
5757 then $a
5858 else throw("List size exceeds 10")
5959
6060 $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)
6161 }
6262
6363
6464 let ASSETS = split(getStrOrFail(this, allowedAssetsKey), SEP)
6565
6666 let DECIMALS = getIntArray(assetsDecimalsKey)
6767
6868 let BETDIVIDERS = getIntArray(betDividersKey)
6969
7070 func keyReservationByAssetStr (assetStr) = ("$RESERVED_AMOUNT_" + assetStr)
7171
7272
7373 func keyReservationByAssetIdx (assetIdx) = keyReservationByAssetStr(ASSETS[assetIdx])
7474
7575
7676 let MINFEEWAVES = ((5 * WAVESD) / 1000)
7777
7878 let idxAssets = 0
7979
8080 let idxDecimals = 1
8181
8282 let idxDividers = 2
8383
8484 let BET1 = 1
8585
8686 let BET2 = 2
8787
8888 let BET4 = 4
8989
9090 let BET8 = 8
9191
9292 let BET14 = 14
9393
9494 let RATEMULT = 10000
9595
96-let RATE = 40000
96+let RATE = 30000
9797
9898 let BETS = [BET2]
9999
100100 let IdxGameState = 0
101101
102102 let IdxPlayerChoice = 1
103103
104104 let IdxPlayerPubKey58 = 2
105105
106106 let IdxStartedHeight = 3
107107
108108 let IdxWinAmount = 4
109109
110110 let IdxAssetId = 5
111111
112112 let STATESUBMITTED = "SUBMITTED"
113113
114114 let STATEWON = "WON"
115115
116116 let STATELOST = "LOST"
117117
118118 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " key is not specified in this.state"))
119119
120120
121121 let RSAPUBLIC = fromBase64String(getStringOrFail(RSAPUBLIC64KEY))
122122
123123 let SERVER = addressFromStringValue(getStringOrFail(SERVERADDRESSKEY))
124124
125125 let RANDORACLETIMEFRAME = valueOrElse(getInteger(this, RANDTIMEFRAMEKEY), 7200)
126126
127127 func getIntOr (key,default) = if (isDefined(getInteger(key)))
128128 then getIntegerValue(key)
129129 else default
130130
131131
132132 func setInt (key,value) = IntegerEntry(key, value)
133133
134134
135135 func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1))
136136
137137
138138 func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by))
139139
140140
141141 func assetIdToStr (assetIdOrUnit) = match assetIdOrUnit {
142142 case b: ByteVector =>
143143 toBase58String(b)
144144 case _ =>
145145 "WAVES"
146146 }
147147
148148
149149 func assetIdFromStr (assetIdStr) = if ((assetIdStr == "WAVES"))
150150 then unit
151151 else fromBase58String(assetIdStr)
152152
153153
154154 func getAssetBalance (assetIdOrUnit) = match assetIdOrUnit {
155155 case assetId: ByteVector =>
156156 assetBalance(this, assetId)
157157 case _ =>
158158 wavesBalance(this).available
159159 }
160160
161161
162162 func increaseReserveAmount (winAmount,assetIdx) = {
163163 let assetIdStr = ASSETS[assetIdx]
164164 let newReservedAmount = (getIntOr(keyReservationByAssetIdx(assetIdx), 0) + winAmount)
165165 if ((newReservedAmount > getAssetBalance(assetIdFromStr(assetIdStr))))
166166 then throw((("Insufficient funds on " + GAME_NAME) + " account. Transaction was rejected for your safety."))
167167 else newReservedAmount
168168 }
169169
170170
171171 func decreaseReservedAmount (gameId,assetIdx,winAmount) = if ((0 > (getIntOr(keyReservationByAssetIdx(assetIdx), 0) - winAmount)))
172172 then throw((("Invalid " + GAME_NAME) + " account state - reserved amount is less than 0"))
173173 else changeInt(keyReservationByAssetIdx(assetIdx), -(winAmount))
174174
175175
176176 func validateAndGetAssetIdx (assetIdStr) = {
177177 let idx = indexOf(ASSETS, assetIdStr)
178178 if (!(isDefined(idx)))
179179 then throw("Invalid payment asset")
180180 else value(idx)
181181 }
182182
183183
184184 func validateBetAndGetWinAmount (bet,internalAssetIdx,playerChoice) = {
185185 let dicesCount = size(playerChoice)
186186 func checkAmount (a,x) = if (a)
187187 then true
188188 else (bet == ((x * DECIMALS[internalAssetIdx]) / BETDIVIDERS[internalAssetIdx]))
189189
190190 if (!({
191191 let $l = BETS
192192 let $s = size($l)
193193 let $acc0 = false
194194 func $f0_1 ($a,$i) = if (($i >= $s))
195195 then $a
196196 else checkAmount($a, $l[$i])
197197
198198 func $f0_2 ($a,$i) = if (($i >= $s))
199199 then $a
200200 else throw("List size exceeds 5")
201201
202202 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
203203 }))
204204 then throw("Bet amount is not valid")
205205 else if ((parseInt(playerChoice) == unit))
206206 then throw("Invalid player's choice")
207207 else if ((dicesCount != NUM_BETS))
208208 then throw("Invalid length of player's choice")
209209 else fraction(bet, RATE, RATEMULT)
210210 }
211211
212212
213213 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]]
214214
215215 let HALF = 5000
216216
217217 let M4 = 10000
218218
219219 func getCoords (gameId,rsaSign) = {
220220 func calcAreas (acc,ignored) = {
221221 let i = acc._3
222222 if ((i == 14))
223223 then acc
224224 else {
225225 let top = HOR_LINES[i]
226226 let bottom = HOR_LINES[(i + 1)]
227227 let area4 = (((((top[1] - top[0]) + bottom[1]) - bottom[0]) * (bottom[2] - top[2])) * 5000)
228228 $Tuple3((acc._1 :+ area4), (acc._2 + area4), (acc._3 + 1))
229229 }
230230 }
231231
232232 let $t079968063 = {
233233 let $l = HOR_LINES
234234 let $s = size($l)
235235 let $acc0 = $Tuple3(nil, 0, 0)
236236 func $f0_1 ($a,$i) = if (($i >= $s))
237237 then $a
238238 else calcAreas($a, $l[$i])
239239
240240 func $f0_2 ($a,$i) = if (($i >= $s))
241241 then $a
242242 else throw("List size exceeds 15")
243243
244244 $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)
245245 }
246246 let areas = $t079968063._1
247247 let totalArea = $t079968063._2
248248 let rand = (toInt(sha256((rsaSign + toBytes(gameId)))) % totalArea)
249249 func check (acc,area) = {
250250 let i = acc._1
251251 let newArea = (acc._2 + area)
252252 $Tuple3((i + 1), newArea, if (if ((0 > acc._3))
253253 then (newArea > rand)
254254 else false)
255255 then i
256256 else acc._3)
257257 }
258258
259259 let j = ( let $l = areas
260260 let $s = size($l)
261261 let $acc0 = $Tuple3(0, 0, -1)
262262 func $f1_1 ($a,$i) = if (($i >= $s))
263263 then $a
264264 else check($a, $l[$i])
265265
266266 func $f1_2 ($a,$i) = if (($i >= $s))
267267 then $a
268268 else throw("List size exceeds 14")
269269
270270 $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
271271 let top = HOR_LINES[j]
272272 let bottom = HOR_LINES[(j + 1)]
273273 let mx04 = ((top[0] + bottom[0]) * HALF)
274274 let mx14 = ((top[1] + bottom[1]) * HALF)
275275 let h4 = ((bottom[2] - top[2]) * M4)
276276 let my4 = ((top[2] + bottom[2]) * HALF)
277277 let randX4 = (mx04 + (toInt(sha256((rsaSign + toBytes(j)))) % (mx14 - mx04)))
278278 let randY4 = ((top[2] * M4) + (toInt(sha256((rsaSign + toBytes(randX4)))) % h4))
279279 let a4 = ((top[2] * M4) - randY4)
280280 let b4 = ((bottom[2] * M4) - randY4)
281281 let x04 = fraction(((top[0] * b4) - (bottom[0] * a4)), M4, h4)
282282 let x14 = fraction(((top[1] * b4) - (bottom[1] * a4)), M4, h4)
283283 if ((x04 > randX4))
284284 then [((2 * mx04) - randX4), ((2 * my4) - randY4)]
285285 else if ((randX4 > x14))
286286 then [((2 * mx14) - randX4), ((2 * my4) - randY4)]
287287 else [randX4, randY4]
288288 }
289289
290290
291291 func getDecorationIndex (gameId,rsaSign) = (toInt(sha256((toBytes(gameId) + rsaSign))) % MAX_DECORATIONS)
292292
293293
294294 func generateRandChoice (gameId,rsaSign) = {
295295 let rsaSigValid = rsaVerify_16Kb(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
296296 if (!(rsaSigValid))
297297 then throw("Invalid RSA signature")
298298 else {
299299 let rand = (toInt(sha256(rsaSign)) % RANDOM_RANGE)
300300 toString((rand + 1))
301301 }
302302 }
303303
304304
305305 func isPlayerWin (playerChoice,randChoise) = {
306306 let s = size(playerChoice)
307307 func check (a,x) = if (a)
308308 then true
309309 else if ((s >= x))
310310 then (take(drop(playerChoice, (x - 1)), 1) == randChoise)
311311 else false
312312
313313 let $l = [1, 2, 3, 4, 5]
314314 let $s = size($l)
315315 let $acc0 = false
316316 func $f0_1 ($a,$i) = if (($i >= $s))
317317 then $a
318318 else check($a, $l[$i])
319319
320320 func $f0_2 ($a,$i) = if (($i >= $s))
321321 then $a
322322 else throw("List size exceeds 5")
323323
324324 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
325325 }
326326
327327
328328 func formatGameDataS (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty,xCoord,yCoord,prizeIndex) = makeString([gameStatus, playerChoice, playerPubKey58, startedHeight, winAmount, assetIdx, if ((randOrEmpty == ""))
329329 then ""
330330 else randOrEmpty, xCoord, yCoord, prizeIndex], "_")
331331
332332
333333 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))
334334
335335
336336 func finishGameData (origGameData,gameStatus,rand,winByTimeout,xCoord,yCoord,prizeIndex) = {
337337 let finishGameData = formatGameDataS(gameStatus, origGameData[IdxPlayerChoice], origGameData[IdxPlayerPubKey58], origGameData[IdxStartedHeight], origGameData[IdxWinAmount], origGameData[IdxAssetId], rand, toString(xCoord), toString(yCoord), toString(prizeIndex))
338338 if (winByTimeout)
339339 then (finishGameData + "_TIMEOUT")
340340 else finishGameData
341341 }
342342
343343
344344 func extractGameData (gameId) = split(match getString(this, gameId) {
345345 case str: String =>
346346 str
347347 case _ =>
348348 throw((("Game: " + gameId) + " not found."))
349349 }, "_")
350350
351351
352352 @Callable(i)
353353 func constructorV1 (rsaPublic64,benzAddress,randOracleTimeFrame,tokensDescriptor) = if ((i.caller != this))
354354 then throw("not authorized")
355355 else {
356356 func splitter (acc,elem) = {
357357 let tokList = split(elem, ":")
358358 if ((size(tokList) != 3))
359359 then throw("Invalid asset record")
360360 else $Tuple3((acc._1 :+ tokList[idxAssets]), (acc._2 :+ tokList[idxDecimals]), (acc._3 :+ tokList[idxDividers]))
361361 }
362362
363363 let r = {
364364 let $l = split_4C(tokensDescriptor, "_")
365365 let $s = size($l)
366366 let $acc0 = $Tuple3(nil, nil, nil)
367367 func $f0_1 ($a,$i) = if (($i >= $s))
368368 then $a
369369 else splitter($a, $l[$i])
370370
371371 func $f0_2 ($a,$i) = if (($i >= $s))
372372 then $a
373373 else throw("List size exceeds 10")
374374
375375 $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)
376376 }
377377 [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))]
378378 }
379379
380380
381381
382382 @Callable(i)
383383 func maintenance (blocked) = if ((i.caller != SERVER))
384384 then throw("not authorized")
385385 else [BooleanEntry(blockedKey, blocked)]
386386
387387
388388
389389 @Callable(i)
390390 func bet (playerChoice) = if (valueOrElse(getBoolean(blockedKey), false))
391391 then throw("Game is stopped for maintenence")
392392 else {
393393 let gameId = toBase58String(i.transactionId)
394394 if ((1 >= size(i.payments)))
395395 then throw("2 payments must be attached")
396396 else if (isDefined(getString(this, gameId)))
397397 then throw((("Bet for: " + gameId) + " was already made."))
398398 else {
399399 let betPmt = value(i.payments[0])
400400 let feePmt = value(i.payments[1])
401401 if (isDefined(feePmt.assetId))
402402 then throw("feePmt (2nd payment) assetId must be in Waves")
403403 else if ((MINFEEWAVES > feePmt.amount))
404404 then throw("feePmt (2nd payment) must be >= 0.005 Waves")
405405 else {
406406 let assetIdStr = assetIdToStr(betPmt.assetId)
407407 let internalAssetIdx = validateAndGetAssetIdx(assetIdStr)
408408 let commission = feePmt.amount
409409 let winAmount = validateBetAndGetWinAmount(betPmt.amount, internalAssetIdx, playerChoice)
410410 let playerPubKey58 = toBase58String(i.callerPublicKey)
411411 let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, internalAssetIdx, "", -1, -1, -1)
412412 [IntegerEntry(keyReservationByAssetIdx(internalAssetIdx), increaseReserveAmount(winAmount, internalAssetIdx)), incrementInt(GAMESCOUNTERKEY), StringEntry(gameId, gameData), ScriptTransfer(SERVER, commission, feePmt.assetId)]
413413 }
414414 }
415415 }
416416
417417
418418
419419 @Callable(i)
420420 func withdraw (gameId,rsaSign) = {
421421 let gameData = extractGameData(gameId)
422422 let gameState = gameData[IdxGameState]
423423 let playerChoice = gameData[IdxPlayerChoice]
424424 let startedHeight = parseIntValue(gameData[IdxStartedHeight])
425425 let winAmount = parseIntValue(gameData[IdxWinAmount])
426426 let assetIdx = parseIntValue(gameData[IdxAssetId])
427427 let playerPubKey58 = gameData[IdxPlayerPubKey58]
428428 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
429429 if ((gameState != STATESUBMITTED))
430430 then throw("Invalid game state for passed gameId")
431431 else if ((i.caller != SERVER))
432432 then throw("Regular withdraw can be done by server only")
433433 else {
434434 let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME)
435435 let randChoice = if (winByTimeout)
436436 then take(playerChoice, 1)
437437 else generateRandChoice(gameId, rsaSign)
438438 let playerWin = isPlayerWin(playerChoice, randChoice)
439439 let newGameStatus = if (playerWin)
440440 then STATEWON
441441 else STATELOST
442442 let coords = if (playerWin)
443443 then [-(M4), -(M4)]
444444 else getCoords(gameId, rsaSign)
445445 let prizeIndex = if (playerWin)
446446 then -1
447447 else getDecorationIndex(gameId, rsaSign)
448448 let newGameData = finishGameData(gameData, newGameStatus, randChoice, winByTimeout, (coords[0] / M4), (coords[1] / M4), prizeIndex)
449449 ([StringEntry(gameId, newGameData), decreaseReservedAmount(gameId, assetIdx, winAmount)] ++ (if (playerWin)
450450 then [ScriptTransfer(playerAddress, winAmount, assetIdFromStr(ASSETS[assetIdx]))]
451451 else nil))
452452 }
453453 }
454454
455455
456456 @Verifier(tx)
457457 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
458458 then match tx {
459459 case ttx: TransferTransaction =>
460460 let assetIdx = validateAndGetAssetIdx(assetIdToStr(ttx.assetId))
461461 ((getAssetBalance(ttx.assetId) - ttx.amount) >= getIntOr(keyReservationByAssetIdx(assetIdx), 0))
462462 case stx: SetScriptTransaction =>
463463 func checker (acc,asset) = if (acc)
464464 then (getIntOr(keyReservationByAssetStr(asset), 0) == 0)
465465 else false
466466
467467 let $l = ASSETS
468468 let $s = size($l)
469469 let $acc0 = true
470470 func $f0_1 ($a,$i) = if (($i >= $s))
471471 then $a
472472 else checker($a, $l[$i])
473473
474474 func $f0_2 ($a,$i) = if (($i >= $s))
475475 then $a
476476 else throw("List size exceeds 10")
477477
478478 $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)
479479 case itx: InvokeScriptTransaction =>
480480 if ((itx.dApp == this))
481481 then (itx.function == "constructorV1")
482482 else false
483483 case _ =>
484484 false
485485 }
486486 else false
487487

github/deemru/w8io/169f3d6 
58.19 ms