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