tx · 8xh42kktAgjFWFNQXm2y4Nm3zpvCwAJry7zUqhZj7RnX 3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ: -0.01700000 Waves 2023.12.14 18:06 [2886546] smart account 3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ > SELF 0.00000000 Waves
{ "type": 13, "id": "8xh42kktAgjFWFNQXm2y4Nm3zpvCwAJry7zUqhZj7RnX", "fee": 1700000, "feeAssetId": null, "timestamp": 1702566400847, "version": 2, "chainId": 84, "sender": "3N8NLvRGsbGhgoXy7EdigPbAz6N2i7ygBcZ", "senderPublicKey": "CQoe8BRHR78TuPQLcK3Ykv39w9CeNLhjKdj6TNbJ5FrM", "proofs": [ "5dnmftW3wHkcTdmxL4wrCgR4iQtQU7nR6HmxkjD8SjswpYPkcRc8ohmWMC4iKBFoRfxYMfcFjJdXvNC6Z5LRzkjm" ], "script": "base64:BgIaCAISBgoECAgBCBIDCgEEEgMKAQgSBAoCCAJIAANTRVACAl9fAAdXQVZFU0lEAQQTq9kzAAZXQVZFU0QAgMLXLwAJR0FNRV9OQU1FAglYbWFzIFRyZWUADFJBTkRPTV9SQU5HRQAFAAhOVU1fQkVUUwABAA9NQVhfREVDT1JBVElPTlMADwEMZ2V0U3RyT3JGYWlsAgdhZGRyZXNzA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFB2FkZHJlc3MFA2tleQkAuQkCCQDMCAICCm1hbmRhdG9yeSAJAMwIAgkApQgBBQdhZGRyZXNzCQDMCAICAS4JAMwIAgUDa2V5CQDMCAICDyBpcyBub3QgZGVmaW5lZAUDbmlsAgABDGdldEludE9yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAmggCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IG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succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCAiMj8rGMrTfSuT3YTSsNhpWeBMudoTzZzdCGTscLRG Next: Epfv8RHBQi7FyqT8xu6bCQEy22g4BJ44wUtZo6f4keXa Diff:
Old | New | Differences | |
---|---|---|---|
93 | 93 | ||
94 | 94 | let RATEMULT = 10000 | |
95 | 95 | ||
96 | - | let RATE = | |
96 | + | let RATE = 30000 | |
97 | 97 | ||
98 | 98 | let BETS = [BET2] | |
99 | 99 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let WAVESID = base58'WAVES' | |
7 | 7 | ||
8 | 8 | let WAVESD = 100000000 | |
9 | 9 | ||
10 | 10 | let GAME_NAME = "Xmas Tree" | |
11 | 11 | ||
12 | 12 | let RANDOM_RANGE = 5 | |
13 | 13 | ||
14 | 14 | let NUM_BETS = 1 | |
15 | 15 | ||
16 | 16 | let MAX_DECORATIONS = 15 | |
17 | 17 | ||
18 | 18 | func getStrOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func getBoolOrFail (address,key) = valueOrErrorMessage(getBoolean(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | let allowedAssetsKey = "%s%s__cfg__allowedAssets" | |
28 | 28 | ||
29 | 29 | let assetsDecimalsKey = "%s%s__cfg__assetsDecimals" | |
30 | 30 | ||
31 | 31 | let betDividersKey = "%s%s__cfg__assetsBetDividers" | |
32 | 32 | ||
33 | 33 | let RSAPUBLIC64KEY = "%s%s__cfg__rsaPublic64" | |
34 | 34 | ||
35 | 35 | let SERVERADDRESSKEY = "%s%s__cfg__benzAddress" | |
36 | 36 | ||
37 | 37 | let RANDTIMEFRAMEKEY = "%s%s__cfg__withdrawTimeFrame" | |
38 | 38 | ||
39 | 39 | let GAMESCOUNTERKEY = "%s%s__runtime__gameNum" | |
40 | 40 | ||
41 | 41 | let blockedKey = "%s%s__runtime__contractIsBlocked" | |
42 | 42 | ||
43 | 43 | let reservedAmountsKey = "%s%s__runtime__reservedAmounts" | |
44 | 44 | ||
45 | 45 | func getIntArray (key) = { | |
46 | 46 | let a = getStrOrFail(this, key) | |
47 | 47 | func filler (acc,el) = (acc :+ parseIntValue(el)) | |
48 | 48 | ||
49 | 49 | let $l = split(a, SEP) | |
50 | 50 | let $s = size($l) | |
51 | 51 | let $acc0 = nil | |
52 | 52 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
53 | 53 | then $a | |
54 | 54 | else filler($a, $l[$i]) | |
55 | 55 | ||
56 | 56 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
57 | 57 | then $a | |
58 | 58 | else throw("List size exceeds 10") | |
59 | 59 | ||
60 | 60 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
61 | 61 | } | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | let ASSETS = split(getStrOrFail(this, allowedAssetsKey), SEP) | |
65 | 65 | ||
66 | 66 | let DECIMALS = getIntArray(assetsDecimalsKey) | |
67 | 67 | ||
68 | 68 | let BETDIVIDERS = getIntArray(betDividersKey) | |
69 | 69 | ||
70 | 70 | func keyReservationByAssetStr (assetStr) = ("$RESERVED_AMOUNT_" + assetStr) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyReservationByAssetIdx (assetIdx) = keyReservationByAssetStr(ASSETS[assetIdx]) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | let MINFEEWAVES = ((5 * WAVESD) / 1000) | |
77 | 77 | ||
78 | 78 | let idxAssets = 0 | |
79 | 79 | ||
80 | 80 | let idxDecimals = 1 | |
81 | 81 | ||
82 | 82 | let idxDividers = 2 | |
83 | 83 | ||
84 | 84 | let BET1 = 1 | |
85 | 85 | ||
86 | 86 | let BET2 = 2 | |
87 | 87 | ||
88 | 88 | let BET4 = 4 | |
89 | 89 | ||
90 | 90 | let BET8 = 8 | |
91 | 91 | ||
92 | 92 | let BET14 = 14 | |
93 | 93 | ||
94 | 94 | let RATEMULT = 10000 | |
95 | 95 | ||
96 | - | let RATE = | |
96 | + | let RATE = 30000 | |
97 | 97 | ||
98 | 98 | let BETS = [BET2] | |
99 | 99 | ||
100 | 100 | let IdxGameState = 0 | |
101 | 101 | ||
102 | 102 | let IdxPlayerChoice = 1 | |
103 | 103 | ||
104 | 104 | let IdxPlayerPubKey58 = 2 | |
105 | 105 | ||
106 | 106 | let IdxStartedHeight = 3 | |
107 | 107 | ||
108 | 108 | let IdxWinAmount = 4 | |
109 | 109 | ||
110 | 110 | let IdxAssetId = 5 | |
111 | 111 | ||
112 | 112 | let STATESUBMITTED = "SUBMITTED" | |
113 | 113 | ||
114 | 114 | let STATEWON = "WON" | |
115 | 115 | ||
116 | 116 | let STATELOST = "LOST" | |
117 | 117 | ||
118 | 118 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " key is not specified in this.state")) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | let RSAPUBLIC = fromBase64String(getStringOrFail(RSAPUBLIC64KEY)) | |
122 | 122 | ||
123 | 123 | let SERVER = addressFromStringValue(getStringOrFail(SERVERADDRESSKEY)) | |
124 | 124 | ||
125 | 125 | let RANDORACLETIMEFRAME = valueOrElse(getInteger(this, RANDTIMEFRAMEKEY), 7200) | |
126 | 126 | ||
127 | 127 | func getIntOr (key,default) = if (isDefined(getInteger(key))) | |
128 | 128 | then getIntegerValue(key) | |
129 | 129 | else default | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func setInt (key,value) = IntegerEntry(key, value) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func incrementInt (key) = setInt(key, (getIntOr(key, -1) + 1)) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func changeInt (key,by) = setInt(key, (getIntOr(key, 0) + by)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func assetIdToStr (assetIdOrUnit) = match assetIdOrUnit { | |
142 | 142 | case b: ByteVector => | |
143 | 143 | toBase58String(b) | |
144 | 144 | case _ => | |
145 | 145 | "WAVES" | |
146 | 146 | } | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func assetIdFromStr (assetIdStr) = if ((assetIdStr == "WAVES")) | |
150 | 150 | then unit | |
151 | 151 | else fromBase58String(assetIdStr) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getAssetBalance (assetIdOrUnit) = match assetIdOrUnit { | |
155 | 155 | case assetId: ByteVector => | |
156 | 156 | assetBalance(this, assetId) | |
157 | 157 | case _ => | |
158 | 158 | wavesBalance(this).available | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func increaseReserveAmount (winAmount,assetIdx) = { | |
163 | 163 | let assetIdStr = ASSETS[assetIdx] | |
164 | 164 | let newReservedAmount = (getIntOr(keyReservationByAssetIdx(assetIdx), 0) + winAmount) | |
165 | 165 | if ((newReservedAmount > getAssetBalance(assetIdFromStr(assetIdStr)))) | |
166 | 166 | then throw((("Insufficient funds on " + GAME_NAME) + " account. Transaction was rejected for your safety.")) | |
167 | 167 | else newReservedAmount | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func decreaseReservedAmount (gameId,assetIdx,winAmount) = if ((0 > (getIntOr(keyReservationByAssetIdx(assetIdx), 0) - winAmount))) | |
172 | 172 | then throw((("Invalid " + GAME_NAME) + " account state - reserved amount is less than 0")) | |
173 | 173 | else changeInt(keyReservationByAssetIdx(assetIdx), -(winAmount)) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func validateAndGetAssetIdx (assetIdStr) = { | |
177 | 177 | let idx = indexOf(ASSETS, assetIdStr) | |
178 | 178 | if (!(isDefined(idx))) | |
179 | 179 | then throw("Invalid payment asset") | |
180 | 180 | else value(idx) | |
181 | 181 | } | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func validateBetAndGetWinAmount (bet,internalAssetIdx,playerChoice) = { | |
185 | 185 | let dicesCount = size(playerChoice) | |
186 | 186 | func checkAmount (a,x) = if (a) | |
187 | 187 | then true | |
188 | 188 | else (bet == ((x * DECIMALS[internalAssetIdx]) / BETDIVIDERS[internalAssetIdx])) | |
189 | 189 | ||
190 | 190 | if (!({ | |
191 | 191 | let $l = BETS | |
192 | 192 | let $s = size($l) | |
193 | 193 | let $acc0 = false | |
194 | 194 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
195 | 195 | then $a | |
196 | 196 | else checkAmount($a, $l[$i]) | |
197 | 197 | ||
198 | 198 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
199 | 199 | then $a | |
200 | 200 | else throw("List size exceeds 5") | |
201 | 201 | ||
202 | 202 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
203 | 203 | })) | |
204 | 204 | then throw("Bet amount is not valid") | |
205 | 205 | else if ((parseInt(playerChoice) == unit)) | |
206 | 206 | then throw("Invalid player's choice") | |
207 | 207 | else if ((dicesCount != NUM_BETS)) | |
208 | 208 | then throw("Invalid length of player's choice") | |
209 | 209 | else fraction(bet, RATE, RATEMULT) | |
210 | 210 | } | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | let HOR_LINES = [[491, 506, 44], [455, 542, 120], [404, 596, 166], [441, 556, 177], [387, 620, 232], [423, 620, 232], [410, 592, 244], [329, 665, 321], [370, 666, 337], [355, 645, 349], [313, 692, 384], [289, 682, 405], [324, 657, 461], [450, 575, 525], [505, 505, 532]] | |
214 | 214 | ||
215 | 215 | let HALF = 5000 | |
216 | 216 | ||
217 | 217 | let M4 = 10000 | |
218 | 218 | ||
219 | 219 | func getCoords (gameId,rsaSign) = { | |
220 | 220 | func calcAreas (acc,ignored) = { | |
221 | 221 | let i = acc._3 | |
222 | 222 | if ((i == 14)) | |
223 | 223 | then acc | |
224 | 224 | else { | |
225 | 225 | let top = HOR_LINES[i] | |
226 | 226 | let bottom = HOR_LINES[(i + 1)] | |
227 | 227 | let area4 = (((((top[1] - top[0]) + bottom[1]) - bottom[0]) * (bottom[2] - top[2])) * 5000) | |
228 | 228 | $Tuple3((acc._1 :+ area4), (acc._2 + area4), (acc._3 + 1)) | |
229 | 229 | } | |
230 | 230 | } | |
231 | 231 | ||
232 | 232 | let $t079968063 = { | |
233 | 233 | let $l = HOR_LINES | |
234 | 234 | let $s = size($l) | |
235 | 235 | let $acc0 = $Tuple3(nil, 0, 0) | |
236 | 236 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
237 | 237 | then $a | |
238 | 238 | else calcAreas($a, $l[$i]) | |
239 | 239 | ||
240 | 240 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
241 | 241 | then $a | |
242 | 242 | else throw("List size exceeds 15") | |
243 | 243 | ||
244 | 244 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
245 | 245 | } | |
246 | 246 | let areas = $t079968063._1 | |
247 | 247 | let totalArea = $t079968063._2 | |
248 | 248 | let rand = (toInt(sha256((rsaSign + toBytes(gameId)))) % totalArea) | |
249 | 249 | func check (acc,area) = { | |
250 | 250 | let i = acc._1 | |
251 | 251 | let newArea = (acc._2 + area) | |
252 | 252 | $Tuple3((i + 1), newArea, if (if ((0 > acc._3)) | |
253 | 253 | then (newArea > rand) | |
254 | 254 | else false) | |
255 | 255 | then i | |
256 | 256 | else acc._3) | |
257 | 257 | } | |
258 | 258 | ||
259 | 259 | let j = ( let $l = areas | |
260 | 260 | let $s = size($l) | |
261 | 261 | let $acc0 = $Tuple3(0, 0, -1) | |
262 | 262 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
263 | 263 | then $a | |
264 | 264 | else check($a, $l[$i]) | |
265 | 265 | ||
266 | 266 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
267 | 267 | then $a | |
268 | 268 | else throw("List size exceeds 14") | |
269 | 269 | ||
270 | 270 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14))._3 | |
271 | 271 | let top = HOR_LINES[j] | |
272 | 272 | let bottom = HOR_LINES[(j + 1)] | |
273 | 273 | let mx04 = ((top[0] + bottom[0]) * HALF) | |
274 | 274 | let mx14 = ((top[1] + bottom[1]) * HALF) | |
275 | 275 | let h4 = ((bottom[2] - top[2]) * M4) | |
276 | 276 | let my4 = ((top[2] + bottom[2]) * HALF) | |
277 | 277 | let randX4 = (mx04 + (toInt(sha256((rsaSign + toBytes(j)))) % (mx14 - mx04))) | |
278 | 278 | let randY4 = ((top[2] * M4) + (toInt(sha256((rsaSign + toBytes(randX4)))) % h4)) | |
279 | 279 | let a4 = ((top[2] * M4) - randY4) | |
280 | 280 | let b4 = ((bottom[2] * M4) - randY4) | |
281 | 281 | let x04 = fraction(((top[0] * b4) - (bottom[0] * a4)), M4, h4) | |
282 | 282 | let x14 = fraction(((top[1] * b4) - (bottom[1] * a4)), M4, h4) | |
283 | 283 | if ((x04 > randX4)) | |
284 | 284 | then [((2 * mx04) - randX4), ((2 * my4) - randY4)] | |
285 | 285 | else if ((randX4 > x14)) | |
286 | 286 | then [((2 * mx14) - randX4), ((2 * my4) - randY4)] | |
287 | 287 | else [randX4, randY4] | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | ||
291 | 291 | func getDecorationIndex (gameId,rsaSign) = (toInt(sha256((toBytes(gameId) + rsaSign))) % MAX_DECORATIONS) | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | func generateRandChoice (gameId,rsaSign) = { | |
295 | 295 | let rsaSigValid = rsaVerify_16Kb(SHA256, toBytes(gameId), rsaSign, RSAPUBLIC) | |
296 | 296 | if (!(rsaSigValid)) | |
297 | 297 | then throw("Invalid RSA signature") | |
298 | 298 | else { | |
299 | 299 | let rand = (toInt(sha256(rsaSign)) % RANDOM_RANGE) | |
300 | 300 | toString((rand + 1)) | |
301 | 301 | } | |
302 | 302 | } | |
303 | 303 | ||
304 | 304 | ||
305 | 305 | func isPlayerWin (playerChoice,randChoise) = { | |
306 | 306 | let s = size(playerChoice) | |
307 | 307 | func check (a,x) = if (a) | |
308 | 308 | then true | |
309 | 309 | else if ((s >= x)) | |
310 | 310 | then (take(drop(playerChoice, (x - 1)), 1) == randChoise) | |
311 | 311 | else false | |
312 | 312 | ||
313 | 313 | let $l = [1, 2, 3, 4, 5] | |
314 | 314 | let $s = size($l) | |
315 | 315 | let $acc0 = false | |
316 | 316 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
317 | 317 | then $a | |
318 | 318 | else check($a, $l[$i]) | |
319 | 319 | ||
320 | 320 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
321 | 321 | then $a | |
322 | 322 | else throw("List size exceeds 5") | |
323 | 323 | ||
324 | 324 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
325 | 325 | } | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func formatGameDataS (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty,xCoord,yCoord,prizeIndex) = makeString([gameStatus, playerChoice, playerPubKey58, startedHeight, winAmount, assetIdx, if ((randOrEmpty == "")) | |
329 | 329 | then "" | |
330 | 330 | else randOrEmpty, xCoord, yCoord, prizeIndex], "_") | |
331 | 331 | ||
332 | 332 | ||
333 | 333 | func formatGameData (gameStatus,playerChoice,playerPubKey58,startedHeight,winAmount,assetIdx,randOrEmpty,xCoord,yCoord,prizeIndex) = formatGameDataS(gameStatus, playerChoice, playerPubKey58, toString(startedHeight), toString(winAmount), toString(assetIdx), randOrEmpty, toString(xCoord), toString(yCoord), toString(prizeIndex)) | |
334 | 334 | ||
335 | 335 | ||
336 | 336 | func finishGameData (origGameData,gameStatus,rand,winByTimeout,xCoord,yCoord,prizeIndex) = { | |
337 | 337 | let finishGameData = formatGameDataS(gameStatus, origGameData[IdxPlayerChoice], origGameData[IdxPlayerPubKey58], origGameData[IdxStartedHeight], origGameData[IdxWinAmount], origGameData[IdxAssetId], rand, toString(xCoord), toString(yCoord), toString(prizeIndex)) | |
338 | 338 | if (winByTimeout) | |
339 | 339 | then (finishGameData + "_TIMEOUT") | |
340 | 340 | else finishGameData | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | ||
344 | 344 | func extractGameData (gameId) = split(match getString(this, gameId) { | |
345 | 345 | case str: String => | |
346 | 346 | str | |
347 | 347 | case _ => | |
348 | 348 | throw((("Game: " + gameId) + " not found.")) | |
349 | 349 | }, "_") | |
350 | 350 | ||
351 | 351 | ||
352 | 352 | @Callable(i) | |
353 | 353 | func constructorV1 (rsaPublic64,benzAddress,randOracleTimeFrame,tokensDescriptor) = if ((i.caller != this)) | |
354 | 354 | then throw("not authorized") | |
355 | 355 | else { | |
356 | 356 | func splitter (acc,elem) = { | |
357 | 357 | let tokList = split(elem, ":") | |
358 | 358 | if ((size(tokList) != 3)) | |
359 | 359 | then throw("Invalid asset record") | |
360 | 360 | else $Tuple3((acc._1 :+ tokList[idxAssets]), (acc._2 :+ tokList[idxDecimals]), (acc._3 :+ tokList[idxDividers])) | |
361 | 361 | } | |
362 | 362 | ||
363 | 363 | let r = { | |
364 | 364 | let $l = split_4C(tokensDescriptor, "_") | |
365 | 365 | let $s = size($l) | |
366 | 366 | let $acc0 = $Tuple3(nil, nil, nil) | |
367 | 367 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
368 | 368 | then $a | |
369 | 369 | else splitter($a, $l[$i]) | |
370 | 370 | ||
371 | 371 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
372 | 372 | then $a | |
373 | 373 | else throw("List size exceeds 10") | |
374 | 374 | ||
375 | 375 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
376 | 376 | } | |
377 | 377 | [StringEntry(RSAPUBLIC64KEY, rsaPublic64), StringEntry(SERVERADDRESSKEY, benzAddress), IntegerEntry(RANDTIMEFRAMEKEY, randOracleTimeFrame), StringEntry(allowedAssetsKey, makeString_2C(r._1, SEP)), StringEntry(assetsDecimalsKey, makeString(r._2, SEP)), StringEntry(betDividersKey, makeString(r._3, SEP))] | |
378 | 378 | } | |
379 | 379 | ||
380 | 380 | ||
381 | 381 | ||
382 | 382 | @Callable(i) | |
383 | 383 | func maintenance (blocked) = if ((i.caller != SERVER)) | |
384 | 384 | then throw("not authorized") | |
385 | 385 | else [BooleanEntry(blockedKey, blocked)] | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | ||
389 | 389 | @Callable(i) | |
390 | 390 | func bet (playerChoice) = if (valueOrElse(getBoolean(blockedKey), false)) | |
391 | 391 | then throw("Game is stopped for maintenence") | |
392 | 392 | else { | |
393 | 393 | let gameId = toBase58String(i.transactionId) | |
394 | 394 | if ((1 >= size(i.payments))) | |
395 | 395 | then throw("2 payments must be attached") | |
396 | 396 | else if (isDefined(getString(this, gameId))) | |
397 | 397 | then throw((("Bet for: " + gameId) + " was already made.")) | |
398 | 398 | else { | |
399 | 399 | let betPmt = value(i.payments[0]) | |
400 | 400 | let feePmt = value(i.payments[1]) | |
401 | 401 | if (isDefined(feePmt.assetId)) | |
402 | 402 | then throw("feePmt (2nd payment) assetId must be in Waves") | |
403 | 403 | else if ((MINFEEWAVES > feePmt.amount)) | |
404 | 404 | then throw("feePmt (2nd payment) must be >= 0.005 Waves") | |
405 | 405 | else { | |
406 | 406 | let assetIdStr = assetIdToStr(betPmt.assetId) | |
407 | 407 | let internalAssetIdx = validateAndGetAssetIdx(assetIdStr) | |
408 | 408 | let commission = feePmt.amount | |
409 | 409 | let winAmount = validateBetAndGetWinAmount(betPmt.amount, internalAssetIdx, playerChoice) | |
410 | 410 | let playerPubKey58 = toBase58String(i.callerPublicKey) | |
411 | 411 | let gameData = formatGameData(STATESUBMITTED, playerChoice, playerPubKey58, height, winAmount, internalAssetIdx, "", -1, -1, -1) | |
412 | 412 | [IntegerEntry(keyReservationByAssetIdx(internalAssetIdx), increaseReserveAmount(winAmount, internalAssetIdx)), incrementInt(GAMESCOUNTERKEY), StringEntry(gameId, gameData), ScriptTransfer(SERVER, commission, feePmt.assetId)] | |
413 | 413 | } | |
414 | 414 | } | |
415 | 415 | } | |
416 | 416 | ||
417 | 417 | ||
418 | 418 | ||
419 | 419 | @Callable(i) | |
420 | 420 | func withdraw (gameId,rsaSign) = { | |
421 | 421 | let gameData = extractGameData(gameId) | |
422 | 422 | let gameState = gameData[IdxGameState] | |
423 | 423 | let playerChoice = gameData[IdxPlayerChoice] | |
424 | 424 | let startedHeight = parseIntValue(gameData[IdxStartedHeight]) | |
425 | 425 | let winAmount = parseIntValue(gameData[IdxWinAmount]) | |
426 | 426 | let assetIdx = parseIntValue(gameData[IdxAssetId]) | |
427 | 427 | let playerPubKey58 = gameData[IdxPlayerPubKey58] | |
428 | 428 | let playerAddress = addressFromPublicKey(fromBase58String(playerPubKey58)) | |
429 | 429 | if ((gameState != STATESUBMITTED)) | |
430 | 430 | then throw("Invalid game state for passed gameId") | |
431 | 431 | else if ((i.caller != SERVER)) | |
432 | 432 | then throw("Regular withdraw can be done by server only") | |
433 | 433 | else { | |
434 | 434 | let winByTimeout = ((height - startedHeight) > RANDORACLETIMEFRAME) | |
435 | 435 | let randChoice = if (winByTimeout) | |
436 | 436 | then take(playerChoice, 1) | |
437 | 437 | else generateRandChoice(gameId, rsaSign) | |
438 | 438 | let playerWin = isPlayerWin(playerChoice, randChoice) | |
439 | 439 | let newGameStatus = if (playerWin) | |
440 | 440 | then STATEWON | |
441 | 441 | else STATELOST | |
442 | 442 | let coords = if (playerWin) | |
443 | 443 | then [-(M4), -(M4)] | |
444 | 444 | else getCoords(gameId, rsaSign) | |
445 | 445 | let prizeIndex = if (playerWin) | |
446 | 446 | then -1 | |
447 | 447 | else getDecorationIndex(gameId, rsaSign) | |
448 | 448 | let newGameData = finishGameData(gameData, newGameStatus, randChoice, winByTimeout, (coords[0] / M4), (coords[1] / M4), prizeIndex) | |
449 | 449 | ([StringEntry(gameId, newGameData), decreaseReservedAmount(gameId, assetIdx, winAmount)] ++ (if (playerWin) | |
450 | 450 | then [ScriptTransfer(playerAddress, winAmount, assetIdFromStr(ASSETS[assetIdx]))] | |
451 | 451 | else nil)) | |
452 | 452 | } | |
453 | 453 | } | |
454 | 454 | ||
455 | 455 | ||
456 | 456 | @Verifier(tx) | |
457 | 457 | func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
458 | 458 | then match tx { | |
459 | 459 | case ttx: TransferTransaction => | |
460 | 460 | let assetIdx = validateAndGetAssetIdx(assetIdToStr(ttx.assetId)) | |
461 | 461 | ((getAssetBalance(ttx.assetId) - ttx.amount) >= getIntOr(keyReservationByAssetIdx(assetIdx), 0)) | |
462 | 462 | case stx: SetScriptTransaction => | |
463 | 463 | func checker (acc,asset) = if (acc) | |
464 | 464 | then (getIntOr(keyReservationByAssetStr(asset), 0) == 0) | |
465 | 465 | else false | |
466 | 466 | ||
467 | 467 | let $l = ASSETS | |
468 | 468 | let $s = size($l) | |
469 | 469 | let $acc0 = true | |
470 | 470 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
471 | 471 | then $a | |
472 | 472 | else checker($a, $l[$i]) | |
473 | 473 | ||
474 | 474 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
475 | 475 | then $a | |
476 | 476 | else throw("List size exceeds 10") | |
477 | 477 | ||
478 | 478 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
479 | 479 | case itx: InvokeScriptTransaction => | |
480 | 480 | if ((itx.dApp == this)) | |
481 | 481 | then (itx.function == "constructorV1") | |
482 | 482 | else false | |
483 | 483 | case _ => | |
484 | 484 | false | |
485 | 485 | } | |
486 | 486 | else false | |
487 | 487 |
github/deemru/w8io/169f3d6 60.16 ms ◑