tx · D6gbhA39Wfb7w2eRvjkZnXJYgaY762jdt7rK8jh4Fmk1

3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA:  -0.01000000 Waves

2023.06.03 18:24 [2606675] smart account 3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA > SELF 0.00000000 Waves

{ "type": 13, "id": "D6gbhA39Wfb7w2eRvjkZnXJYgaY762jdt7rK8jh4Fmk1", "fee": 1000000, "feeAssetId": null, "timestamp": 1685805919544, "version": 2, "chainId": 84, "sender": "3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA", "senderPublicKey": "Dx7cJVhpJb4qUDGiDnSjj6Wfjdj5nmzwVLfaggkbjDtv", "proofs": [ "3aB4DAw4eSA3RBcAaU7sy3gifcNxi24rDQnjmrXNb1MFXfHjRTibWW4LjJXVLz7ug15nHvzAvPRWfGA9XBU4BzDg" ], "script": "base64:BgIGCAISABIABgEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAQFpBBFhY2NlcHRhYmxlQXNzZXRJZAEgIkSm54hUfVEormpXug9p+nbhDnc37ahHq1IfaU2UQkcDCQAAAgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIUUGF5bWVudCBub3QgYXR0YWNoZWQEAXAJAJEDAggFAWkIcGF5bWVudHMAAAQHJG1hdGNoMAgFAXAHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAdhc3NldElkBQckbWF0Y2gwAwkAAAIFB2Fzc2V0SWQFEWFjY2VwdGFibGVBc3NldElkCQBnAggFAXAGYW1vdW50CQEKbnVtVG9XYXZlcwEAAQcJAGcCCAUBcAZhbW91bnQJAQpudW1Ub1dhdmVzAQABARNnZXRMdWNreVdoZWVsQmV0S2V5AQFpCQCsAgICD2JldF9MdWNreVdoZWVsXwkApQgBCAUBaQZjYWxsZXIBE2dldEx1Y2t5V2hlZWxXb25LZXkBAWkJAKwCAgIPd29uX0x1Y2t5V2hlZWx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aWdodAIRdW5leGNwZWN0ZWQgZXJyb3IEA3ZyZgkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCAULcmV2ZWFsQmxvY2sDdnJmAhF1bmV4Y3BlY3RlZCBlcnJvcgQKcmFuZG9tU2VlZAkAsQkBCQD1AwEFA3ZyZgQMcmFuZG9tTnVtYmVyCQBkAgkAagIFCnJhbmRvbVNlZWQJAGQCCQBlAgAMAAEAAQABBA13aW5uaW5nQW1vdW50CQEZZ2FtZUx1Y2t5V2hlZWxXaGF0VXNlcldvbgEFDHJhbmRvbU51bWJlcgMJAGYCBQ13aW5uaW5nQW1vdW50AAAJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBE2dldEx1Y2t5V2hlZWxCZXRLZXkBBQFpCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUNd2lubmluZ0Ftb3VudAUEdW5pdAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE2dldEx1Y2t5V2hlZWxXb25LZXkBBQFpBQ13aW5uaW5nQW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEcZ2V0THVja3lXaGVlbFJhbmRvbU51bWJlcktleQEFAWkFDHJhbmRvbU51bWJlcgUDbmlsCQDMCAIJAQtEZWxldGVFbnRyeQEJARNnZXRMdWNreVdoZWVsQmV0S2V5AQUBaQkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE2dldEx1Y2t5V2hlZWxXb25LZXkBBQFpBQ13aW5uaW5nQW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEcZ2V0THVja3lXaGVlbFJhbmRvbU51bWJlcktleQEFAWkFDHJhbmRvbU51bWJlcgUDbmlsALb5Dzk=", "height": 2606675, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4RG8Fit1vRGWGGHaBKGKsSo1gTuP8cgScYchQXv35yDK Next: 9LXAkVvc73oLyu77La1BUMfDFGdi7Cb11AXxdswNzwRt Diff:
OldNewDifferences
3838 else if ((5 == $match0))
3939 then numToWaves(1)
4040 else if ((7 == $match0))
41- then numToWaves(4)
41+ then numToWaves(6)
4242 else if ((11 == $match0))
4343 then numToWaves(1)
4444 else 0
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func numToWaves (num) = (num * 100000000)
55
66
77 func isPaymentOk (i) = {
88 let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg'
99 if ((size(i.payments) == 0))
1010 then throw("Payment not attached")
1111 else {
1212 let p = i.payments[0]
1313 match p.assetId {
1414 case assetId: ByteVector =>
1515 if ((assetId == acceptableAssetId))
1616 then (p.amount >= numToWaves(1))
1717 else false
1818 case _ =>
1919 (p.amount >= numToWaves(1))
2020 }
2121 }
2222 }
2323
2424
2525 func getLuckyWheelBetKey (i) = ("bet_LuckyWheel_" + toString(i.caller))
2626
2727
2828 func getLuckyWheelWonKey (i) = ("won_LuckyWheel_" + toString(i.caller))
2929
3030
3131 func getLuckyWheelRandomNumberKey (i) = ("randomNumber_LuckyWheel_" + toString(i.caller))
3232
3333
3434 func gameLuckyWheelWhatUserWon (value) = match value {
3535 case _ =>
3636 if ((1 == $match0))
3737 then numToWaves(2)
3838 else if ((5 == $match0))
3939 then numToWaves(1)
4040 else if ((7 == $match0))
41- then numToWaves(4)
41+ then numToWaves(6)
4242 else if ((11 == $match0))
4343 then numToWaves(1)
4444 else 0
4545 }
4646
4747
4848 @Callable(i)
4949 func commitLuckyWheel () = if (!(isPaymentOk(i)))
5050 then throw("Wrong payment amount or asset")
5151 else [IntegerEntry(getLuckyWheelBetKey(i), (height + 1)), DeleteEntry(getLuckyWheelRandomNumberKey(i)), DeleteEntry(getLuckyWheelWonKey(i))]
5252
5353
5454
5555 @Callable(i)
5656 func revealLuckyWheel () = {
5757 let commitHeight = valueOrErrorMessage(getIntegerValue(getLuckyWheelBetKey(i)), "Bet not found")
5858 if ((commitHeight > height))
5959 then throw((("wait " + toString((commitHeight - height))) + " blocks to reveal this id"))
6060 else {
6161 let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error")
6262 let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error")
6363 let randomSeed = toInt(keccak256(vrf))
6464 let randomNumber = ((randomSeed % ((12 - 1) + 1)) + 1)
6565 let winningAmount = gameLuckyWheelWhatUserWon(randomNumber)
6666 if ((winningAmount > 0))
6767 then [DeleteEntry(getLuckyWheelBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
6868 else [DeleteEntry(getLuckyWheelBetKey(i)), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
6969 }
7070 }
7171
7272

github/deemru/w8io/169f3d6 
25.02 ms