tx · GgxepTxMZteQCP5HtU6VQe9fehEdoMP5sgRr4BjqkuCw

3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr:  -0.01400000 Waves

2023.12.11 16:42 [2882030] smart account 3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr > SELF 0.00000000 Waves

{ "type": 13, "id": "GgxepTxMZteQCP5HtU6VQe9fehEdoMP5sgRr4BjqkuCw", "fee": 1400000, "feeAssetId": null, "timestamp": 1702302187528, "version": 2, "chainId": 84, "sender": "3MyrsoUShtK8LVWE6mGVinCdwiJeedCtkvr", "senderPublicKey": "53WfUfPHKFYj846Npe6Bu5indsxPueAsu9YWe8fnprXh", "proofs": [ "5NJHDtjjtyn8BYGTw4Re3XmJzE6F7sHsz2JEPwEj9VQTmvzzCNMzgTAT9UArxyNvMK5PBZrzZnuva7KkbCqADHtD" ], "script": "base64:BgIaCAISBgoECAgBCBIDCgEEEgMKAQgSBAoCCAJCAANTRVACAl9fAAdXQVZFU0lEAQQTq9kzAAZXQVZFU0QAgMLXLwAJR0FNRV9OQU1FAg9DYXJkIG9mIHRoZSBEYXkADFJBTkRPTV9SQU5HRQkAZAIJAGQCACgABgAFAAhOVU1fQkVUUwABAAhXSU5fQ0FSRAIBMAEMZ2V0U3RyT3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFB2FkZHJlc3MFA2tleQkAuQkCCQDMCAICCm1hbmRhdG9yeSAJAMwIAgkApQgBBQdhZGRyZXNzCQDMCAICAS4JAMwIAgUDa2V5CQDMCAICDyBpcyBub3QgZGVmaW5lZAUDbmlsAgABDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IG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IJAQhnZXRJbnRPcgIJARhrZXlSZXNlcnZhdGlvbkJ5QXNzZXRTdHIBBQVhc3NldAAAAAAHCgACJGwFBkFTU0VUUwoAAiRzCQCQAwEFAiRsCgAFJGFjYzAGCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQdjaGVja2VyAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhRMaXN0IHNpemUgZXhjZWVkcyAxMAkBBSRmMF8yAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgUFJGFjYzAAAAABAAIAAwAEAAUABgAHAAgACQAKBwdzS+Gl", "height": 2882030, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DGsR1vDJrNaRA1WeRT65YhtvBeNefZrwUSMGXTQ1f4cU Next: none Diff:
OldNewDifferences
99
1010 let GAME_NAME = "Card of the Day"
1111
12-let RANDOM_RANGE = 40
12+let RANDOM_RANGE = ((40 + 6) + 5)
1313
1414 let NUM_BETS = 1
1515
16-let WIN_CARD = toString((RANDOM_RANGE - 1))
16+let WIN_CARD = "0"
1717
1818 func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
1919
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 = "Card of the Day"
1111
12-let RANDOM_RANGE = 40
12+let RANDOM_RANGE = ((40 + 6) + 5)
1313
1414 let NUM_BETS = 1
1515
16-let WIN_CARD = toString((RANDOM_RANGE - 1))
16+let WIN_CARD = "0"
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 func getIntArray (key) = {
4444 let a = getStrOrFail(this, key)
4545 func filler (acc,el) = (acc :+ parseIntValue(el))
4646
4747 let $l = split(a, SEP)
4848 let $s = size($l)
4949 let $acc0 = nil
5050 func $f0_1 ($a,$i) = if (($i >= $s))
5151 then $a
5252 else filler($a, $l[$i])
5353
5454 func $f0_2 ($a,$i) = if (($i >= $s))
5555 then $a
5656 else throw("List size exceeds 10")
5757
5858 $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)
5959 }
6060
6161
6262 let ASSETS = split(getStrOrFail(this, allowedAssetsKey), SEP)
6363
6464 let DECIMALS = getIntArray(assetsDecimalsKey)
6565
6666 let BETDIVIDERS = getIntArray(betDividersKey)
6767
6868 func keyReservationByAssetStr (assetStr) = ("$RESERVED_AMOUNT_" + assetStr)
6969
7070
7171 func keyReservationByAssetIdx (assetIdx) = keyReservationByAssetStr(ASSETS[assetIdx])
7272
7373
7474 let MINFEEWAVES = ((5 * WAVESD) / 1000)
7575
7676 let idxAssets = 0
7777
7878 let idxDecimals = 1
7979
8080 let idxDividers = 2
8181
8282 let BET1 = 1
8383
8484 let BET2 = 2
8585
8686 let BET4 = 4
8787
8888 let BET8 = 8
8989
9090 let BET14 = 14
9191
9292 let RATEMULT = 10000
9393
9494 let RATE = 250000
9595
9696 let BETS = [BET2]
9797
9898 let IdxGameState = 0
9999
100100 let IdxPlayerChoice = 1
101101
102102 let IdxPlayerPubKey58 = 2
103103
104104 let IdxStartedHeight = 3
105105
106106 let IdxWinAmount = 4
107107
108108 let IdxAssetId = 5
109109
110110 let STATESUBMITTED = "SUBMITTED"
111111
112112 let STATEWON = "WON"
113113
114114 let STATELOST = "LOST"
115115
116116 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " key is not specified in this.state"))
117117
118118
119119 let RSAPUBLIC = fromBase64String(getStringOrFail(RSAPUBLIC64KEY))
120120
121121 let SERVER = addressFromStringValue(getStringOrFail(SERVERADDRESSKEY))
122122
123123 let RANDORACLETIMEFRAME = valueOrElse(getInteger(this, RANDTIMEFRAMEKEY), 7200)
124124
125125 func getIntOr (key,default) = if (isDefined(getInteger(key)))
126126 then getIntegerValue(key)
127127 else default
128128
129129
130130 func setInt (key,value) = IntegerEntry(key, value)
131131
132132
133133 func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1))
134134
135135
136136 func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by))
137137
138138
139139 func assetIdToStr (assetIdOrUnit) = match assetIdOrUnit {
140140 case b: ByteVector =>
141141 toBase58String(b)
142142 case _ =>
143143 "WAVES"
144144 }
145145
146146
147147 func assetIdFromStr (assetIdStr) = if ((assetIdStr == "WAVES"))
148148 then unit
149149 else fromBase58String(assetIdStr)
150150
151151
152152 func getAssetBalance (assetIdOrUnit) = match assetIdOrUnit {
153153 case assetId: ByteVector =>
154154 assetBalance(this, assetId)
155155 case _ =>
156156 wavesBalance(this).available
157157 }
158158
159159
160160 func increaseReserveAmount (winAmount,assetIdx) = {
161161 let assetIdStr = ASSETS[assetIdx]
162162 let newReservedAmount = (getIntOr(keyReservationByAssetIdx(assetIdx), 0) + winAmount)
163163 if ((newReservedAmount > getAssetBalance(assetIdFromStr(assetIdStr))))
164164 then throw((("Insufficient funds on " + GAME_NAME) + " account. Transaction was rejected for your safety."))
165165 else newReservedAmount
166166 }
167167
168168
169169 func decreaseReservedAmount (gameId,assetIdx,winAmount) = if ((0 > (getIntOr(keyReservationByAssetIdx(assetIdx), 0) - winAmount)))
170170 then throw((("Invalid " + GAME_NAME) + " account state - reserved amount is less than 0"))
171171 else changeInt(keyReservationByAssetIdx(assetIdx), -(winAmount))
172172
173173
174174 func validateAndGetAssetIdx (assetIdStr) = {
175175 let idx = indexOf(ASSETS, assetIdStr)
176176 if (!(isDefined(idx)))
177177 then throw("Invalid payment asset")
178178 else value(idx)
179179 }
180180
181181
182182 func validateBetAndGetWinAmount (bet,internalAssetIdx,playerChoice) = {
183183 let dicesCount = size(playerChoice)
184184 func checkAmount (a,x) = if (a)
185185 then true
186186 else (bet == ((x * DECIMALS[internalAssetIdx]) / BETDIVIDERS[internalAssetIdx]))
187187
188188 if (!({
189189 let $l = BETS
190190 let $s = size($l)
191191 let $acc0 = false
192192 func $f0_1 ($a,$i) = if (($i >= $s))
193193 then $a
194194 else checkAmount($a, $l[$i])
195195
196196 func $f0_2 ($a,$i) = if (($i >= $s))
197197 then $a
198198 else throw("List size exceeds 5")
199199
200200 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
201201 }))
202202 then throw("Bet amount is not valid")
203203 else if ((parseInt(playerChoice) == unit))
204204 then throw("Invalid player's choice")
205205 else fraction(bet, RATE, RATEMULT)
206206 }
207207
208208
209209 func generateRandChoice (gameId,rsaSign,playerChoice) = {
210210 let rsaSigValid = rsaVerify_16Kb(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
211211 if (!(rsaSigValid))
212212 then throw("Invalid RSA signature")
213213 else {
214214 let rand = (toInt(sha256((rsaSign + toBytes(playerChoice)))) % RANDOM_RANGE)
215215 toString(rand)
216216 }
217217 }
218218
219219
220220 func isPlayerWin (playerChoice,randChoise) = (playerChoice == randChoise)
221221
222222
223223 func formatGameDataS (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty) = makeString([gameStatus, playerChoice, playerPubKey58, startedHeight, winAmount, assetIdx, if ((randOrEmpty == ""))
224224 then ""
225225 else randOrEmpty], "_")
226226
227227
228228 func formatGameData (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty) = formatGameDataS(gameStatus, playerChoice, playerPubKey58, toString(startedHeight), toString(winAmount), toString(assetIdx), randOrEmpty)
229229
230230
231231 func finishGameData (origGameData,gameStatus,rand,winByTimeout) = {
232232 let finishGameData = formatGameDataS(gameStatus, rand, origGameData[IdxPlayerPubKey58], origGameData[IdxStartedHeight], origGameData[IdxWinAmount], origGameData[IdxAssetId], WIN_CARD)
233233 if (winByTimeout)
234234 then (finishGameData + "_TIMEOUT")
235235 else finishGameData
236236 }
237237
238238
239239 func extractGameData (gameId) = split(match getString(this, gameId) {
240240 case str: String =>
241241 str
242242 case _ =>
243243 throw((("Game: " + gameId) + " not found."))
244244 }, "_")
245245
246246
247247 @Callable(i)
248248 func constructorV1 (rsaPublic64,benzAddress,randOracleTimeFrame,tokensDescriptor) = if ((i.caller != SERVER))
249249 then throw("not authorized")
250250 else {
251251 func splitter (acc,elem) = {
252252 let tokList = split(elem, ":")
253253 if ((size(tokList) != 4))
254254 then throw("Invalid asset record")
255255 else $Tuple3((acc._1 :+ tokList[idxAssets]), (acc._2 :+ tokList[idxDecimals]), (acc._3 :+ tokList[idxDividers]))
256256 }
257257
258258 let r = {
259259 let $l = split_4C(tokensDescriptor, "_")
260260 let $s = size($l)
261261 let $acc0 = $Tuple3(nil, nil, nil)
262262 func $f0_1 ($a,$i) = if (($i >= $s))
263263 then $a
264264 else splitter($a, $l[$i])
265265
266266 func $f0_2 ($a,$i) = if (($i >= $s))
267267 then $a
268268 else throw("List size exceeds 10")
269269
270270 $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)
271271 }
272272 [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))]
273273 }
274274
275275
276276
277277 @Callable(i)
278278 func maintenance (blocked) = if ((i.caller != SERVER))
279279 then throw("not authorized")
280280 else [BooleanEntry(blockedKey, blocked)]
281281
282282
283283
284284 @Callable(i)
285285 func bet (playerChoice) = if (valueOrElse(getBoolean(blockedKey), false))
286286 then throw("Game is stopped for maintenence")
287287 else {
288288 let gameId = toBase58String(i.transactionId)
289289 if ((1 >= size(i.payments)))
290290 then throw("2 payments must be attached")
291291 else if (isDefined(getString(this, gameId)))
292292 then throw((("Bet for: " + gameId) + " was already made."))
293293 else {
294294 let betPmt = value(i.payments[0])
295295 let feePmt = value(i.payments[1])
296296 if (isDefined(feePmt.assetId))
297297 then throw("feePmt (2nd payment) assetId must be in Waves")
298298 else if ((MINFEEWAVES > feePmt.amount))
299299 then throw("feePmt (2nd payment) must be >= 0.005 Waves")
300300 else {
301301 let assetIdStr = assetIdToStr(betPmt.assetId)
302302 let internalAssetIdx = validateAndGetAssetIdx(assetIdStr)
303303 let commission = feePmt.amount
304304 let winAmount = validateBetAndGetWinAmount(betPmt.amount, internalAssetIdx, playerChoice)
305305 let playerPubKey58 = toBase58String(i.callerPublicKey)
306306 let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, internalAssetIdx, "")
307307 [IntegerEntry(keyReservationByAssetIdx(internalAssetIdx), increaseReserveAmount(winAmount, internalAssetIdx)), incrementInt(GAMESCOUNTERKEY), StringEntry(gameId, gameData), ScriptTransfer(SERVER, commission, feePmt.assetId)]
308308 }
309309 }
310310 }
311311
312312
313313
314314 @Callable(i)
315315 func withdraw (gameId,rsaSign) = {
316316 let gameData = extractGameData(gameId)
317317 let gameState = gameData[IdxGameState]
318318 let playerChoice = gameData[IdxPlayerChoice]
319319 let startedHeight = parseIntValue(gameData[IdxStartedHeight])
320320 let winAmount = parseIntValue(gameData[IdxWinAmount])
321321 let assetIdx = parseIntValue(gameData[IdxAssetId])
322322 let playerPubKey58 = gameData[IdxPlayerPubKey58]
323323 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
324324 if ((gameState != STATESUBMITTED))
325325 then throw("Invalid game state for passed gameId")
326326 else if ((i.caller != SERVER))
327327 then throw("Regular withdraw can be done by server only")
328328 else {
329329 let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME)
330330 let randChoise = if (winByTimeout)
331331 then WIN_CARD
332332 else generateRandChoice(gameId, rsaSign, playerChoice)
333333 let playerWin = isPlayerWin(randChoise, WIN_CARD)
334334 let newGameStatus = if (playerWin)
335335 then STATEWON
336336 else STATELOST
337337 let newGameData = finishGameData(gameData, newGameStatus, randChoise, winByTimeout)
338338 ([StringEntry(gameId, newGameData), decreaseReservedAmount(gameId, assetIdx, winAmount)] ++ (if (playerWin)
339339 then [ScriptTransfer(playerAddress, winAmount, assetIdFromStr(ASSETS[assetIdx]))]
340340 else nil))
341341 }
342342 }
343343
344344
345345 @Verifier(tx)
346346 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
347347 then match tx {
348348 case ttx: TransferTransaction =>
349349 let assetIdx = validateAndGetAssetIdx(assetIdToStr(ttx.assetId))
350350 ((getAssetBalance(ttx.assetId) - ttx.amount) >= getIntOr(keyReservationByAssetIdx(assetIdx), 0))
351351 case stx: SetScriptTransaction =>
352352 func checker (acc,asset) = if (acc)
353353 then (getIntOr(keyReservationByAssetStr(asset), 0) == 0)
354354 else false
355355
356356 let $l = ASSETS
357357 let $s = size($l)
358358 let $acc0 = true
359359 func $f0_1 ($a,$i) = if (($i >= $s))
360360 then $a
361361 else checker($a, $l[$i])
362362
363363 func $f0_2 ($a,$i) = if (($i >= $s))
364364 then $a
365365 else throw("List size exceeds 10")
366366
367367 $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)
368368 case _ =>
369369 false
370370 }
371371 else false
372372

github/deemru/w8io/026f985 
57.70 ms