tx · 5Rb6Pno8poU7pDUdFrzZqfPboE9BfzJcqgaa4cd9KkUk
3MvEkw2C78pz2dKAppkhh1mRH6HuJGwRCSk: -0.01000000 Waves
2023.05.29 19:22 [2599496] smart account 3MvEkw2C78pz2dKAppkhh1mRH6HuJGwRCSk > SELF 0.00000000 Waves
{
"type": 13,
"id": "5Rb6Pno8poU7pDUdFrzZqfPboE9BfzJcqgaa4cd9KkUk",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1685377426731,
"version": 2,
"chainId": 84,
"sender": "3MvEkw2C78pz2dKAppkhh1mRH6HuJGwRCSk",
"senderPublicKey": "9s6e65tKERrhVTka26nUspCZX3GsFZJ6zko3rgnryQqg",
"proofs": [
"41PubQCbk9veWUhuHPSJh867AiYAU9yd8VCmMer76exuKpEkVJJXWTdxfMRHDmoppABfjKCKFd26gcWUveBBcMtF"
],
"script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAAAwEAAAAUZ2VuZXJhdGVSYW5kb21OdW1iZXIAAAADAAAAAWkAAAADbWluAAAAA21heAQAAAAKcmFuZG9tU2VlZAkABLEAAAABCQAB9QAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAADHJhbmRvbU51bWJlcgkAAGQAAAACCQAAagAAAAIFAAAACnJhbmRvbVNlZWQJAABkAAAAAgkAAGUAAAACBQAAAANtYXgFAAAAA21pbgAAAAAAAAAAAQUAAAADbWluBQAAAAxyYW5kb21OdW1iZXIBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAEAAAAgIkSm54hUfVEormpXug9p+nbhDnc37ahHq1IfaU2UQkcDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXR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ACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADXdpbm5pbmdBbW91bnQFAAAABHVuaXQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAFZ2FtZV8FAAAAAmlkBQAAAA13aW5uaW5nQW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAF3Rlc3RfZ2FtZV9yYW5kb21OdW1iZXJfBQAAAAJpZAUAAAAMcmFuZG9tTnVtYmVyCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAAGHRlc3RfZ2FtZV93aW5uaW5nQW1vdW50XwUAAAACaWQFAAAADXdpbm5pbmdBbW91bnQFAAAAA25pbAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAVnYW1lXwUAAAACaWQFAAAADXdpbm5pbmdBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAXdGVzdF9nYW1lX3JhbmRvbU51bWJlcl8FAAAAAmlkBQAAAAxyYW5kb21OdW1iZXIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAYdGVzdF9nYW1lX3dpbm5pbmdBbW91bnRfBQAAAAJpZAUAAAANd2lubmluZ0Ftb3VudAUAAAADbmlsAAAAAHCNWOA=",
"height": 2599496,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 5CPZ8uYcsTpBMYo25QRkxhDyoLoen6usGeExASGVLv5Q
Next: BiE1ZnrYataDZu31XvXQT1QDmi3wDULSqfaUgFzjnfJ2
Diff:
Old | New | | Differences |
---|
29 | 29 | | func gameLuckyWheelWhatUserWon (value) = match value { |
---|
30 | 30 | | case _ => |
---|
31 | 31 | | if ((1 == $match0)) |
---|
32 | | - | then 20000000 |
---|
| 32 | + | then 200000000 |
---|
33 | 33 | | else if ((3 == $match0)) |
---|
34 | | - | then 10000000 |
---|
| 34 | + | then 100000000 |
---|
35 | 35 | | else if ((5 == $match0)) |
---|
36 | | - | then 10000000 |
---|
| 36 | + | then 100000000 |
---|
37 | 37 | | else if ((7 == $match0)) |
---|
38 | | - | then 30000000 |
---|
| 38 | + | then 300000000 |
---|
39 | 39 | | else if ((8 == $match0)) |
---|
40 | | - | then 10000000 |
---|
| 40 | + | then 100000000 |
---|
41 | 41 | | else if ((11 == $match0)) |
---|
42 | | - | then 10000000 |
---|
| 42 | + | then 100000000 |
---|
43 | 43 | | else 0 |
---|
44 | 44 | | } |
---|
45 | 45 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | func generateRandomNumber (i,min,max) = { |
---|
5 | 5 | | let randomSeed = toInt(keccak256(i.transactionId)) |
---|
6 | 6 | | let randomNumber = ((randomSeed % ((max - min) + 1)) + min) |
---|
7 | 7 | | randomNumber |
---|
8 | 8 | | } |
---|
9 | 9 | | |
---|
10 | 10 | | |
---|
11 | 11 | | func isPaymentOk (i) = { |
---|
12 | 12 | | let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' |
---|
13 | 13 | | if ((size(i.payments) == 0)) |
---|
14 | 14 | | then throw("Payment not attached") |
---|
15 | 15 | | else { |
---|
16 | 16 | | let p = i.payments[0] |
---|
17 | 17 | | match p.assetId { |
---|
18 | 18 | | case assetId: ByteVector => |
---|
19 | 19 | | if ((assetId == acceptableAssetId)) |
---|
20 | 20 | | then (p.amount >= 10000000) |
---|
21 | 21 | | else false |
---|
22 | 22 | | case _ => |
---|
23 | 23 | | (p.amount >= 10000000) |
---|
24 | 24 | | } |
---|
25 | 25 | | } |
---|
26 | 26 | | } |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | func gameLuckyWheelWhatUserWon (value) = match value { |
---|
30 | 30 | | case _ => |
---|
31 | 31 | | if ((1 == $match0)) |
---|
32 | | - | then 20000000 |
---|
| 32 | + | then 200000000 |
---|
33 | 33 | | else if ((3 == $match0)) |
---|
34 | | - | then 10000000 |
---|
| 34 | + | then 100000000 |
---|
35 | 35 | | else if ((5 == $match0)) |
---|
36 | | - | then 10000000 |
---|
| 36 | + | then 100000000 |
---|
37 | 37 | | else if ((7 == $match0)) |
---|
38 | | - | then 30000000 |
---|
| 38 | + | then 300000000 |
---|
39 | 39 | | else if ((8 == $match0)) |
---|
40 | | - | then 10000000 |
---|
| 40 | + | then 100000000 |
---|
41 | 41 | | else if ((11 == $match0)) |
---|
42 | | - | then 10000000 |
---|
| 42 | + | then 100000000 |
---|
43 | 43 | | else 0 |
---|
44 | 44 | | } |
---|
45 | 45 | | |
---|
46 | 46 | | |
---|
47 | 47 | | @Callable(i) |
---|
48 | 48 | | func gameLuckyWheel (id) = if (!(isPaymentOk(i))) |
---|
49 | 49 | | then throw("Wrong payment amount or asset") |
---|
50 | 50 | | else { |
---|
51 | 51 | | let randomNumber = generateRandomNumber(i, 1, 12) |
---|
52 | 52 | | let winningAmount = gameLuckyWheelWhatUserWon(randomNumber) |
---|
53 | 53 | | if ((winningAmount > 0)) |
---|
54 | 54 | | then [ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(("game_" + id), winningAmount), IntegerEntry(("test_game_randomNumber_" + id), randomNumber), IntegerEntry(("test_game_winningAmount_" + id), winningAmount)] |
---|
55 | 55 | | else [IntegerEntry(("game_" + id), winningAmount), IntegerEntry(("test_game_randomNumber_" + id), randomNumber), IntegerEntry(("test_game_winningAmount_" + id), winningAmount)] |
---|
56 | 56 | | } |
---|
57 | 57 | | |
---|
58 | 58 | | |
---|