tx · BtX8vUPS2krFinnzfzyeqVxCR5BdoJYfBqWNiDbGGF8J

3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8:  -0.01500000 Waves

2022.11.11 12:50 [2312320] smart account 3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8 > SELF 0.00000000 Waves

{ "type": 13, "id": "BtX8vUPS2krFinnzfzyeqVxCR5BdoJYfBqWNiDbGGF8J", "fee": 1500000, "feeAssetId": null, "timestamp": 1668160232471, "version": 2, "chainId": 84, "sender": "3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8", "senderPublicKey": "6L7iBerXuPa5E74WCM6fLSB2VM1bMG9jgASH8tu9orHN", "proofs": [ "53cVio1eMW84KFsNQDmoNP1PCuBXXRrD4Tyykep1VZ3PcUFvb6zrUK7bqoRqUhc6CVHCewFfx8BYkSTvzBitcxcF" ], "script": "base64:BgIoCAISBwoFAQgBAQgSBgoEAQEICBIDCgEBEgQKAgEIEgQKAhEYEgASACsAD0dBTUVfVFlQRV9HUk9VUAIFR3JvdXAAEUdBTUVfVFlQRV9QTEFUT0ZGAghQbGF5LW9mZgAKR0FNRV9UWVBFUwkAzAgCBQ9HQU1FX1RZUEVfR1JPVVAJAMwIAgURR0FNRV9UWVBFX1BMQVRPRkYFA25pbAAEVVNEVAEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAB01JTl9CRVQAwIQ9AAhPTkVfSE9VUgkAaAIJAGgCAAUAPADoBwARTU9ORVlfQk9YX0FERFJFRVMJAQdBZGRyZXNzAQEaAVSxYgy7BRV2F+zuKtUZtXyHmoiep9yqU84AB0JFVF9GRUUA9AMACUZFRV9TQ0FMRQCQTgAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMABmtDYXVzZQIOc2h1dGRvd25fY2F1c2UADWtHYW1lU3RyYVRpbWUCDl9zdGFydEdhbWVUaW1lAAlrR2FtZVR5cGU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gkAzQgCBQxnYW1lc0VudHJpZXMJAQxJbnRlZ2VyRW50cnkCBQtrTGFzdEdhbWVJZAUHbmV3TEdJZAFpAQhzaHV0ZG93bgADCQEBIQEFBmFjdGl2ZQkAAgEJAKwCAgIiREFwcCBpcyBhbHJlYWR5IHN1c3BlbmRlZC4gQ2F1c2U6IAkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzBQZrQ2F1c2UCGnRoZSBjYXVzZSB3YXNuJ3Qgc3BlY2lmaWVkAwkBASEBCQEPY29udGFpbnNFbGVtZW50AgkAzAgCBQxhZG1pblB1YktleTEJAMwIAgUMYWRtaW5QdWJLZXkyCQDMCAIFDGFkbWluUHViS2V5MwUDbmlsCAUBaQ9jYWxsZXJQdWJsaWNLZXkJAAIBAiFPbmx5IGFkbWluIGNhbiBjYWxsIHRoaXMgZnVuY3Rpb24JAQdzdXNwZW5kAQIPUGF1c2VkIGJ5IGFkbWluAWkBCGFjdGl2YXRlAAMFBmFjdGl2ZQkAAgECFkRBcHAgaXMgYWxyZWFkeSBhY3RpdmUDCQEBIQEJAQ9jb250YWluc0VsZW1lbnQCCQDMCAIFDGFkbWluUHViS2V5MQkAzAgCBQxhZG1pblB1YktleTIJAMwIAgUMYWRtaW5QdWJLZXkzBQNuaWwIBQFpD2NhbGxlclB1YmxpY0tleQkAAgECIU9ubHkgYWRtaW4gY2FuIGNhbGwgdGhpcyBmdW5jdGlvbgkAzAgCCQEMQm9vbGVhbkVudHJ5AgUHa0FjdGl2ZQYJAMwIAgkBC0RlbGV0ZUVudHJ5AQUGa0NhdXNlBQNuaWwAMoq0HQ==", "height": 2312320, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BQWHHgZYQNjvRUCxxz6GLeAh6uRD4Sdssdf9WrAYu3EV Next: 8KSKFpUBLp3Yv66cNUcd2ScBLWHK1jsNKafgejmVHqLc Diff:
OldNewDifferences
195195 let totalWinValueMax = ((G1 + (G2 * 3)) + (G3 * 2))
196196 let D1 = if ((G1 == 0))
197197 then 0
198- else fraction((G1 + fraction((G2 * B), 3, totalWinValueMax)), UB1, G1)
198+ else fraction((G1 + fraction((G1 * B), 3, totalWinValueMax)), UB1, G1)
199199 let D2 = if ((G2 == 0))
200200 then 0
201201 else fraction((G2 + fraction((G2 * B), 3, totalWinValueMax)), UB2, G2)
202202 let D3 = if ((G3 == 0))
203203 then 0
204204 else fraction((G3 + fraction((G3 * B), 3, totalWinValueMax)), UB3, G3)
205- let claimAmount = ((D1 + D2) + D3)
205+ let claimAmount = if ((B == 0))
206+ then ((UB1 + UB2) + UB3)
207+ else ((D1 + D2) + D3)
206208 claimAmount
207209 }
208210
219221 func bet (gameId,type,result,refId) = valueOrElse(isActive(), {
220222 let user = toString(i.caller)
221223 let gIdStr = toString(gameId)
222- let $t064816556 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
223- let pmtAmount = $t064816556._1
224- let pmtAssetId = $t064816556._2
224+ let $t065176592 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
225+ let pmtAmount = $t065176592._1
226+ let pmtAssetId = $t065176592._2
225227 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
226228 let gameType = getStringValue(this, (toString(gameId) + kGameType))
227229 if ((pmtAssetId != USDT))
324326 let totalWinValue = ((totalWinType1 + totalWinType2) + totalWinType3)
325327 let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
326328 let bankWithFee = (totalBets - totalWinValue)
327- let $t01061810776 = if ((totalWinValue == 0))
329+ let $t01065410812 = if ((totalWinValue == 0))
328330 then $Tuple2(bankWithFee, 0)
329331 else {
330332 let f = fraction(bankWithFee, BET_FEE, FEE_SCALE)
331333 $Tuple2(f, (bankWithFee - f))
332334 }
333- let fee = $t01061810776._1
334- let bank = $t01061810776._2
335+ let fee = $t01065410812._1
336+ let bank = $t01065410812._2
335337 [StringEntry((gIdStr + kGameResult), result), IntegerEntry((gIdStr + kBank), bank), IntegerEntry((gIdStr + kFinalTime), lastBlock.timestamp), ScriptTransfer(MONEY_BOX_ADDREES, fee, USDT)]
336338 }
337339 }
341343 @Callable(i)
342344 func initGames (startGameTimes,types) = {
343345 func initGame (acc,startGameTime) = {
344- let $t01116011194 = acc
345- let entries = $t01116011194._1
346- let lastGameId = $t01116011194._2
347- let j = $t01116011194._3
346+ let $t01119611230 = acc
347+ let entries = $t01119611230._1
348+ let lastGameId = $t01119611230._2
349+ let j = $t01119611230._3
348350 let newGameId = (lastGameId + 1)
349351 if ((lastBlock.timestamp > startGameTime))
350352 then throw("startGameTime must be in the future")
357359 }
358360
359361 let lastGameId = valueOrElse(getInteger(this, kLastGameId), 0)
360- let $t01173711822 = {
362+ let $t01177311858 = {
361363 let $l = startGameTimes
362364 let $s = size($l)
363365 let $acc0 = $Tuple3(nil, lastGameId, 0)
371373
372374 $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($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($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($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), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
373375 }
374- let gamesEntries = $t01173711822._1
375- let newLGId = $t01173711822._2
376+ let gamesEntries = $t01177311858._1
377+ let newLGId = $t01177311858._2
376378 (gamesEntries :+ IntegerEntry(kLastGameId, newLGId))
377379 }
378380
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let GAME_TYPE_GROUP = "Group"
55
66 let GAME_TYPE_PLATOFF = "Play-off"
77
88 let GAME_TYPES = [GAME_TYPE_GROUP, GAME_TYPE_PLATOFF]
99
1010 let USDT = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS'
1111
1212 let MIN_BET = 1000000
1313
1414 let ONE_HOUR = ((5 * 60) * 1000)
1515
1616 let MONEY_BOX_ADDREES = Address(base58'3N65zqVKchaFdW4gS7FxCRibjfkVgJvo7PT')
1717
1818 let BET_FEE = 500
1919
2020 let FEE_SCALE = 10000
2121
2222 let kActive = "active"
2323
2424 let kActiveGlob = "active_all_contracts"
2525
2626 let kCause = "shutdown_cause"
2727
2828 let kGameStraTime = "_startGameTime"
2929
3030 let kGameType = "_GameType"
3131
3232 let kLastGameId = "last_game_id"
3333
3434 let kTotalBets = "_totalBets"
3535
3636 let kToWinA = "_toWinA"
3737
3838 let kToWinB = "_toWinB"
3939
4040 let kOnDraw = "_onDraw"
4141
4242 let kGameResult = "_result"
4343
4444 let kBank = "_bank"
4545
4646 let kFinalTime = "_finalTimeā€"
4747
4848 let kTotalBetsForType = "_totalBetsForType"
4949
5050 let kUserBet = "_userBet"
5151
5252 let kUserRefId = "_refId"
5353
5454 let kUserClaimed = "_claimed"
5555
5656 let kAdminPubKey1 = "admin_pub_1"
5757
5858 let kAdminPubKey2 = "admin_pub_2"
5959
6060 let kAdminPubKey3 = "admin_pub_3"
6161
6262 let oracle = Address(base58'3PEbqViERCoKnmcSULh6n2aiMvUdSQdCsom')
6363
6464 func getBase58FromOracle (key) = match getString(oracle, key) {
6565 case string: String =>
6666 fromBase58String(string)
6767 case nothing =>
6868 throw((key + "is empty"))
6969 }
7070
7171
7272 let adminPubKey1 = getBase58FromOracle(kAdminPubKey1)
7373
7474 let adminPubKey2 = getBase58FromOracle(kAdminPubKey2)
7575
7676 let adminPubKey3 = getBase58FromOracle(kAdminPubKey3)
7777
7878 let active = valueOrElse(getBoolean(this, kActive), true)
7979
8080 let activeGlob = valueOrElse(getBoolean(oracle, kActiveGlob), true)
8181
8282 func isActive () = if (if (active)
8383 then activeGlob
8484 else false)
8585 then unit
8686 else throw("DApp is inactive at this moment")
8787
8888
8989 func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey))
9090 then unit
9191 else throw("Only admin can call this function")
9292
9393
9494 func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)]
9595
9696
9797 func getUserBetKey (user,gameId,type,result) = (((((((user + "_") + toString(gameId)) + "_") + toString(type)) + "_") + result) + kUserBet)
9898
9999
100100 func getTotalBetsForTypeKey (gameId,type,result) = (((((toString(gameId) + "_") + toString(type)) + "_") + result) + kTotalBetsForType)
101101
102102
103103 func validateBet (gameType,type,result) = if ((type == 1))
104104 then if ((size(result) != 1))
105105 then throw("Game result must contain only one letter: A,B,D")
106106 else if (!(contains("ABD", result)))
107107 then throw("Game result must contain only one letter: A,B,D")
108108 else if (if ((gameType == GAME_TYPE_PLATOFF))
109109 then !(contains("AB", result))
110110 else false)
111111 then throw("Game result must contain only one letter: A,B")
112112 else true
113113 else if ((type == 2))
114114 then {
115115 let splited = split(result, "_")
116116 if ((size(splited) != 2))
117117 then throw("Inncorrect game result")
118118 else {
119119 let ballsA = valueOrErrorMessage(parseInt(splited[0]), "Inncorrect game result")
120120 let ballsB = valueOrErrorMessage(parseInt(splited[1]), "Inncorrect game result")
121121 if ((ballsA == ballsB))
122122 then throw("Inncorrect game result. A and B cannot be equal")
123123 else true
124124 }
125125 }
126126 else if ((type == 3))
127127 then {
128128 let splited = split(result, "_")
129129 if ((size(splited) != 2))
130130 then throw("Inncorrect game result")
131131 else {
132132 let team = splited[0]
133133 let ballsAmount = valueOrErrorMessage(parseInt(splited[1]), "Inncorrect game result")
134134 if ((0 >= ballsAmount))
135135 then throw("Inncorrect game result, balls amount must be greater then 0")
136136 else if (if ((size(team) != 1))
137137 then true
138138 else !(contains("AB", team)))
139139 then throw("Game result must contain only one letter: A,B")
140140 else true
141141 }
142142 }
143143 else false
144144
145145
146146 func calcClaim (gameId,userAddress,result,type,amount) = {
147147 let spldRes = split(result, "_")
148148 let $t039694495 = if ((type == 1))
149149 then if ((result == "A"))
150150 then $Tuple3("1_0", 1, 0)
151151 else if ((result == "B"))
152152 then $Tuple3("0_1", 0, 1)
153153 else $Tuple3("1_1", 1, 1)
154154 else if ((type == 2))
155155 then $Tuple3(result, parseIntValue(spldRes[0]), parseIntValue(spldRes[1]))
156156 else if ((type == 3))
157157 then if ((spldRes[0] == "A"))
158158 then $Tuple3((spldRes[1] + "_0"), parseIntValue(spldRes[1]), 0)
159159 else $Tuple3(("0_" + spldRes[1]), 0, parseIntValue(spldRes[1]))
160160 else $Tuple3(result, parseIntValue(spldRes[0]), parseIntValue(spldRes[1]))
161161 let gameResult = $t039694495._1
162162 let ballsA = $t039694495._2
163163 let ballsB = $t039694495._3
164164 let diff = if ((ballsA > ballsB))
165165 then (ballsA - ballsB)
166166 else (ballsB - ballsA)
167167 let winner = if ((ballsA > ballsB))
168168 then "A"
169169 else if ((ballsB > ballsA))
170170 then "B"
171171 else "D"
172172 let G1 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0) + (if ((type == 1))
173173 then amount
174174 else 0))
175175 let G2 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, gameResult)), 0) + (if ((type == 2))
176176 then amount
177177 else 0))
178178 let G3 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0) + (if ((type == 3))
179179 then amount
180180 else 0))
181181 let totalWinValue = ((G1 + G2) + G3)
182182 let totalBets = (valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0) + amount)
183183 let bankWithFee = (totalBets - totalWinValue)
184184 let fee = fraction(bankWithFee, BET_FEE, FEE_SCALE)
185185 let B = (bankWithFee - fee)
186186 let UB1 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 1, winner)), 0) + (if ((type == 1))
187187 then amount
188188 else 0))
189189 let UB2 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 2, gameResult)), 0) + (if ((type == 2))
190190 then amount
191191 else 0))
192192 let UB3 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 3, ((winner + "_") + toString(diff)))), 0) + (if ((type == 3))
193193 then amount
194194 else 0))
195195 let totalWinValueMax = ((G1 + (G2 * 3)) + (G3 * 2))
196196 let D1 = if ((G1 == 0))
197197 then 0
198- else fraction((G1 + fraction((G2 * B), 3, totalWinValueMax)), UB1, G1)
198+ else fraction((G1 + fraction((G1 * B), 3, totalWinValueMax)), UB1, G1)
199199 let D2 = if ((G2 == 0))
200200 then 0
201201 else fraction((G2 + fraction((G2 * B), 3, totalWinValueMax)), UB2, G2)
202202 let D3 = if ((G3 == 0))
203203 then 0
204204 else fraction((G3 + fraction((G3 * B), 3, totalWinValueMax)), UB3, G3)
205- let claimAmount = ((D1 + D2) + D3)
205+ let claimAmount = if ((B == 0))
206+ then ((UB1 + UB2) + UB3)
207+ else ((D1 + D2) + D3)
206208 claimAmount
207209 }
208210
209211
210212 @Callable(i)
211213 func potentialWinnings (gameId,userAddress,amount,type,result) = {
212214 let claimAmount = calcClaim(gameId, userAddress, result, type, amount)
213215 $Tuple2(nil, claimAmount)
214216 }
215217
216218
217219
218220 @Callable(i)
219221 func bet (gameId,type,result,refId) = valueOrElse(isActive(), {
220222 let user = toString(i.caller)
221223 let gIdStr = toString(gameId)
222- let $t064816556 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
223- let pmtAmount = $t064816556._1
224- let pmtAssetId = $t064816556._2
224+ let $t065176592 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
225+ let pmtAmount = $t065176592._1
226+ let pmtAssetId = $t065176592._2
225227 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
226228 let gameType = getStringValue(this, (toString(gameId) + kGameType))
227229 if ((pmtAssetId != USDT))
228230 then throw("Pamyment must be In USDT asset")
229231 else if ((MIN_BET > pmtAmount))
230232 then throw((("Min bet " + toString((MIN_BET / 1000000))) + "USDT"))
231233 else if ((gameStartTime == 0))
232234 then throw(("There is no game with id" + toString(gameId)))
233235 else if (((lastBlock.timestamp + ONE_HOUR) >= gameStartTime))
234236 then throw("Bets on this game are no longer accepted")
235237 else if (!(validateBet(gameType, type, result)))
236238 then throw("Incorrect bet type")
237239 else {
238240 let spldRes = split(result, "_")
239241 let userBetKey = getUserBetKey(user, gameId, type, result)
240242 let totalBetsForTypeBetKey = getTotalBetsForTypeKey(gameId, type, result)
241243 let userBet = (valueOrElse(getInteger(this, userBetKey), 0) + pmtAmount)
242244 let totalBetsForTypeBet = (valueOrElse(getInteger(this, totalBetsForTypeBetKey), 0) + pmtAmount)
243245 let totalBets = (valueOrElse(getInteger(this, (gIdStr + kTotalBets)), 0) + pmtAmount)
244246 let toWinA = (valueOrElse(getInteger(this, (gIdStr + kToWinA)), 0) + (if (if ((type == 1))
245247 then (result == "A")
246248 else false)
247249 then pmtAmount
248250 else if (if ((type == 2))
249251 then (parseIntValue(spldRes[0]) > parseIntValue(spldRes[1]))
250252 else false)
251253 then pmtAmount
252254 else if (if ((type == 3))
253255 then (spldRes[0] == "A")
254256 else false)
255257 then pmtAmount
256258 else 0))
257259 let toWinB = (valueOrElse(getInteger(this, (gIdStr + kToWinB)), 0) + (if (if ((type == 1))
258260 then (result == "B")
259261 else false)
260262 then pmtAmount
261263 else if (if ((type == 2))
262264 then (parseIntValue(spldRes[1]) > parseIntValue(spldRes[0]))
263265 else false)
264266 then pmtAmount
265267 else if (if ((type == 3))
266268 then (spldRes[0] == "B")
267269 else false)
268270 then pmtAmount
269271 else 0))
270272 let onDraw = (valueOrElse(getInteger(this, (gIdStr + kOnDraw)), 0) + (if (if ((type == 1))
271273 then (result == "D")
272274 else false)
273275 then pmtAmount
274276 else 0))
275277 ([IntegerEntry(userBetKey, userBet), IntegerEntry(totalBetsForTypeBetKey, totalBetsForTypeBet), IntegerEntry((gIdStr + kTotalBets), totalBets), IntegerEntry((gIdStr + kToWinA), toWinA), IntegerEntry((gIdStr + kToWinB), toWinB), IntegerEntry((gIdStr + kOnDraw), onDraw)] ++ (if (!(isDefined(getString(this, (user + kUserRefId)))))
276278 then [StringEntry((user + kUserRefId), refId)]
277279 else nil))
278280 }
279281 })
280282
281283
282284
283285 @Callable(i)
284286 func claim (gameId) = valueOrElse(isActive(), {
285287 let user = toString(i.caller)
286288 let gIdStr = toString(gameId)
287289 let finalTime = valueOrErrorMessage(getInteger(this, (gIdStr + kFinalTime)), "You can claim only after game finish")
288290 if ((lastBlock.timestamp > (finalTime + ONE_HOUR)))
289291 then throw("You can claim only after one hour pass after final time")
290292 else if (isDefined(getBoolean(this, (((user + "_") + gIdStr) + kUserClaimed))))
291293 then throw("You are alredy claimed")
292294 else {
293295 let gameResult = getStringValue(this, (gIdStr + kGameResult))
294296 let claimAmount = calcClaim(gameId, user, gameResult, 0, 0)
295297 if ((claimAmount == 0))
296298 then throw("Nothing to claim")
297299 else $Tuple2([BooleanEntry((((user + "_") + gIdStr) + kUserClaimed), true), ScriptTransfer(i.caller, claimAmount, USDT)], claimAmount)
298300 }
299301 })
300302
301303
302304
303305 @Callable(i)
304306 func gameSummary (gameId,result) = {
305307 let gIdStr = toString(gameId)
306308 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
307309 if ((gameStartTime == 0))
308310 then throw(("There is no game with id" + toString(gameId)))
309311 else {
310312 let spldRes = split(result, "_")
311313 let ballsA = valueOrErrorMessage(parseInt(spldRes[0]), "Inncorrect game result")
312314 let ballsB = valueOrErrorMessage(parseInt(spldRes[1]), "Inncorrect game result")
313315 let diff = if ((ballsA > ballsB))
314316 then (ballsA - ballsB)
315317 else (ballsB - ballsA)
316318 let winner = if ((ballsA > ballsB))
317319 then "A"
318320 else if ((ballsB > ballsA))
319321 then "B"
320322 else "D"
321323 let totalWinType1 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0)
322324 let totalWinType2 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, result)), 0)
323325 let totalWinType3 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0)
324326 let totalWinValue = ((totalWinType1 + totalWinType2) + totalWinType3)
325327 let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
326328 let bankWithFee = (totalBets - totalWinValue)
327- let $t01061810776 = if ((totalWinValue == 0))
329+ let $t01065410812 = if ((totalWinValue == 0))
328330 then $Tuple2(bankWithFee, 0)
329331 else {
330332 let f = fraction(bankWithFee, BET_FEE, FEE_SCALE)
331333 $Tuple2(f, (bankWithFee - f))
332334 }
333- let fee = $t01061810776._1
334- let bank = $t01061810776._2
335+ let fee = $t01065410812._1
336+ let bank = $t01065410812._2
335337 [StringEntry((gIdStr + kGameResult), result), IntegerEntry((gIdStr + kBank), bank), IntegerEntry((gIdStr + kFinalTime), lastBlock.timestamp), ScriptTransfer(MONEY_BOX_ADDREES, fee, USDT)]
336338 }
337339 }
338340
339341
340342
341343 @Callable(i)
342344 func initGames (startGameTimes,types) = {
343345 func initGame (acc,startGameTime) = {
344- let $t01116011194 = acc
345- let entries = $t01116011194._1
346- let lastGameId = $t01116011194._2
347- let j = $t01116011194._3
346+ let $t01119611230 = acc
347+ let entries = $t01119611230._1
348+ let lastGameId = $t01119611230._2
349+ let j = $t01119611230._3
348350 let newGameId = (lastGameId + 1)
349351 if ((lastBlock.timestamp > startGameTime))
350352 then throw("startGameTime must be in the future")
351353 else if (!(containsElement(GAME_TYPES, types[j])))
352354 then throw(("type must contain one of values: " + makeString(GAME_TYPES, ",")))
353355 else {
354356 let gameEntries = [IntegerEntry((toString(newGameId) + kGameStraTime), startGameTime), StringEntry((toString(newGameId) + kGameType), types[j])]
355357 $Tuple3((entries ++ gameEntries), newGameId, (j + 1))
356358 }
357359 }
358360
359361 let lastGameId = valueOrElse(getInteger(this, kLastGameId), 0)
360- let $t01173711822 = {
362+ let $t01177311858 = {
361363 let $l = startGameTimes
362364 let $s = size($l)
363365 let $acc0 = $Tuple3(nil, lastGameId, 0)
364366 func $f0_1 ($a,$i) = if (($i >= $s))
365367 then $a
366368 else initGame($a, $l[$i])
367369
368370 func $f0_2 ($a,$i) = if (($i >= $s))
369371 then $a
370372 else throw("List size exceeds 50")
371373
372374 $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($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($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($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), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50)
373375 }
374- let gamesEntries = $t01173711822._1
375- let newLGId = $t01173711822._2
376+ let gamesEntries = $t01177311858._1
377+ let newLGId = $t01177311858._2
376378 (gamesEntries :+ IntegerEntry(kLastGameId, newLGId))
377379 }
378380
379381
380382
381383 @Callable(i)
382384 func shutdown () = if (!(active))
383385 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
384386 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
385387 then throw("Only admin can call this function")
386388 else suspend("Paused by admin")
387389
388390
389391
390392 @Callable(i)
391393 func activate () = if (active)
392394 then throw("DApp is already active")
393395 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
394396 then throw("Only admin can call this function")
395397 else [BooleanEntry(kActive, true), DeleteEntry(kCause)]
396398
397399

github/deemru/w8io/026f985 
51.91 ms