tx · 37dtpMsNKmzRL3vZ5DjMRCrVuvg6eLpJcsRfr8yisabj 3N26gCrijWPWiTMtJnMTr6w7aYjTHvFrb9W: -0.01800000 Waves 2024.12.31 03:01 [3437939] smart account 3N26gCrijWPWiTMtJnMTr6w7aYjTHvFrb9W > SELF 0.00000000 Waves
{ "type": 13, "id": "37dtpMsNKmzRL3vZ5DjMRCrVuvg6eLpJcsRfr8yisabj", "fee": 1800000, "feeAssetId": null, "timestamp": 1735603436655, "version": 2, "chainId": 84, "sender": "3N26gCrijWPWiTMtJnMTr6w7aYjTHvFrb9W", "senderPublicKey": "2TcsKvByVqLpuS2moS4EDghATgPre6iVgcXjBcGtmZVL", "proofs": [ "2QNpzVvYARLYJotfPTcuZqkHY6fu454WqtHj26sMQYwtdEa31VyAk1aZNRndmKgPD86hqZaVB43wZotgy8uMSQV5" ], "script": "base64:BgIZCAISAwoBCBIAEgMKAQgSAwoBCBIECgIICCoBFHRyeUdldFN0cmluZ0V4dGVybmFsAgdhZGRyZXNzA2tleQQHJG1hdGNoMAkAnQgCBQdhZGRyZXNzBQNrZXkDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAFhBQckbWF0Y2gwBQFhAgABDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABDHRyeUdldFN0cmluZwEDa2V5CQEUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwCBQR0aGlzBQNrZXkBBWFzSW50AQV2YWx1ZQQHJG1hdGNoMAUFdmFsdWUDCQABAgUHJG1hdGNoMAIDSW50BANpbnQFByRtYXRjaDAFA2ludAMJAAECBQckbWF0Y2gwAgZTdHJpbmcEBnN0cmluZwUHJG1hdGNoMAkAAgEJAKwCAgIpUkFJOiB3cm9uZyB0eXBlLCBleHBlY3RlZDogSW50LCBidXQgZ290OiAFBnN0cmluZwkAAgECHlJBSTogd3JvbmcgdHlwZSwgZ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hbGxlcgkAkQMCCAUBaQhwYXltZW50cwABBwUIaXRlbUNvZGUHAwkAAAIFC2Jvb3N0ZXJUeXBlAgxBUlQtSFdSRVNDVUUJAM4IAgkAzAgCCQEEQnVybgIFB2Fzc2V0SWQAAQUDbmlsCQEVZmluaXNoUmViaXJ0aEludGVybmFsBgUGaW5pdFR4CQClCAEIBQFpBmNhbGxlcgkAkQMCCAUBaQhwYXltZW50cwABBwIABgMJAAACBQtib29zdGVyVHlwZQIOQVJULUdJRlRfRE9VQkwJAM4IAgkAzAgCCQEEQnVybgIFB2Fzc2V0SWQAAQUDbmlsCQEVZmluaXNoUmViaXJ0aEludGVybmFsBgUGaW5pdFR4CQClCAEIBQFpBmNhbGxlcgkAkQMCCAUBaQhwYXltZW50cwABBgIABwkAAgECG0Vycm9yISBXcm9uZyBpdGVtIGF0dGFjaGVkIAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgMJAAACCQCQAwEIBQFpCHBheW1lbnRzAAEJARVmaW5pc2hSZWJpcnRoSW50ZXJuYWwGBQZpbml0VHgJAKUIAQgFAWkGY2FsbGVyCQCRAwIIBQFpCHBheW1lbnRzAAAHAgAHCQACAQIQSW52YWxpZCBwYXltZW50cwB6YkFA", "height": 3437939, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3cC6ZKYXwLmGipt6hNmRAqGPmJMgh2NGSrD4Am4PxX6Q Next: none Diff:
Old | New | Differences | |
---|---|---|---|
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | - | func getRandomWin (tx,finishHeight) = { | |
176 | - | let n = getRandomNumber(1000, tx, finishHeight, 0) | |
177 | - | let result = if ((100 > n)) | |
178 | - | then "battleground_A" | |
179 | - | else if ((200 > n)) | |
180 | - | then "battleground_B" | |
181 | - | else if ((300 > n)) | |
182 | - | then "battleground_C" | |
183 | - | else if ((400 > n)) | |
184 | - | then "battleground_D" | |
185 | - | else if ((450 > n)) | |
186 | - | then "incubator" | |
187 | - | else if ((490 > n)) | |
188 | - | then "duckling_40" | |
189 | - | else if ((540 > n)) | |
190 | - | then "duckling_20" | |
191 | - | else if ((640 > n)) | |
192 | - | then "item!ART-FEED5" | |
193 | - | else if ((710 > n)) | |
194 | - | then "item!ART-FEED10" | |
195 | - | else if ((740 > n)) | |
196 | - | then "item!ART-FEED15" | |
197 | - | else if ((770 > n)) | |
198 | - | then "item!ART-FEED20" | |
199 | - | else if ((790 > n)) | |
200 | - | then "item!ART-FEED25" | |
201 | - | else if ((810 > n)) | |
202 | - | then "item!ART-FEED50" | |
203 | - | else if ((830 > n)) | |
204 | - | then "item!ART-FEED100" | |
205 | - | else if ((860 > n)) | |
206 | - | then "item!ART-MUTARIUM-G" | |
207 | - | else if ((890 > n)) | |
208 | - | then "item!ART-MUTARIUM-D" | |
209 | - | else if ((910 > n)) | |
210 | - | then "item!ART-FREEGENE" | |
211 | - | else if ((930 > n)) | |
212 | - | then "item!ART-FIXGENE" | |
213 | - | else if ((980 > n)) | |
214 | - | then "trtl_incubator" | |
215 | - | else "item!ART-FEED500" | |
216 | - | $Tuple2(n, result) | |
175 | + | func getRandomReturn (tx,finishHeight) = { | |
176 | + | let n = getRandomNumber(2, tx, finishHeight, 1) | |
177 | + | if ((n == 0)) | |
178 | + | then true | |
179 | + | else false | |
217 | 180 | } | |
218 | 181 | ||
219 | 182 | ||
220 | - | func finishRebirthInternal (initTx,address,additionalPayment,double) = { | |
183 | + | func getRandomWin (tx,finishHeight,blacklistCode) = { | |
184 | + | let jackpotRandom = getRandomNumber(300, tx, finishHeight, 1) | |
185 | + | if ((jackpotRandom == 1)) | |
186 | + | then $Tuple2(jackpotRandom, "jackpot") | |
187 | + | else { | |
188 | + | let n = getRandomNumber(1000, tx, finishHeight, 0) | |
189 | + | let result = if (if ((500 > n)) | |
190 | + | then (blacklistCode != "incubator") | |
191 | + | else false) | |
192 | + | then "incubator" | |
193 | + | else "trtl_incubator" | |
194 | + | $Tuple2(n, result) | |
195 | + | } | |
196 | + | } | |
197 | + | ||
198 | + | ||
199 | + | func finishRebirthInternal (initTx,address,additionalPayment,double,blacklistCode,rescue) = { | |
221 | 200 | let finishBlock = tryGetInteger((((("address_" + address) + "_initTx_") + initTx) + "_finishBlock")) | |
222 | 201 | let status = tryGetString((((("address_" + address) + "_initTx_") + initTx) + "_status")) | |
223 | 202 | let validPayment = checkAdditionalPayment(additionalPayment) | |
227 | 206 | else if ((finishBlock > height)) | |
228 | 207 | then throw("you cannot finish rebirth, yet") | |
229 | 208 | else { | |
230 | - | let output = getRandomWin(fromBase58String(initTx), finishBlock) | |
209 | + | let output = getRandomWin(fromBase58String(initTx), finishBlock, blacklistCode) | |
231 | 210 | let win = output._2 | |
232 | 211 | let random = output._1 | |
233 | 212 | let txId = initTx | |
251 | 230 | then call | |
252 | 231 | else throw("Strict value is not equal to itself.") | |
253 | 232 | } | |
254 | - | else if ((win == " | |
233 | + | else if ((win == "jackpot")) | |
255 | 234 | then { | |
256 | - | let call = if (!(double)) | |
235 | + | let call = invoke(getCanineIncubatorAddress(), "issueJackpot", [address, txId, "WWFSANTA"], nil) | |
236 | + | if ((call == call)) | |
237 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
238 | + | else throw("Strict value is not equal to itself.") | |
239 | + | } | |
240 | + | else if ((win == "incubator")) | |
241 | + | then { | |
242 | + | let call = if (!(double)) | |
243 | + | then { | |
244 | + | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
245 | + | if ((first == first)) | |
246 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
247 | + | else throw("Strict value is not equal to itself.") | |
248 | + | } | |
249 | + | else { | |
250 | + | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
251 | + | if ((first == first)) | |
252 | + | then { | |
253 | + | let second = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
254 | + | if ((second == second)) | |
255 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "incubator")] | |
256 | + | else throw("Strict value is not equal to itself.") | |
257 | + | } | |
258 | + | else throw("Strict value is not equal to itself.") | |
259 | + | } | |
260 | + | if ((call == call)) | |
261 | + | then call | |
262 | + | else throw("Strict value is not equal to itself.") | |
263 | + | } | |
264 | + | else if ((indexOf(win, "duckling") != unit)) | |
257 | 265 | then { | |
258 | - | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
259 | - | if ((first == first)) | |
260 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
266 | + | let level = parseIntValue(split(win, "_")[1]) | |
267 | + | let levelFinal = if (double) | |
268 | + | then (2 * level) | |
269 | + | else level | |
270 | + | let call = invoke(getBabyDuckAddress(), "issueFreeDuckling", [address, txId, levelFinal], nil) | |
271 | + | if ((call == call)) | |
272 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
261 | 273 | else throw("Strict value is not equal to itself.") | |
262 | 274 | } | |
263 | - | else { | |
264 | - | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
265 | - | if ((first == first)) | |
266 | - | then { | |
267 | - | let second = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
268 | - | if ((second == second)) | |
269 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "incubator")] | |
270 | - | else throw("Strict value is not equal to itself.") | |
271 | - | } | |
272 | - | else throw("Strict value is not equal to itself.") | |
273 | - | } | |
274 | - | if ((call == call)) | |
275 | - | then call | |
276 | - | else throw("Strict value is not equal to itself.") | |
277 | - | } | |
278 | - | else if ((indexOf(win, "duckling") != unit)) | |
279 | - | then { | |
280 | - | let level = parseIntValue(split(win, "_")[1]) | |
281 | - | let levelFinal = if (double) | |
282 | - | then (2 * level) | |
283 | - | else level | |
284 | - | let call = invoke(getBabyDuckAddress(), "issueFreeDuckling", [address, txId, levelFinal], nil) | |
285 | - | if ((call == call)) | |
286 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
287 | - | else throw("Strict value is not equal to itself.") | |
288 | - | } | |
289 | - | else if ((win == "trtl_incubator")) | |
290 | - | then { | |
291 | - | let call = if (!(double)) | |
292 | - | then { | |
293 | - | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
294 | - | if ((first == first)) | |
295 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
296 | - | else throw("Strict value is not equal to itself.") | |
297 | - | } | |
298 | - | else { | |
299 | - | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
300 | - | if ((first == first)) | |
301 | - | then { | |
302 | - | let second = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
303 | - | if ((second == second)) | |
304 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "trtl_incubator")] | |
305 | - | else throw("Strict value is not equal to itself.") | |
306 | - | } | |
307 | - | else throw("Strict value is not equal to itself.") | |
308 | - | } | |
309 | - | if ((call == call)) | |
310 | - | then call | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | else if ((indexOf(win, "item") != unit)) | |
275 | + | else if ((win == "trtl_incubator")) | |
314 | 276 | then { | |
315 | - | let itemName = split(win, "!")[1] | |
316 | 277 | let call = if (!(double)) | |
317 | 278 | then { | |
318 | - | let first = invoke( | |
279 | + | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
319 | 280 | if ((first == first)) | |
320 | 281 | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
321 | 282 | else throw("Strict value is not equal to itself.") | |
322 | 283 | } | |
323 | 284 | else { | |
324 | - | let first = invoke( | |
285 | + | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
325 | 286 | if ((first == first)) | |
326 | 287 | then { | |
327 | - | let second = invoke( | |
288 | + | let second = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
328 | 289 | if ((second == second)) | |
329 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), | |
290 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "trtl_incubator")] | |
330 | 291 | else throw("Strict value is not equal to itself.") | |
331 | 292 | } | |
332 | 293 | else throw("Strict value is not equal to itself.") | |
335 | 296 | then call | |
336 | 297 | else throw("Strict value is not equal to itself.") | |
337 | 298 | } | |
338 | - | else throw(("RFB: Some error occured, please contact the admins! " + win)) | |
299 | + | else if ((indexOf(win, "item") != unit)) | |
300 | + | then { | |
301 | + | let itemName = split(win, "!")[1] | |
302 | + | let call = if (!(double)) | |
303 | + | then { | |
304 | + | let first = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 0], nil) | |
305 | + | if ((first == first)) | |
306 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
307 | + | else throw("Strict value is not equal to itself.") | |
308 | + | } | |
309 | + | else { | |
310 | + | let first = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 0], nil) | |
311 | + | if ((first == first)) | |
312 | + | then { | |
313 | + | let second = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 1], nil) | |
314 | + | if ((second == second)) | |
315 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), win)] | |
316 | + | else throw("Strict value is not equal to itself.") | |
317 | + | } | |
318 | + | else throw("Strict value is not equal to itself.") | |
319 | + | } | |
320 | + | if ((call == call)) | |
321 | + | then call | |
322 | + | else throw("Strict value is not equal to itself.") | |
323 | + | } | |
324 | + | else throw(("RFB: Some error occured, please contact the admins! " + win)) | |
339 | 325 | if ((result == result)) | |
340 | - | then ((result ++ [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win"), win), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_status"), "finish"), IntegerEntry((((("address_" + address) + "_initTx_") + initTx) + "_random"), random)]) ++ validPayment) | |
326 | + | then { | |
327 | + | let returnToSender = if (rescue) | |
328 | + | then getRandomReturn(fromBase58String(initTx), finishBlock) | |
329 | + | else false | |
330 | + | let returnPayload = if (returnToSender) | |
331 | + | then { | |
332 | + | let assetId = fromBase58String(getStringValue((((("address_" + address) + "_initTx_") + initTx) + "_assetId"))) | |
333 | + | let issuer = checkReal(assetId) | |
334 | + | let gen = asString(invoke(getCanineBreederAddress(), "getGenFromName", [value(assetInfo(assetId)).name], nil)) | |
335 | + | if ((gen == gen)) | |
336 | + | then { | |
337 | + | let call = invoke(issuer, "increaseRarity", [toBase58String(assetId), gen], nil) | |
338 | + | if ((call == call)) | |
339 | + | then [ScriptTransfer(addressFromStringValue(address), 1, assetId)] | |
340 | + | else throw("Strict value is not equal to itself.") | |
341 | + | } | |
342 | + | else throw("Strict value is not equal to itself.") | |
343 | + | } | |
344 | + | else nil | |
345 | + | ((result ++ [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win"), win), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_status"), "finish"), IntegerEntry((((("address_" + address) + "_initTx_") + initTx) + "_random"), random)]) ++ validPayment) | |
346 | + | } | |
341 | 347 | else throw("Strict value is not equal to itself.") | |
342 | 348 | } | |
343 | 349 | else throw("Strict value is not equal to itself.") | |
393 | 399 | ||
394 | 400 | ||
395 | 401 | @Callable(i) | |
396 | - | func finishRebirth (initTx) = finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false) | |
402 | + | func finishRebirth (initTx) = finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false, "", false) | |
397 | 403 | ||
398 | 404 | ||
399 | 405 | ||
407 | 413 | let boosterType = asString(invoke(getItemsAddress(), "checkArtefactDetails", [toBase58String(assetId)], nil)) | |
408 | 414 | if ((boosterType == boosterType)) | |
409 | 415 | then if ((boosterType == "ART-GIFT_DOUBL")) | |
410 | - | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true)) | |
416 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true, "", false)) | |
411 | 417 | else throw("Error! Wrong item attached to double rewards!") | |
412 | 418 | else throw("Strict value is not equal to itself.") | |
413 | 419 | } | |
420 | + | ||
421 | + | ||
422 | + | ||
423 | + | @Callable(i) | |
424 | + | func finishRebirthItem (initTx,itemCode) = if (if ((size(i.payments) == 2)) | |
425 | + | then (i.payments[0].amount == 1) | |
426 | + | else false) | |
427 | + | then { | |
428 | + | let assetId = value(i.payments[0].assetId) | |
429 | + | let boosterType = asString(invoke(getItemsAddress(), "checkArtefactDetails", [toBase58String(assetId)], nil)) | |
430 | + | if ((boosterType == boosterType)) | |
431 | + | then if ((boosterType == "ART-HWERASE")) | |
432 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], false, itemCode, false)) | |
433 | + | else if ((boosterType == "ART-HWRESCUE")) | |
434 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], false, "", true)) | |
435 | + | else if ((boosterType == "ART-GIFT_DOUBL")) | |
436 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true, "", false)) | |
437 | + | else throw("Error! Wrong item attached ") | |
438 | + | else throw("Strict value is not equal to itself.") | |
439 | + | } | |
440 | + | else if ((size(i.payments) == 1)) | |
441 | + | then finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false, "", false) | |
442 | + | else throw("Invalid payments") | |
414 | 443 | ||
415 | 444 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
5 | 5 | case a: String => | |
6 | 6 | a | |
7 | 7 | case _ => | |
8 | 8 | "" | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func tryGetInteger (key) = match getInteger(this, key) { | |
13 | 13 | case b: Int => | |
14 | 14 | b | |
15 | 15 | case _ => | |
16 | 16 | 0 | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func tryGetString (key) = tryGetStringExternal(this, key) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func asInt (value) = match value { | |
24 | 24 | case int: Int => | |
25 | 25 | int | |
26 | 26 | case string: String => | |
27 | 27 | throw(("RAI: wrong type, expected: Int, but got: " + string)) | |
28 | 28 | case _ => | |
29 | 29 | throw("RAI: wrong type, expected: Int") | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func asBoolean (value) = match value { | |
34 | 34 | case boolean: Boolean => | |
35 | 35 | boolean | |
36 | 36 | case _ => | |
37 | 37 | throw("FAB: wrong type, expected: Boolean") | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func asString (value) = match value { | |
42 | 42 | case s: String => | |
43 | 43 | s | |
44 | 44 | case s: Int => | |
45 | 45 | throw("wrong type, expected: String, got: Int") | |
46 | 46 | case s: Unit => | |
47 | 47 | throw("wrong type, expected: String, got: Unit") | |
48 | 48 | case _ => | |
49 | 49 | throw("wrong type, expected: String") | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func staticKey_oracleAddress () = "static_oracleAddress" | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func staticKey_extraFee () = "static_extraFee" | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func staticKey_feeAggregator () = "static_feeAggregator" | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func staticKey_canineIncubatorAddress () = "static_felineIncubatorAddress" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func staticKey_canineBreederAddress () = "static_felineBreederAddress" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func staticKey_couponsAddress () = "static_couponsAddress" | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func staticKey_canineStakingAddress () = "static_felineStakingAddress" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func staticKey_duckStakingAddress () = "static_farmingAddressNew" | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func staticKey_duckIncubatorAddress () = "static_incubatorAddress" | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func staticKey_itemsAddress () = "static_itemsAddress" | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func staticKey_canineWavesRebirthPrice () = "static_felinePeteRebirthPrice" | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func staticKey_turtleIncubatorAddress () = "static_turtleIncubatorAddress" | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func staticKey_babyDuckAddress () = "static_babyDuckAddress" | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func staticKey_peteAssetId () = "static_peteAssetId" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getCanineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_canineBreederAddress()))) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getCanineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_canineIncubatorAddress()))) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func getCouponsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_couponsAddress()))) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getCanineStakingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_canineStakingAddress()))) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getDuckStakingAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_duckStakingAddress()))) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getDuckIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_duckIncubatorAddress()))) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress()))) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getTurtleIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_turtleIncubatorAddress()))) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getBabyDuckAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_babyDuckAddress()))) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func getPeteAssetId () = fromBase58String(tryGetStringExternal(getOracle(), staticKey_peteAssetId())) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func tryGetIntegerExternal (address,key) = match getInteger(address, key) { | |
132 | 132 | case b: Int => | |
133 | 133 | b | |
134 | 134 | case _ => | |
135 | 135 | throw("TR: Value not found in sc!") | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | let wavesAmount = tryGetIntegerExternal(getOracle(), staticKey_canineWavesRebirthPrice()) | |
140 | 140 | ||
141 | 141 | let delayForHatching = 2 | |
142 | 142 | ||
143 | 143 | func checkReal (assetId) = if (if ((value(assetInfo(assetId)).issuer == getCanineBreederAddress())) | |
144 | 144 | then true | |
145 | 145 | else (value(assetInfo(assetId)).issuer == getCanineIncubatorAddress())) | |
146 | 146 | then value(assetInfo(assetId)).issuer | |
147 | 147 | else throw("not valid NFT") | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func checkAdditionalPayment (payment) = if (isDefined(payment.assetId)) | |
151 | 151 | then throw("RCAP: Please attach waves") | |
152 | 152 | else { | |
153 | 153 | let feeAmount = getIntegerValue(getOracle(), staticKey_extraFee()) | |
154 | 154 | if ((payment.amount != feeAmount)) | |
155 | 155 | then throw((("RCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
156 | 156 | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func getRandomNumber (options,txId,hatchingFinishHeight,offset) = { | |
161 | 161 | let randomSeedBlock = value(blockInfoByHeight((hatchingFinishHeight - 1))) | |
162 | 162 | let randomHash = sha256((txId + value(randomSeedBlock.vrf))) | |
163 | 163 | (toInt(randomHash, (offset * 8)) % options) | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func tryGetBoolean (key) = match getBoolean(key) { | |
168 | 168 | case b: Boolean => | |
169 | 169 | b | |
170 | 170 | case _ => | |
171 | 171 | false | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | - | func getRandomWin (tx,finishHeight) = { | |
176 | - | let n = getRandomNumber(1000, tx, finishHeight, 0) | |
177 | - | let result = if ((100 > n)) | |
178 | - | then "battleground_A" | |
179 | - | else if ((200 > n)) | |
180 | - | then "battleground_B" | |
181 | - | else if ((300 > n)) | |
182 | - | then "battleground_C" | |
183 | - | else if ((400 > n)) | |
184 | - | then "battleground_D" | |
185 | - | else if ((450 > n)) | |
186 | - | then "incubator" | |
187 | - | else if ((490 > n)) | |
188 | - | then "duckling_40" | |
189 | - | else if ((540 > n)) | |
190 | - | then "duckling_20" | |
191 | - | else if ((640 > n)) | |
192 | - | then "item!ART-FEED5" | |
193 | - | else if ((710 > n)) | |
194 | - | then "item!ART-FEED10" | |
195 | - | else if ((740 > n)) | |
196 | - | then "item!ART-FEED15" | |
197 | - | else if ((770 > n)) | |
198 | - | then "item!ART-FEED20" | |
199 | - | else if ((790 > n)) | |
200 | - | then "item!ART-FEED25" | |
201 | - | else if ((810 > n)) | |
202 | - | then "item!ART-FEED50" | |
203 | - | else if ((830 > n)) | |
204 | - | then "item!ART-FEED100" | |
205 | - | else if ((860 > n)) | |
206 | - | then "item!ART-MUTARIUM-G" | |
207 | - | else if ((890 > n)) | |
208 | - | then "item!ART-MUTARIUM-D" | |
209 | - | else if ((910 > n)) | |
210 | - | then "item!ART-FREEGENE" | |
211 | - | else if ((930 > n)) | |
212 | - | then "item!ART-FIXGENE" | |
213 | - | else if ((980 > n)) | |
214 | - | then "trtl_incubator" | |
215 | - | else "item!ART-FEED500" | |
216 | - | $Tuple2(n, result) | |
175 | + | func getRandomReturn (tx,finishHeight) = { | |
176 | + | let n = getRandomNumber(2, tx, finishHeight, 1) | |
177 | + | if ((n == 0)) | |
178 | + | then true | |
179 | + | else false | |
217 | 180 | } | |
218 | 181 | ||
219 | 182 | ||
220 | - | func finishRebirthInternal (initTx,address,additionalPayment,double) = { | |
183 | + | func getRandomWin (tx,finishHeight,blacklistCode) = { | |
184 | + | let jackpotRandom = getRandomNumber(300, tx, finishHeight, 1) | |
185 | + | if ((jackpotRandom == 1)) | |
186 | + | then $Tuple2(jackpotRandom, "jackpot") | |
187 | + | else { | |
188 | + | let n = getRandomNumber(1000, tx, finishHeight, 0) | |
189 | + | let result = if (if ((500 > n)) | |
190 | + | then (blacklistCode != "incubator") | |
191 | + | else false) | |
192 | + | then "incubator" | |
193 | + | else "trtl_incubator" | |
194 | + | $Tuple2(n, result) | |
195 | + | } | |
196 | + | } | |
197 | + | ||
198 | + | ||
199 | + | func finishRebirthInternal (initTx,address,additionalPayment,double,blacklistCode,rescue) = { | |
221 | 200 | let finishBlock = tryGetInteger((((("address_" + address) + "_initTx_") + initTx) + "_finishBlock")) | |
222 | 201 | let status = tryGetString((((("address_" + address) + "_initTx_") + initTx) + "_status")) | |
223 | 202 | let validPayment = checkAdditionalPayment(additionalPayment) | |
224 | 203 | if ((validPayment == validPayment)) | |
225 | 204 | then if ((status != "open")) | |
226 | 205 | then throw("rebirth is finished or not open") | |
227 | 206 | else if ((finishBlock > height)) | |
228 | 207 | then throw("you cannot finish rebirth, yet") | |
229 | 208 | else { | |
230 | - | let output = getRandomWin(fromBase58String(initTx), finishBlock) | |
209 | + | let output = getRandomWin(fromBase58String(initTx), finishBlock, blacklistCode) | |
231 | 210 | let win = output._2 | |
232 | 211 | let random = output._1 | |
233 | 212 | let txId = initTx | |
234 | 213 | let result = if ((indexOf(win, "ground") != unit)) | |
235 | 214 | then { | |
236 | 215 | let color = takeRight(win, 1) | |
237 | 216 | let call = if (!(double)) | |
238 | 217 | then { | |
239 | 218 | let first = invoke(getCanineStakingAddress(), "addFreePerch", [address, color, 1], nil) | |
240 | 219 | if ((first == first)) | |
241 | 220 | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
242 | 221 | else throw("Strict value is not equal to itself.") | |
243 | 222 | } | |
244 | 223 | else { | |
245 | 224 | let first = invoke(getCanineStakingAddress(), "addFreePerch", [address, color, 2], nil) | |
246 | 225 | if ((first == first)) | |
247 | 226 | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), win)] | |
248 | 227 | else throw("Strict value is not equal to itself.") | |
249 | 228 | } | |
250 | 229 | if ((call == call)) | |
251 | 230 | then call | |
252 | 231 | else throw("Strict value is not equal to itself.") | |
253 | 232 | } | |
254 | - | else if ((win == " | |
233 | + | else if ((win == "jackpot")) | |
255 | 234 | then { | |
256 | - | let call = if (!(double)) | |
235 | + | let call = invoke(getCanineIncubatorAddress(), "issueJackpot", [address, txId, "WWFSANTA"], nil) | |
236 | + | if ((call == call)) | |
237 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
238 | + | else throw("Strict value is not equal to itself.") | |
239 | + | } | |
240 | + | else if ((win == "incubator")) | |
241 | + | then { | |
242 | + | let call = if (!(double)) | |
243 | + | then { | |
244 | + | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
245 | + | if ((first == first)) | |
246 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
247 | + | else throw("Strict value is not equal to itself.") | |
248 | + | } | |
249 | + | else { | |
250 | + | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
251 | + | if ((first == first)) | |
252 | + | then { | |
253 | + | let second = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
254 | + | if ((second == second)) | |
255 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "incubator")] | |
256 | + | else throw("Strict value is not equal to itself.") | |
257 | + | } | |
258 | + | else throw("Strict value is not equal to itself.") | |
259 | + | } | |
260 | + | if ((call == call)) | |
261 | + | then call | |
262 | + | else throw("Strict value is not equal to itself.") | |
263 | + | } | |
264 | + | else if ((indexOf(win, "duckling") != unit)) | |
257 | 265 | then { | |
258 | - | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
259 | - | if ((first == first)) | |
260 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
266 | + | let level = parseIntValue(split(win, "_")[1]) | |
267 | + | let levelFinal = if (double) | |
268 | + | then (2 * level) | |
269 | + | else level | |
270 | + | let call = invoke(getBabyDuckAddress(), "issueFreeDuckling", [address, txId, levelFinal], nil) | |
271 | + | if ((call == call)) | |
272 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
261 | 273 | else throw("Strict value is not equal to itself.") | |
262 | 274 | } | |
263 | - | else { | |
264 | - | let first = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
265 | - | if ((first == first)) | |
266 | - | then { | |
267 | - | let second = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
268 | - | if ((second == second)) | |
269 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "incubator")] | |
270 | - | else throw("Strict value is not equal to itself.") | |
271 | - | } | |
272 | - | else throw("Strict value is not equal to itself.") | |
273 | - | } | |
274 | - | if ((call == call)) | |
275 | - | then call | |
276 | - | else throw("Strict value is not equal to itself.") | |
277 | - | } | |
278 | - | else if ((indexOf(win, "duckling") != unit)) | |
279 | - | then { | |
280 | - | let level = parseIntValue(split(win, "_")[1]) | |
281 | - | let levelFinal = if (double) | |
282 | - | then (2 * level) | |
283 | - | else level | |
284 | - | let call = invoke(getBabyDuckAddress(), "issueFreeDuckling", [address, txId, levelFinal], nil) | |
285 | - | if ((call == call)) | |
286 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(call))] | |
287 | - | else throw("Strict value is not equal to itself.") | |
288 | - | } | |
289 | - | else if ((win == "trtl_incubator")) | |
290 | - | then { | |
291 | - | let call = if (!(double)) | |
292 | - | then { | |
293 | - | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
294 | - | if ((first == first)) | |
295 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
296 | - | else throw("Strict value is not equal to itself.") | |
297 | - | } | |
298 | - | else { | |
299 | - | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
300 | - | if ((first == first)) | |
301 | - | then { | |
302 | - | let second = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
303 | - | if ((second == second)) | |
304 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "trtl_incubator")] | |
305 | - | else throw("Strict value is not equal to itself.") | |
306 | - | } | |
307 | - | else throw("Strict value is not equal to itself.") | |
308 | - | } | |
309 | - | if ((call == call)) | |
310 | - | then call | |
311 | - | else throw("Strict value is not equal to itself.") | |
312 | - | } | |
313 | - | else if ((indexOf(win, "item") != unit)) | |
275 | + | else if ((win == "trtl_incubator")) | |
314 | 276 | then { | |
315 | - | let itemName = split(win, "!")[1] | |
316 | 277 | let call = if (!(double)) | |
317 | 278 | then { | |
318 | - | let first = invoke( | |
279 | + | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
319 | 280 | if ((first == first)) | |
320 | 281 | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
321 | 282 | else throw("Strict value is not equal to itself.") | |
322 | 283 | } | |
323 | 284 | else { | |
324 | - | let first = invoke( | |
285 | + | let first = invoke(getTurtleIncubatorAddress(), "issueFreeTurtle", [address, txId], nil) | |
325 | 286 | if ((first == first)) | |
326 | 287 | then { | |
327 | - | let second = invoke( | |
288 | + | let second = invoke(getCanineIncubatorAddress(), "issueFree", [address, txId], nil) | |
328 | 289 | if ((second == second)) | |
329 | - | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), | |
290 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), "trtl_incubator")] | |
330 | 291 | else throw("Strict value is not equal to itself.") | |
331 | 292 | } | |
332 | 293 | else throw("Strict value is not equal to itself.") | |
333 | 294 | } | |
334 | 295 | if ((call == call)) | |
335 | 296 | then call | |
336 | 297 | else throw("Strict value is not equal to itself.") | |
337 | 298 | } | |
338 | - | else throw(("RFB: Some error occured, please contact the admins! " + win)) | |
299 | + | else if ((indexOf(win, "item") != unit)) | |
300 | + | then { | |
301 | + | let itemName = split(win, "!")[1] | |
302 | + | let call = if (!(double)) | |
303 | + | then { | |
304 | + | let first = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 0], nil) | |
305 | + | if ((first == first)) | |
306 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first))] | |
307 | + | else throw("Strict value is not equal to itself.") | |
308 | + | } | |
309 | + | else { | |
310 | + | let first = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 0], nil) | |
311 | + | if ((first == first)) | |
312 | + | then { | |
313 | + | let second = invoke(getItemsAddress(), "issueArtefactIndex", [itemName, address, 1], nil) | |
314 | + | if ((second == second)) | |
315 | + | then [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result"), asString(first)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_result1"), asString(second)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win1"), win)] | |
316 | + | else throw("Strict value is not equal to itself.") | |
317 | + | } | |
318 | + | else throw("Strict value is not equal to itself.") | |
319 | + | } | |
320 | + | if ((call == call)) | |
321 | + | then call | |
322 | + | else throw("Strict value is not equal to itself.") | |
323 | + | } | |
324 | + | else throw(("RFB: Some error occured, please contact the admins! " + win)) | |
339 | 325 | if ((result == result)) | |
340 | - | then ((result ++ [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win"), win), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_status"), "finish"), IntegerEntry((((("address_" + address) + "_initTx_") + initTx) + "_random"), random)]) ++ validPayment) | |
326 | + | then { | |
327 | + | let returnToSender = if (rescue) | |
328 | + | then getRandomReturn(fromBase58String(initTx), finishBlock) | |
329 | + | else false | |
330 | + | let returnPayload = if (returnToSender) | |
331 | + | then { | |
332 | + | let assetId = fromBase58String(getStringValue((((("address_" + address) + "_initTx_") + initTx) + "_assetId"))) | |
333 | + | let issuer = checkReal(assetId) | |
334 | + | let gen = asString(invoke(getCanineBreederAddress(), "getGenFromName", [value(assetInfo(assetId)).name], nil)) | |
335 | + | if ((gen == gen)) | |
336 | + | then { | |
337 | + | let call = invoke(issuer, "increaseRarity", [toBase58String(assetId), gen], nil) | |
338 | + | if ((call == call)) | |
339 | + | then [ScriptTransfer(addressFromStringValue(address), 1, assetId)] | |
340 | + | else throw("Strict value is not equal to itself.") | |
341 | + | } | |
342 | + | else throw("Strict value is not equal to itself.") | |
343 | + | } | |
344 | + | else nil | |
345 | + | ((result ++ [StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_win"), win), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_status"), "finish"), IntegerEntry((((("address_" + address) + "_initTx_") + initTx) + "_random"), random)]) ++ validPayment) | |
346 | + | } | |
341 | 347 | else throw("Strict value is not equal to itself.") | |
342 | 348 | } | |
343 | 349 | else throw("Strict value is not equal to itself.") | |
344 | 350 | } | |
345 | 351 | ||
346 | 352 | ||
347 | 353 | @Callable(i) | |
348 | 354 | func configureOracle (oracle) = if ((i.caller != this)) | |
349 | 355 | then throw("RCU: admin only") | |
350 | 356 | else [StringEntry("static_oracleAddress", oracle)] | |
351 | 357 | ||
352 | 358 | ||
353 | 359 | ||
354 | 360 | @Callable(i) | |
355 | 361 | func initRebirth () = { | |
356 | 362 | let pmtCanine = i.payments[0] | |
357 | 363 | let pmtPete = i.payments[1] | |
358 | 364 | let extra = checkAdditionalPayment(i.payments[2]) | |
359 | 365 | if ((extra == extra)) | |
360 | 366 | then { | |
361 | 367 | let assetId = value(pmtCanine.assetId) | |
362 | 368 | let initTx = toBase58String(i.transactionId) | |
363 | 369 | let address = toString(i.caller) | |
364 | 370 | if ((pmtCanine.amount != 1)) | |
365 | 371 | then throw("NFT is not attached") | |
366 | 372 | else if (if ((pmtPete.amount != wavesAmount)) | |
367 | 373 | then true | |
368 | 374 | else (pmtPete.assetId != getPeteAssetId())) | |
369 | 375 | then throw("Pete payment is not attached or wrong!") | |
370 | 376 | else { | |
371 | 377 | let sendToAggreGator = (pmtPete.amount / 4) | |
372 | 378 | let topup = (pmtPete.amount - sendToAggreGator) | |
373 | 379 | let addMore = invoke(getCanineStakingAddress(), "addPeteAndStakeMore", nil, [AttachedPayment(getPeteAssetId(), topup)]) | |
374 | 380 | if ((addMore == addMore)) | |
375 | 381 | then { | |
376 | 382 | let issuer = checkReal(assetId) | |
377 | 383 | let gen = asString(invoke(getCanineBreederAddress(), "getGenFromName", [value(assetInfo(assetId)).name], nil)) | |
378 | 384 | if ((gen == gen)) | |
379 | 385 | then { | |
380 | 386 | let call = invoke(issuer, "reduceRarity", [toBase58String(assetId), gen], nil) | |
381 | 387 | if ((call == call)) | |
382 | 388 | then ([IntegerEntry((((("address_" + address) + "_initTx_") + initTx) + "_finishBlock"), (height + delayForHatching)), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_status"), "open"), StringEntry((((("address_" + address) + "_initTx_") + initTx) + "_assetId"), toBase58String(assetId)), ScriptTransfer(getFeeAggregator(), sendToAggreGator, getPeteAssetId())] ++ extra) | |
383 | 389 | else throw("Strict value is not equal to itself.") | |
384 | 390 | } | |
385 | 391 | else throw("Strict value is not equal to itself.") | |
386 | 392 | } | |
387 | 393 | else throw("Strict value is not equal to itself.") | |
388 | 394 | } | |
389 | 395 | } | |
390 | 396 | else throw("Strict value is not equal to itself.") | |
391 | 397 | } | |
392 | 398 | ||
393 | 399 | ||
394 | 400 | ||
395 | 401 | @Callable(i) | |
396 | - | func finishRebirth (initTx) = finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false) | |
402 | + | func finishRebirth (initTx) = finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false, "", false) | |
397 | 403 | ||
398 | 404 | ||
399 | 405 | ||
400 | 406 | @Callable(i) | |
401 | 407 | func finishRebirthDouble (initTx) = if (!(if ((size(i.payments) == 2)) | |
402 | 408 | then (i.payments[0].amount == 1) | |
403 | 409 | else false)) | |
404 | 410 | then throw("Invalid payment") | |
405 | 411 | else { | |
406 | 412 | let assetId = value(i.payments[0].assetId) | |
407 | 413 | let boosterType = asString(invoke(getItemsAddress(), "checkArtefactDetails", [toBase58String(assetId)], nil)) | |
408 | 414 | if ((boosterType == boosterType)) | |
409 | 415 | then if ((boosterType == "ART-GIFT_DOUBL")) | |
410 | - | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true)) | |
416 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true, "", false)) | |
411 | 417 | else throw("Error! Wrong item attached to double rewards!") | |
412 | 418 | else throw("Strict value is not equal to itself.") | |
413 | 419 | } | |
420 | + | ||
421 | + | ||
422 | + | ||
423 | + | @Callable(i) | |
424 | + | func finishRebirthItem (initTx,itemCode) = if (if ((size(i.payments) == 2)) | |
425 | + | then (i.payments[0].amount == 1) | |
426 | + | else false) | |
427 | + | then { | |
428 | + | let assetId = value(i.payments[0].assetId) | |
429 | + | let boosterType = asString(invoke(getItemsAddress(), "checkArtefactDetails", [toBase58String(assetId)], nil)) | |
430 | + | if ((boosterType == boosterType)) | |
431 | + | then if ((boosterType == "ART-HWERASE")) | |
432 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], false, itemCode, false)) | |
433 | + | else if ((boosterType == "ART-HWRESCUE")) | |
434 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], false, "", true)) | |
435 | + | else if ((boosterType == "ART-GIFT_DOUBL")) | |
436 | + | then ([Burn(assetId, 1)] ++ finishRebirthInternal(initTx, toString(i.caller), i.payments[1], true, "", false)) | |
437 | + | else throw("Error! Wrong item attached ") | |
438 | + | else throw("Strict value is not equal to itself.") | |
439 | + | } | |
440 | + | else if ((size(i.payments) == 1)) | |
441 | + | then finishRebirthInternal(initTx, toString(i.caller), i.payments[0], false, "", false) | |
442 | + | else throw("Invalid payments") | |
414 | 443 | ||
415 | 444 |
github/deemru/w8io/169f3d6 55.10 ms ◑![]()