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