tx · AciMgN56vqSTijC4Y9YntaHSGmdRViYxVGMn6E4DuX4D

3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE:  -0.05000000 Waves

2019.11.27 07:29 [783198] smart account 3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE > SELF 0.00000000 Waves

{ "type": 13, "id": "AciMgN56vqSTijC4Y9YntaHSGmdRViYxVGMn6E4DuX4D", "fee": 5000000, "feeAssetId": null, "timestamp": 1574829013533, "version": 1, "sender": "3NA7cHZ9oBicev5AEn3BidRAyitA3HdjRbE", "senderPublicKey": "FEmBffz5oKcY5pLrHbwcj8jxovWVvTYCeNRzNT6uHBJc", "proofs": [ "2YGVFdViQkQ7nBXtevCrwfmByPbPWXTuaLANfjKQPrjLQWUsT68qWrZFiZrJrYH8aT4Lv3LzvbpSxzMgJFJtkoaN" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAJwAAAAAJUlNBUFVCTElDCQACWwAAAAECAAABj2Jhc2U2NDpNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQWc0ZEFSNlhiQkRBUzloci9FajNkSnY2RmZjNDY2eC9tT0dNV1UzbHJBQnMzcWE4QkhtdUpHbmtmYnBFZjJ2QXdZVE9XUHZ2emZNMTBPQmJmbG9TeXEzYzlNS3Z5VGUxbHVCTEdxVzR2WlVYSXl2U2d6MWxpeVVWZWZJUXkzZHlGOWpiZVRaYkMwYmJjVC83TzNERUwrMDF6NkErckRDYWNTWjBsR29sU1E2QW5oTHh6SWtWcE9RSmJyQm1DK3grWnVaUENNV3pKeW5kNWFlT243amFqL21rUlZ5eGU2Zy8wT2hXejROaWlaWGV1TVJCKzhtS3kwZldEL1VsSWxaV0hzQVMyWm1ya1hLcWpMcTAvMHdyOElMSmt6bmpTcWRuSTVJYmpnM3VRcmovNEFOK2k5cjI4YVE3My9aa1B0WTVTYncwQU9pQUJCdTdnSG1xOWF5VnhaUUlEQVFBQgAAAAAP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CQABkQAAAAIFAAAABGJldHMAAAAAAAAAAAACAAAAAAkBAAAAFHZhbGlkYXRlQmV0QW5kR2V0QW10AAAAAQMJAABnAAAAAgUAAAABcwAAAAAAAAAAAgkAAZEAAAACBQAAAARiZXRzAAAAAAAAAAABAgAAAAABAAAAEEluY3JlbWVudEdhbWVOdW0AAAAABAAAAAdnYW1lTnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAD0dBTUVTQ09VTlRFUktFWQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAANudW0FAAAAByRtYXRjaDAFAAAAA251bQAAAAAAAAAAAAkAAGQAAAACBQAAAAdnYW1lTnVtAAAAAAAAAAABAAAAAQAAAAFpAQAAAAxwbGF5Um91bGV0dGUAAAABAAAABGJldHMEAAAAB2JldExpc3QJAAS1AAAAAgUAAAAEYmV0cwIAAAABfAQAAAABdAkBAAAACmdldEJldHNBbXQAAAABBQAAAAdiZXRMaXN0CQAAAgAAAAEJAAGkAAAAAQUAAAABdAAAAAAZBPKz", "chainId": 84, "height": 783198, "spentComplexity": 0 } View: original | compacted Prev: 3vyJGUgUmtvAMrko5Pf7Wt6mpJfhTtQG2jDP1xotTh5k Next: EtBy7VhwofvS1nhhXBHBUsx9sxELsry2EwfWEH9uhpjc Diff:
OldNewDifferences
325325
326326 func getBetsAmt (bets) = {
327327 let s = size(bets)
328- let a = (validateBetAndGetAmt(if ((1 >= s))
328+ (validateBetAndGetAmt(if ((s >= 1))
329329 then bets[0]
330- else "") + validateBetAndGetAmt(if ((2 >= s))
330+ else "") + validateBetAndGetAmt(if ((s >= 2))
331331 then bets[1]
332332 else ""))
333- a
334333 }
335334
336335
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let RSAPUBLIC = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg4dAR6XbBDAS9hr/Ej3dJv6Ffc466x/mOGMWU3lrABs3qa8BHmuJGnkfbpEf2vAwYTOWPvvzfM10OBbfloSyq3c9MKvyTe1luBLGqW4vZUXIyvSgz1liyUVefIQy3dyF9jbeTZbC0bbcT/7O3DEL+01z6A+rDCacSZ0lGolSQ6AnhLxzIkVpOQJbrBmC+x+ZuZPCMWzJynd5aeOn7jaj/mkRVyxe6g/0OhWz4NiiZXeuMRB+8mKy0fWD/UlIlZWHsAS2ZmrkXKqjLq0/0wr8ILJkznjSqdnI5Ibjg3uQrj/4AN+i9r28aQ73/ZkPtY5Sbw0AOiABBu7gHmq9ayVxZQIDAQAB")
55
66 let GAMESCOUNTERKEY = "$GAME_NUM"
77
88 let RESERVATIONKEY = "$RESERVED_AMOUNT"
99
1010 let WBET = base58'A4q1mYKo11yuH9gmvDodeJoksagcyQzeFE9JtphMWddw'
1111
1212 let WALLETWAVESBET = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1313
1414 let WALLETMCAFEE = Address(base58'3MtCy2PCFPyu8A9SRNL4qUo1V17SGLHftD8')
1515
1616 let WAVELET = 100000000
1717
1818 let FEEWAVESBET = 4
1919
2020 let FEEMCAFEE = 2
2121
2222 let STATESUBMITTED = "SUBMITTED"
2323
2424 let STATEWON = "WON"
2525
2626 let STATELOST = "LOST"
2727
2828 let BETMIN = (1 * WAVELET)
2929
3030 let BETMAX = (20000000 * WAVELET)
3131
3232 let TSTRAIGHT = 1
3333
3434 let TSPLIT = 2
3535
3636 let TSTREET = 3
3737
3838 let TCORNER = 4
3939
4040 let TLINE = 5
4141
4242 let TCOLUMN = 6
4343
4444 let TDOZEN = 7
4545
4646 let TRED = 8
4747
4848 let TBLACK = 9
4949
5050 let TODD = 10
5151
5252 let TEVEN = 11
5353
5454 let T1TO18 = 12
5555
5656 let T19TO36 = 13
5757
5858 let HORIZONTAL = 1
5959
6060 let VERTICAL = 2
6161
6262 func is0to36 (num) = if (if ((num >= 0))
6363 then (37 > num)
6464 else false)
6565 then true
6666 else throw("Invalid range, try between 0 and 36. Game aborted!")
6767
6868
6969 func isSplit (num1,num2,direction) = if ((direction == HORIZONTAL))
7070 then if (if (if (if (if ((num1 > 0))
7171 then (34 > num1)
7272 else false)
7373 then true
7474 else if ((num1 == 0))
7575 then (num2 == 1)
7676 else false)
7777 then true
7878 else if ((num1 == 0))
7979 then (num2 == 2)
8080 else false)
8181 then true
8282 else if ((num1 == 0))
8383 then (num2 == 3)
8484 else false)
8585 then true
8686 else throw("Invalid split hotizontal move. Game aborted!")
8787 else if ((direction == VERTICAL))
8888 then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1))
8989 then true
9090 else (num1 == 2))
9191 then true
9292 else (num1 == 4))
9393 then true
9494 else (num1 == 5))
9595 then true
9696 else (num1 == 7))
9797 then true
9898 else (num1 == 8))
9999 then true
100100 else (num1 == 10))
101101 then true
102102 else (num1 == 11))
103103 then true
104104 else (num1 == 13))
105105 then true
106106 else (num1 == 14))
107107 then true
108108 else (num1 == 16))
109109 then true
110110 else (num1 == 17))
111111 then true
112112 else (num1 == 19))
113113 then true
114114 else (num1 == 20))
115115 then true
116116 else (num1 == 22))
117117 then true
118118 else (num1 == 23))
119119 then true
120120 else (num1 == 25))
121121 then true
122122 else (num1 == 26))
123123 then true
124124 else (num1 == 28))
125125 then true
126126 else (num1 == 29))
127127 then true
128128 else (num1 == 31))
129129 then true
130130 else (num1 == 32))
131131 then true
132132 else (num1 == 34))
133133 then true
134134 else (num1 == 35))
135135 then true
136136 else throw("Invalid split vertical move. Game aborted!")
137137 else throw("Invalid split move. Game aborted!")
138138
139139
140140 func isStreet (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1))
141141 then true
142142 else (num1 == 4))
143143 then true
144144 else (num1 == 7))
145145 then true
146146 else (num1 == 10))
147147 then true
148148 else (num1 == 13))
149149 then true
150150 else (num1 == 16))
151151 then true
152152 else (num1 == 19))
153153 then true
154154 else (num1 == 22))
155155 then true
156156 else (num1 == 25))
157157 then true
158158 else (num1 == 28))
159159 then true
160160 else (num1 == 31))
161161 then true
162162 else (num1 == 34))
163163 then true
164164 else if ((num1 == 0))
165165 then (num2 == 1)
166166 else false)
167167 then true
168168 else if ((num1 == 0))
169169 then (num2 == 3)
170170 else false)
171171 then true
172172 else throw("Invalid street move. Game aborted!")
173173
174174
175175 func isCorner (num1,num2) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((num1 == 1))
176176 then true
177177 else (num1 == 2))
178178 then true
179179 else (num1 == 4))
180180 then true
181181 else (num1 == 5))
182182 then true
183183 else (num1 == 7))
184184 then true
185185 else (num1 == 8))
186186 then true
187187 else (num1 == 10))
188188 then true
189189 else (num1 == 11))
190190 then true
191191 else (num1 == 13))
192192 then true
193193 else (num1 == 14))
194194 then true
195195 else (num1 == 16))
196196 then true
197197 else (num1 == 17))
198198 then true
199199 else (num1 == 19))
200200 then true
201201 else (num1 == 20))
202202 then true
203203 else (num1 == 22))
204204 then true
205205 else (num1 == 23))
206206 then true
207207 else (num1 == 25))
208208 then true
209209 else (num1 == 26))
210210 then true
211211 else (num1 == 28))
212212 then true
213213 else (num1 == 29))
214214 then true
215215 else (num1 == 31))
216216 then true
217217 else (num1 == 32))
218218 then true
219219 else if ((num1 == 0))
220220 then (num2 == 1)
221221 else false)
222222 then true
223223 else throw("Invalid corner move. Game aborted!")
224224
225225
226226 func isLine (num) = if (if (if (if (if (if (if (if (if (if (if ((num == 1))
227227 then true
228228 else (num == 4))
229229 then true
230230 else (num == 7))
231231 then true
232232 else (num == 10))
233233 then true
234234 else (num == 13))
235235 then true
236236 else (num == 16))
237237 then true
238238 else (num == 19))
239239 then true
240240 else (num == 22))
241241 then true
242242 else (num == 25))
243243 then true
244244 else (num == 28))
245245 then true
246246 else (num == 31))
247247 then true
248248 else throw("Invalid line move. Game aborted!")
249249
250250
251251 func isColumn (column) = if (if (if ((column == 1))
252252 then true
253253 else (column == 2))
254254 then true
255255 else (column == 3))
256256 then true
257257 else throw("Invalid column move. Game aborted!")
258258
259259
260260 func isDozen (dozen) = if (if (if ((dozen == 1))
261261 then true
262262 else (dozen == 2))
263263 then true
264264 else (dozen == 3))
265265 then true
266266 else throw("Invalid dozen move. Game aborted!")
267267
268268
269269 func validateBetAndGetAmt (bet) = if ((size(bet) != 0))
270270 then {
271271 let betContents = split(bet, "_")
272272 if ((size(betContents) == 5))
273273 then {
274274 let betType = parseInt(betContents[0])
275275 let betAmount = parseIntValue(betContents[1])
276276 let betNum1 = parseIntValue(betContents[2])
277277 let betNum2 = parseIntValue(betContents[3])
278278 let betNum3 = parseIntValue(betContents[4])
279279 if (is0to36(betNum1))
280280 then if ((betType == TSTRAIGHT))
281281 then betAmount
282282 else if ((betType == TSPLIT))
283283 then if (isSplit(betNum1, betNum2, betNum3))
284284 then betAmount
285285 else 0
286286 else if ((betType == TSTREET))
287287 then if (isStreet(betNum1, betNum2))
288288 then betAmount
289289 else 0
290290 else if ((betType == TCOLUMN))
291291 then if (isCorner(betNum1, betNum2))
292292 then betAmount
293293 else 0
294294 else if ((betType == TLINE))
295295 then if (isLine(betNum1))
296296 then betAmount
297297 else 0
298298 else if ((betType == TCOLUMN))
299299 then if (isColumn(betNum1))
300300 then betAmount
301301 else 0
302302 else if ((betType == TDOZEN))
303303 then if (isDozen(betNum1))
304304 then betAmount
305305 else 0
306306 else if ((betType == TRED))
307307 then betAmount
308308 else if ((betType == TBLACK))
309309 then betAmount
310310 else if ((betType == TODD))
311311 then betAmount
312312 else if ((betType == TEVEN))
313313 then betAmount
314314 else if ((betType == T1TO18))
315315 then betAmount
316316 else if ((betType == T19TO36))
317317 then betAmount
318318 else throw("Invalid bet type, Game aborted!")
319319 else throw("Invalid bet range, Game aborted!")
320320 }
321321 else throw("Invalid bet structure, Game aborted!")
322322 }
323323 else 0
324324
325325
326326 func getBetsAmt (bets) = {
327327 let s = size(bets)
328- let a = (validateBetAndGetAmt(if ((1 >= s))
328+ (validateBetAndGetAmt(if ((s >= 1))
329329 then bets[0]
330- else "") + validateBetAndGetAmt(if ((2 >= s))
330+ else "") + validateBetAndGetAmt(if ((s >= 2))
331331 then bets[1]
332332 else ""))
333- a
334333 }
335334
336335
337336 func IncrementGameNum () = {
338337 let gameNum = match getInteger(this, GAMESCOUNTERKEY) {
339338 case num: Int =>
340339 num
341340 case _ =>
342341 0
343342 }
344343 (gameNum + 1)
345344 }
346345
347346
348347 @Callable(i)
349348 func playRoulette (bets) = {
350349 let betList = split(bets, "|")
351350 let t = getBetsAmt(betList)
352351 throw(toString(t))
353352 }
354353
355354

github/deemru/w8io/169f3d6 
66.26 ms