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