tx · 4K7GJdRxbZg7YxTnQesn16LVbDYmTZjXr29rK3rQXiB8 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD: -0.01500000 Waves 2019.10.06 15:06 [707894] smart account 3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD > SELF 0.00000000 Waves
{ "type": 13, "id": "4K7GJdRxbZg7YxTnQesn16LVbDYmTZjXr29rK3rQXiB8", "fee": 1500000, "feeAssetId": null, "timestamp": 1570363618447, "version": 1, "sender": "3NBFHpzVTqcHQB6Zxec1f6N6ZGBWQ4VsBFD", "senderPublicKey": "8W9JLTJTfxrJrBNXxngzueBF4vJqeb6p9jFob7wb6QWQ", "proofs": [ "4jik3KBJyWwRHrGMci59hn4J7F7aqPyr1b8uaUtVXVrEvoeS47mh4CjbtorSi3paVfMjDd7xuSN4Hqt66yejYDN2" ], "script": "base64:AAIDAAAAAAAAAAwIARIAEgYKBAgICAgAAAAoAAAAAA1yc2FQdWJsaWNLZXkxCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9raXV6L0JWNEVqb3hHaFRtTkNidDJUZ2tiU1BIL3c2OWIzRjFyS21ENjFKaVBYdnZGOEwycEk5eE9ZY1c0Rm1vRVpWSGxSUXRBbGFKeWtsMytyc3JFQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkyCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQUpuWHpiTS9WMnNEVjFVTGJQU09sSGtsZE9UV1JySGk1ZnhJa0JtdWV2ckNsTVBWSDdycWNjd2lyRE5jTWRJZHdYSEk5QWRoajlGV2p3R0l3ZlUvSzZNQ0F3RUFBUT09AAAAAA1yc2FQdWJsaWNLZXkzCQACWwAAAAECAAAAgE1Gd3dEUVlKS29aSWh2Y05BUUVCQlFBRFN3QXdTQUpCQU9SRGV2eTByNGt6THFPeVNsb0I2M0h1djJlNHplSEtIakNzeTV2dEZLbVdaYlhKYThnWll0NCtFa2xGSW8xSzlvcXU1QkFQVmZKM0ZPenMyVTFBK2cwQ0F3RUFBUT09AAAAAAVkcnVtMQkABEwAAAACAgAAAAEyCQAETAAAAAICAAAAATEJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAE1CQAETAAAAAICAAAAATEJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATMJAARMAAAAAgIAAAABNAkABEwAAAACAgAAAAEzCQAETAAAAAICAAAAATQJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATUJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAE3CQAETAAAAAICAAAAATQJAARMAAAAAgIAAAABNgkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATMFAAAAA25pbAAAAAAFZHJ1bTIJAARMAAAAAgIAAAABNwkABEwAAAACAgAAAAE2CQAETAAAAAICAAAAATMJAARMAAAAAgIAAAABMQkABEwAAAACAgAAAAE0CQAETAAAAAICAAAAATIJAARMAAAAAgIAAAABMQkABEwAAAACAgAAAAEyCQAETAAAAAICAAAAATUJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATQJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAE2CQAETAAAAAICAAAAATUJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATEJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAE0BQAAAANuaWwAAAAABWRydW0zCQAETAAAAAICAAAAATQJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAExCQAETAAAAAICAAAAATYJAARMAAAAAgIAAAABNQkABEwAAAACAgAAAAE3CQAETAAAAAICAAAAATQJAARMAAAAAgIAAAABMwkABEwAAAACAgAAAAE2CQAETAAAAAICAAAAATEJAARMAAAAAgIAAAABMgkABEwAAAACAgAAAAE0CQAETAAAAAICAAAAATMJAARMAAAAAgIAAAABMQkABEwAAA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RjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAARzc3R4BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAARzc3R4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAAEc3N0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAARzc3R4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAABGlzdHgFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAABGlzdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAARpc3R4AAAABnByb29mcwAAAAAAAAAAAAgFAAAABGlzdHgAAAAPc2VuZGVyUHVibGljS2V5B1t6HK8=", "chainId": 84, "height": 707894, "spentComplexity": 0 } View: original | compacted Prev: Es6tbAPdcPhkpapmgUckotW2xsbgewzC8DdP575dBGfi Next: ABgD7TaaoTB3n7q8QC6dXkhKgW4BG6RLYuTQuj56kzRn Diff:
Old | New | Differences | |
---|---|---|---|
100 | 100 | else throw("Bet amount is not in range") | |
101 | 101 | ||
102 | 102 | ||
103 | - | func increaseReservedBalance (pmtAmt,pmtAssetName) = { | |
103 | + | func increaseReservedBalance (pmtAmt,pmtAssetName,assetId58) = { | |
104 | 104 | let currentReservedBalance = { | |
105 | 105 | let valueReservedBalance = getInteger(this, (pmtAssetName + "_Reserved")) | |
106 | 106 | match valueReservedBalance { | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | let newReservedBalance = (currentReservedBalance + pmtAmt) | |
114 | - | if (( | |
114 | + | if ((assetBalance(this, assetId58) >= newReservedBalance)) | |
115 | 115 | then { | |
116 | 116 | let increaseReservedBalance = newReservedBalance | |
117 | 117 | increaseReservedBalance | |
213 | 213 | else throw("Asset name is incorrect") | |
214 | 214 | ||
215 | 215 | ||
216 | + | func assetIdToName (assetId) = if (!(isDefined(assetId))) | |
217 | + | then "WAVES" | |
218 | + | else if ((assetId == btcId)) | |
219 | + | then "BTC" | |
220 | + | else if ((assetId == ethId)) | |
221 | + | then "ETH" | |
222 | + | else if ((assetId == ltcId)) | |
223 | + | then "LTC" | |
224 | + | else if ((assetId == wctId)) | |
225 | + | then "WCT" | |
226 | + | else if ((assetId == vstId)) | |
227 | + | then "VST" | |
228 | + | else throw("AssetId is incorrect") | |
229 | + | ||
230 | + | ||
216 | 231 | @Callable(i) | |
217 | 232 | func makeBet () = { | |
218 | 233 | let pmt = extract(i.payment) | |
219 | 234 | let betAmount = (pmt.amount - commission) | |
235 | + | let assetId = pmt.assetId | |
220 | 236 | let gameId = toBase58String(i.transactionId) | |
221 | 237 | let gameStart = height | |
222 | 238 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
223 | - | let pmtAssetName = if (!(isDefined(pmt.assetId))) | |
224 | - | then "WAVES" | |
225 | - | else if ((pmt.assetId == btcId)) | |
226 | - | then "BTC" | |
227 | - | else if ((pmt.assetId == ethId)) | |
228 | - | then "ETH" | |
229 | - | else if ((pmt.assetId == ltcId)) | |
230 | - | then "LTC" | |
231 | - | else if ((pmt.assetId == wctId)) | |
232 | - | then "WCT" | |
233 | - | else if ((pmt.assetId == vstId)) | |
234 | - | then "VST" | |
235 | - | else throw("AssetId is incorrect") | |
236 | - | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName) | |
239 | + | let pmtAssetName = assetIdToName(assetId) | |
240 | + | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName, pmt.assetId) | |
237 | 241 | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount) | |
238 | 242 | if (pmtAmtCorrect) | |
239 | 243 | then { |
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 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 | - | func increaseReservedBalance (pmtAmt,pmtAssetName) = { | |
103 | + | func increaseReservedBalance (pmtAmt,pmtAssetName,assetId58) = { | |
104 | 104 | let currentReservedBalance = { | |
105 | 105 | let valueReservedBalance = getInteger(this, (pmtAssetName + "_Reserved")) | |
106 | 106 | match valueReservedBalance { | |
107 | 107 | case a: Int => | |
108 | 108 | a | |
109 | 109 | case _ => | |
110 | 110 | 0 | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | let newReservedBalance = (currentReservedBalance + pmtAmt) | |
114 | - | if (( | |
114 | + | if ((assetBalance(this, assetId58) >= newReservedBalance)) | |
115 | 115 | then { | |
116 | 116 | let increaseReservedBalance = newReservedBalance | |
117 | 117 | increaseReservedBalance | |
118 | 118 | } | |
119 | 119 | else throw("Bet was rejected. Insufficient funds on game account.") | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func getDataList (gameId) = { | |
124 | 124 | let getDataString = getString(this, (gameId + "_GameId")) | |
125 | 125 | let a = match getDataString { | |
126 | 126 | case a: String => | |
127 | 127 | a | |
128 | 128 | case _ => | |
129 | 129 | throw("GameId was not found") | |
130 | 130 | } | |
131 | 131 | split(a, "_") | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func rsaToInt (gameId,rsaSign,rsaPublicKey) = { | |
136 | 136 | let rsaCheck = rsaVerify(SHA256, toBytes(gameId), fromBase64String(rsaSign), rsaPublicKey) | |
137 | 137 | if (rsaCheck) | |
138 | 138 | then { | |
139 | 139 | let rsaInt = (toInt(sha256(fromBase64String(rsaSign))) % 19) | |
140 | 140 | if (if ((rsaInt >= 0)) | |
141 | 141 | then (19 >= rsaInt) | |
142 | 142 | else false) | |
143 | 143 | then rsaInt | |
144 | 144 | else throw("Integer is not in range") | |
145 | 145 | } | |
146 | 146 | else throw("Rsa Signature is invalid") | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func decreaseReservedBalance (betAmt,assetId) = { | |
151 | 151 | let valueReservedBalance = getInteger(this, (assetId + "_Reserved")) | |
152 | 152 | let extractReservedBalance = match valueReservedBalance { | |
153 | 153 | case a: Int => | |
154 | 154 | a | |
155 | 155 | case _ => | |
156 | 156 | 0 | |
157 | 157 | } | |
158 | 158 | let decreaseReservedBalance = (extractReservedBalance - betAmt) | |
159 | 159 | if ((decreaseReservedBalance >= 0)) | |
160 | 160 | then decreaseReservedBalance | |
161 | 161 | else throw("Reserved balance couldn't be less than 0") | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func drumIntToString (drumInt) = if ((10 > drumInt)) | |
166 | 166 | then ("0" + toString(drumInt)) | |
167 | 167 | else toString(drumInt) | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func defineMultiplier (threeInARow,twoInARow) = if ((threeInARow == "777")) | |
171 | 171 | then 5370 | |
172 | 172 | else if ((threeInARow == "666")) | |
173 | 173 | then 1300 | |
174 | 174 | else if ((threeInARow == "555")) | |
175 | 175 | then 450 | |
176 | 176 | else if ((threeInARow == "444")) | |
177 | 177 | then 200 | |
178 | 178 | else if ((threeInARow == "333")) | |
179 | 179 | then 150 | |
180 | 180 | else if ((threeInARow == "222")) | |
181 | 181 | then 110 | |
182 | 182 | else if ((threeInARow == "111")) | |
183 | 183 | then 40 | |
184 | 184 | else if ((twoInARow == "77")) | |
185 | 185 | then 270 | |
186 | 186 | else if ((twoInARow == "66")) | |
187 | 187 | then 130 | |
188 | 188 | else if ((twoInARow == "55")) | |
189 | 189 | then 65 | |
190 | 190 | else if ((twoInARow == "44")) | |
191 | 191 | then 30 | |
192 | 192 | else if ((twoInARow == "33")) | |
193 | 193 | then 20 | |
194 | 194 | else if ((twoInARow == "22")) | |
195 | 195 | then 15 | |
196 | 196 | else if ((twoInARow == "11")) | |
197 | 197 | then 10 | |
198 | 198 | else 0 | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func AssetNameToBase58 (assetName) = if ((assetName == "WAVES")) | |
202 | 202 | then wavesId | |
203 | 203 | else if ((assetName == "BTC")) | |
204 | 204 | then btcId | |
205 | 205 | else if ((assetName == "ETH")) | |
206 | 206 | then ethId | |
207 | 207 | else if ((assetName == "LTC")) | |
208 | 208 | then ltcId | |
209 | 209 | else if ((assetName == "VST")) | |
210 | 210 | then vstId | |
211 | 211 | else if ((assetName == "WCT")) | |
212 | 212 | then wctId | |
213 | 213 | else throw("Asset name is incorrect") | |
214 | 214 | ||
215 | 215 | ||
216 | + | func assetIdToName (assetId) = if (!(isDefined(assetId))) | |
217 | + | then "WAVES" | |
218 | + | else if ((assetId == btcId)) | |
219 | + | then "BTC" | |
220 | + | else if ((assetId == ethId)) | |
221 | + | then "ETH" | |
222 | + | else if ((assetId == ltcId)) | |
223 | + | then "LTC" | |
224 | + | else if ((assetId == wctId)) | |
225 | + | then "WCT" | |
226 | + | else if ((assetId == vstId)) | |
227 | + | then "VST" | |
228 | + | else throw("AssetId is incorrect") | |
229 | + | ||
230 | + | ||
216 | 231 | @Callable(i) | |
217 | 232 | func makeBet () = { | |
218 | 233 | let pmt = extract(i.payment) | |
219 | 234 | let betAmount = (pmt.amount - commission) | |
235 | + | let assetId = pmt.assetId | |
220 | 236 | let gameId = toBase58String(i.transactionId) | |
221 | 237 | let gameStart = height | |
222 | 238 | let playerPublicKey = toBase58String(i.callerPublicKey) | |
223 | - | let pmtAssetName = if (!(isDefined(pmt.assetId))) | |
224 | - | then "WAVES" | |
225 | - | else if ((pmt.assetId == btcId)) | |
226 | - | then "BTC" | |
227 | - | else if ((pmt.assetId == ethId)) | |
228 | - | then "ETH" | |
229 | - | else if ((pmt.assetId == ltcId)) | |
230 | - | then "LTC" | |
231 | - | else if ((pmt.assetId == wctId)) | |
232 | - | then "WCT" | |
233 | - | else if ((pmt.assetId == vstId)) | |
234 | - | then "VST" | |
235 | - | else throw("AssetId is incorrect") | |
236 | - | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName) | |
239 | + | let pmtAssetName = assetIdToName(assetId) | |
240 | + | let setReservedBalance = increaseReservedBalance(betAmount, pmtAssetName, pmt.assetId) | |
237 | 241 | let pmtAmtCorrect = pmtAmtCheck(pmtAssetName, betAmount) | |
238 | 242 | if (pmtAmtCorrect) | |
239 | 243 | then { | |
240 | 244 | let dataString = ((((((((stateAcc + "_") + playerPublicKey) + "_") + toString(betAmount)) + "_") + pmtAssetName) + "_") + toString(gameStart)) | |
241 | 245 | WriteSet([DataEntry((gameId + "_GameId"), dataString), DataEntry((pmtAssetName + "_Reserved"), setReservedBalance)]) | |
242 | 246 | } | |
243 | 247 | else throw("assetId is incorrect") | |
244 | 248 | } | |
245 | 249 | ||
246 | 250 | ||
247 | 251 | ||
248 | 252 | @Callable(i) | |
249 | 253 | func playGame (gameId,rsaSign1,rsaSign2,rsaSign3) = { | |
250 | 254 | let dataList = getDataList(gameId) | |
251 | 255 | let gameState = dataList[0] | |
252 | 256 | let playerAddress = addressFromPublicKey(fromBase58String(dataList[1])) | |
253 | 257 | let betAmt = parseIntValue(dataList[2]) | |
254 | 258 | let assetName = dataList[3] | |
255 | 259 | let gameStart = parseIntValue(dataList[4]) | |
256 | 260 | let assetId58 = AssetNameToBase58(assetName) | |
257 | 261 | let setReservedBalance = decreaseReservedBalance(betAmt, assetName) | |
258 | 262 | let drum1Int = rsaToInt(gameId, rsaSign1, rsaPublicKey1) | |
259 | 263 | let drum2Int = rsaToInt(gameId, rsaSign2, rsaPublicKey2) | |
260 | 264 | let drum3Int = rsaToInt(gameId, rsaSign3, rsaPublicKey3) | |
261 | 265 | let threeInARow = ((drum1[drum1Int] + drum2[drum2Int]) + drum3[drum3Int]) | |
262 | 266 | let twoInARow = (drum1[drum1Int] + drum2[drum2Int]) | |
263 | 267 | let droppedElementsString = { | |
264 | 268 | let drum1ToString = drumIntToString(drum1Int) | |
265 | 269 | let drum2ToString = drumIntToString(drum2Int) | |
266 | 270 | let drum3ToString = drumIntToString(drum3Int) | |
267 | 271 | ((drum1ToString + drum2ToString) + drum3ToString) | |
268 | 272 | } | |
269 | 273 | let winAmt = { | |
270 | 274 | let multiplier = defineMultiplier(threeInARow, twoInARow) | |
271 | 275 | ((betAmt * multiplier) / 10) | |
272 | 276 | } | |
273 | 277 | let winPmtAmt = { | |
274 | 278 | let balance = assetBalance(this, assetId58) | |
275 | 279 | if ((winAmt > balance)) | |
276 | 280 | then (betAmt * 2) | |
277 | 281 | else winAmt | |
278 | 282 | } | |
279 | 283 | let gameTimeCheck = (gameTimeFrame > (height - gameStart)) | |
280 | 284 | let stateCorrect = (gameState == stateAcc) | |
281 | 285 | if (stateCorrect) | |
282 | 286 | then if (gameTimeCheck) | |
283 | 287 | then if ((winAmt == 0)) | |
284 | 288 | then WriteSet([DataEntry((gameId + "_GameId"), ((((((((((((((stateLose + "_") + dataList[1]) + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) + "_") + toString(winAmt)) + "_") + threeInARow) + "_") + droppedElementsString)), DataEntry((assetName + "_Reserved"), setReservedBalance)]) | |
285 | 289 | else ScriptResult(WriteSet([DataEntry((gameId + "_GameId"), ((((((((((((((stateWin + "_") + dataList[1]) + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) + "_") + toString(winAmt)) + "_") + threeInARow) + "_") + droppedElementsString)), DataEntry((assetName + "_Reserved"), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, winPmtAmt, assetId58)])) | |
286 | 290 | else ScriptResult(WriteSet([DataEntry((gameId + "_GameId"), ((((((((((((((stateTimeout + "_") + dataList[1]) + "_") + dataList[2]) + "_") + dataList[3]) + "_") + dataList[4]) + "_") + toString((betAmt * 2))) + "_") + "000") + "_") + "000000")), DataEntry((assetName + "_Reserved"), setReservedBalance)]), TransferSet([ScriptTransfer(playerAddress, betAmt, assetId58)])) | |
287 | 291 | else throw("Game state is incorrect") | |
288 | 292 | } | |
289 | 293 | ||
290 | 294 | ||
291 | 295 | @Verifier(tx) | |
292 | 296 | func verify () = match tx { | |
293 | 297 | case ttx: TransferTransaction => | |
294 | 298 | let assetName = if (!(isDefined(ttx.assetId))) | |
295 | 299 | then "WAVES" | |
296 | 300 | else if ((ttx.assetId == btcId)) | |
297 | 301 | then "BTC" | |
298 | 302 | else if ((ttx.assetId == ethId)) | |
299 | 303 | then "ETH" | |
300 | 304 | else if ((ttx.assetId == ltcId)) | |
301 | 305 | then "LTC" | |
302 | 306 | else if ((ttx.assetId == wctId)) | |
303 | 307 | then "WCT" | |
304 | 308 | else if ((ttx.assetId == vstId)) | |
305 | 309 | then "VST" | |
306 | 310 | else throw("AssetId is incorrect") | |
307 | 311 | let valueReservedBalance = getInteger(this, (assetName + "_Reserved")) | |
308 | 312 | let reservedBalance = match valueReservedBalance { | |
309 | 313 | case a: Int => | |
310 | 314 | a | |
311 | 315 | case _ => | |
312 | 316 | 0 | |
313 | 317 | } | |
314 | 318 | let availableBalance = (wavesBalance(this) - reservedBalance) | |
315 | 319 | let availibleAmount = (availableBalance >= ttx.amount) | |
316 | 320 | let signature = sigVerify(ttx.bodyBytes, ttx.proofs[0], ttx.senderPublicKey) | |
317 | 321 | if (availibleAmount) | |
318 | 322 | then signature | |
319 | 323 | else false | |
320 | 324 | case sstx: SetScriptTransaction => | |
321 | 325 | sigVerify(sstx.bodyBytes, sstx.proofs[0], sstx.senderPublicKey) | |
322 | 326 | case istx: InvokeScriptTransaction => | |
323 | 327 | sigVerify(istx.bodyBytes, istx.proofs[0], istx.senderPublicKey) | |
324 | 328 | case _ => | |
325 | 329 | false | |
326 | 330 | } | |
327 | 331 |
github/deemru/w8io/169f3d6 62.19 ms ◑