tx · Ezhozijervr4gJUuVviNqWRa8CRFv84pvmfTspwe13uf

3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe:  -0.01500000 Waves

2019.07.17 09:54 [589505] smart account 3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe > SELF 0.00000000 Waves

{ "type": 13, "id": "Ezhozijervr4gJUuVviNqWRa8CRFv84pvmfTspwe13uf", "fee": 1500000, "feeAssetId": null, "timestamp": 1563346518403, "version": 1, "sender": "3MqQ9ihYKGehfUnXYf5WmkYSZUD71ByeCQe", "senderPublicKey": "HcUXEkA9JTGp78LcTKsu4FmEpbDmnqntL4aMNLx1BHMB", "proofs": [ "3XoEsdNFcL4u63H9VN7gQxgyjRbwbfoKS9RgVBzLFRGTa1omaQoBEkicX2kb49C9q3zcY4kzvmvM8SozEha1Lwg7" ], "script": "base64:AAIDAAAAAAAAAAAAAABBAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGPYmFzZTY0Ok1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBbXB1WGNJL280cElCNXl3djlET09HYXBUQlV3UlZsTS82K0g2aEZlbE9YdGtyd1kvWUl0bVB4RURwejdyQWVyUVBRZTl0RFBFYUF2L0dubEV6dHliT0ZYZ3U5RHpEZThZb01SRDF2YWtnb0Fjb2dtYlk1OFFENktNajVIa29Wai95VE5JYzlzemo1cWhJbHJBZG1iM0tMTDZoUVU3eTgrSmo2OUJXVlBzYVFna3NwU2RlWXRiMXRIUWM3dDk1bjdPWjU2cjJBN0czK2JRZjZuU01rUGtBaElyRXBiQ201OG9pR0JjemRUZC9McUZTVm90WnNiTDdZaDZTSExmbkhlRCtRZ2NmSnJuYW04T0hNR0pFSlRSWGpJTGVIR2psUkNQOG9WcGlvSHJ5MVMyeFB4NXNWekltMk1NK0N6WWVuQUdsbzBqMjZhdEJoaVVMb1R1bHdEM3BRSURBUUFCAAAAAAZTRVJWRVIJAQAAABxAZXh0clV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ml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAABmdhbWVJZAUAAAAObmV3R2FtZURhdGFTdHIJAARMAAAAAgUAAAARZGVjcmVhc2VkUmVzZXJ2ZXMFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAADCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAA3R0eAUAAAAHJG1hdGNoMAkAAGcAAAACCQAAZQAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzCAUAAAADdHR4AAAABmFtb3VudAkBAAAAEkV4dHJhY3RSZXNlcnZlZEFtdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAANzdHgFAAAAByRtYXRjaDAGBwfr9HtM", "chainId": 84, "height": 589505, "spentComplexity": 0 } View: original | compacted Prev: BqjVLajQ1eZvxnPAM5w9MjxinzjhyiYYYX2mLK3FYukn Next: B5sh5eCzMdCK9paWDLCYPuA5K58YRVhyZedKNwx1fbiW Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB")
55
6-let SERVER = addressFromStringValue("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH")
6+let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j")
77
8-let RANDORACLETIMEFRAME = 2880
8+let RANDORACLETIMEFRAME = 4320
99
1010 let WAVELET = ((100 * 1000) * 1000)
1111
1212 let COMMISSION = ((5 * WAVELET) / 1000)
1313
14-let BET1 = (1 * WAVELET)
14+let BETMIN = ((1 * WAVELET) / 2)
1515
16-let BET2 = (2 * WAVELET)
16+let BETMAX = (6 * WAVELET)
1717
18-let BET4 = (4 * WAVELET)
18+let BETSTEP = ((1 * WAVELET) / 10)
1919
20-let BET8 = (8 * WAVELET)
20+let PRECISION = 10000
2121
22-let BET14 = (14 * WAVELET)
22+let R1MAX = 96
2323
24-let RATEMULT = 10000
24+let R1MIN = 94
2525
26-let RATE1 = 39655
26+let R1K = 9860
2727
28-let RATE2 = 24600
28+let R2MAX = 93
2929
30-let RATE3 = 19000
30+let R2MIN = 87
3131
32-let RATE4 = 14200
32+let R2K = 9800
3333
34-let RATE5 = 11400
34+let R3MAX = 86
35+
36+let R3MIN = 86
37+
38+let R3K = 9750
39+
40+let R4MAX = 85
41+
42+let R4MIN = 84
43+
44+let R4K = 9670
45+
46+let R5MAX = 83
47+
48+let R5MIN = 83
49+
50+let R5K = 9630
51+
52+let R6MAX = 82
53+
54+let R6MIN = 67
55+
56+let R6K = 9610
57+
58+let R7MAX = 66
59+
60+let R7MIN = 56
61+
62+let R7K = 9560
63+
64+let R8MAX = 55
65+
66+let R8MIN = 38
67+
68+let R8K = 9500
69+
70+let R9MAX = 37
71+
72+let R9MIN = 3
73+
74+let R9K = 9290
75+
76+let R10MAX = 2
77+
78+let R10MIN = 1
79+
80+let R10K = 9860
3581
3682 let IdxGameState = 0
3783
78124 let newReservedAmount = (ExtractReservedAmt() + winAmt)
79125 let balance = wavesBalance(this)
80126 if ((newReservedAmount > balance))
81- then throw("Insufficient funds on Dice Roller account. Transaction was rejected for your safety.")
127+ then throw("Insufficient funds on Waves Rider account. Transaction was rejected for your safety.")
82128 else newReservedAmount
83129 }
84130
92138
93139
94140 func ValidateBetAndDefineWinAmt (betAmt,playerChoice) = {
95- let betAmtValid = if (if (if (if ((betAmt == (BET1 + COMMISSION)))
96- then true
97- else (betAmt == (BET2 + COMMISSION)))
98- then true
99- else (betAmt == (BET4 + COMMISSION)))
100- then true
101- else (betAmt == (BET8 + COMMISSION)))
102- then true
103- else (betAmt == (BET14 + COMMISSION))
141+ let bet = (betAmt - COMMISSION)
142+ let betAmtValid = if (if ((bet >= BETMIN))
143+ then (BETMAX >= bet)
144+ else false)
145+ then ((bet % BETSTEP) == 0)
146+ else false
104147 if (betAmtValid)
105148 then {
106- let dicesCount = size(playerChoice)
107- let bet = (betAmt - COMMISSION)
108- if ((dicesCount == 1))
109- then ((bet * RATE1) / RATEMULT)
110- else if ((dicesCount == 2))
111- then ((bet * RATE2) / RATEMULT)
112- else if ((dicesCount == 3))
113- then ((bet * RATE3) / RATEMULT)
114- else if ((dicesCount == 4))
115- then ((bet * RATE4) / RATEMULT)
116- else if ((dicesCount == 5))
117- then ((bet * RATE5) / RATEMULT)
118- else throw("Invalid dices count in player's choice")
149+ let playerChoiceInt = parseIntValue(playerChoice)
150+ if (if ((playerChoiceInt >= 1))
151+ then (96 >= playerChoiceInt)
152+ else false)
153+ then {
154+ let RKxPrecision = if (if ((R1MAX >= playerChoiceInt))
155+ then (playerChoiceInt >= R1MIN)
156+ else false)
157+ then R1K
158+ else if (if ((R2MAX >= playerChoiceInt))
159+ then (playerChoiceInt >= R2MIN)
160+ else false)
161+ then R2K
162+ else if (if ((R3MAX >= playerChoiceInt))
163+ then (playerChoiceInt >= R3MIN)
164+ else false)
165+ then R3K
166+ else if (if ((R4MAX >= playerChoiceInt))
167+ then (playerChoiceInt >= R4MIN)
168+ else false)
169+ then R4K
170+ else if (if ((R5MAX >= playerChoiceInt))
171+ then (playerChoiceInt >= R5MIN)
172+ else false)
173+ then R5K
174+ else if (if ((R6MAX >= playerChoiceInt))
175+ then (playerChoiceInt >= R6MIN)
176+ else false)
177+ then R6K
178+ else if (if ((R7MAX >= playerChoiceInt))
179+ then (playerChoiceInt >= R7MIN)
180+ else false)
181+ then R7K
182+ else if (if ((R8MAX >= playerChoiceInt))
183+ then (playerChoiceInt >= R8MIN)
184+ else false)
185+ then R8K
186+ else if (if ((R9MAX >= playerChoiceInt))
187+ then (playerChoiceInt >= R9MIN)
188+ else false)
189+ then R9K
190+ else if (if ((R10MAX >= playerChoiceInt))
191+ then (playerChoiceInt >= R10MIN)
192+ else false)
193+ then R10K
194+ else throw(("Couldn't define range: playerChoice=" + playerChoice))
195+ ((((100 * RKxPrecision) / playerChoiceInt) * bet) / PRECISION)
196+ }
197+ else throw("Player choice is out of the condition below: 1 <= choice <= 96")
119198 }
120- else throw("Bet amount is not in range")
199+ else throw(((((("Bet amount is not in range: minBet=" + toString(BETMIN)) + " maxBet=") + toString(BETMAX)) + " betStep=") + toString(BETSTEP)))
121200 }
122201
123202
124-func RandToStr (r) = if ((r == 0))
125- then "1"
126- else if ((r == 1))
127- then "2"
128- else if ((r == 2))
129- then "3"
130- else if ((r == 3))
131- then "4"
132- else if ((r == 4))
133- then "5"
134- else if ((r == 5))
135- then "6"
136- else throw(("Unsupported r parameter passed: expected=[0,...,5] actual=" + toString(r)))
203+func RandToStr (r) = if (if ((r >= 1))
204+ then (100 >= r)
205+ else false)
206+ then toString(r)
207+ else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r)))
137208
138209
139210 func GenerateRandInt (gameId,rsaSign) = {
140211 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
141212 if (rsaSigValid)
142213 then {
143- let rand = (toInt(sha256(rsaSign)) % 6)
214+ let rand = (toInt(sha256(rsaSign)) % 100)
144215 if ((0 > rand))
145- then (-1 * rand)
146- else rand
216+ then ((-1 * rand) + 1)
217+ else (rand + 1)
147218 }
148219 else throw("Invalid RSA signature")
149220 }
150221
151222
152-func IsPlayerWin (playerChoice,randStr) = {
153- let s = size(playerChoice)
154- if (if (if (if (if (if ((s >= 1))
155- then (take(drop(playerChoice, 0), 1) == randStr)
156- else false)
157- then true
158- else if ((s >= 2))
159- then (take(drop(playerChoice, 1), 1) == randStr)
160- else false)
161- then true
162- else if ((s >= 3))
163- then (take(drop(playerChoice, 2), 1) == randStr)
164- else false)
165- then true
166- else if ((s >= 4))
167- then (take(drop(playerChoice, 3), 1) == randStr)
168- else false)
169- then true
170- else if ((s >= 5))
171- then (take(drop(playerChoice, 4), 1) == randStr)
172- else false)
173- then true
174- else if ((s >= 6))
175- then (take(drop(playerChoice, 5), 1) == randStr)
176- else false
223+func IsPlayerWin (playerChoice,rand) = {
224+ let playerChoiceInt = parseIntValue(playerChoice)
225+ (playerChoiceInt >= rand)
177226 }
178227
179228
292341 then throw("Invalid game state for passed gameId")
293342 else if (winByTimeout)
294343 then {
295- let randStr = take(playerChoice, 1)
344+ let randStr = playerChoice
296345 let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr)
297346 WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves)
298347 }
299348 else {
300- let randStr = RandToStr(GenerateRandInt(gameId, rsaSign))
301- if (IsPlayerWin(playerChoice, randStr))
349+ let rand = GenerateRandInt(gameId, rsaSign)
350+ let randStr = RandToStr(rand)
351+ if (IsPlayerWin(playerChoice, rand))
302352 then {
303353 let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr)
304354 WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqlAiANSmBpDHYKP9sKgeN/l1bAb28g/tGlgDkwT5FiMN4X3pwdvdxE7mvSR8/41dU9rx4jG+6tZpb1ULVDPs431tR2IRaTXw5Cj+Ac2vhL+5JamCerGD1UW+bh/EGQtxo8W3YLDrofXB5QHJx4Pkz2Kgf+oS/C8hHuB/U4krO76U0507GTjZPP9kRQ0uLSMeqQXt8wXS+nMp5wajqxPpDLMaSREgsKwv/AEkP4dzpTYbikLBYl4qtdJsD84HLFSkiwd3BhcOrPjoIYmLxQuBD5TIMKTKD3sdZgaY9rsyqx3A00innyxD6zp3b4gFpUOX8JxKZdEC2myEqleNgg7GzwIDAQAB")
4+let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmpuXcI/o4pIB5ywv9DOOGapTBUwRVlM/6+H6hFelOXtkrwY/YItmPxEDpz7rAerQPQe9tDPEaAv/GnlEztybOFXgu9DzDe8YoMRD1vakgoAcogmbY58QD6KMj5HkoVj/yTNIc9szj5qhIlrAdmb3KLL6hQU7y8+Jj69BWVPsaQgkspSdeYtb1tHQc7t95n7OZ56r2A7G3+bQf6nSMkPkAhIrEpbCm58oiGBczdTd/LqFSVotZsbL7Yh6SHLfnHeD+QgcfJrnam8OHMGJEJTRXjILeHGjlRCP8oVpioHry1S2xPx5sVzIm2MM+CzYenAGlo0j26atBhiULoTulwD3pQIDAQAB")
55
6-let SERVER = addressFromStringValue("3N4Aib5iubWiGMzdTh6wWiVDVbo32oeVUmH")
6+let SERVER = addressFromStringValue("3NCiG28LmWyTigWG13E5QnvdHBsZFYXSS2j")
77
8-let RANDORACLETIMEFRAME = 2880
8+let RANDORACLETIMEFRAME = 4320
99
1010 let WAVELET = ((100 * 1000) * 1000)
1111
1212 let COMMISSION = ((5 * WAVELET) / 1000)
1313
14-let BET1 = (1 * WAVELET)
14+let BETMIN = ((1 * WAVELET) / 2)
1515
16-let BET2 = (2 * WAVELET)
16+let BETMAX = (6 * WAVELET)
1717
18-let BET4 = (4 * WAVELET)
18+let BETSTEP = ((1 * WAVELET) / 10)
1919
20-let BET8 = (8 * WAVELET)
20+let PRECISION = 10000
2121
22-let BET14 = (14 * WAVELET)
22+let R1MAX = 96
2323
24-let RATEMULT = 10000
24+let R1MIN = 94
2525
26-let RATE1 = 39655
26+let R1K = 9860
2727
28-let RATE2 = 24600
28+let R2MAX = 93
2929
30-let RATE3 = 19000
30+let R2MIN = 87
3131
32-let RATE4 = 14200
32+let R2K = 9800
3333
34-let RATE5 = 11400
34+let R3MAX = 86
35+
36+let R3MIN = 86
37+
38+let R3K = 9750
39+
40+let R4MAX = 85
41+
42+let R4MIN = 84
43+
44+let R4K = 9670
45+
46+let R5MAX = 83
47+
48+let R5MIN = 83
49+
50+let R5K = 9630
51+
52+let R6MAX = 82
53+
54+let R6MIN = 67
55+
56+let R6K = 9610
57+
58+let R7MAX = 66
59+
60+let R7MIN = 56
61+
62+let R7K = 9560
63+
64+let R8MAX = 55
65+
66+let R8MIN = 38
67+
68+let R8K = 9500
69+
70+let R9MAX = 37
71+
72+let R9MIN = 3
73+
74+let R9K = 9290
75+
76+let R10MAX = 2
77+
78+let R10MIN = 1
79+
80+let R10K = 9860
3581
3682 let IdxGameState = 0
3783
3884 let IdxPlayerChoice = 1
3985
4086 let IdxPlayerPubKey58 = 2
4187
4288 let IdxStartedHeight = 3
4389
4490 let IdxWinAmt = 4
4591
4692 let IdxRandOrEmpty = 5
4793
4894 let RESERVATIONKEY = "$RESERVED_AMOUNT"
4995
5096 let GAMESCOUNTERKEY = "$GAME_NUM"
5197
5298 let STATESUBMITTED = "SUBMITTED"
5399
54100 let STATEWON = "WON"
55101
56102 let STATELOST = "LOST"
57103
58104 func IncrementGameNum () = {
59105 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
60106 case num: Int =>
61107 num
62108 case _ =>
63109 0
64110 }
65111 (gameNum + 1)
66112 }
67113
68114
69115 func ExtractReservedAmt () = match getInteger(this, RESERVATIONKEY) {
70116 case a: Int =>
71117 a
72118 case _ =>
73119 0
74120 }
75121
76122
77123 func ValidateAndIncreaseReservedAmt (winAmt) = {
78124 let newReservedAmount = (ExtractReservedAmt() + winAmt)
79125 let balance = wavesBalance(this)
80126 if ((newReservedAmount > balance))
81- then throw("Insufficient funds on Dice Roller account. Transaction was rejected for your safety.")
127+ then throw("Insufficient funds on Waves Rider account. Transaction was rejected for your safety.")
82128 else newReservedAmount
83129 }
84130
85131
86132 func DecreaseReservedAmt (gameId,winAmt) = {
87133 let newReservedAmount = (ExtractReservedAmt() - winAmt)
88134 if ((0 > newReservedAmount))
89135 then throw("Invalid Dice Roller account state - reserved amount is less than 0")
90136 else DataEntry(RESERVATIONKEY, newReservedAmount)
91137 }
92138
93139
94140 func ValidateBetAndDefineWinAmt (betAmt,playerChoice) = {
95- let betAmtValid = if (if (if (if ((betAmt == (BET1 + COMMISSION)))
96- then true
97- else (betAmt == (BET2 + COMMISSION)))
98- then true
99- else (betAmt == (BET4 + COMMISSION)))
100- then true
101- else (betAmt == (BET8 + COMMISSION)))
102- then true
103- else (betAmt == (BET14 + COMMISSION))
141+ let bet = (betAmt - COMMISSION)
142+ let betAmtValid = if (if ((bet >= BETMIN))
143+ then (BETMAX >= bet)
144+ else false)
145+ then ((bet % BETSTEP) == 0)
146+ else false
104147 if (betAmtValid)
105148 then {
106- let dicesCount = size(playerChoice)
107- let bet = (betAmt - COMMISSION)
108- if ((dicesCount == 1))
109- then ((bet * RATE1) / RATEMULT)
110- else if ((dicesCount == 2))
111- then ((bet * RATE2) / RATEMULT)
112- else if ((dicesCount == 3))
113- then ((bet * RATE3) / RATEMULT)
114- else if ((dicesCount == 4))
115- then ((bet * RATE4) / RATEMULT)
116- else if ((dicesCount == 5))
117- then ((bet * RATE5) / RATEMULT)
118- else throw("Invalid dices count in player's choice")
149+ let playerChoiceInt = parseIntValue(playerChoice)
150+ if (if ((playerChoiceInt >= 1))
151+ then (96 >= playerChoiceInt)
152+ else false)
153+ then {
154+ let RKxPrecision = if (if ((R1MAX >= playerChoiceInt))
155+ then (playerChoiceInt >= R1MIN)
156+ else false)
157+ then R1K
158+ else if (if ((R2MAX >= playerChoiceInt))
159+ then (playerChoiceInt >= R2MIN)
160+ else false)
161+ then R2K
162+ else if (if ((R3MAX >= playerChoiceInt))
163+ then (playerChoiceInt >= R3MIN)
164+ else false)
165+ then R3K
166+ else if (if ((R4MAX >= playerChoiceInt))
167+ then (playerChoiceInt >= R4MIN)
168+ else false)
169+ then R4K
170+ else if (if ((R5MAX >= playerChoiceInt))
171+ then (playerChoiceInt >= R5MIN)
172+ else false)
173+ then R5K
174+ else if (if ((R6MAX >= playerChoiceInt))
175+ then (playerChoiceInt >= R6MIN)
176+ else false)
177+ then R6K
178+ else if (if ((R7MAX >= playerChoiceInt))
179+ then (playerChoiceInt >= R7MIN)
180+ else false)
181+ then R7K
182+ else if (if ((R8MAX >= playerChoiceInt))
183+ then (playerChoiceInt >= R8MIN)
184+ else false)
185+ then R8K
186+ else if (if ((R9MAX >= playerChoiceInt))
187+ then (playerChoiceInt >= R9MIN)
188+ else false)
189+ then R9K
190+ else if (if ((R10MAX >= playerChoiceInt))
191+ then (playerChoiceInt >= R10MIN)
192+ else false)
193+ then R10K
194+ else throw(("Couldn't define range: playerChoice=" + playerChoice))
195+ ((((100 * RKxPrecision) / playerChoiceInt) * bet) / PRECISION)
196+ }
197+ else throw("Player choice is out of the condition below: 1 <= choice <= 96")
119198 }
120- else throw("Bet amount is not in range")
199+ else throw(((((("Bet amount is not in range: minBet=" + toString(BETMIN)) + " maxBet=") + toString(BETMAX)) + " betStep=") + toString(BETSTEP)))
121200 }
122201
123202
124-func RandToStr (r) = if ((r == 0))
125- then "1"
126- else if ((r == 1))
127- then "2"
128- else if ((r == 2))
129- then "3"
130- else if ((r == 3))
131- then "4"
132- else if ((r == 4))
133- then "5"
134- else if ((r == 5))
135- then "6"
136- else throw(("Unsupported r parameter passed: expected=[0,...,5] actual=" + toString(r)))
203+func RandToStr (r) = if (if ((r >= 1))
204+ then (100 >= r)
205+ else false)
206+ then toString(r)
207+ else throw(("Unsupported r parameter passed: expected=[1,...,100] actual=" + toString(r)))
137208
138209
139210 func GenerateRandInt (gameId,rsaSign) = {
140211 let rsaSigValid = rsaVerify(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC)
141212 if (rsaSigValid)
142213 then {
143- let rand = (toInt(sha256(rsaSign)) % 6)
214+ let rand = (toInt(sha256(rsaSign)) % 100)
144215 if ((0 > rand))
145- then (-1 * rand)
146- else rand
216+ then ((-1 * rand) + 1)
217+ else (rand + 1)
147218 }
148219 else throw("Invalid RSA signature")
149220 }
150221
151222
152-func IsPlayerWin (playerChoice,randStr) = {
153- let s = size(playerChoice)
154- if (if (if (if (if (if ((s >= 1))
155- then (take(drop(playerChoice, 0), 1) == randStr)
156- else false)
157- then true
158- else if ((s >= 2))
159- then (take(drop(playerChoice, 1), 1) == randStr)
160- else false)
161- then true
162- else if ((s >= 3))
163- then (take(drop(playerChoice, 2), 1) == randStr)
164- else false)
165- then true
166- else if ((s >= 4))
167- then (take(drop(playerChoice, 3), 1) == randStr)
168- else false)
169- then true
170- else if ((s >= 5))
171- then (take(drop(playerChoice, 4), 1) == randStr)
172- else false)
173- then true
174- else if ((s >= 6))
175- then (take(drop(playerChoice, 5), 1) == randStr)
176- else false
223+func IsPlayerWin (playerChoice,rand) = {
224+ let playerChoiceInt = parseIntValue(playerChoice)
225+ (playerChoiceInt >= rand)
177226 }
178227
179228
180229 func FormatGameDataParam (p) = {
181230 let s = size(p)
182231 if ((s == 0))
183232 then throw("Parameter size must be greater then 0")
184233 else if ((s > 99))
185234 then throw("Parameter size must be less then 100")
186235 else if ((10 > s))
187236 then (("0" + toString(s)) + p)
188237 else (toString(s) + p)
189238 }
190239
191240
192241 func FormatGameDataStr (gameState,playerChoice,playerPubKey58,startedHeight,winAmt,randOrEmpty) = {
193242 let fullStateStr = ((((((((FormatGameDataParam(gameState) + "_") + FormatGameDataParam(playerChoice)) + "_") + FormatGameDataParam(playerPubKey58)) + "_") + FormatGameDataParam(toString(startedHeight))) + "_") + FormatGameDataParam(toString(winAmt)))
194243 if ((randOrEmpty == ""))
195244 then fullStateStr
196245 else ((fullStateStr + "_") + FormatGameDataParam(randOrEmpty))
197246 }
198247
199248
200249 func RemoveUnderscoreIfPresent (remaining) = if ((size(remaining) > 0))
201250 then drop(remaining, 1)
202251 else remaining
203252
204253
205254 func ParseNextAttribute (remaining) = {
206255 let s = size(remaining)
207256 if ((s > 0))
208257 then {
209258 let nn = parseIntValue(take(remaining, 2))
210259 let v = take(drop(remaining, 2), nn)
211260 let tmpRemaining = drop(remaining, (nn + 2))
212261 let remainingState = RemoveUnderscoreIfPresent(tmpRemaining)
213262 [v, remainingState]
214263 }
215264 else throw("Empty string was passed into parseNextAttribute func")
216265 }
217266
218267
219268 func ParseGameRawDataStr (rawStateStr) = {
220269 let gameState = ParseNextAttribute(rawStateStr)
221270 let playerChoice = ParseNextAttribute(gameState[1])
222271 let playerPubKey58 = ParseNextAttribute(playerChoice[1])
223272 let startedHeight = ParseNextAttribute(playerPubKey58[1])
224273 let winAmt = ParseNextAttribute(startedHeight[1])
225274 [gameState[0], playerChoice[0], playerPubKey58[0], startedHeight[0], winAmt[0]]
226275 }
227276
228277
229278 func ExtractGameDataList (gameId) = {
230279 let rawDataStr = match getString(this, gameId) {
231280 case str: String =>
232281 str
233282 case _ =>
234283 throw(("Couldn't find game by " + gameId))
235284 }
236285 ParseGameRawDataStr(rawDataStr)
237286 }
238287
239288
240289 func WinScriptSet (gameId,playerAddress,winAmt,newGameDataStr,winByTimeout,decreasedReserves) = {
241290 let wSetCommonData = [decreasedReserves]
242291 let tSetCommonData = [ScriptTransfer(playerAddress, winAmt, unit)]
243292 if (winByTimeout)
244293 then {
245294 let newGameDataStrAdjusted = ((newGameDataStr + "_") + FormatGameDataParam("TIMEOUT"))
246295 let gameData = DataEntry(gameId, newGameDataStrAdjusted)
247296 ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData))
248297 }
249298 else {
250299 let gameData = DataEntry(gameId, newGameDataStr)
251300 ScriptResult(WriteSet(gameData :: wSetCommonData), TransferSet(tSetCommonData))
252301 }
253302 }
254303
255304
256305 @Callable(i)
257306 func bet (playerChoice) = {
258307 let newGameNum = IncrementGameNum()
259308 let gameId = toBase58String(i.transactionId)
260309 let pmt = extract(i.payment)
261310 let betNotInWaves = isDefined(pmt.assetId)
262311 let feeNotInWaves = isDefined(pmt.assetId)
263312 let winAmt = ValidateBetAndDefineWinAmt(pmt.amount, playerChoice)
264313 let txIdUsed = isDefined(getString(this, gameId))
265314 if (betNotInWaves)
266315 then throw("Bet amount must be in Waves")
267316 else if (feeNotInWaves)
268317 then throw("Transaction's fee must be in Waves")
269318 else if (txIdUsed)
270319 then throw("Passed txId had been used before. Game aborted.")
271320 else {
272321 let playerPubKey58 = toBase58String(i.callerPublicKey)
273322 let gameDataStr = FormatGameDataStr(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmt, "")
274323 ScriptResult(WriteSet([DataEntry(RESERVATIONKEY, ValidateAndIncreaseReservedAmt(winAmt)), DataEntry(GAMESCOUNTERKEY, newGameNum), DataEntry(gameId, gameDataStr)]), TransferSet([ScriptTransfer(SERVER, COMMISSION, unit)]))
275324 }
276325 }
277326
278327
279328
280329 @Callable(i)
281330 func withdraw (gameId,rsaSign) = {
282331 let gameDataList = ExtractGameDataList(gameId)
283332 let gameState = gameDataList[IdxGameState]
284333 let playerChoice = gameDataList[IdxPlayerChoice]
285334 let startedHeight = parseIntValue(gameDataList[IdxStartedHeight])
286335 let winAmt = parseIntValue(gameDataList[IdxWinAmt])
287336 let playerPubKey58 = gameDataList[IdxPlayerPubKey58]
288337 let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58))
289338 let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME)
290339 let decreasedReserves = DecreaseReservedAmt(gameId, winAmt)
291340 if ((gameState != STATESUBMITTED))
292341 then throw("Invalid game state for passed gameId")
293342 else if (winByTimeout)
294343 then {
295- let randStr = take(playerChoice, 1)
344+ let randStr = playerChoice
296345 let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr)
297346 WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves)
298347 }
299348 else {
300- let randStr = RandToStr(GenerateRandInt(gameId, rsaSign))
301- if (IsPlayerWin(playerChoice, randStr))
349+ let rand = GenerateRandInt(gameId, rsaSign)
350+ let randStr = RandToStr(rand)
351+ if (IsPlayerWin(playerChoice, rand))
302352 then {
303353 let newGameDataStr = FormatGameDataStr(STATEWON, playerChoice, playerPubKey58, startedHeight, winAmt, randStr)
304354 WinScriptSet(gameId, playerAddress, winAmt, newGameDataStr, winByTimeout, decreasedReserves)
305355 }
306356 else {
307357 let newGameDataStr = FormatGameDataStr(STATELOST, playerChoice, playerPubKey58, startedHeight, winAmt, randStr)
308358 WriteSet([DataEntry(gameId, newGameDataStr), decreasedReserves])
309359 }
310360 }
311361 }
312362
313363
314364 @Verifier(tx)
315365 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
316366 then match tx {
317367 case ttx: TransferTransaction =>
318368 ((wavesBalance(this) - ttx.amount) >= ExtractReservedAmt())
319369 case stx: SetScriptTransaction =>
320370 true
321371 case _ =>
322372 false
323373 }
324374 else false
325375

github/deemru/w8io/026f985 
70.87 ms