tx · 9LXAkVvc73oLyu77La1BUMfDFGdi7Cb11AXxdswNzwRt

3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA:  -0.01000000 Waves

2023.06.03 18:46 [2606705] smart account 3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA > SELF 0.00000000 Waves

{ "type": 13, "id": "9LXAkVvc73oLyu77La1BUMfDFGdi7Cb11AXxdswNzwRt", "fee": 1000000, "feeAssetId": null, "timestamp": 1685807255229, "version": 2, "chainId": 84, "sender": "3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA", "senderPublicKey": "Dx7cJVhpJb4qUDGiDnSjj6Wfjdj5nmzwVLfaggkbjDtv", "proofs": [ "4xQWNW6YT6qgAj9qzVYxPdB5NUGwyPWXbGRMkmwKTjDZBboPmr3d1qc87yxF6ZEypKF4XWrqEroztcX1dEEPxNtn" ], "script": "base64:BgIGCAISABIABwEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAQFpBBFhY2NlcHRhYmxlQXNzZXRJZAEgIkSm54hUfVEormpXug9p+nbhDnc37ahHq1IfaU2UQkcDCQAAAgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIUUGF5bWVudCBub3QgYXR0YWNoZWQEAXAJAJEDAggFAWkIcGF5bWVudHMAAAQHJG1hdGNoMAgFAXAHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAdhc3NldElkBQckbWF0Y2gwAwkAAAIFB2Fzc2V0SWQFEWFjY2VwdGFibGVBc3NldElkCQBnAggFAXAGYW1vdW50CQEKbnVtVG9XYXZlcwEAAQcJAGcCCAUBcAZhbW91bnQJAQpudW1Ub1dhdmVzAQABARNnZXRMdWNreVdoZWVsQmV0S2V5AQFpCQCsAgICD2JldF9MdWNreVdoZWVsXwkApQgBCAUBaQZjYWxsZXIBE2dldEx1Y2t5V2hlZWxXb25LZXkBAWkJAKwCAgIPd29uX0x1Y2t5V2hlZWxfCQClC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VhbEJsb2NrCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAO0HAQUMY29tbWl0SGVpZ2h0AhF1bmV4Y3BlY3RlZCBlcnJvcgQDdnJmCQETdmFsdWVPckVycm9yTWVzc2FnZQIIBQtyZXZlYWxCbG9jawN2cmYCEXVuZXhjcGVjdGVkIGVycm9yBApyYW5kb21TZWVkCQCxCQEJAPUDAQUDdnJmBAxyYW5kb21OdW1iZXIJAGQCCQBqAgUKcmFuZG9tU2VlZAkAZAIJAGUCAAwAAQABAAEEDXdpbm5pbmdBbW91bnQJARlnYW1lTHVja3lXaGVlbFdoYXRVc2VyV29uAQUMcmFuZG9tTnVtYmVyAwkAZgIFDXdpbm5pbmdBbW91bnQAAAkAzAgCCQELRGVsZXRlRW50cnkBCQETZ2V0THVja3lXaGVlbEJldEtleQEFAWkJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQ13aW5uaW5nQW1vdW50BQR1bml0CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQETZ2V0THVja3lXaGVlbFdvbktleQEFAWkFDXdpbm5pbmdBbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIJARxnZXRMdWNreVdoZWVsUmFuZG9tTnVtYmVyS2V5AQUBaQUMcmFuZG9tTnVtYmVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQETZ2V0THVja3lXaGVlbExvZ0tleQEFAWkFDXdpbm5pbmdBbW91bnQFA25pbAkAzAgCCQELRGVsZXRlRW50cnkBCQETZ2V0THVja3lXaGVlbEJldEtleQEFAWkJAMwIAgkBDEludGVnZXJFbnRyeQIJARNnZXRMdWNreVdoZWVsV29uS2V5AQUBaQUNd2lubmluZ0Ftb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBHGdldEx1Y2t5V2hlZWxSYW5kb21OdW1iZXJLZXkBBQFpBQxyYW5kb21OdW1iZXIFA25pbABT9/cB", "height": 2606705, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D6gbhA39Wfb7w2eRvjkZnXJYgaY762jdt7rK8jh4Fmk1 Next: J66F5jHRodUYP18ArFJhHV8XgQvEQm4Csv1QZFpMPpLc Diff:
OldNewDifferences
2929
3030
3131 func getLuckyWheelRandomNumberKey (i) = ("randomNumber_LuckyWheel_" + toString(i.caller))
32+
33+
34+func getLuckyWheelLogKey (i) = ("log_LuckyWheel_" + toString(i.caller))
3235
3336
3437 func gameLuckyWheelWhatUserWon (value) = match value {
6467 let randomNumber = ((randomSeed % ((12 - 1) + 1)) + 1)
6568 let winningAmount = gameLuckyWheelWhatUserWon(randomNumber)
6669 if ((winningAmount > 0))
67- then [DeleteEntry(getLuckyWheelBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
70+ then [DeleteEntry(getLuckyWheelBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber), IntegerEntry(getLuckyWheelLogKey(i), winningAmount)]
6871 else [DeleteEntry(getLuckyWheelBetKey(i)), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
6972 }
7073 }
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))
32+
33+
34+func getLuckyWheelLogKey (i) = ("log_LuckyWheel_" + toString(i.caller))
3235
3336
3437 func gameLuckyWheelWhatUserWon (value) = match value {
3538 case _ =>
3639 if ((1 == $match0))
3740 then numToWaves(2)
3841 else if ((5 == $match0))
3942 then numToWaves(1)
4043 else if ((7 == $match0))
4144 then numToWaves(6)
4245 else if ((11 == $match0))
4346 then numToWaves(1)
4447 else 0
4548 }
4649
4750
4851 @Callable(i)
4952 func commitLuckyWheel () = if (!(isPaymentOk(i)))
5053 then throw("Wrong payment amount or asset")
5154 else [IntegerEntry(getLuckyWheelBetKey(i), (height + 1)), DeleteEntry(getLuckyWheelRandomNumberKey(i)), DeleteEntry(getLuckyWheelWonKey(i))]
5255
5356
5457
5558 @Callable(i)
5659 func revealLuckyWheel () = {
5760 let commitHeight = valueOrErrorMessage(getIntegerValue(getLuckyWheelBetKey(i)), "Bet not found")
5861 if ((commitHeight > height))
5962 then throw((("wait " + toString((commitHeight - height))) + " blocks to reveal this id"))
6063 else {
6164 let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error")
6265 let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error")
6366 let randomSeed = toInt(keccak256(vrf))
6467 let randomNumber = ((randomSeed % ((12 - 1) + 1)) + 1)
6568 let winningAmount = gameLuckyWheelWhatUserWon(randomNumber)
6669 if ((winningAmount > 0))
67- then [DeleteEntry(getLuckyWheelBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
70+ then [DeleteEntry(getLuckyWheelBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber), IntegerEntry(getLuckyWheelLogKey(i), winningAmount)]
6871 else [DeleteEntry(getLuckyWheelBetKey(i)), IntegerEntry(getLuckyWheelWonKey(i), winningAmount), IntegerEntry(getLuckyWheelRandomNumberKey(i), randomNumber)]
6972 }
7073 }
7174
7275

github/deemru/w8io/169f3d6 
29.25 ms