tx · a9WDsvvtRGtMyGwqxUymkougA2zvG4wg29as56HLzu4

3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8:  -0.01300000 Waves

2022.11.10 20:14 [2311339] smart account 3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8 > SELF 0.00000000 Waves

{ "type": 13, "id": "a9WDsvvtRGtMyGwqxUymkougA2zvG4wg29as56HLzu4", "fee": 1300000, "feeAssetId": null, "timestamp": 1668100444436, "version": 2, "chainId": 84, "sender": "3Mungn3ygy3DzpbDUKPbJQaeNKfQHu9fkK8", "senderPublicKey": "6L7iBerXuPa5E74WCM6fLSB2VM1bMG9jgASH8tu9orHN", "proofs": [ "v6ZABN7Ftme5utetpwRpo9JJ6yVoyPKcLVEAeQ5Ta1u1qEWWQpMwuCqzGJceLCeFMGCLJo4PfbCGG6rMr4yhwoc" ], "script": "base64:BgIoCAISBwoFAQgBAQgSBgoEAQEICBIDCgEBEgQKAgEIEgQKAhEYEgASACoAD0dBTUVfVFlQRV9HUk9VUAIFR3JvdXAAEUdBTUVfVFlQRV9QTEFUT0ZGAghQbGF5LW9mZgAKR0FNRV9UWVBFUwkAzAgCBQ9HQU1FX1RZUEVfR1JPVVAJAMwIAgURR0FNRV9UWVBFX1BMQVRPRkYFA25pbAAEVVNEVAEgbySjyqsw3FIpmOgsYVruWn8jTcItdbvpnapU4NLQB8EAB01JTl9CRVQAwIQ9AAhPTkVfSE9VUgkAaAIJAGgCAAUAPADoBwARTU9ORVlfQk9YX0FERFJFRVMJAQdBZGRyZXNzAQEaAVSxYgy7BRV2F+zuKtUZtXyHmoiep9yqU84AB0JFVF9GRUUA9AMACUZFRV9TQ0FMRQCQTgAHa0FjdGl2ZQIGYWN0aXZlAAtrQWN0aXZlR2xvYgIUYWN0aXZlX2FsbF9jb250cmFjdHMABmtDYXVzZQIOc2h1dGRvd25fY2F1c2UADWtHYW1lU3RyYVRpbWUCDl9zdGFydEdhbWVUaW1lAAlrR2FtZVR5cGUCCV9HY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, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ey56cvi11nPBonVsYTRiLmC35Bh3KVLMTgfSFDqNV57h Next: 3dwwLKhoSMJmjsXhKrPU93xySYpTPEh79PBm6b1PJTkH Diff:
OldNewDifferences
171171 let G1 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0) + (if ((type == 1))
172172 then amount
173173 else 0))
174- let G2 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, result)), 0) + (if ((type == 2))
174+ let G2 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, gameResult)), 0) + (if ((type == 2))
175175 then amount
176176 else 0))
177177 let G3 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0) + (if ((type == 3))
178178 then amount
179179 else 0))
180180 let totalWinValue = ((G1 + G2) + G3)
181- let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
181+ let totalBets = (valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0) + amount)
182182 let bankWithFee = (totalBets - totalWinValue)
183183 let fee = fraction(bankWithFee, BET_FEE, FEE_SCALE)
184184 let B = (bankWithFee - fee)
197197 else (((G1 + ((G1 / totalWinValueMax) * B)) * UB1) / G1)
198198 let D2 = if ((G2 == 0))
199199 then 0
200- else (((G2 + ((G2 / totalWinValueMax) * B)) * UB2) / G2)
200+ else (((G2 + (((G2 * 3) / totalWinValueMax) * B)) * UB2) / G2)
201201 let D3 = if ((G3 == 0))
202202 then 0
203- else (((G3 + ((G3 / totalWinValueMax) * B)) * UB3) / G3)
203+ else (((G3 + (((G3 * 2) / totalWinValueMax) * B)) * UB3) / G3)
204204 let claimAmount = ((D1 + D2) + D3)
205205 $Tuple2(nil, claimAmount)
206206 }
211211 func bet (gameId,type,result,refId) = valueOrElse(isActive(), {
212212 let user = toString(i.caller)
213213 let gIdStr = toString(gameId)
214- let $t061036178 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
215- let pmtAmount = $t061036178._1
216- let pmtAssetId = $t061036178._2
214+ let $t061246199 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
215+ let pmtAmount = $t061246199._1
216+ let pmtAssetId = $t061246199._2
217217 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
218218 let gameType = getStringValue(this, (toString(gameId) + kGameType))
219219 if ((pmtAssetId != USDT))
307307 else (((G1 + ((G1 / totalWinValueMax) * B)) * UB1) / G1)
308308 let D2 = if ((G2 == 0))
309309 then 0
310- else (((G2 + ((G2 / totalWinValueMax) * B)) * UB2) / G2)
310+ else (((G2 + (((G2 * 3) / totalWinValueMax) * B)) * UB2) / G2)
311311 let D3 = if ((G3 == 0))
312312 then 0
313- else (((G3 + ((G3 / totalWinValueMax) * B)) * UB3) / G3)
313+ else (((G3 + (((G3 * 2) / totalWinValueMax) * B)) * UB3) / G3)
314314 let claimAmount = ((D1 + D2) + D3)
315315 if ((claimAmount == 0))
316316 then throw("Nothing to claim")
344344 let totalWinValue = ((totalWinType1 + totalWinType2) + totalWinType3)
345345 let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
346346 let bankWithFee = (totalBets - totalWinValue)
347- let $t01148911647 = if ((totalWinValue == 0))
347+ let $t01151811676 = if ((totalWinValue == 0))
348348 then $Tuple2(bankWithFee, 0)
349349 else {
350350 let f = fraction(bankWithFee, BET_FEE, FEE_SCALE)
351351 $Tuple2(f, (bankWithFee - f))
352352 }
353- let fee = $t01148911647._1
354- let bank = $t01148911647._2
353+ let fee = $t01151811676._1
354+ let bank = $t01151811676._2
355355 [StringEntry((gIdStr + kGameResult), result), IntegerEntry((gIdStr + kBank), bank), IntegerEntry((gIdStr + kFinalTime), lastBlock.timestamp), ScriptTransfer(MONEY_BOX_ADDREES, fee, USDT)]
356356 }
357357 }
361361 @Callable(i)
362362 func initGames (startGameTimes,types) = {
363363 func initGame (acc,startGameTime) = {
364- let $t01203112065 = acc
365- let entries = $t01203112065._1
366- let lastGameId = $t01203112065._2
367- let j = $t01203112065._3
364+ let $t01206012094 = acc
365+ let entries = $t01206012094._1
366+ let lastGameId = $t01206012094._2
367+ let j = $t01206012094._3
368368 let newGameId = (lastGameId + 1)
369369 if ((lastBlock.timestamp > startGameTime))
370370 then throw("startGameTime must be in the future")
377377 }
378378
379379 let lastGameId = valueOrElse(getInteger(this, kLastGameId), 0)
380- let $t01260812693 = {
380+ let $t01263712722 = {
381381 let $l = startGameTimes
382382 let $s = size($l)
383383 let $acc0 = $Tuple3(nil, lastGameId, 0)
391391
392392 $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)
393393 }
394- let gamesEntries = $t01260812693._1
395- let newLGId = $t01260812693._2
394+ let gamesEntries = $t01263712722._1
395+ let newLGId = $t01263712722._2
396396 (gamesEntries :+ IntegerEntry(kLastGameId, newLGId))
397397 }
398398
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 @Callable(i)
147147 func potentialWinnings (gameId,userAddress,amount,type,result) = {
148148 let spldRes = split(result, "_")
149149 let $t039904398 = if ((type == 1))
150150 then if ((result == "A"))
151151 then $Tuple3("1_0", 1, 0)
152152 else if ((result == "B"))
153153 then $Tuple3("0_1", 0, 1)
154154 else $Tuple3("1_1", 1, 1)
155155 else if ((type == 2))
156156 then $Tuple3(result, parseIntValue(spldRes[0]), parseIntValue(spldRes[1]))
157157 else 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 let gameResult = $t039904398._1
161161 let ballsA = $t039904398._2
162162 let ballsB = $t039904398._3
163163 let diff = if ((ballsA > ballsB))
164164 then (ballsA - ballsB)
165165 else (ballsB - ballsA)
166166 let winner = if ((ballsA > ballsB))
167167 then "A"
168168 else if ((ballsB > ballsA))
169169 then "B"
170170 else "D"
171171 let G1 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0) + (if ((type == 1))
172172 then amount
173173 else 0))
174- let G2 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, result)), 0) + (if ((type == 2))
174+ let G2 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, gameResult)), 0) + (if ((type == 2))
175175 then amount
176176 else 0))
177177 let G3 = (valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0) + (if ((type == 3))
178178 then amount
179179 else 0))
180180 let totalWinValue = ((G1 + G2) + G3)
181- let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
181+ let totalBets = (valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0) + amount)
182182 let bankWithFee = (totalBets - totalWinValue)
183183 let fee = fraction(bankWithFee, BET_FEE, FEE_SCALE)
184184 let B = (bankWithFee - fee)
185185 let UB1 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 1, winner)), 0) + (if ((type == 1))
186186 then amount
187187 else 0))
188188 let UB2 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 2, gameResult)), 0) + (if ((type == 2))
189189 then amount
190190 else 0))
191191 let UB3 = (valueOrElse(getInteger(this, getUserBetKey(userAddress, gameId, 3, ((winner + "_") + toString(diff)))), 0) + (if ((type == 3))
192192 then amount
193193 else 0))
194194 let totalWinValueMax = ((G1 + (G2 * 3)) + (G3 * 2))
195195 let D1 = if ((G1 == 0))
196196 then 0
197197 else (((G1 + ((G1 / totalWinValueMax) * B)) * UB1) / G1)
198198 let D2 = if ((G2 == 0))
199199 then 0
200- else (((G2 + ((G2 / totalWinValueMax) * B)) * UB2) / G2)
200+ else (((G2 + (((G2 * 3) / totalWinValueMax) * B)) * UB2) / G2)
201201 let D3 = if ((G3 == 0))
202202 then 0
203- else (((G3 + ((G3 / totalWinValueMax) * B)) * UB3) / G3)
203+ else (((G3 + (((G3 * 2) / totalWinValueMax) * B)) * UB3) / G3)
204204 let claimAmount = ((D1 + D2) + D3)
205205 $Tuple2(nil, claimAmount)
206206 }
207207
208208
209209
210210 @Callable(i)
211211 func bet (gameId,type,result,refId) = valueOrElse(isActive(), {
212212 let user = toString(i.caller)
213213 let gIdStr = toString(gameId)
214- let $t061036178 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
215- let pmtAmount = $t061036178._1
216- let pmtAssetId = $t061036178._2
214+ let $t061246199 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
215+ let pmtAmount = $t061246199._1
216+ let pmtAssetId = $t061246199._2
217217 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
218218 let gameType = getStringValue(this, (toString(gameId) + kGameType))
219219 if ((pmtAssetId != USDT))
220220 then throw("Pamyment must be In USDT asset")
221221 else if ((MIN_BET > pmtAmount))
222222 then throw((("Min bet " + toString((MIN_BET / 1000000))) + "USDT"))
223223 else if ((gameStartTime == 0))
224224 then throw(("There is no game with id" + toString(gameId)))
225225 else if (((lastBlock.timestamp + ONE_HOUR) >= gameStartTime))
226226 then throw("Bets on this game are no longer accepted")
227227 else if (!(validateBet(gameType, type, result)))
228228 then throw("Incorrect bet type")
229229 else {
230230 let spldRes = split(result, "_")
231231 let userBetKey = getUserBetKey(user, gameId, type, result)
232232 let totalBetsForTypeBetKey = getTotalBetsForTypeKey(gameId, type, result)
233233 let userBet = (valueOrElse(getInteger(this, userBetKey), 0) + pmtAmount)
234234 let totalBetsForTypeBet = (valueOrElse(getInteger(this, totalBetsForTypeBetKey), 0) + pmtAmount)
235235 let totalBets = (valueOrElse(getInteger(this, (gIdStr + kTotalBets)), 0) + pmtAmount)
236236 let toWinA = (valueOrElse(getInteger(this, (gIdStr + kToWinA)), 0) + (if (if ((type == 1))
237237 then (result == "A")
238238 else false)
239239 then pmtAmount
240240 else if (if ((type == 2))
241241 then (parseIntValue(spldRes[0]) > parseIntValue(spldRes[1]))
242242 else false)
243243 then pmtAmount
244244 else if (if ((type == 3))
245245 then (spldRes[0] == "A")
246246 else false)
247247 then pmtAmount
248248 else 0))
249249 let toWinB = (valueOrElse(getInteger(this, (gIdStr + kToWinB)), 0) + (if (if ((type == 1))
250250 then (result == "B")
251251 else false)
252252 then pmtAmount
253253 else if (if ((type == 2))
254254 then (parseIntValue(spldRes[1]) > parseIntValue(spldRes[0]))
255255 else false)
256256 then pmtAmount
257257 else if (if ((type == 3))
258258 then (spldRes[0] == "B")
259259 else false)
260260 then pmtAmount
261261 else 0))
262262 let onDraw = (valueOrElse(getInteger(this, (gIdStr + kOnDraw)), 0) + (if (if ((type == 1))
263263 then (result == "D")
264264 else false)
265265 then pmtAmount
266266 else 0))
267267 ([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)))))
268268 then [StringEntry((user + kUserRefId), refId)]
269269 else nil))
270270 }
271271 })
272272
273273
274274
275275 @Callable(i)
276276 func claim (gameId) = valueOrElse(isActive(), {
277277 let user = toString(i.caller)
278278 let gIdStr = toString(gameId)
279279 let finalTime = valueOrErrorMessage(getInteger(this, (gIdStr + kFinalTime)), "You can claim only after game finish")
280280 if ((lastBlock.timestamp > (finalTime + ONE_HOUR)))
281281 then throw("You can claim only after one hour pass after final time")
282282 else if (isDefined(getBoolean(this, (((user + "_") + gIdStr) + kUserClaimed))))
283283 then throw("You are alredy claimed")
284284 else {
285285 let gameResult = getStringValue(this, (gIdStr + kGameResult))
286286 let spldRes = split(gameResult, "_")
287287 let ballsA = valueOrErrorMessage(parseInt(spldRes[0]), "Inncorrect game result")
288288 let ballsB = valueOrErrorMessage(parseInt(spldRes[1]), "Inncorrect game result")
289289 let diff = if ((ballsA > ballsB))
290290 then (ballsA - ballsB)
291291 else (ballsB - ballsA)
292292 let winner = if ((ballsA > ballsB))
293293 then "A"
294294 else if ((ballsB > ballsA))
295295 then "B"
296296 else "D"
297297 let B = getIntegerValue(this, (gIdStr + kBank))
298298 let UB1 = valueOrElse(getIntegerValue(this, getUserBetKey(user, gameId, 1, winner)), 0)
299299 let UB2 = valueOrElse(getIntegerValue(this, getUserBetKey(user, gameId, 2, gameResult)), 0)
300300 let UB3 = valueOrElse(getIntegerValue(this, getUserBetKey(user, gameId, 3, ((winner + "_") + toString(diff)))), 0)
301301 let G1 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0)
302302 let G2 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, gameResult)), 0)
303303 let G3 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0)
304304 let totalWinValueMax = ((G1 + (G2 * 3)) + (G3 * 2))
305305 let D1 = if ((G1 == 0))
306306 then 0
307307 else (((G1 + ((G1 / totalWinValueMax) * B)) * UB1) / G1)
308308 let D2 = if ((G2 == 0))
309309 then 0
310- else (((G2 + ((G2 / totalWinValueMax) * B)) * UB2) / G2)
310+ else (((G2 + (((G2 * 3) / totalWinValueMax) * B)) * UB2) / G2)
311311 let D3 = if ((G3 == 0))
312312 then 0
313- else (((G3 + ((G3 / totalWinValueMax) * B)) * UB3) / G3)
313+ else (((G3 + (((G3 * 2) / totalWinValueMax) * B)) * UB3) / G3)
314314 let claimAmount = ((D1 + D2) + D3)
315315 if ((claimAmount == 0))
316316 then throw("Nothing to claim")
317317 else $Tuple2([BooleanEntry((((user + "_") + gIdStr) + kUserClaimed), true), ScriptTransfer(i.caller, claimAmount, USDT)], claimAmount)
318318 }
319319 })
320320
321321
322322
323323 @Callable(i)
324324 func gameSummary (gameId,result) = {
325325 let gIdStr = toString(gameId)
326326 let gameStartTime = valueOrElse(getInteger(this, (toString(gameId) + kGameStraTime)), 0)
327327 if ((gameStartTime == 0))
328328 then throw(("There is no game with id" + toString(gameId)))
329329 else {
330330 let spldRes = split(result, "_")
331331 let ballsA = valueOrErrorMessage(parseInt(spldRes[0]), "Inncorrect game result")
332332 let ballsB = valueOrErrorMessage(parseInt(spldRes[1]), "Inncorrect game result")
333333 let diff = if ((ballsA > ballsB))
334334 then (ballsA - ballsB)
335335 else (ballsB - ballsA)
336336 let winner = if ((ballsA > ballsB))
337337 then "A"
338338 else if ((ballsB > ballsA))
339339 then "B"
340340 else "D"
341341 let totalWinType1 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 1, winner)), 0)
342342 let totalWinType2 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 2, result)), 0)
343343 let totalWinType3 = valueOrElse(getInteger(this, getTotalBetsForTypeKey(gameId, 3, ((winner + "_") + toString(diff)))), 0)
344344 let totalWinValue = ((totalWinType1 + totalWinType2) + totalWinType3)
345345 let totalBets = valueOrElse(getInteger(this, (toString(gameId) + kTotalBets)), 0)
346346 let bankWithFee = (totalBets - totalWinValue)
347- let $t01148911647 = if ((totalWinValue == 0))
347+ let $t01151811676 = if ((totalWinValue == 0))
348348 then $Tuple2(bankWithFee, 0)
349349 else {
350350 let f = fraction(bankWithFee, BET_FEE, FEE_SCALE)
351351 $Tuple2(f, (bankWithFee - f))
352352 }
353- let fee = $t01148911647._1
354- let bank = $t01148911647._2
353+ let fee = $t01151811676._1
354+ let bank = $t01151811676._2
355355 [StringEntry((gIdStr + kGameResult), result), IntegerEntry((gIdStr + kBank), bank), IntegerEntry((gIdStr + kFinalTime), lastBlock.timestamp), ScriptTransfer(MONEY_BOX_ADDREES, fee, USDT)]
356356 }
357357 }
358358
359359
360360
361361 @Callable(i)
362362 func initGames (startGameTimes,types) = {
363363 func initGame (acc,startGameTime) = {
364- let $t01203112065 = acc
365- let entries = $t01203112065._1
366- let lastGameId = $t01203112065._2
367- let j = $t01203112065._3
364+ let $t01206012094 = acc
365+ let entries = $t01206012094._1
366+ let lastGameId = $t01206012094._2
367+ let j = $t01206012094._3
368368 let newGameId = (lastGameId + 1)
369369 if ((lastBlock.timestamp > startGameTime))
370370 then throw("startGameTime must be in the future")
371371 else if (!(containsElement(GAME_TYPES, types[j])))
372372 then throw(("type must contain one of values: " + makeString(GAME_TYPES, ",")))
373373 else {
374374 let gameEntries = [IntegerEntry((toString(newGameId) + kGameStraTime), startGameTime), StringEntry((toString(newGameId) + kGameType), types[j])]
375375 $Tuple3((entries ++ gameEntries), newGameId, (j + 1))
376376 }
377377 }
378378
379379 let lastGameId = valueOrElse(getInteger(this, kLastGameId), 0)
380- let $t01260812693 = {
380+ let $t01263712722 = {
381381 let $l = startGameTimes
382382 let $s = size($l)
383383 let $acc0 = $Tuple3(nil, lastGameId, 0)
384384 func $f0_1 ($a,$i) = if (($i >= $s))
385385 then $a
386386 else initGame($a, $l[$i])
387387
388388 func $f0_2 ($a,$i) = if (($i >= $s))
389389 then $a
390390 else throw("List size exceeds 50")
391391
392392 $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)
393393 }
394- let gamesEntries = $t01260812693._1
395- let newLGId = $t01260812693._2
394+ let gamesEntries = $t01263712722._1
395+ let newLGId = $t01263712722._2
396396 (gamesEntries :+ IntegerEntry(kLastGameId, newLGId))
397397 }
398398
399399
400400
401401 @Callable(i)
402402 func shutdown () = if (!(active))
403403 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified")))
404404 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
405405 then throw("Only admin can call this function")
406406 else suspend("Paused by admin")
407407
408408
409409
410410 @Callable(i)
411411 func activate () = if (active)
412412 then throw("DApp is already active")
413413 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
414414 then throw("Only admin can call this function")
415415 else [BooleanEntry(kActive, true), DeleteEntry(kCause)]
416416
417417

github/deemru/w8io/026f985 
112.48 ms