tx · G9VyeGTSJB3annR4NbFn3J4YvxigUSsprChZtP4Phr8h 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD: -0.01500000 Waves 2019.10.03 16:31 [703598] smart account 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD > SELF 0.00000000 Waves
{ "type": 13, "id": "G9VyeGTSJB3annR4NbFn3J4YvxigUSsprChZtP4Phr8h", "fee": 1500000, "feeAssetId": null, "timestamp": 1570109309406, "version": 1, "sender": "3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD", "senderPublicKey": "8W9JLTJTfxrJrBNXxngzueBF4vJqeb6p9jFob7wb6QWQ", "proofs": [ "5FHSPfqyBE14uqgUsYEmQh4tXgouTN6VhM4syQTHsjhXZQfEGp8NAKhJrKzrC3wsadbTSJ2gyDTcG96SW6eYGuqu" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgYKBAgCAgIAAAAiAAAAAA1yc2FQdWJsaWNLZXkxCQACWwAAAAECAAAAh2Jhc2U2NDpNRnd3RFFZSktvWklodmNOQVFFQkJRQURTd0F3U0FKQkFPa2l1ei9CVjRFam94R2hUbU5DYnQyVGdrYlNQSC93NjliM0YxckttRDYxSmlQWHZ2RjhMMnBJOXhPWWNXNEZtb0VaVkhsUlF0QWxhSnlrbDMrcnNyRUNBd0VBQVE9PQAAAAANcnNhUHVibGljS2V5MgkAAlsAAAABAgAAAIdiYXNlNjQ6TUZ3d0RRWUpLb1pJaHZjTkFRRUJCUUFEU3dBd1NBSkJBSm5YemJNL1Yyc0RWMVVMYlBTT2xIa2xkT1RXUnJIaTVmeElrQm11ZXZyQ2xNUFZIN3JxY2N3aXJETmNNZElkd1hISTlBZGhqOUZXandHSXdmVS9LNk1DQXdFQUFRPT0AAAAADXJzYVB1YmxpY0tleTMJAAJbAAAAAQIAAACHYmFzZTY0Ok1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9SRGV2eTByNGt6THFPeVN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MQIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gxBQAAAAFhAAAAAAAAAAAABAAAABBhdmFpbGFibGVCYWxhbmNlCQAAZQAAAAIJAQAAAAx3YXZlc0JhbGFuY2UAAAABBQAAAAR0aGlzBQAAAA9yZXNlcnZlZEJhbGFuY2UEAAAAD2F2YWlsaWJsZUFtb3VudAkAAGcAAAACBQAAABBhdmFpbGFibGVCYWxhbmNlCAUAAAADdHR4AAAABmFtb3VudAQAAAAJc2lnbmF0dXJlCQAB9AAAAAMIBQAAAAN0dHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAN0dHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAADdHR4AAAAD3NlbmRlclB1YmxpY0tleQMFAAAAD2F2YWlsaWJsZUFtb3VudAUAAAAJc2lnbmF0dXJlBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAABHNzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAABHNzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAARzc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAABHNzdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAAEaXN0eAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAAEaXN0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAABGlzdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAAEaXN0eAAAAA9zZW5kZXJQdWJsaWNLZXkHjXEEYg==", "chainId": 84, "height": 703598, "spentComplexity": 0 } View: original | compacted Prev: G4NXVLtnvYqYtJAvYtU3vjp6QRtMxKj44ePTLsF5JReT Next: 6w5gnQyfma8Yz2Q4qwPtG1PmcUnDCQbycYReJCyzSdYF Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let rsaPublicKey1 = fromBase64String("base64: | |
4 | + | let rsaPublicKey1 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOkiuz/BV4EjoxGhTmNCbt2TgkbSPH/w69b3F1rKmD61JiPXvvF8L2pI9xOYcW4FmoEZVHlRQtAlaJykl3+rsrECAwEAAQ==") | |
5 | 5 | ||
6 | - | let rsaPublicKey2 = fromBase64String("base64: | |
6 | + | let rsaPublicKey2 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnXzbM/V2sDV1ULbPSOlHkldOTWRrHi5fxIkBmuevrClMPVH7rqccwirDNcMdIdwXHI9Adhj9FWjwGIwfU/K6MCAwEAAQ==") | |
7 | 7 | ||
8 | - | let rsaPublicKey3 = fromBase64String("base64: | |
8 | + | let rsaPublicKey3 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==") | |
9 | 9 | ||
10 | - | let gameTimeFrame = 1440 | |
10 | + | let gameTimeFrame = (1440 * 2) | |
11 | 11 | ||
12 | 12 | let stateAcc = "Accepted" | |
13 | 13 | ||
17 | 17 | ||
18 | 18 | let stateLose = "Lose" | |
19 | 19 | ||
20 | - | let | |
20 | + | let wavesId = unit | |
21 | 21 | ||
22 | - | let | |
22 | + | let btcId = base58'DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn' | |
23 | 23 | ||
24 | - | let | |
24 | + | let ethId = base58'BrmjyAWT5jjr3Wpsiyivyvg5vDuzoX2s93WgiexXetB3' | |
25 | 25 | ||
26 | - | let | |
26 | + | let ltcId = base58'BNdAstuFogzSyN2rY3beJbnBYwYcu7RzTHFjW88g8roK' | |
27 | 27 | ||
28 | - | let | |
28 | + | let vstId = base58'AMFteLfPzPhTsFc3NfvHG7fSRUnsp3tJXPH88G1PCisT' | |
29 | 29 | ||
30 | - | let WavesMinAmt = 10000000 | |
30 | + | let wctId = base58'EmcmfM27TPaemhuREZGD8WLvsuLCdqx8WovMrDQKbXS1' | |
31 | + | ||
32 | + | let WavesMinAmt = 100000000 | |
31 | 33 | ||
32 | 34 | let WavesMaxAmt = (WavesMinAmt * 10) | |
33 | 35 | ||
121 | 123 | ||
122 | 124 | ||
123 | 125 | func intToElem (rsaInt) = if ((2 > rsaInt)) | |
124 | - | then " | |
126 | + | then "7" | |
125 | 127 | else if ((4 > rsaInt)) | |
126 | - | then " | |
128 | + | then "6" | |
127 | 129 | else if ((6 > rsaInt)) | |
128 | - | then " | |
130 | + | then "5" | |
129 | 131 | else if ((8 > rsaInt)) | |
130 | 132 | then "4" | |
131 | 133 | else if ((10 > rsaInt)) | |
132 | - | then " | |
134 | + | then "3" | |
133 | 135 | else if ((12 > rsaInt)) | |
134 | - | then " | |
135 | - | else " | |
136 | + | then "2" | |
137 | + | else "1" | |
136 | 138 | ||
137 | 139 | ||
138 | 140 | func rsaToInt (gameId,rsaSign,rsaPublicKey) = { | |
165 | 167 | } | |
166 | 168 | ||
167 | 169 | ||
168 | - | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == " | |
169 | - | then | |
170 | - | else if ((threeDrums == " | |
171 | - | then | |
172 | - | else if ((threeDrums == " | |
173 | - | then | |
170 | + | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == "777")) | |
171 | + | then 5370 | |
172 | + | else if ((threeDrums == "666")) | |
173 | + | then 1300 | |
174 | + | else if ((threeDrums == "555")) | |
175 | + | then 450 | |
174 | 176 | else if ((threeDrums == "444")) | |
175 | - | then | |
176 | - | else if ((threeDrums == " | |
177 | - | then | |
178 | - | else if ((threeDrums == " | |
179 | - | then | |
180 | - | else if ((threeDrums == " | |
181 | - | then | |
182 | - | else if ((twoDrums == " | |
183 | - | then | |
184 | - | else if ((twoDrums == " | |
185 | - | then | |
186 | - | else if ((twoDrums == " | |
187 | - | then | |
177 | + | then 200 | |
178 | + | else if ((threeDrums == "333")) | |
179 | + | then 150 | |
180 | + | else if ((threeDrums == "222")) | |
181 | + | then 110 | |
182 | + | else if ((threeDrums == "111")) | |
183 | + | then 40 | |
184 | + | else if ((twoDrums == "77")) | |
185 | + | then 270 | |
186 | + | else if ((twoDrums == "66")) | |
187 | + | then 130 | |
188 | + | else if ((twoDrums == "55")) | |
189 | + | then 65 | |
188 | 190 | else if ((twoDrums == "44")) | |
189 | - | then | |
190 | - | else if ((twoDrums == " | |
191 | - | then | |
192 | - | else if ((twoDrums == " | |
193 | - | then | |
194 | - | else if ((twoDrums == " | |
195 | - | then | |
191 | + | then 30 | |
192 | + | else if ((twoDrums == "33")) | |
193 | + | then 20 | |
194 | + | else if ((twoDrums == "22")) | |
195 | + | then 15 | |
196 | + | else if ((twoDrums == "11")) | |
197 | + | then 10 | |
196 | 198 | else 0 | |
199 | + | ||
200 | + | ||
201 | + | func AssetNameToBase58 (assetName) = if ((assetName == "WAVES")) | |
202 | + | then wavesId | |
203 | + | else if ((assetName == "BTC")) | |
204 | + | then btcId | |
205 | + | else if ((assetName == "ETH")) | |
206 | + | then ethId | |
207 | + | else if ((assetName == "LTC")) | |
208 | + | then ltcId | |
209 | + | else if ((assetName == "VST")) | |
210 | + | then vstId | |
211 | + | else if ((assetName == "WCT")) | |
212 | + | then wctId | |
213 | + | else throw("Asset name is incorrect") | |
197 | 214 | ||
198 | 215 | ||
199 | 216 | @Callable(i) | |
205 | 222 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
206 | 223 | let pmtAssetId = if (!(isDefined(pmt.assetId))) | |
207 | 224 | then "WAVES" | |
208 | - | else if ((pmt.assetId == | |
225 | + | else if ((pmt.assetId == btcId)) | |
209 | 226 | then "BTC" | |
210 | - | else if ((pmt.assetId == | |
227 | + | else if ((pmt.assetId == ethId)) | |
211 | 228 | then "ETH" | |
212 | - | else if ((pmt.assetId == | |
229 | + | else if ((pmt.assetId == ltcId)) | |
213 | 230 | then "LTC" | |
214 | - | else if ((pmt.assetId == | |
231 | + | else if ((pmt.assetId == wctId)) | |
215 | 232 | then "WCT" | |
216 | - | else if ((pmt.assetId == | |
233 | + | else if ((pmt.assetId == vstId)) | |
217 | 234 | then "VST" | |
218 | 235 | else throw("AssetId is incorrect") | |
219 | 236 | let setReservedBalance = increaseReservedBalance(pmtAmt, pmtAssetId) | |
234 | 251 | let gameState = dataList[0] | |
235 | 252 | let playerAddress = addressFromPublicKey(fromBase58String(dataList[1])) | |
236 | 253 | let betAmt = parseIntValue(dataList[2]) | |
237 | - | let | |
254 | + | let assetName = dataList[3] | |
238 | 255 | let gameStart = parseIntValue(dataList[4]) | |
256 | + | let assetId58 = AssetNameToBase58(assetName) | |
239 | 257 | let gameTimeCheck = (gameTimeFrame > (height - gameStart)) | |
240 | - | let | |
241 | - | let setReservedBalance = decreaseReservedBalance(betAmt, | |
258 | + | let stateCorrect = (gameState == stateAcc) | |
259 | + | let setReservedBalance = decreaseReservedBalance(betAmt, assetName) | |
242 | 260 | let droppedElementsList = { | |
243 | 261 | let roll1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1) | |
244 | 262 | let roll2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2) | |
252 | 270 | let threeDrums = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
253 | 271 | let twoDrums = (droppedElementsList[0] + droppedElementsList[1]) | |
254 | 272 | let multiplier = defineMultiplier(threeDrums, twoDrums) | |
255 | - | (betAmt * multiplier) | |
273 | + | ((betAmt * multiplier) / 10) | |
256 | 274 | } | |
257 | 275 | let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) | |
258 | 276 | let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
259 | - | if ( | |
277 | + | if (stateCorrect) | |
260 | 278 | then if (gameTimeCheck) | |
261 | 279 | then if ((winAmt == 0)) | |
262 | - | then WriteSet([DataEntry(gameId, (((stateLose + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + | |
263 | - | else ScriptResult(WriteSet([DataEntry(gameId, (((stateWin + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + | |
264 | - | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + | |
280 | + | then WriteSet([DataEntry(gameId, (((stateLose + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]) | |
281 | + | else ScriptResult(WriteSet([DataEntry(gameId, (((stateWin + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winAmt, assetId58)])) | |
282 | + | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
265 | 283 | else throw("Game state is incorrect") | |
266 | 284 | } | |
267 | 285 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let rsaPublicKey1 = fromBase64String("base64: | |
4 | + | let rsaPublicKey1 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAOkiuz/BV4EjoxGhTmNCbt2TgkbSPH/w69b3F1rKmD61JiPXvvF8L2pI9xOYcW4FmoEZVHlRQtAlaJykl3+rsrECAwEAAQ==") | |
5 | 5 | ||
6 | - | let rsaPublicKey2 = fromBase64String("base64: | |
6 | + | let rsaPublicKey2 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJnXzbM/V2sDV1ULbPSOlHkldOTWRrHi5fxIkBmuevrClMPVH7rqccwirDNcMdIdwXHI9Adhj9FWjwGIwfU/K6MCAwEAAQ==") | |
7 | 7 | ||
8 | - | let rsaPublicKey3 = fromBase64String("base64: | |
8 | + | let rsaPublicKey3 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAORDevy0r4kzLqOySloB63Huv2e4zeHKHjCsy5vtFKmWZbXJa8gZYt4+EklFIo1K9oqu5BAPVfJ3FOzs2U1A+g0CAwEAAQ==") | |
9 | 9 | ||
10 | - | let gameTimeFrame = 1440 | |
10 | + | let gameTimeFrame = (1440 * 2) | |
11 | 11 | ||
12 | 12 | let stateAcc = "Accepted" | |
13 | 13 | ||
14 | 14 | let stateWin = "Win" | |
15 | 15 | ||
16 | 16 | let stateTimeout = "WinByTimeout" | |
17 | 17 | ||
18 | 18 | let stateLose = "Lose" | |
19 | 19 | ||
20 | - | let | |
20 | + | let wavesId = unit | |
21 | 21 | ||
22 | - | let | |
22 | + | let btcId = base58'DWgwcZTMhSvnyYCoWLRUXXSH1RSkzThXLJhww9gwkqdn' | |
23 | 23 | ||
24 | - | let | |
24 | + | let ethId = base58'BrmjyAWT5jjr3Wpsiyivyvg5vDuzoX2s93WgiexXetB3' | |
25 | 25 | ||
26 | - | let | |
26 | + | let ltcId = base58'BNdAstuFogzSyN2rY3beJbnBYwYcu7RzTHFjW88g8roK' | |
27 | 27 | ||
28 | - | let | |
28 | + | let vstId = base58'AMFteLfPzPhTsFc3NfvHG7fSRUnsp3tJXPH88G1PCisT' | |
29 | 29 | ||
30 | - | let WavesMinAmt = 10000000 | |
30 | + | let wctId = base58'EmcmfM27TPaemhuREZGD8WLvsuLCdqx8WovMrDQKbXS1' | |
31 | + | ||
32 | + | let WavesMinAmt = 100000000 | |
31 | 33 | ||
32 | 34 | let WavesMaxAmt = (WavesMinAmt * 10) | |
33 | 35 | ||
34 | 36 | let BtcMinAmt = 10000 | |
35 | 37 | ||
36 | 38 | let BtcMaxAmt = (BtcMinAmt * 10) | |
37 | 39 | ||
38 | 40 | let EthMinAmt = 1000000 | |
39 | 41 | ||
40 | 42 | let EthMaxAmt = (EthMinAmt * 10) | |
41 | 43 | ||
42 | 44 | let LtcMinAmt = 2000000 | |
43 | 45 | ||
44 | 46 | let LtcMaxAmt = (LtcMinAmt * 10) | |
45 | 47 | ||
46 | 48 | let WctMinAmt = 500000000 | |
47 | 49 | ||
48 | 50 | let WctMaxAmt = (WctMinAmt * 10) | |
49 | 51 | ||
50 | 52 | let VstMinAmt = 500000000 | |
51 | 53 | ||
52 | 54 | let VstMaxAmt = (VstMinAmt * 10) | |
53 | 55 | ||
54 | 56 | func pmtAmtCheck (pmtAssetId,pmtAmt) = if ((pmtAssetId == "WAVES")) | |
55 | 57 | then if (if ((pmtAmt >= WavesMinAmt)) | |
56 | 58 | then (WavesMaxAmt >= pmtAmt) | |
57 | 59 | else false) | |
58 | 60 | then true | |
59 | 61 | else throw("Bet amount is not in range") | |
60 | 62 | else if ((pmtAssetId == "BTC")) | |
61 | 63 | then if (if ((pmtAmt >= BtcMinAmt)) | |
62 | 64 | then (BtcMaxAmt >= pmtAmt) | |
63 | 65 | else false) | |
64 | 66 | then true | |
65 | 67 | else throw("Bet amount is not in range") | |
66 | 68 | else if ((pmtAssetId == "ETH")) | |
67 | 69 | then if (if ((pmtAmt >= EthMinAmt)) | |
68 | 70 | then (EthMaxAmt >= pmtAmt) | |
69 | 71 | else false) | |
70 | 72 | then true | |
71 | 73 | else throw("Bet amount is not in range") | |
72 | 74 | else if ((pmtAssetId == "LTC")) | |
73 | 75 | then if (if ((pmtAmt >= LtcMinAmt)) | |
74 | 76 | then (LtcMaxAmt >= pmtAmt) | |
75 | 77 | else false) | |
76 | 78 | then true | |
77 | 79 | else throw("Bet amount is not in range") | |
78 | 80 | else if ((pmtAssetId == "WCT")) | |
79 | 81 | then if (if ((pmtAmt >= WctMinAmt)) | |
80 | 82 | then (WctMaxAmt >= pmtAmt) | |
81 | 83 | else false) | |
82 | 84 | then true | |
83 | 85 | else throw("Bet amount is not in range") | |
84 | 86 | else if (if ((pmtAmt >= VstMinAmt)) | |
85 | 87 | then (VstMaxAmt >= pmtAmt) | |
86 | 88 | else false) | |
87 | 89 | then true | |
88 | 90 | else throw("Bet amount is not in range") | |
89 | 91 | ||
90 | 92 | ||
91 | 93 | func increaseReservedBalance (pmtAmt,pmtAssetId) = { | |
92 | 94 | let currentReservedBalance = { | |
93 | 95 | let valueReservedBalance = getInteger(this, ("Reserved_" + pmtAssetId)) | |
94 | 96 | match valueReservedBalance { | |
95 | 97 | case a: Int => | |
96 | 98 | a | |
97 | 99 | case _ => | |
98 | 100 | 0 | |
99 | 101 | } | |
100 | 102 | } | |
101 | 103 | let newReservedBalance = (currentReservedBalance + pmtAmt) | |
102 | 104 | if ((wavesBalance(this) >= newReservedBalance)) | |
103 | 105 | then { | |
104 | 106 | let increaseReservedBalance = newReservedBalance | |
105 | 107 | increaseReservedBalance | |
106 | 108 | } | |
107 | 109 | else throw("Bet was rejected. Insufficient funds on game account.") | |
108 | 110 | } | |
109 | 111 | ||
110 | 112 | ||
111 | 113 | func getDataList (gameId) = { | |
112 | 114 | let getDataString = getString(this, gameId) | |
113 | 115 | let a = match getDataString { | |
114 | 116 | case a: String => | |
115 | 117 | a | |
116 | 118 | case _ => | |
117 | 119 | throw("GameId was not found") | |
118 | 120 | } | |
119 | 121 | split(a, "_") | |
120 | 122 | } | |
121 | 123 | ||
122 | 124 | ||
123 | 125 | func intToElem (rsaInt) = if ((2 > rsaInt)) | |
124 | - | then " | |
126 | + | then "7" | |
125 | 127 | else if ((4 > rsaInt)) | |
126 | - | then " | |
128 | + | then "6" | |
127 | 129 | else if ((6 > rsaInt)) | |
128 | - | then " | |
130 | + | then "5" | |
129 | 131 | else if ((8 > rsaInt)) | |
130 | 132 | then "4" | |
131 | 133 | else if ((10 > rsaInt)) | |
132 | - | then " | |
134 | + | then "3" | |
133 | 135 | else if ((12 > rsaInt)) | |
134 | - | then " | |
135 | - | else " | |
136 | + | then "2" | |
137 | + | else "1" | |
136 | 138 | ||
137 | 139 | ||
138 | 140 | func rsaToInt (gameId,rsaSign,rsaPublicKey) = { | |
139 | 141 | let rsaCheck = rsaVerify(SHA256, toBytes(gameId), rsaSign, rsaPublicKey) | |
140 | 142 | if (rsaCheck) | |
141 | 143 | then { | |
142 | 144 | let rsaInt = ((toInt(sha256(rsaSign)) % 19) + 1) | |
143 | 145 | if (if ((rsaInt > 0)) | |
144 | 146 | then (20 >= rsaInt) | |
145 | 147 | else false) | |
146 | 148 | then rsaInt | |
147 | 149 | else throw("Rsa integer is not in range") | |
148 | 150 | } | |
149 | 151 | else throw("Rsa Signature is invalid") | |
150 | 152 | } | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | func decreaseReservedBalance (betAmt,assetId) = { | |
154 | 156 | let valueReservedBalance = getInteger(this, ("Reserved_" + assetId)) | |
155 | 157 | let extractReservedBalance = match valueReservedBalance { | |
156 | 158 | case a: Int => | |
157 | 159 | a | |
158 | 160 | case _ => | |
159 | 161 | 0 | |
160 | 162 | } | |
161 | 163 | let decreaseReservedBalance = (extractReservedBalance - betAmt) | |
162 | 164 | if ((decreaseReservedBalance > 0)) | |
163 | 165 | then decreaseReservedBalance | |
164 | 166 | else throw("Reserved balance couldn't be less than 0") | |
165 | 167 | } | |
166 | 168 | ||
167 | 169 | ||
168 | - | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == " | |
169 | - | then | |
170 | - | else if ((threeDrums == " | |
171 | - | then | |
172 | - | else if ((threeDrums == " | |
173 | - | then | |
170 | + | func defineMultiplier (threeDrums,twoDrums) = if ((threeDrums == "777")) | |
171 | + | then 5370 | |
172 | + | else if ((threeDrums == "666")) | |
173 | + | then 1300 | |
174 | + | else if ((threeDrums == "555")) | |
175 | + | then 450 | |
174 | 176 | else if ((threeDrums == "444")) | |
175 | - | then | |
176 | - | else if ((threeDrums == " | |
177 | - | then | |
178 | - | else if ((threeDrums == " | |
179 | - | then | |
180 | - | else if ((threeDrums == " | |
181 | - | then | |
182 | - | else if ((twoDrums == " | |
183 | - | then | |
184 | - | else if ((twoDrums == " | |
185 | - | then | |
186 | - | else if ((twoDrums == " | |
187 | - | then | |
177 | + | then 200 | |
178 | + | else if ((threeDrums == "333")) | |
179 | + | then 150 | |
180 | + | else if ((threeDrums == "222")) | |
181 | + | then 110 | |
182 | + | else if ((threeDrums == "111")) | |
183 | + | then 40 | |
184 | + | else if ((twoDrums == "77")) | |
185 | + | then 270 | |
186 | + | else if ((twoDrums == "66")) | |
187 | + | then 130 | |
188 | + | else if ((twoDrums == "55")) | |
189 | + | then 65 | |
188 | 190 | else if ((twoDrums == "44")) | |
189 | - | then | |
190 | - | else if ((twoDrums == " | |
191 | - | then | |
192 | - | else if ((twoDrums == " | |
193 | - | then | |
194 | - | else if ((twoDrums == " | |
195 | - | then | |
191 | + | then 30 | |
192 | + | else if ((twoDrums == "33")) | |
193 | + | then 20 | |
194 | + | else if ((twoDrums == "22")) | |
195 | + | then 15 | |
196 | + | else if ((twoDrums == "11")) | |
197 | + | then 10 | |
196 | 198 | else 0 | |
199 | + | ||
200 | + | ||
201 | + | func AssetNameToBase58 (assetName) = if ((assetName == "WAVES")) | |
202 | + | then wavesId | |
203 | + | else if ((assetName == "BTC")) | |
204 | + | then btcId | |
205 | + | else if ((assetName == "ETH")) | |
206 | + | then ethId | |
207 | + | else if ((assetName == "LTC")) | |
208 | + | then ltcId | |
209 | + | else if ((assetName == "VST")) | |
210 | + | then vstId | |
211 | + | else if ((assetName == "WCT")) | |
212 | + | then wctId | |
213 | + | else throw("Asset name is incorrect") | |
197 | 214 | ||
198 | 215 | ||
199 | 216 | @Callable(i) | |
200 | 217 | func bet () = { | |
201 | 218 | let pmt = extract(i.payment) | |
202 | 219 | let pmtAmt = pmt.amount | |
203 | 220 | let gameId = toBase58String(i.transactionId) | |
204 | 221 | let gameStart = height | |
205 | 222 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
206 | 223 | let pmtAssetId = if (!(isDefined(pmt.assetId))) | |
207 | 224 | then "WAVES" | |
208 | - | else if ((pmt.assetId == | |
225 | + | else if ((pmt.assetId == btcId)) | |
209 | 226 | then "BTC" | |
210 | - | else if ((pmt.assetId == | |
227 | + | else if ((pmt.assetId == ethId)) | |
211 | 228 | then "ETH" | |
212 | - | else if ((pmt.assetId == | |
229 | + | else if ((pmt.assetId == ltcId)) | |
213 | 230 | then "LTC" | |
214 | - | else if ((pmt.assetId == | |
231 | + | else if ((pmt.assetId == wctId)) | |
215 | 232 | then "WCT" | |
216 | - | else if ((pmt.assetId == | |
233 | + | else if ((pmt.assetId == vstId)) | |
217 | 234 | then "VST" | |
218 | 235 | else throw("AssetId is incorrect") | |
219 | 236 | let setReservedBalance = increaseReservedBalance(pmtAmt, pmtAssetId) | |
220 | 237 | let pmtAmtCorrect = pmtAmtCheck(pmtAssetId, pmtAmt) | |
221 | 238 | if (pmtAmtCorrect) | |
222 | 239 | then { | |
223 | 240 | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(pmtAmt)) + "_") + pmtAssetId) + "_") + toString(gameStart)) | |
224 | 241 | WriteSet([DataEntry(gameId, dataString), DataEntry(("Reserved_" + pmtAssetId), setReservedBalance)]) | |
225 | 242 | } | |
226 | 243 | else throw("assetId is incorrect") | |
227 | 244 | } | |
228 | 245 | ||
229 | 246 | ||
230 | 247 | ||
231 | 248 | @Callable(i) | |
232 | 249 | func withdraw (gameId,rsaSign1,rsaSign2,rsaSign3) = { | |
233 | 250 | let dataList = getDataList(gameId) | |
234 | 251 | let gameState = dataList[0] | |
235 | 252 | let playerAddress = addressFromPublicKey(fromBase58String(dataList[1])) | |
236 | 253 | let betAmt = parseIntValue(dataList[2]) | |
237 | - | let | |
254 | + | let assetName = dataList[3] | |
238 | 255 | let gameStart = parseIntValue(dataList[4]) | |
256 | + | let assetId58 = AssetNameToBase58(assetName) | |
239 | 257 | let gameTimeCheck = (gameTimeFrame > (height - gameStart)) | |
240 | - | let | |
241 | - | let setReservedBalance = decreaseReservedBalance(betAmt, | |
258 | + | let stateCorrect = (gameState == stateAcc) | |
259 | + | let setReservedBalance = decreaseReservedBalance(betAmt, assetName) | |
242 | 260 | let droppedElementsList = { | |
243 | 261 | let roll1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1) | |
244 | 262 | let roll2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2) | |
245 | 263 | let roll3Int = rsaToInt(gameId, rsaSign3, rsaPublicKey3) | |
246 | 264 | let element1 = intToElem(roll1Int) | |
247 | 265 | let element2 = intToElem(roll2Int) | |
248 | 266 | let element3 = intToElem(roll3Int) | |
249 | 267 | [element1, element2, element3] | |
250 | 268 | } | |
251 | 269 | let winAmt = { | |
252 | 270 | let threeDrums = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
253 | 271 | let twoDrums = (droppedElementsList[0] + droppedElementsList[1]) | |
254 | 272 | let multiplier = defineMultiplier(threeDrums, twoDrums) | |
255 | - | (betAmt * multiplier) | |
273 | + | ((betAmt * multiplier) / 10) | |
256 | 274 | } | |
257 | 275 | let stringForNewData = ((((((dataList[1] + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) | |
258 | 276 | let droppedElements = ((droppedElementsList[0] + droppedElementsList[1]) + droppedElementsList[2]) | |
259 | - | if ( | |
277 | + | if (stateCorrect) | |
260 | 278 | then if (gameTimeCheck) | |
261 | 279 | then if ((winAmt == 0)) | |
262 | - | then WriteSet([DataEntry(gameId, (((stateLose + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + | |
263 | - | else ScriptResult(WriteSet([DataEntry(gameId, (((stateWin + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + | |
264 | - | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + | |
280 | + | then WriteSet([DataEntry(gameId, (((stateLose + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]) | |
281 | + | else ScriptResult(WriteSet([DataEntry(gameId, (((stateWin + stringForNewData) + toString(winAmt)) + droppedElements)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winAmt, assetId58)])) | |
282 | + | else ScriptResult(WriteSet([DataEntry(gameId, (stateTimeout + stringForNewData)), DataEntry(("Reserved_" + assetName), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
265 | 283 | else throw("Game state is incorrect") | |
266 | 284 | } | |
267 | 285 | ||
268 | 286 | ||
269 | 287 | @Verifier(tx) | |
270 | 288 | func verify () = match tx { | |
271 | 289 | case ttx: TransferTransaction => | |
272 | 290 | let valueReservedBalance = getInteger(this, "Reserved") | |
273 | 291 | let reservedBalance = match valueReservedBalance { | |
274 | 292 | case a: Int => | |
275 | 293 | a | |
276 | 294 | case _ => | |
277 | 295 | 0 | |
278 | 296 | } | |
279 | 297 | let availableBalance = (wavesBalance(this) - reservedBalance) | |
280 | 298 | let availibleAmount = (availableBalance >= ttx.amount) | |
281 | 299 | let signature = sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
282 | 300 | if (availibleAmount) | |
283 | 301 | then signature | |
284 | 302 | else false | |
285 | 303 | case sstx: SetScriptTransaction => | |
286 | 304 | sigVerify(sstx.bodyBytes, sstx.proofs[0], sstx.senderPublicKey) | |
287 | 305 | case istx: InvokeScriptTransaction => | |
288 | 306 | sigVerify(istx.bodyBytes, istx.proofs[0], istx.senderPublicKey) | |
289 | 307 | case _ => | |
290 | 308 | false | |
291 | 309 | } | |
292 | 310 |
github/deemru/w8io/169f3d6 1946.99 ms ◑