tx · H3pWq3WSbEvyfarWciMSnrPTTeVp9BbxBfSdc13p7nSc 3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T: -0.01000000 Waves 2023.06.07 15:47 [2612264] smart account 3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T > SELF 0.00000000 Waves
{ "type": 13, "id": "H3pWq3WSbEvyfarWciMSnrPTTeVp9BbxBfSdc13p7nSc", "fee": 1000000, "feeAssetId": null, "timestamp": 1686142058773, "version": 2, "chainId": 84, "sender": "3N272hFk6FBTgLM5HqpYVcCVmMcSCrEma9T", "senderPublicKey": "97sWz4UZWijkagGprhucQHR7b7nN6FfojMELnzuFEyY1", "proofs": [ "5PYQMj6RfFPshXAtUf8uWPxYYujbY1Z2Q6oW8R3eTMvjuMA54sg2SVu4Nbig9eSfMTqH5mMpjdpGakJ7kANqfjnQ" ], "script": "base64:BgIPCAISBQoDAREIEgASABIAFwEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAgFpA3N1bQQRYWNjZXB0YWJsZUFzc2V0SWQBICJEpueIVH1RKK5qV7oPafp24Q53N+2oR6tSH2lNlEJHAwkAAAIJAJADAQgFAWkIcGF5bWVudHMAAAkAAgECFFBheW1lbnQgbm90IGF0dGFjaGVkBAFwCQCRAwIIBQFpCHBheW1lbnRzAAADCQAAAggFAXAHYXNzZXRJZAURYWNjZXB0YWJsZUFzc2V0SWQGBwELbWFwSW50VG9TdHICBWFjY3VtBG5leHQJAMwIAgkApAMBBQRuZXh0BQVhY2N1bQELbWFwU3RyVG9JbnQCBWFjY3VtBG5leHQJAMwIAgkBDXBhcnNlSW50VmFsdWUBBQRuZXh0BQVhY2N1bQELbWFwSW50VG9TdW0CBWFjY3VtBG5leHQJAGQCBQVhY2N1bQUEbmV4dAEMbGlzdEludFRvU3VtAQNhcnIKAAIkbAUDYXJyCgACJHMJAJADAQUCJGwKAAUkYWNjMAAACgEFJGYwXzECAiRhAiRpAwkAZwIF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G9tTnVtYmVyS2V5AQUBaQUMcmFuZG9tTnVtYmVyCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEMTFdfZ2V0TG9nS2V5AQUBaQUNd2lubmluZ0Ftb3VudAUDbmlsCQDMCAIJAQtEZWxldGVFbnRyeQEJAQxMV19nZXRCZXRLZXkBBQFpCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEMTFdfZ2V0V29uS2V5AQUBaQUNd2lubmluZ0Ftb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBFUxXX2dldFJhbmRvbU51bWJlcktleQEFAWkFDHJhbmRvbU51bWJlcgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBDExXX2dldExvZ0tleQEFAWkFDXdpbm5pbmdBbW91bnQFA25pbAAj222b", "height": 2612264, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BhFAQbPCM1syNT4ASAS5yZXWqGiaNbhZfdrUyMjdNbrY Next: 2ZWNKTRB5hDrnQAqY42kGUR9m2ELMg4Zm77boSRVva8a Diff:
Old | New | Differences | |
---|---|---|---|
10 | 10 | then throw("Payment not attached") | |
11 | 11 | else { | |
12 | 12 | let p = i.payments[0] | |
13 | - | if (if ((p.assetId == acceptableAssetId)) | |
14 | - | then (p.amount >= numToWaves(sum)) | |
15 | - | else false) | |
13 | + | if ((p.assetId == acceptableAssetId)) | |
16 | 14 | then true | |
17 | 15 | else false | |
18 | 16 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func numToWaves (num) = (num * 100000000) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func isPaymentOk (i,sum) = { | |
8 | 8 | let acceptableAssetId = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
9 | 9 | if ((size(i.payments) == 0)) | |
10 | 10 | then throw("Payment not attached") | |
11 | 11 | else { | |
12 | 12 | let p = i.payments[0] | |
13 | - | if (if ((p.assetId == acceptableAssetId)) | |
14 | - | then (p.amount >= numToWaves(sum)) | |
15 | - | else false) | |
13 | + | if ((p.assetId == acceptableAssetId)) | |
16 | 14 | then true | |
17 | 15 | else false | |
18 | 16 | } | |
19 | 17 | } | |
20 | 18 | ||
21 | 19 | ||
22 | 20 | func mapIntToStr (accum,next) = toString(next) :: accum | |
23 | 21 | ||
24 | 22 | ||
25 | 23 | func mapStrToInt (accum,next) = parseIntValue(next) :: accum | |
26 | 24 | ||
27 | 25 | ||
28 | 26 | func mapIntToSum (accum,next) = (accum + next) | |
29 | 27 | ||
30 | 28 | ||
31 | 29 | func listIntToSum (arr) = { | |
32 | 30 | let $l = arr | |
33 | 31 | let $s = size($l) | |
34 | 32 | let $acc0 = 0 | |
35 | 33 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
36 | 34 | then $a | |
37 | 35 | else mapIntToSum($a, $l[$i]) | |
38 | 36 | ||
39 | 37 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
40 | 38 | then $a | |
41 | 39 | else throw("List size exceeds 100") | |
42 | 40 | ||
43 | 41 | $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
44 | 42 | } | |
45 | 43 | ||
46 | 44 | ||
47 | 45 | func listIntToListString (arr) = { | |
48 | 46 | let $l = arr | |
49 | 47 | let $s = size($l) | |
50 | 48 | let $acc0 = nil | |
51 | 49 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
52 | 50 | then $a | |
53 | 51 | else mapIntToStr($a, $l[$i]) | |
54 | 52 | ||
55 | 53 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
56 | 54 | then $a | |
57 | 55 | else throw("List size exceeds 100") | |
58 | 56 | ||
59 | 57 | $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
60 | 58 | } | |
61 | 59 | ||
62 | 60 | ||
63 | 61 | func listStringToListIng (arr) = { | |
64 | 62 | let $l = arr | |
65 | 63 | let $s = size($l) | |
66 | 64 | let $acc0 = nil | |
67 | 65 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
68 | 66 | then $a | |
69 | 67 | else mapStrToInt($a, $l[$i]) | |
70 | 68 | ||
71 | 69 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
72 | 70 | then $a | |
73 | 71 | else throw("List size exceeds 100") | |
74 | 72 | ||
75 | 73 | $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($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), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
76 | 74 | } | |
77 | 75 | ||
78 | 76 | ||
79 | 77 | func listStringCompressToString (arr) = makeString(arr, "|") | |
80 | 78 | ||
81 | 79 | ||
82 | 80 | func stringDecompressToListString (str) = split(str, "|") | |
83 | 81 | ||
84 | 82 | ||
85 | 83 | func listIntCompressToString (arr) = makeString(listIntToListString(arr), "|") | |
86 | 84 | ||
87 | 85 | ||
88 | 86 | func stringDecompressToListInt (arrStr) = listStringToListIng(split(arrStr, "|")) | |
89 | 87 | ||
90 | 88 | ||
91 | 89 | func LW_getBetKey (i) = ("bet_LuckyWheel_" + toString(i.caller)) | |
92 | 90 | ||
93 | 91 | ||
94 | 92 | func LW_getWonKey (i) = ("won_LuckyWheel_" + toString(i.caller)) | |
95 | 93 | ||
96 | 94 | ||
97 | 95 | func LW_getRandomNumberKey (i) = ("randomNumber_LuckyWheel_" + toString(i.caller)) | |
98 | 96 | ||
99 | 97 | ||
100 | 98 | func LW_getLogKey (i) = ((("log_LuckyWheel_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
101 | 99 | ||
102 | 100 | ||
103 | 101 | func LW_whatUserWon (value) = match value { | |
104 | 102 | case _ => | |
105 | 103 | if ((1 == $match0)) | |
106 | 104 | then numToWaves(2) | |
107 | 105 | else if ((3 == $match0)) | |
108 | 106 | then numToWaves(1) | |
109 | 107 | else if ((7 == $match0)) | |
110 | 108 | then numToWaves(6) | |
111 | 109 | else if ((9 == $match0)) | |
112 | 110 | then numToWaves(1) | |
113 | 111 | else 0 | |
114 | 112 | } | |
115 | 113 | ||
116 | 114 | ||
117 | 115 | func R_WinCalculator (randomNumber,betAmount,selectedNumberBets,betDirection) = { | |
118 | 116 | let RED_SECTORS = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
119 | 117 | if (if ((size(selectedNumberBets) == 1)) | |
120 | 118 | then (betDirection == "num") | |
121 | 119 | else false) | |
122 | 120 | then if ((selectedNumberBets[0] == randomNumber)) | |
123 | 121 | then (betAmount * 36) | |
124 | 122 | else 0 | |
125 | 123 | else if ((size(selectedNumberBets) == 2)) | |
126 | 124 | then if (containsElement(selectedNumberBets, randomNumber)) | |
127 | 125 | then (betAmount * 18) | |
128 | 126 | else 0 | |
129 | 127 | else if ((size(selectedNumberBets) == 3)) | |
130 | 128 | then if (containsElement(selectedNumberBets, randomNumber)) | |
131 | 129 | then (betAmount * 12) | |
132 | 130 | else 0 | |
133 | 131 | else if ((size(selectedNumberBets) == 4)) | |
134 | 132 | then if (containsElement(selectedNumberBets, randomNumber)) | |
135 | 133 | then (betAmount * 9) | |
136 | 134 | else 0 | |
137 | 135 | else if ((size(selectedNumberBets) == 12)) | |
138 | 136 | then if (containsElement(selectedNumberBets, randomNumber)) | |
139 | 137 | then (betAmount * 3) | |
140 | 138 | else 0 | |
141 | 139 | else if ((betDirection == "red")) | |
142 | 140 | then if (containsElement(RED_SECTORS, randomNumber)) | |
143 | 141 | then (betAmount * 2) | |
144 | 142 | else 0 | |
145 | 143 | else if ((betDirection == "black")) | |
146 | 144 | then if (if (!(containsElement(RED_SECTORS, randomNumber))) | |
147 | 145 | then (randomNumber != 0) | |
148 | 146 | else false) | |
149 | 147 | then (betAmount * 2) | |
150 | 148 | else 0 | |
151 | 149 | else if ((betDirection == "odd")) | |
152 | 150 | then if (((randomNumber % 2) != 0)) | |
153 | 151 | then (betAmount * 2) | |
154 | 152 | else 0 | |
155 | 153 | else if ((betDirection == "even")) | |
156 | 154 | then if (((randomNumber % 2) == 0)) | |
157 | 155 | then (betAmount * 2) | |
158 | 156 | else 0 | |
159 | 157 | else if ((size(selectedNumberBets) == 18)) | |
160 | 158 | then if (containsElement(selectedNumberBets, randomNumber)) | |
161 | 159 | then (betAmount * 2) | |
162 | 160 | else 0 | |
163 | 161 | else 0 | |
164 | 162 | } | |
165 | 163 | ||
166 | 164 | ||
167 | 165 | func R_getBetKey (i) = ("bet_Roulette_" + toString(i.caller)) | |
168 | 166 | ||
169 | 167 | ||
170 | 168 | func R_getBetAmountKey (i) = ("betAmount_Roulette_" + toString(i.caller)) | |
171 | 169 | ||
172 | 170 | ||
173 | 171 | func R_getSelectedNumbersKey (i) = ("selectedNumbers_Roulette_" + toString(i.caller)) | |
174 | 172 | ||
175 | 173 | ||
176 | 174 | func R_getDirectionKey (i) = ("direction_Roulette_" + toString(i.caller)) | |
177 | 175 | ||
178 | 176 | ||
179 | 177 | func R_getLogKey (i) = ((("log_Roulette_" + toString(i.caller)) + "_") + toBase58String(i.transactionId)) | |
180 | 178 | ||
181 | 179 | ||
182 | 180 | @Callable(i) | |
183 | 181 | func Roulette_commit (betAmount,selectedNumberBets,betDirection) = if (!(isPaymentOk(i, betAmount))) | |
184 | 182 | then throw("Wrong payment amount or asset") | |
185 | 183 | else [IntegerEntry(R_getBetKey(i), (height + 1)), IntegerEntry(R_getBetAmountKey(i), betAmount), StringEntry(R_getSelectedNumbersKey(i), listIntCompressToString(selectedNumberBets)), StringEntry(R_getDirectionKey(i), betDirection)] | |
186 | 184 | ||
187 | 185 | ||
188 | 186 | ||
189 | 187 | @Callable(i) | |
190 | 188 | func Roulette_reveal () = { | |
191 | 189 | let commitHeight = valueOrErrorMessage(getIntegerValue(R_getBetKey(i)), "Bet not found") | |
192 | 190 | let betAmount = valueOrErrorMessage(getIntegerValue(R_getBetAmountKey(i)), "Bet amount not found") | |
193 | 191 | let selectedNumbersStr = valueOrErrorMessage(getStringValue(R_getSelectedNumbersKey(i)), "Selected numbers not found") | |
194 | 192 | let direction = valueOrErrorMessage(getStringValue(R_getDirectionKey(i)), "Direction not found") | |
195 | 193 | let selectedNumbers = stringDecompressToListInt(selectedNumbersStr) | |
196 | 194 | if ((commitHeight > height)) | |
197 | 195 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
198 | 196 | else { | |
199 | 197 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
200 | 198 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
201 | 199 | let randomHash = sha256(value(vrf)) | |
202 | 200 | let randomNumber = (toInt(randomHash, 16) % 37) | |
203 | 201 | let winningAmount = R_WinCalculator(randomNumber, betAmount, selectedNumbers, direction) | |
204 | 202 | if ((winningAmount > 0)) | |
205 | 203 | then [DeleteEntry(R_getBetKey(i)), DeleteEntry(R_getBetAmountKey(i)), DeleteEntry(R_getSelectedNumbersKey(i)), DeleteEntry(R_getDirectionKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(R_getLogKey(i), winningAmount)] | |
206 | 204 | else [DeleteEntry(R_getBetKey(i)), DeleteEntry(R_getBetAmountKey(i)), DeleteEntry(R_getSelectedNumbersKey(i)), DeleteEntry(R_getDirectionKey(i)), IntegerEntry(R_getLogKey(i), winningAmount)] | |
207 | 205 | } | |
208 | 206 | } | |
209 | 207 | ||
210 | 208 | ||
211 | 209 | ||
212 | 210 | @Callable(i) | |
213 | 211 | func LuckyWheel_commit () = if (!(isPaymentOk(i, 1))) | |
214 | 212 | then throw("Wrong payment amount or asset") | |
215 | 213 | else [IntegerEntry(LW_getBetKey(i), (height + 1)), DeleteEntry(LW_getRandomNumberKey(i)), DeleteEntry(LW_getWonKey(i))] | |
216 | 214 | ||
217 | 215 | ||
218 | 216 | ||
219 | 217 | @Callable(i) | |
220 | 218 | func LuckyWheel_reveal () = { | |
221 | 219 | let commitHeight = valueOrErrorMessage(getIntegerValue(LW_getBetKey(i)), "Bet not found") | |
222 | 220 | if ((commitHeight > height)) | |
223 | 221 | then throw((("Wait " + toString((commitHeight - height))) + " blocks to reveal this id")) | |
224 | 222 | else { | |
225 | 223 | let revealBlock = valueOrErrorMessage(blockInfoByHeight(commitHeight), "unexcpected error") | |
226 | 224 | let vrf = valueOrErrorMessage(revealBlock.vrf, "unexcpected error") | |
227 | 225 | let randomHash = sha256(value(vrf)) | |
228 | 226 | let randomNumber = (toInt(randomHash, 16) % 12) | |
229 | 227 | let winningAmount = LW_whatUserWon(randomNumber) | |
230 | 228 | if ((winningAmount > 0)) | |
231 | 229 | then [DeleteEntry(LW_getBetKey(i)), ScriptTransfer(i.caller, winningAmount, unit), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), IntegerEntry(LW_getLogKey(i), winningAmount)] | |
232 | 230 | else [DeleteEntry(LW_getBetKey(i)), IntegerEntry(LW_getWonKey(i), winningAmount), IntegerEntry(LW_getRandomNumberKey(i), randomNumber), IntegerEntry(LW_getLogKey(i), winningAmount)] | |
233 | 231 | } | |
234 | 232 | } | |
235 | 233 | ||
236 | 234 |
github/deemru/w8io/026f985 50.99 ms ◑