tx · BmA973qTCRT6vnKXmgU6dv2eBRJp3rwREqATjmtKQmST 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep: -0.03100000 Waves 2023.04.04 18:20 [2519988] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves
{ "type": 13, "id": "BmA973qTCRT6vnKXmgU6dv2eBRJp3rwREqATjmtKQmST", "fee": 3100000, "feeAssetId": null, "timestamp": 1680621662200, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "cQYDbwoArs9rcz4w7ZNdCs3e3fdWetdQ9A7Mgpgs8phHdC2V8yCKuazDVBguZxDNeuo3DtKn1uQV8NvxBUvywP6" ], "script": "base64:BgIxCAISAwoBCBIECgIRERIECgIRERIDCgEREgUKAwEBARIDCgEIEgQKAggIEgUKAwgICEsAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDgAgMLXLwAGTVVMVDEwAIDIr6AlAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkbkFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABILYmKcME9c5TkaQOS3UkL2SMUbH6369UKb1I0h0qsqrRAwkAAAIBAVQFByRtYXRjaDABIPd26vf3g8pl224T7gI7z1gplanB0Y3yS9ps2B1igMjeCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4BD2dldFN0cmluZ09yRmFpbAIHYWRkcmVz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WxkbwkAzQgCBQhhY3Rpb25zMQkBDlNjcmlwdFRyYW5zZmVyAwkBEUBleHRyTmF0aXZlKDEwNjIpAQUJbGFuZE93bmVyCQBlAggFAXACXzYFC3VzZEJwMldoRmVlBQt1c2RuQXNzZXRJZAMJAQIhPQIJAJADAQgFAWkIcGF5bWVudHMAAAkAAgECEk5vIHBheW1lbnRzIG5lZWRlZAUIYWN0aW9uczEJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AGDdwpQ==", "height": 2519988, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D8Ym5Yaxs2mf7dJkesir4SCVS5cdsTc711XgtTpfpg1A Next: H7sffFJyLftf7NJwoYGqNt59piPRhaiLsmqv9PLR1xJW Diff:
Old | New | Differences | |
---|---|---|---|
288 | 288 | else unit | |
289 | 289 | ||
290 | 290 | ||
291 | - | @Callable(bp) | |
292 | - | func constructorV1 (bq) = if ((bp.caller != this)) | |
291 | + | func bp (aJ,aK) = { | |
292 | + | let bq = aJ._1 | |
293 | + | let br = split(aK, "@") | |
294 | + | if ((size(br) != 2)) | |
295 | + | then throw("Incorrect order format, should be amount@price") | |
296 | + | else { | |
297 | + | let bs = parseIntValue(br[0]) | |
298 | + | let bt = parseIntValue(br[1]) | |
299 | + | let bu = fraction(bs, bt, c) | |
300 | + | let bv = parseIntValue(aJ._5[bq]) | |
301 | + | let bw = split(aJ._6[bq], "@") | |
302 | + | let bx = parseIntValue(bw[0]) | |
303 | + | let by = parseIntValue(bw[1]) | |
304 | + | if ((0 > by)) | |
305 | + | then throw("Price can't be negative") | |
306 | + | else { | |
307 | + | let bz = fraction(bx, by, c) | |
308 | + | if ((bs == 0)) | |
309 | + | then if ((bx > 0)) | |
310 | + | then $Tuple4((bq + 1), (aJ._2 :+ toString(bv)), (aJ._3 - bx), (aJ._4 - bz)) | |
311 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bx))), (aJ._3 + bx), aJ._4) | |
312 | + | else if ((bs > 0)) | |
313 | + | then if ((0 > bx)) | |
314 | + | then { | |
315 | + | let bA = (bs + bx) | |
316 | + | $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bx))), (aJ._3 + bA), (aJ._4 + bu)) | |
317 | + | } | |
318 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString(bv)), ((aJ._3 + bs) - bx), ((aJ._4 + bu) - bz)) | |
319 | + | else if ((0 > bx)) | |
320 | + | then { | |
321 | + | let bA = (bx - bs) | |
322 | + | if ((0 > (bv - bA))) | |
323 | + | then throw((((("Attempt to take " + toString(bA)) + " from warehouse, but only ") + toString(bv)) + " available")) | |
324 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bA))), (aJ._3 + bA), aJ._3) | |
325 | + | } | |
326 | + | else if ((0 > (bv + bs))) | |
327 | + | then throw((((("Attempt to take " + toString(-(bs))) + " from warehouse, but only ") + toString(bv)) + " available")) | |
328 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv + bs))), ((aJ._3 - bs) - bx), (aJ._4 - bz)) | |
329 | + | } | |
330 | + | } | |
331 | + | } | |
332 | + | ||
333 | + | ||
334 | + | func bB (aJ,bC) = { | |
335 | + | let bq = aJ._7 | |
336 | + | let bD = split(bC, "@") | |
337 | + | if ((size(bD) != 2)) | |
338 | + | then throw("Incorrect order format, should be amount@price") | |
339 | + | else { | |
340 | + | let bE = parseIntValue(bD[0]) | |
341 | + | let bF = parseIntValue(bD[1]) | |
342 | + | if ((0 > bF)) | |
343 | + | then throw("Price can't be negative") | |
344 | + | else { | |
345 | + | let bG = fraction(bE, bF, c) | |
346 | + | let bH = parseIntValue(aJ._8[bq]) | |
347 | + | let bv = parseIntValue(aJ._9[bq]) | |
348 | + | let bI = split(aJ._10[bq], "@") | |
349 | + | let bJ = parseIntValue(bI[0]) | |
350 | + | let bK = parseIntValue(bI[1]) | |
351 | + | if (if ((bE != 0)) | |
352 | + | then (bF != bK) | |
353 | + | else false) | |
354 | + | then throw(((((("Prices of " + M[bq]) + " don't match! WH price=") + toString(bK)) + ", your price=") + toString(bF))) | |
355 | + | else { | |
356 | + | let bL = fraction(bJ, bK, c) | |
357 | + | if ((bE == 0)) | |
358 | + | then $Tuple10((aJ._1 :+ toString(bv)), (aJ._2 :+ aJ._10[bq]), (aJ._3 :+ toString(bH)), aJ._4, aJ._5, aJ._6, (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
359 | + | else if ((bE > 0)) | |
360 | + | then if ((0 > bJ)) | |
361 | + | then if ((bE > -(bJ))) | |
362 | + | then throw(((((("Attempt to buy " + toString(bE)) + " of ") + M[bq]) + ", but warehouse only sells ") + toString(-(bJ)))) | |
363 | + | else $Tuple10((aJ._1 :+ toString(bv)), (aJ._2 :+ ((toString((bJ + bE)) + "@") + toString(bK))), (aJ._3 :+ toString((bH + bE))), (aJ._4 + bE), aJ._5, (aJ._6 + bG), (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
364 | + | else throw((("Attempt to buy " + M[bq]) + " while warehouse doesn't sell it")) | |
365 | + | else if ((bJ > 0)) | |
366 | + | then if ((-(bE) > bJ)) | |
367 | + | then throw(((((("Attempt to sell " + toString(-(bE))) + " of ") + M[bq]) + ", but warehouse only buys ") + toString(bJ))) | |
368 | + | else if ((-(bE) > bH)) | |
369 | + | then throw(((((("Attempt to sell " + toString(-(bE))) + ", but you only have ") + toString(bH)) + " of ") + M[bq])) | |
370 | + | else $Tuple10((aJ._1 :+ toString((bv - bE))), (aJ._2 :+ ((toString((bJ + bE)) + "@") + toString(bK))), (aJ._3 :+ toString((bH + bE))), (aJ._4 - bE), (aJ._5 - bG), aJ._6, (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
371 | + | else throw((("Attempt to sell " + M[bq]) + " while warehouse doesn't buy it")) | |
372 | + | } | |
373 | + | } | |
374 | + | } | |
375 | + | } | |
376 | + | ||
377 | + | ||
378 | + | @Callable(bM) | |
379 | + | func constructorV1 (bN) = if ((bM.caller != this)) | |
293 | 380 | then throw("Permission denied") | |
294 | - | else [StringEntry(r(), | |
381 | + | else [StringEntry(r(), bN)] | |
295 | 382 | ||
296 | 383 | ||
297 | 384 | ||
298 | - | @Callable( | |
299 | - | func sellResources ( | |
300 | - | let | |
301 | - | if (( | |
385 | + | @Callable(bM) | |
386 | + | func sellResources (bO,bP) = { | |
387 | + | let bQ = bo() | |
388 | + | if ((bQ == bQ)) | |
302 | 389 | then { | |
303 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
304 | - | if ((size( | |
390 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
391 | + | if ((size(bM.payments) != 0)) | |
305 | 392 | then throw("sellResources doesn't require any payments") | |
306 | 393 | else { | |
307 | - | let | |
308 | - | if (( | |
309 | - | then throw(("Duck location type should be Factory, but is " + | |
394 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
395 | + | if ((bR[aj] != "F")) | |
396 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
310 | 397 | else { | |
311 | - | let aW = | |
312 | - | let | |
313 | - | let | |
314 | - | func | |
315 | - | then throw(((((("You have " + | |
316 | - | else if ((0 > | |
317 | - | then throw(((("You tried to sell negative amount of " + K[ | |
318 | - | else if (( | |
398 | + | let aW = bR[ak] | |
399 | + | let bS = bm(ab(ac)) | |
400 | + | let bT = split(bS[am], "_") | |
401 | + | func bU (aJ,bq) = if ((bO[bq] > parseIntValue(bT[bq]))) | |
402 | + | then throw(((((("You have " + bT[bq]) + " of ") + K[bq]) + ", but tried to sell ") + toString(bO[bq]))) | |
403 | + | else if ((0 > bO[bq])) | |
404 | + | then throw(((("You tried to sell negative amount of " + K[bq]) + ": ") + toString(bO[bq]))) | |
405 | + | else if ((bO[bq] > 0)) | |
319 | 406 | then { | |
320 | - | let | |
321 | - | $Tuple3((aJ._1 :+ | |
407 | + | let bV = aV(aW, bq, bO[bq], bP[bq]) | |
408 | + | $Tuple3((aJ._1 :+ bV._1), (aJ._2 :+ toString((parseIntValue(bT[bq]) - bO[bq]))), (aJ._3 + bV._2)) | |
322 | 409 | } | |
323 | - | else $Tuple3(aJ._1, (aJ._2 :+ | |
410 | + | else $Tuple3(aJ._1, (aJ._2 :+ bT[bq]), aJ._3) | |
324 | 411 | ||
325 | - | let | |
412 | + | let bW = { | |
326 | 413 | let aL = [0, 1, 2, 3, 4, 5] | |
327 | 414 | let aM = size(aL) | |
328 | 415 | let aN = $Tuple3(nil, nil, 0) | |
329 | 416 | func aO (aP,aQ) = if ((aQ >= aM)) | |
330 | 417 | then aP | |
331 | - | else | |
418 | + | else bU(aP, aL[aQ]) | |
332 | 419 | ||
333 | 420 | func aR (aP,aQ) = if ((aQ >= aM)) | |
334 | 421 | then aP | |
336 | 423 | ||
337 | 424 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
338 | 425 | } | |
339 | - | let | |
340 | - | let | |
341 | - | $Tuple2(( | |
426 | + | let bX = makeString([bS[al], makeString(bW._2, "_"), bS[an], bS[ao]], ":") | |
427 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
428 | + | $Tuple2((bW._1 :+ ScriptTransfer(bM.caller, bW._3, f)), bY) | |
342 | 429 | } | |
343 | 430 | } | |
344 | 431 | } | |
347 | 434 | ||
348 | 435 | ||
349 | 436 | ||
350 | - | @Callable( | |
351 | - | func buyMaterials ( | |
352 | - | let | |
353 | - | if (( | |
437 | + | @Callable(bM) | |
438 | + | func buyMaterials (bO,bZ) = { | |
439 | + | let bQ = bo() | |
440 | + | if ((bQ == bQ)) | |
354 | 441 | then { | |
355 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
356 | - | if ((size( | |
442 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
443 | + | if ((size(bM.payments) != 1)) | |
357 | 444 | then throw("exactly 1 payment must be attached") | |
358 | 445 | else { | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | if (( | |
446 | + | let ca = bM.payments[0] | |
447 | + | let cb = ca.amount | |
448 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
449 | + | if ((cc != f)) | |
363 | 450 | then throw("USDN payments only!") | |
364 | 451 | else { | |
365 | - | let | |
366 | - | if (( | |
367 | - | then throw(("Duck location type should be Factory, but is " + | |
452 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
453 | + | if ((bR[aj] != "F")) | |
454 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
368 | 455 | else { | |
369 | - | let aW = | |
370 | - | let | |
371 | - | let | |
372 | - | func | |
373 | - | then throw(((("You tried to buy negative amount of " + L[ | |
374 | - | else if (( | |
456 | + | let aW = bR[ak] | |
457 | + | let bS = bm(ab(ac)) | |
458 | + | let cd = split(bS[an], "_") | |
459 | + | func ce (aJ,bq) = if ((0 > bO[bq])) | |
460 | + | then throw(((("You tried to buy negative amount of " + L[bq]) + ": ") + toString(bO[bq]))) | |
461 | + | else if ((bO[bq] > 0)) | |
375 | 462 | then { | |
376 | - | let | |
377 | - | $Tuple3((aJ._1 :+ | |
463 | + | let bV = be(aW, bq, bO[bq], bZ[bq]) | |
464 | + | $Tuple3((aJ._1 :+ bV._1), (aJ._2 :+ toString((parseIntValue(cd[bq]) + bV._3))), (aJ._3 + bV._2)) | |
378 | 465 | } | |
379 | - | else $Tuple3(aJ._1, (aJ._2 :+ | |
466 | + | else $Tuple3(aJ._1, (aJ._2 :+ cd[bq]), aJ._3) | |
380 | 467 | ||
381 | - | let | |
468 | + | let bW = { | |
382 | 469 | let aL = [0, 1, 2, 3, 4, 5] | |
383 | 470 | let aM = size(aL) | |
384 | 471 | let aN = $Tuple3(nil, nil, 0) | |
385 | 472 | func aO (aP,aQ) = if ((aQ >= aM)) | |
386 | 473 | then aP | |
387 | - | else | |
474 | + | else ce(aP, aL[aQ]) | |
388 | 475 | ||
389 | 476 | func aR (aP,aQ) = if ((aQ >= aM)) | |
390 | 477 | then aP | |
392 | 479 | ||
393 | 480 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
394 | 481 | } | |
395 | - | if (( | |
396 | - | then throw(((("Insufficient payment! Attached=" + toString( | |
482 | + | if ((bW._3 > cb)) | |
483 | + | then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3))) | |
397 | 484 | else { | |
398 | - | let | |
399 | - | let | |
400 | - | let t = if ((( | |
401 | - | then [ScriptTransfer( | |
485 | + | let bX = makeString([bS[al], bS[am], makeString(bW._2, "_"), bS[ao]], ":") | |
486 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
487 | + | let t = if (((cb - bW._3) > 0)) | |
488 | + | then [ScriptTransfer(bM.caller, (cb - bW._3), f)] | |
402 | 489 | else nil | |
403 | - | $Tuple2(( | |
490 | + | $Tuple2((bW._1 ++ t), bY) | |
404 | 491 | } | |
405 | 492 | } | |
406 | 493 | } | |
411 | 498 | ||
412 | 499 | ||
413 | 500 | ||
414 | - | @Callable( | |
415 | - | func exchangeResources ( | |
416 | - | let | |
417 | - | if (( | |
501 | + | @Callable(bM) | |
502 | + | func exchangeResources (bO) = { | |
503 | + | let bQ = bo() | |
504 | + | if ((bQ == bQ)) | |
418 | 505 | then { | |
419 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
420 | - | if ((size( | |
506 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
507 | + | if ((size(bM.payments) != 1)) | |
421 | 508 | then throw("exactly 1 payment must be attached") | |
422 | 509 | else { | |
423 | - | let | |
424 | - | let | |
425 | - | let | |
426 | - | if (( | |
510 | + | let ca = bM.payments[0] | |
511 | + | let cb = ca.amount | |
512 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
513 | + | if ((cc != f)) | |
427 | 514 | then throw("USDN payments only!") | |
428 | 515 | else { | |
429 | - | let | |
430 | - | if (( | |
431 | - | then throw(("Duck location type should be Factory, but is " + | |
516 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
517 | + | if ((bR[aj] != "F")) | |
518 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
432 | 519 | else { | |
433 | - | let aW = | |
434 | - | let | |
435 | - | let | |
436 | - | let | |
437 | - | func | |
438 | - | let aZ = U(aW, | |
520 | + | let aW = bR[ak] | |
521 | + | let bS = bm(ab(ac)) | |
522 | + | let bT = split(bS[am], "_") | |
523 | + | let cd = split(bS[an], "_") | |
524 | + | func cf (aJ,bq) = { | |
525 | + | let aZ = U(aW, bq) | |
439 | 526 | let ba = valueOrElse(getInteger(aZ), 0) | |
440 | - | let | |
441 | - | if (( | |
442 | - | then throw(((((("You have " + | |
443 | - | else if ((0 > | |
444 | - | then throw(((("You tried to exchange negative amount of " + K[ | |
445 | - | else if (( | |
446 | - | then $Tuple4((aJ._1 :+ toString((parseIntValue( | |
447 | - | else $Tuple4((aJ._1 :+ | |
527 | + | let cg = bO[bq] | |
528 | + | if ((cg > parseIntValue(bT[bq]))) | |
529 | + | then throw(((((("You have " + bT[bq]) + " of ") + K[bq]) + ", but tried to exchange ") + toString(cg))) | |
530 | + | else if ((0 > cg)) | |
531 | + | then throw(((("You tried to exchange negative amount of " + K[bq]) + ": ") + toString(cg))) | |
532 | + | else if ((cg > 0)) | |
533 | + | then $Tuple4((aJ._1 :+ toString((parseIntValue(bT[bq]) - cg))), (aJ._2 :+ toString((parseIntValue(cd[bq]) + cg))), (aJ._3 + fraction(cg, C, c)), (aJ._4 :+ IntegerEntry(aZ, ba))) | |
534 | + | else $Tuple4((aJ._1 :+ bT[bq]), (aJ._2 :+ cd[bq]), aJ._3, aJ._4) | |
448 | 535 | } | |
449 | 536 | ||
450 | - | let | |
537 | + | let bW = { | |
451 | 538 | let aL = [0, 1, 2, 3, 4, 5] | |
452 | 539 | let aM = size(aL) | |
453 | 540 | let aN = $Tuple4(nil, nil, 0, nil) | |
454 | 541 | func aO (aP,aQ) = if ((aQ >= aM)) | |
455 | 542 | then aP | |
456 | - | else | |
543 | + | else cf(aP, aL[aQ]) | |
457 | 544 | ||
458 | 545 | func aR (aP,aQ) = if ((aQ >= aM)) | |
459 | 546 | then aP | |
461 | 548 | ||
462 | 549 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
463 | 550 | } | |
464 | - | if (( | |
465 | - | then throw(((("Insufficient payment! Attached=" + toString( | |
551 | + | if ((bW._3 > cb)) | |
552 | + | then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3))) | |
466 | 553 | else { | |
467 | - | let | |
468 | - | let | |
469 | - | let t = if ((( | |
470 | - | then [ScriptTransfer( | |
554 | + | let bX = makeString([bS[al], makeString(bW._1, "_"), makeString(bW._2, "_"), bS[ao]], ":") | |
555 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
556 | + | let t = if (((cb - bW._3) > 0)) | |
557 | + | then [ScriptTransfer(bM.caller, (cb - bW._3), f)] | |
471 | 558 | else nil | |
472 | - | $Tuple2((t ++ | |
559 | + | $Tuple2((t ++ bW._4), bY) | |
473 | 560 | } | |
474 | 561 | } | |
475 | 562 | } | |
480 | 567 | ||
481 | 568 | ||
482 | 569 | ||
483 | - | @Callable( | |
484 | - | func buyGoods ( | |
485 | - | let | |
486 | - | if (( | |
487 | - | then if ((size( | |
570 | + | @Callable(bM) | |
571 | + | func buyGoods (ch,ci,cj) = { | |
572 | + | let bQ = bo() | |
573 | + | if ((bQ == bQ)) | |
574 | + | then if ((size(bM.payments) != 0)) | |
488 | 575 | then throw("buyGoods doesn't require any payments") | |
489 | - | else if ((0 > | |
576 | + | else if ((0 > cj)) | |
490 | 577 | then throw("Quantity should be positive") | |
491 | 578 | else { | |
492 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
493 | - | let | |
494 | - | if (( | |
495 | - | then throw(("Duck location type should be Manufactory, but is " + | |
579 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
580 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
581 | + | if ((bR[aj] != "M")) | |
582 | + | then throw(("Duck location type should be Manufactory, but is " + bR[aj])) | |
496 | 583 | else { | |
497 | - | let | |
498 | - | let | |
499 | - | let | |
500 | - | if (if ((0 > | |
584 | + | let ck = bR[ai] | |
585 | + | let bS = bm(ab(ac)) | |
586 | + | let cd = split(bS[an], "_") | |
587 | + | if (if ((0 > ch)) | |
501 | 588 | then true | |
502 | - | else ( | |
503 | - | then throw(("Unknown product idx=" + toString( | |
589 | + | else (ch >= size(O))) | |
590 | + | then throw(("Unknown product idx=" + toString(ch))) | |
504 | 591 | else { | |
505 | - | let | |
506 | - | if ((N[ | |
507 | - | then throw(((("This product is available in " + N[ | |
592 | + | let cl = (ch % size(N)) | |
593 | + | if ((N[cl] != ck)) | |
594 | + | then throw(((("This product is available in " + N[cl]) + ", but you are in ") + ck)) | |
508 | 595 | else { | |
509 | - | let | |
510 | - | if ((size( | |
511 | - | then throw(("Fatal: unknown recipe: " + O[ | |
596 | + | let cm = split(O[ch], "_") | |
597 | + | if ((size(cm) != (A + 2))) | |
598 | + | then throw(("Fatal: unknown recipe: " + O[ch])) | |
512 | 599 | else { | |
513 | - | let | |
600 | + | let cn = if ((bS[ao] == "")) | |
514 | 601 | then nil | |
515 | - | else split( | |
516 | - | func | |
517 | - | let | |
518 | - | let | |
519 | - | then split( | |
602 | + | else split(bS[ao], "_") | |
603 | + | func co (aJ,cp) = { | |
604 | + | let cq = aJ._2 | |
605 | + | let cr = if ((size(cn) > cq)) | |
606 | + | then split(cn[cq], ",") | |
520 | 607 | else ["0", "0", "0"] | |
521 | - | let | |
522 | - | let | |
523 | - | let | |
524 | - | let | |
525 | - | let | |
526 | - | let | |
527 | - | let aX = ( | |
528 | - | let | |
608 | + | let cs = cr[0] | |
609 | + | let ct = parseIntValue(cs) | |
610 | + | let cu = cr[1] | |
611 | + | let cv = parseIntValue(cu) | |
612 | + | let cw = cr[2] | |
613 | + | let cx = parseIntValue(cw) | |
614 | + | let aX = (cj * parseIntValue(cm[7])) | |
615 | + | let cy = if ((cq == ch)) | |
529 | 616 | then { | |
530 | - | let g = | |
617 | + | let g = ci | |
531 | 618 | if ((1 == g)) | |
532 | - | then ((((toString(( | |
619 | + | then ((((toString((ct + aX)) + ",") + cu) + ",") + cw) | |
533 | 620 | else if ((2 == g)) | |
534 | - | then (((( | |
621 | + | then ((((cs + ",") + toString((cv + aX))) + ",") + cw) | |
535 | 622 | else if ((3 == g)) | |
536 | - | then (((( | |
537 | - | else throw(("Product level should be 1..3, not " + toString( | |
623 | + | then ((((cs + ",") + cu) + ",") + toString((cx + aX))) | |
624 | + | else throw(("Product level should be 1..3, not " + toString(ci))) | |
538 | 625 | } | |
539 | - | else (((( | |
540 | - | $Tuple2((aJ._1 :+ | |
626 | + | else ((((cs + ",") + cu) + ",") + cw) | |
627 | + | $Tuple2((aJ._1 :+ cy), (cq + 1)) | |
541 | 628 | } | |
542 | 629 | ||
543 | - | let | |
630 | + | let cz = ( let aL = O | |
544 | 631 | let aM = size(aL) | |
545 | 632 | let aN = $Tuple2(nil, 0) | |
546 | 633 | func aO (aP,aQ) = if ((aQ >= aM)) | |
547 | 634 | then aP | |
548 | - | else | |
635 | + | else co(aP, aL[aQ]) | |
549 | 636 | ||
550 | 637 | func aR (aP,aQ) = if ((aQ >= aM)) | |
551 | 638 | then aP | |
552 | 639 | else throw("List size exceeds 50") | |
553 | 640 | ||
554 | 641 | aR(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50))._1 | |
555 | - | func | |
556 | - | let | |
557 | - | let | |
558 | - | if (( | |
559 | - | then throw(((((((("You have " + | |
560 | - | else if (( | |
561 | - | then (aJ :+ toString(( | |
562 | - | else (aJ :+ | |
642 | + | func cA (aJ,bq) = { | |
643 | + | let cB = (parseIntValue(cm[bq]) * cj) | |
644 | + | let cC = parseIntValue(cd[bq]) | |
645 | + | if ((cB > cC)) | |
646 | + | then throw(((((((("You have " + cd[bq]) + " of ") + L[bq]) + ", but recipe requires ") + toString(cB)) + " for quantity ") + toString(cj))) | |
647 | + | else if ((cB > 0)) | |
648 | + | then (aJ :+ toString((cC - cB))) | |
649 | + | else (aJ :+ cd[bq]) | |
563 | 650 | } | |
564 | 651 | ||
565 | - | let | |
652 | + | let bW = { | |
566 | 653 | let aL = [0, 1, 2, 3, 4, 5] | |
567 | 654 | let aM = size(aL) | |
568 | 655 | let aN = nil | |
569 | - | func | |
656 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
570 | 657 | then aP | |
571 | - | else | |
658 | + | else cA(aP, aL[aQ]) | |
572 | 659 | ||
573 | - | func | |
660 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
574 | 661 | then aP | |
575 | 662 | else throw("List size exceeds 6") | |
576 | 663 | ||
577 | - | | |
664 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
578 | 665 | } | |
579 | - | let | |
580 | - | let | |
581 | - | $Tuple2(nil, | |
666 | + | let bX = makeString([bS[al], bS[am], makeString(bW, "_"), makeString(cz, "_")], ":") | |
667 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
668 | + | $Tuple2(nil, bY) | |
582 | 669 | } | |
583 | 670 | } | |
584 | 671 | } | |
589 | 676 | ||
590 | 677 | ||
591 | 678 | ||
592 | - | @Callable( | |
593 | - | func acceptServicePayment ( | |
594 | - | let | |
595 | - | if (( | |
596 | - | then if ((size( | |
679 | + | @Callable(bM) | |
680 | + | func acceptServicePayment (cF) = { | |
681 | + | let bQ = bo() | |
682 | + | if ((bQ == bQ)) | |
683 | + | then if ((size(bM.payments) != 1)) | |
597 | 684 | then throw("exactly 1 payment must be attached") | |
598 | 685 | else { | |
599 | - | let | |
600 | - | let | |
601 | - | let | |
602 | - | if (( | |
686 | + | let ca = bM.payments[0] | |
687 | + | let cb = ca.amount | |
688 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
689 | + | if ((cc != f)) | |
603 | 690 | then throw("USDN payments only!") | |
604 | 691 | else { | |
605 | - | let | |
606 | - | let g = | |
692 | + | let cG = { | |
693 | + | let g = cF | |
607 | 694 | if (("LAND_RENAME" == g)) | |
608 | 695 | then 10000000 | |
609 | 696 | else throw("Unknown service!") | |
610 | 697 | } | |
611 | - | if (( | |
612 | - | then throw(((( | |
613 | - | else $Tuple2(nil, | |
698 | + | if ((cb != cG)) | |
699 | + | then throw((((cF + " costs ") + toString(cG)) + " USDN")) | |
700 | + | else $Tuple2(nil, cb) | |
614 | 701 | } | |
615 | 702 | } | |
616 | 703 | else throw("Strict value is not equal to itself.") | |
618 | 705 | ||
619 | 706 | ||
620 | 707 | ||
621 | - | @Callable( | |
622 | - | func setWarehouseOrder ( | |
623 | - | let | |
624 | - | let | |
625 | - | let | |
708 | + | @Callable(bM) | |
709 | + | func setWarehouseOrder (cH,Y) = { | |
710 | + | let cI = bM.originCaller | |
711 | + | let cJ = toString(cI) | |
712 | + | let cK = value(assetInfo(fromBase58String(Y))) | |
626 | 713 | if (!(isDefined(getInteger(y, ah(Y))))) | |
627 | - | then throw((("NFT " + | |
714 | + | then throw((("NFT " + cK.name) + " is not staked")) | |
628 | 715 | else { | |
629 | - | let | |
630 | - | if (( | |
716 | + | let cL = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + cK.name) + " is orphaned")) | |
717 | + | if ((cL != cJ)) | |
631 | 718 | then throw((G + " is not yours")) | |
632 | 719 | else { | |
633 | - | let | |
634 | - | if ((size( | |
720 | + | let cM = split_4C(cH, ":") | |
721 | + | if ((size(cM) != 3)) | |
635 | 722 | then throw("cargoListStr should contain exactly 2 ':' separators") | |
636 | 723 | else { | |
637 | - | let | |
638 | - | let | |
639 | - | let | |
724 | + | let cN = split(cM[0], "_") | |
725 | + | let cO = split(cM[1], "_") | |
726 | + | let cP = if ((cM[2] == "")) | |
640 | 727 | then nil | |
641 | - | else split( | |
642 | - | if ((size( | |
728 | + | else split(cM[2], "_") | |
729 | + | if ((size(cN) != A)) | |
643 | 730 | then throw("All 6 resources should be passed") | |
644 | - | else if ((size( | |
731 | + | else if ((size(cO) != A)) | |
645 | 732 | then throw("All 6 materials should be passed") | |
646 | 733 | else { | |
647 | - | let | |
648 | - | let aH = split_4C( | |
649 | - | let | |
650 | - | let | |
651 | - | let | |
734 | + | let cQ = ax(invoke(y, "getWarehouseREADONLY", [Y], nil)) | |
735 | + | let aH = split_4C(cQ, ":") | |
736 | + | let cR = split(aH[aq], "_") | |
737 | + | let cS = split(aH[ar], "_") | |
738 | + | let cT = if ((aH[as] == "")) | |
652 | 739 | then nil | |
653 | 740 | else split(aH[as], "_") | |
654 | - | let | |
655 | - | let | |
656 | - | let | |
657 | - | let | |
658 | - | let | |
741 | + | let cU = aG(aH) | |
742 | + | let cV = aS(aH) | |
743 | + | let cW = aT(aH) | |
744 | + | let cX = parseIntValue(aH[at]) | |
745 | + | let cY = ((((aD(aH[ap]) - cU) - cV) - cW) - cX) | |
659 | 746 | let aB = X(Y) | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
747 | + | let cZ = aA(aB) | |
748 | + | let da = split(cZ[au], "_") | |
749 | + | let db = split(cZ[av], "_") | |
750 | + | let dc = if ((cZ[aw] == "")) | |
664 | 751 | then nil | |
665 | - | else split(cD[aw], "_") | |
666 | - | let cH = 0 | |
667 | - | func cI (aJ,aK) = { | |
668 | - | let by = aJ._1 | |
669 | - | let cJ = split(aK, "@") | |
670 | - | if ((size(cJ) != 2)) | |
671 | - | then throw("Incorrect order format, should be amount@price") | |
672 | - | else { | |
673 | - | let cK = parseIntValue(cJ[0]) | |
674 | - | let cL = parseIntValue(cJ[1]) | |
675 | - | let cM = fraction(cK, cL, c) | |
676 | - | let cN = parseIntValue(cv[by]) | |
677 | - | let cO = split(cE[by], "@") | |
678 | - | let cP = parseIntValue(cO[0]) | |
679 | - | let cQ = parseIntValue(cO[1]) | |
680 | - | if ((0 > cQ)) | |
681 | - | then throw("Price can't be negative") | |
682 | - | else { | |
683 | - | let cR = fraction(cP, cQ, c) | |
684 | - | if ((cK == 0)) | |
685 | - | then if ((cP > 0)) | |
686 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cN)), (aJ._3 - cP), (aJ._4 - cR)) | |
687 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN - cP))), (aJ._3 + cP), aJ._4) | |
688 | - | else if ((cK > 0)) | |
689 | - | then if ((0 > cP)) | |
690 | - | then { | |
691 | - | let cS = (cK + cP) | |
692 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cN - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
693 | - | } | |
694 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cN)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
695 | - | else if ((0 > cP)) | |
696 | - | then { | |
697 | - | let cS = (cP - cK) | |
698 | - | if ((0 > (cN - cS))) | |
699 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cN)) + " available")) | |
700 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN - cS))), (aJ._3 + cS), aJ._4) | |
701 | - | } | |
702 | - | else if ((0 > (cN + cK))) | |
703 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cN)) + " available")) | |
704 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
705 | - | } | |
706 | - | } | |
707 | - | } | |
708 | - | ||
709 | - | let cT = { | |
710 | - | let aL = cr | |
752 | + | else split(cZ[aw], "_") | |
753 | + | let dd = 0 | |
754 | + | let de = { | |
755 | + | let aL = cN | |
711 | 756 | let aM = size(aL) | |
712 | - | let aN = $ | |
757 | + | let aN = $Tuple6(0, nil, 0, 0, cR, da) | |
713 | 758 | func aO (aP,aQ) = if ((aQ >= aM)) | |
714 | 759 | then aP | |
715 | - | else | |
760 | + | else bp(aP, aL[aQ]) | |
716 | 761 | ||
717 | 762 | func aR (aP,aQ) = if ((aQ >= aM)) | |
718 | 763 | then aP | |
720 | 765 | ||
721 | 766 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
722 | 767 | } | |
723 | - | func cU (aJ,aK) = { | |
724 | - | let by = aJ._1 | |
725 | - | let cJ = split(aK, "@") | |
726 | - | if ((size(cJ) != 2)) | |
727 | - | then throw("Incorrect order format, should be amount@price") | |
728 | - | else { | |
729 | - | let cK = parseIntValue(cJ[0]) | |
730 | - | let cL = parseIntValue(cJ[1]) | |
731 | - | let cM = fraction(cK, cL, c) | |
732 | - | let cV = parseIntValue(cw[by]) | |
733 | - | let cO = split(cF[by], "@") | |
734 | - | let cP = parseIntValue(cO[0]) | |
735 | - | let cQ = parseIntValue(cO[1]) | |
736 | - | if ((0 > cQ)) | |
737 | - | then throw("Price can't be negative") | |
738 | - | else { | |
739 | - | let cR = fraction(cP, cQ, c) | |
740 | - | if ((cK == 0)) | |
741 | - | then if ((cP > 0)) | |
742 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cV)), (aJ._3 - cP), (aJ._4 - cR)) | |
743 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV - cP))), (aJ._3 + cP), aJ._4) | |
744 | - | else if ((cK > 0)) | |
745 | - | then if ((0 > cP)) | |
746 | - | then { | |
747 | - | let cS = (cK + cP) | |
748 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cV - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
749 | - | } | |
750 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cV)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
751 | - | else if ((0 > cP)) | |
752 | - | then { | |
753 | - | let cS = (cP - cK) | |
754 | - | if ((0 > (cV - cS))) | |
755 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cV)) + " available")) | |
756 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV - cS))), (aJ._3 + cS), aJ._4) | |
757 | - | } | |
758 | - | else if ((0 > (cV + cK))) | |
759 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cV)) + " available")) | |
760 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
761 | - | } | |
762 | - | } | |
763 | - | } | |
768 | + | let bj = { | |
769 | + | let aL = cO | |
770 | + | let aM = size(aL) | |
771 | + | let aN = $Tuple6(0, nil, de._3, de._4, cS, db) | |
772 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
773 | + | then aP | |
774 | + | else bp(aP, aL[aQ]) | |
764 | 775 | ||
765 | - | let bj = { | |
766 | - | let aL = cs | |
767 | - | let aM = size(aL) | |
768 | - | let aN = $Tuple4(0, nil, cT._3, cT._4) | |
769 | - | func ch (aP,aQ) = if ((aQ >= aM)) | |
770 | - | then aP | |
771 | - | else cU(aP, aL[aQ]) | |
772 | - | ||
773 | - | func ci (aP,aQ) = if ((aQ >= aM)) | |
776 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
774 | 777 | then aP | |
775 | 778 | else throw("List size exceeds 6") | |
776 | 779 | ||
777 | - | | |
780 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
778 | 781 | } | |
779 | - | func cW (aJ,aK) = { | |
780 | - | let by = aJ._1 | |
781 | - | let cJ = split(aK, "@") | |
782 | - | if ((size(cJ) != 2)) | |
783 | - | then throw("Incorrect order format, should be amount@price") | |
784 | - | else { | |
785 | - | let cK = parseIntValue(cJ[0]) | |
786 | - | let cL = parseIntValue(cJ[1]) | |
787 | - | let cM = fraction(cK, cL, c) | |
788 | - | let cX = parseIntValue(cx[by]) | |
789 | - | let cO = split(cG[by], "@") | |
790 | - | let cP = parseIntValue(cO[0]) | |
791 | - | let cQ = parseIntValue(cO[1]) | |
792 | - | if ((0 > cQ)) | |
793 | - | then throw("Price can't be negative") | |
794 | - | else { | |
795 | - | let cR = fraction(cP, cQ, c) | |
796 | - | if ((cK == 0)) | |
797 | - | then if ((cP > 0)) | |
798 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cX)), (aJ._3 - cP), (aJ._4 - cR)) | |
799 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX - cP))), (aJ._3 + cP), aJ._4) | |
800 | - | else if ((cK > 0)) | |
801 | - | then if ((0 > cP)) | |
802 | - | then { | |
803 | - | let cS = (cK + cP) | |
804 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cX - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
805 | - | } | |
806 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cX)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
807 | - | else if ((0 > cP)) | |
808 | - | then { | |
809 | - | let cS = (cP - cK) | |
810 | - | if ((0 > (cX - cS))) | |
811 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cX)) + " available")) | |
812 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX - cS))), (aJ._3 + cS), aJ._3) | |
813 | - | } | |
814 | - | else if ((0 > (cX + cK))) | |
815 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cX)) + " available")) | |
816 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
817 | - | } | |
818 | - | } | |
819 | - | } | |
782 | + | let aC = { | |
783 | + | let aL = cP | |
784 | + | let aM = size(aL) | |
785 | + | let aN = $Tuple6(0, nil, bj._3, bj._4, cT, dc) | |
786 | + | func df (aP,aQ) = if ((aQ >= aM)) | |
787 | + | then aP | |
788 | + | else bp(aP, aL[aQ]) | |
820 | 789 | ||
821 | - | let aC = { | |
822 | - | let aL = ct | |
823 | - | let aM = size(aL) | |
824 | - | let aN = $Tuple4(0, nil, bj._3, bj._4) | |
825 | - | func cY (aP,aQ) = if ((aQ >= aM)) | |
826 | - | then aP | |
827 | - | else cW(aP, aL[aQ]) | |
828 | - | ||
829 | - | func cZ (aP,aQ) = if ((aQ >= aM)) | |
790 | + | func dg (aP,aQ) = if ((aQ >= aM)) | |
830 | 791 | then aP | |
831 | 792 | else throw("List size exceeds 50") | |
832 | 793 | ||
833 | - | | |
794 | + | dg(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
834 | 795 | } | |
835 | - | let | |
836 | - | if (( | |
837 | - | then throw((((("Attempt to reserve " + toString( | |
796 | + | let dh = aC._3 | |
797 | + | if ((dh > cY)) | |
798 | + | then throw((((("Attempt to reserve " + toString(dh)) + " space, but only ") + toString(cY)) + " warehouse space left")) | |
838 | 799 | else { | |
839 | - | let | |
840 | - | let | |
841 | - | if (( | |
800 | + | let di = makeString_2C([aH[ap], makeString(de._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_"), toString(dh)], ":") | |
801 | + | let dj = invoke(y, "saveWarehouse", [di, Y], nil) | |
802 | + | if ((dj == dj)) | |
842 | 803 | then { | |
843 | - | let | |
844 | - | if (( | |
845 | - | then if ((size( | |
804 | + | let dk = aC._4 | |
805 | + | if ((dk > 0)) | |
806 | + | then if ((size(bM.payments) != 1)) | |
846 | 807 | then throw("exactly 1 payment must be attached") | |
847 | 808 | else { | |
848 | - | let | |
849 | - | let | |
850 | - | let | |
851 | - | if (( | |
809 | + | let ca = bM.payments[0] | |
810 | + | let cb = ca.amount | |
811 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
812 | + | if ((cc != f)) | |
852 | 813 | then throw("USDN payments only!") | |
853 | - | else if (( | |
854 | - | then throw(("Payment needed is " + toString( | |
855 | - | else [StringEntry(aB, | |
814 | + | else if ((cb != dk)) | |
815 | + | then throw(("Payment needed is " + toString(dk))) | |
816 | + | else [StringEntry(aB, cH)] | |
856 | 817 | } | |
857 | - | else if (( | |
858 | - | then if ((size( | |
818 | + | else if ((dk == 0)) | |
819 | + | then if ((size(bM.payments) != 0)) | |
859 | 820 | then throw("No payments needed") | |
860 | - | else [StringEntry(aB, | |
861 | - | else if ((size( | |
821 | + | else [StringEntry(aB, cH)] | |
822 | + | else if ((size(bM.payments) != 0)) | |
862 | 823 | then throw("No payments needed") | |
863 | - | else [ScriptTransfer( | |
824 | + | else [ScriptTransfer(cI, -(dk), f), StringEntry(aB, cH)] | |
864 | 825 | } | |
865 | 826 | else throw("Strict value is not equal to itself.") | |
866 | 827 | } | |
872 | 833 | ||
873 | 834 | ||
874 | 835 | ||
875 | - | @Callable( | |
876 | - | func acceptWarehouseOrder ( | |
877 | - | let | |
878 | - | let | |
879 | - | let | |
880 | - | let | |
881 | - | let | |
882 | - | if (( | |
883 | - | then throw((("Duck location type is " + | |
884 | - | else if (( | |
885 | - | then throw(((("Your staked duck is " + | |
836 | + | @Callable(bM) | |
837 | + | func acceptWarehouseOrder (dl,Y,ac) = { | |
838 | + | let dm = bM.originCaller | |
839 | + | let dn = toString(dm) | |
840 | + | let do = valueOrErrorMessage(getString(y, Z(dn)), "You don't have a duck staked") | |
841 | + | let bR = valueOrElse(getString(y, ad(do)), z) | |
842 | + | let dp = split(value(bR), "_") | |
843 | + | if ((dp[aj] != "L")) | |
844 | + | then throw((("Duck location type is " + dp[aj]) + ", but should be L")) | |
845 | + | else if ((do != ac)) | |
846 | + | then throw(((("Your staked duck is " + do) + ", but passed ") + ac)) | |
886 | 847 | else { | |
887 | - | let | |
848 | + | let dq = value(assetInfo(fromBase58String(Y))) | |
888 | 849 | if (!(isDefined(getInteger(y, ah(Y))))) | |
889 | - | then throw((("NFT " + | |
850 | + | then throw((("NFT " + dq.name) + " is not staked")) | |
890 | 851 | else { | |
891 | - | let | |
892 | - | if (( | |
852 | + | let dr = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dq.name) + " is orphaned")) | |
853 | + | if ((dr == dn)) | |
893 | 854 | then throw("You cannot trade with yourself") | |
894 | 855 | else { | |
895 | - | let | |
896 | - | if ((size( | |
856 | + | let ds = split_4C(dl, ":") | |
857 | + | if ((size(ds) != 3)) | |
897 | 858 | then throw("bpOrderStr should contain exactly 2 ':' separators") | |
898 | 859 | else { | |
899 | - | let | |
900 | - | let | |
901 | - | let | |
860 | + | let dt = split(ds[0], "_") | |
861 | + | let du = split(ds[1], "_") | |
862 | + | let dv = if ((ds[2] == "")) | |
902 | 863 | then nil | |
903 | - | else split( | |
904 | - | if ((size( | |
864 | + | else split(ds[2], "_") | |
865 | + | if ((size(dt) != A)) | |
905 | 866 | then throw("All 6 resources should be passed") | |
906 | - | else if ((size( | |
867 | + | else if ((size(du) != A)) | |
907 | 868 | then throw("All 6 materials should be passed") | |
908 | 869 | else { | |
909 | - | let | |
910 | - | let aH = split_4C( | |
911 | - | let | |
912 | - | let | |
913 | - | let | |
870 | + | let cQ = ax(invoke(y, "getWarehouseREADONLY", [Y], nil)) | |
871 | + | let aH = split_4C(cQ, ":") | |
872 | + | let cR = split(aH[aq], "_") | |
873 | + | let cS = split(aH[ar], "_") | |
874 | + | let cT = if ((aH[as] == "")) | |
914 | 875 | then nil | |
915 | 876 | else split(aH[as], "_") | |
916 | - | let | |
917 | - | let | |
918 | - | let | |
919 | - | let | |
920 | - | let | |
877 | + | let cU = aG(aH) | |
878 | + | let cV = aS(aH) | |
879 | + | let cW = aT(aH) | |
880 | + | let cX = parseIntValue(aH[at]) | |
881 | + | let cY = ((((aD(aH[ap]) - cU) - cV) - cW) - cX) | |
921 | 882 | let bn = ab(ac) | |
922 | - | let | |
923 | - | let | |
924 | - | let | |
925 | - | let | |
883 | + | let bS = bm(bn) | |
884 | + | let dw = split(bS[am], "_") | |
885 | + | let dx = split(bS[an], "_") | |
886 | + | let dy = if ((bS[ao] == "")) | |
926 | 887 | then nil | |
927 | - | else split( | |
888 | + | else split(bS[ao], "_") | |
928 | 889 | let aB = X(Y) | |
929 | - | let | |
930 | - | let | |
931 | - | let | |
932 | - | let | |
890 | + | let dz = aA(aB) | |
891 | + | let dA = split(dz[au], "_") | |
892 | + | let dB = split(dz[av], "_") | |
893 | + | let dC = if ((dz[aw] == "")) | |
933 | 894 | then nil | |
934 | - | else split(ds[aw], "_") | |
935 | - | let cH = 0 | |
936 | - | func cI (aJ,by) = { | |
937 | - | let dw = split(dm[by], "@") | |
938 | - | if ((size(dw) != 2)) | |
939 | - | then throw("Incorrect order format, should be amount@price") | |
940 | - | else { | |
941 | - | let dx = parseIntValue(dw[0]) | |
942 | - | let dy = parseIntValue(dw[1]) | |
943 | - | if ((0 > dy)) | |
944 | - | then throw("Price can't be negative") | |
945 | - | else { | |
946 | - | let dz = fraction(dx, dy, c) | |
947 | - | let dA = parseIntValue(dp[by]) | |
948 | - | let cN = parseIntValue(cv[by]) | |
949 | - | let dB = split(dt[by], "@") | |
950 | - | let dC = parseIntValue(dB[0]) | |
951 | - | let dD = parseIntValue(dB[1]) | |
952 | - | if (if ((dx != 0)) | |
953 | - | then (dy != dD) | |
954 | - | else false) | |
955 | - | then throw(((((("Prices of " + K[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
956 | - | else { | |
957 | - | let dE = fraction(dC, dD, c) | |
958 | - | if ((dx == 0)) | |
959 | - | then $Tuple6((aJ._1 :+ cv[by]), (aJ._2 :+ dt[by]), (aJ._3 :+ dp[by]), aJ._4, aJ._5, aJ._6) | |
960 | - | else if ((dx > 0)) | |
961 | - | then if ((0 > dC)) | |
962 | - | then if ((dx > -(dC))) | |
963 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + K[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
964 | - | else $Tuple6((aJ._1 :+ cv[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dA + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz)) | |
965 | - | else throw((("Attempt to buy " + K[by]) + " while warehouse doesn't sell it")) | |
966 | - | else if ((dC > 0)) | |
967 | - | then if ((-(dx) > dC)) | |
968 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + K[by]) + ", but warehouse only buys ") + toString(dC))) | |
969 | - | else if ((-(dx) > dA)) | |
970 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dp[by]) + " of ") + K[by])) | |
971 | - | else $Tuple6((aJ._1 :+ toString((cN - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dA + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6) | |
972 | - | else throw((("Attempt to sell " + K[by]) + " while warehouse doesn't buy it")) | |
973 | - | } | |
974 | - | } | |
975 | - | } | |
976 | - | } | |
977 | - | ||
978 | - | let cT = { | |
979 | - | let aL = [0, 1, 2, 3, 4, 5] | |
895 | + | else split(dz[aw], "_") | |
896 | + | let dd = 0 | |
897 | + | let de = { | |
898 | + | let aL = dt | |
980 | 899 | let aM = size(aL) | |
981 | - | let aN = $ | |
900 | + | let aN = $Tuple10(nil, nil, nil, 0, 0, 0, 0, dw, cR, dA) | |
982 | 901 | func aO (aP,aQ) = if ((aQ >= aM)) | |
983 | 902 | then aP | |
984 | - | else | |
903 | + | else bB(aP, aL[aQ]) | |
985 | 904 | ||
986 | 905 | func aR (aP,aQ) = if ((aQ >= aM)) | |
987 | 906 | then aP | |
989 | 908 | ||
990 | 909 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
991 | 910 | } | |
992 | - | func cU (aJ,by) = { | |
993 | - | let dF = split(dn[by], "@") | |
994 | - | if ((size(dF) != 2)) | |
995 | - | then throw("Incorrect order format, should be amount@price") | |
996 | - | else { | |
997 | - | let dx = parseIntValue(dF[0]) | |
998 | - | let dy = parseIntValue(dF[1]) | |
999 | - | if ((0 > dy)) | |
1000 | - | then throw("Price can't be negative") | |
1001 | - | else { | |
1002 | - | let dz = fraction(dx, dy, c) | |
1003 | - | let dG = parseIntValue(dq[by]) | |
1004 | - | let cV = parseIntValue(cw[by]) | |
1005 | - | let dB = split(du[by], "@") | |
1006 | - | let dC = parseIntValue(dB[0]) | |
1007 | - | let dD = parseIntValue(dB[1]) | |
1008 | - | if (if ((dx != 0)) | |
1009 | - | then (dy != dD) | |
1010 | - | else false) | |
1011 | - | then throw(((((("Prices of " + L[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
1012 | - | else { | |
1013 | - | let dE = fraction(dC, dD, c) | |
1014 | - | if ((dx == 0)) | |
1015 | - | then $Tuple6((aJ._1 :+ cw[by]), (aJ._2 :+ du[by]), (aJ._3 :+ dq[by]), aJ._4, aJ._5, aJ._6) | |
1016 | - | else if ((dx > 0)) | |
1017 | - | then if ((0 > dC)) | |
1018 | - | then if ((dx > -(dC))) | |
1019 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + L[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
1020 | - | else $Tuple6((aJ._1 :+ cw[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dG + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz)) | |
1021 | - | else throw((("Attempt to buy " + L[by]) + " while warehouse doesn't sell it")) | |
1022 | - | else if ((dC > 0)) | |
1023 | - | then if ((-(dx) > dC)) | |
1024 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + L[by]) + ", but warehouse only buys ") + toString(dC))) | |
1025 | - | else if ((-(dx) > dG)) | |
1026 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dq[by]) + " of ") + L[by])) | |
1027 | - | else $Tuple6((aJ._1 :+ toString((cV - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dG + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6) | |
1028 | - | else throw((("Attempt to sell " + L[by]) + " while warehouse doesn't buy it")) | |
1029 | - | } | |
1030 | - | } | |
1031 | - | } | |
1032 | - | } | |
911 | + | let bj = { | |
912 | + | let aL = du | |
913 | + | let aM = size(aL) | |
914 | + | let aN = $Tuple10(nil, nil, nil, de._4, de._5, de._6, 0, dx, cS, dB) | |
915 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
916 | + | then aP | |
917 | + | else bB(aP, aL[aQ]) | |
1033 | 918 | ||
1034 | - | let bj = { | |
1035 | - | let aL = [0, 1, 2, 3, 4, 5] | |
1036 | - | let aM = size(aL) | |
1037 | - | let aN = $Tuple6(nil, nil, nil, cT._4, cT._5, cT._6) | |
1038 | - | func ch (aP,aQ) = if ((aQ >= aM)) | |
1039 | - | then aP | |
1040 | - | else cU(aP, aL[aQ]) | |
1041 | - | ||
1042 | - | func ci (aP,aQ) = if ((aQ >= aM)) | |
919 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
1043 | 920 | then aP | |
1044 | 921 | else throw("List size exceeds 6") | |
1045 | 922 | ||
1046 | - | | |
923 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
1047 | 924 | } | |
1048 | - | func cW (aJ,dH) = { | |
1049 | - | let by = aJ._7 | |
1050 | - | let dI = split(dH, "@") | |
1051 | - | if ((size(dI) != 2)) | |
1052 | - | then throw("Incorrect order format, should be amount@price") | |
1053 | - | else { | |
1054 | - | let dx = parseIntValue(dI[0]) | |
1055 | - | let dy = parseIntValue(dI[1]) | |
1056 | - | if ((0 > dy)) | |
1057 | - | then throw("Price can't be negative") | |
1058 | - | else { | |
1059 | - | let dz = fraction(dx, dy, c) | |
1060 | - | let dJ = parseIntValue(dr[by]) | |
1061 | - | let cX = parseIntValue(cx[by]) | |
1062 | - | let dB = split(dv[by], "@") | |
1063 | - | let dC = parseIntValue(dB[0]) | |
1064 | - | let dD = parseIntValue(dB[1]) | |
1065 | - | if (if ((dx != 0)) | |
1066 | - | then (dy != dD) | |
1067 | - | else false) | |
1068 | - | then throw(((((("Prices of " + M[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
1069 | - | else { | |
1070 | - | let dE = fraction(dC, dD, c) | |
1071 | - | if ((dx == 0)) | |
1072 | - | then $Tuple7((aJ._1 :+ cx[by]), (aJ._2 :+ dv[by]), (aJ._3 :+ dr[by]), aJ._4, aJ._5, aJ._6, (aJ._7 + 1)) | |
1073 | - | else if ((dx > 0)) | |
1074 | - | then if ((0 > dC)) | |
1075 | - | then if ((dx > -(dC))) | |
1076 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + M[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
1077 | - | else $Tuple7((aJ._1 :+ cx[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dJ + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz), (aJ._7 + 1)) | |
1078 | - | else throw((("Attempt to buy " + M[by]) + " while warehouse doesn't sell it")) | |
1079 | - | else if ((dC > 0)) | |
1080 | - | then if ((-(dx) > dC)) | |
1081 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + M[by]) + ", but warehouse only buys ") + toString(dC))) | |
1082 | - | else if ((-(dx) > dJ)) | |
1083 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dr[by]) + " of ") + M[by])) | |
1084 | - | else $Tuple7((aJ._1 :+ toString((cX - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dJ + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6, (aJ._7 + 1)) | |
1085 | - | else throw((("Attempt to sell " + M[by]) + " while warehouse doesn't buy it")) | |
1086 | - | } | |
1087 | - | } | |
1088 | - | } | |
1089 | - | } | |
925 | + | let aC = { | |
926 | + | let aL = dv | |
927 | + | let aM = size(aL) | |
928 | + | let aN = $Tuple10(nil, nil, nil, bj._4, bj._5, bj._6, 0, dy, cT, dC) | |
929 | + | func df (aP,aQ) = if ((aQ >= aM)) | |
930 | + | then aP | |
931 | + | else bB(aP, aL[aQ]) | |
1090 | 932 | ||
1091 | - | let aC = { | |
1092 | - | let aL = do | |
1093 | - | let aM = size(aL) | |
1094 | - | let aN = $Tuple7(nil, nil, nil, bj._4, bj._5, bj._6, 0) | |
1095 | - | func cY (aP,aQ) = if ((aQ >= aM)) | |
1096 | - | then aP | |
1097 | - | else cW(aP, aL[aQ]) | |
1098 | - | ||
1099 | - | func cZ (aP,aQ) = if ((aQ >= aM)) | |
933 | + | func dg (aP,aQ) = if ((aQ >= aM)) | |
1100 | 934 | then aP | |
1101 | 935 | else throw("List size exceeds 50") | |
1102 | 936 | ||
1103 | - | | |
937 | + | dg(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
1104 | 938 | } | |
1105 | - | let | |
1106 | - | let | |
939 | + | let dh = aC._4 | |
940 | + | let dD = if ((0 > (cX - dh))) | |
1107 | 941 | then 0 | |
1108 | - | else ( | |
1109 | - | let | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | if (( | |
942 | + | else (cX - dh) | |
943 | + | let di = makeString_2C([aH[ap], makeString(de._1, "_"), makeString(bj._1, "_"), makeString(aC._1, "_"), toString(dD)], ":") | |
944 | + | let dE = makeString_2C([makeString(de._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_")], ":") | |
945 | + | let dF = makeString_2C([bS[al], makeString(de._3, "_"), makeString(bj._3, "_"), makeString(aC._3, "_")], ":") | |
946 | + | let dj = invoke(y, "saveWarehouse", [di, Y], nil) | |
947 | + | if ((dj == dj)) | |
1114 | 948 | then { | |
1115 | - | let | |
1116 | - | if (( | |
949 | + | let dG = invoke(y, "updateBackpack", [ac, dF], nil) | |
950 | + | if ((dG == dG)) | |
1117 | 951 | then { | |
1118 | - | let | |
1119 | - | let | |
1120 | - | let | |
1121 | - | let | |
1122 | - | then ( | |
1123 | - | else | |
1124 | - | let | |
1125 | - | let | |
1126 | - | if (( | |
1127 | - | then if ((size( | |
952 | + | let dH = [StringEntry(aB, dE)] | |
953 | + | let dI = fraction(aC._5, J, b) | |
954 | + | let dJ = aC._5 | |
955 | + | let dK = if ((dJ > 0)) | |
956 | + | then (dH :+ ScriptTransfer(dm, (aC._5 - dI), f)) | |
957 | + | else dH | |
958 | + | let dL = fraction(aC._6, J, b) | |
959 | + | let dM = aC._6 | |
960 | + | if ((dM > 0)) | |
961 | + | then if ((size(bM.payments) != 1)) | |
1128 | 962 | then throw("exactly 1 payment must be attached") | |
1129 | 963 | else { | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | if (( | |
964 | + | let ca = bM.payments[0] | |
965 | + | let cb = ca.amount | |
966 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
967 | + | if ((cc != f)) | |
1134 | 968 | then throw("USDN payments only!") | |
1135 | - | else if (( | |
1136 | - | then throw(("Payment needed is " + toString( | |
1137 | - | else ( | |
969 | + | else if ((cb != dM)) | |
970 | + | then throw(("Payment needed is " + toString(dM))) | |
971 | + | else (dK :+ ScriptTransfer(addressFromStringValue(dr), (aC._6 - dL), f)) | |
1138 | 972 | } | |
1139 | - | else if ((size( | |
973 | + | else if ((size(bM.payments) != 0)) | |
1140 | 974 | then throw("No payments needed") | |
1141 | - | else | |
975 | + | else dK | |
1142 | 976 | } | |
1143 | 977 | else throw("Strict value is not equal to itself.") | |
1144 | 978 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = 1000000 | |
7 | 7 | ||
8 | 8 | let c = 100000000 | |
9 | 9 | ||
10 | 10 | let d = 10000000000 | |
11 | 11 | ||
12 | 12 | let e = take(drop(this.bytes, 1), 1) | |
13 | 13 | ||
14 | 14 | let f = { | |
15 | 15 | let g = e | |
16 | 16 | if ((base58'2W' == g)) | |
17 | 17 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
18 | 18 | else if ((base58'2T' == g)) | |
19 | 19 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
20 | 20 | else throw("Unknown chain") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | let h = { | |
24 | 24 | let g = e | |
25 | 25 | if ((base58'2W' == g)) | |
26 | 26 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
27 | 27 | else if ((base58'2T' == g)) | |
28 | 28 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
29 | 29 | else throw("Unknown chain") | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | func i (j,k) = valueOrErrorMessage(getString(j, k), makeString(["mandatory ", toString(j), ".", k, " is not defined"], "")) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func l (k,m) = valueOrElse(getInteger(this, k), m) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | let n = 1 | |
39 | 39 | ||
40 | 40 | let o = 2 | |
41 | 41 | ||
42 | 42 | let p = 3 | |
43 | 43 | ||
44 | 44 | func q () = "%s__restConfig" | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func r () = "%s__restAddr" | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func s (t) = split_4C(i(t, q()), a) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func u (v,w) = valueOrErrorMessage(addressFromString(v[w]), ("Rest cfg doesn't contain address at index " + toString(w))) | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | let x = addressFromStringValue(valueOrElse(getString(this, r()), h)) | |
57 | 57 | ||
58 | 58 | let v = s(x) | |
59 | 59 | ||
60 | 60 | let y = u(v, n) | |
61 | 61 | ||
62 | 62 | let z = "Africa_F_Africa" | |
63 | 63 | ||
64 | 64 | let A = 6 | |
65 | 65 | ||
66 | 66 | let B = 10000000000 | |
67 | 67 | ||
68 | 68 | let C = 158549 | |
69 | 69 | ||
70 | 70 | let D = 10000 | |
71 | 71 | ||
72 | 72 | let E = 200 | |
73 | 73 | ||
74 | 74 | let F = 300 | |
75 | 75 | ||
76 | 76 | let G = "LAND" | |
77 | 77 | ||
78 | 78 | let H = "DUCK" | |
79 | 79 | ||
80 | 80 | let I = 10000000000 | |
81 | 81 | ||
82 | 82 | let J = 10000 | |
83 | 83 | ||
84 | 84 | let K = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"] | |
85 | 85 | ||
86 | 86 | let L = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
87 | 87 | ||
88 | 88 | let M = ["First Aid Kit", "Backpack", "Food Ration", "Jet Pack", "Radar"] | |
89 | 89 | ||
90 | 90 | let N = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
91 | 91 | ||
92 | 92 | let O = ["1_1_1_2_2_5_1_10", "2_5_5_2_7_5_2_100", "1_1_1_2_2_5_1_10", "9_9_1_5_5_1_5_100", "1_5_1_5_5_1_1_100"] | |
93 | 93 | ||
94 | 94 | let P = 0 | |
95 | 95 | ||
96 | 96 | let Q = 1 | |
97 | 97 | ||
98 | 98 | let R = 2 | |
99 | 99 | ||
100 | 100 | let S = 3 | |
101 | 101 | ||
102 | 102 | let T = 4 | |
103 | 103 | ||
104 | 104 | func U (V,W) = ((("factoryWhByContinentAndRes_" + V) + "_") + toString(W)) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func X (Y) = ("landOrder_" + Y) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func Z (aa) = ("stakedDuckByOwner_" + aa) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func ab (ac) = ("backPack_" + ac) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func ad (ac) = ("duckLocation_" + ac) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func ae () = "contractsBlocked" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func af (ag) = ("nftOwner_" + ag) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func ah (ag) = ("stakedTime_" + ag) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | let ai = 0 | |
129 | 129 | ||
130 | 130 | let aj = 1 | |
131 | 131 | ||
132 | 132 | let ak = 2 | |
133 | 133 | ||
134 | 134 | let al = 0 | |
135 | 135 | ||
136 | 136 | let am = 1 | |
137 | 137 | ||
138 | 138 | let an = 2 | |
139 | 139 | ||
140 | 140 | let ao = 3 | |
141 | 141 | ||
142 | 142 | let ap = 0 | |
143 | 143 | ||
144 | 144 | let aq = 1 | |
145 | 145 | ||
146 | 146 | let ar = 2 | |
147 | 147 | ||
148 | 148 | let as = 3 | |
149 | 149 | ||
150 | 150 | let at = 4 | |
151 | 151 | ||
152 | 152 | let au = 0 | |
153 | 153 | ||
154 | 154 | let av = 1 | |
155 | 155 | ||
156 | 156 | let aw = 2 | |
157 | 157 | ||
158 | 158 | func ax (ay) = { | |
159 | 159 | let g = ay | |
160 | 160 | if ($isInstanceOf(g, "String")) | |
161 | 161 | then { | |
162 | 162 | let az = g | |
163 | 163 | az | |
164 | 164 | } | |
165 | 165 | else throw("fail to cast into String") | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func aA (aB) = { | |
170 | 170 | let aC = split(valueOrElse(getString(aB), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":") | |
171 | 171 | [if ((size(split(aC[au], "_")) == A)) | |
172 | 172 | then aC[au] | |
173 | 173 | else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aC[av], "_")) == A)) | |
174 | 174 | then aC[av] | |
175 | 175 | else "0@0_0@0_0@0_0@0_0@0_0@0", aC[aw]] | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func aD (aE) = { | |
180 | 180 | let aF = split(aE, "_") | |
181 | 181 | ((I * (parseIntValue(aF[1]) + 1)) * parseIntValue(aF[0])) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func aG (aH) = { | |
186 | 186 | func aI (aJ,aK) = (aJ + parseIntValue(aK)) | |
187 | 187 | ||
188 | 188 | let aL = split(aH[aq], "_") | |
189 | 189 | let aM = size(aL) | |
190 | 190 | let aN = 0 | |
191 | 191 | func aO (aP,aQ) = if ((aQ >= aM)) | |
192 | 192 | then aP | |
193 | 193 | else aI(aP, aL[aQ]) | |
194 | 194 | ||
195 | 195 | func aR (aP,aQ) = if ((aQ >= aM)) | |
196 | 196 | then aP | |
197 | 197 | else throw("List size exceeds 6") | |
198 | 198 | ||
199 | 199 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
200 | 200 | } | |
201 | 201 | ||
202 | 202 | ||
203 | 203 | func aS (aH) = { | |
204 | 204 | func aI (aJ,aK) = (aJ + parseIntValue(aK)) | |
205 | 205 | ||
206 | 206 | let aL = split(aH[ar], "_") | |
207 | 207 | let aM = size(aL) | |
208 | 208 | let aN = 0 | |
209 | 209 | func aO (aP,aQ) = if ((aQ >= aM)) | |
210 | 210 | then aP | |
211 | 211 | else aI(aP, aL[aQ]) | |
212 | 212 | ||
213 | 213 | func aR (aP,aQ) = if ((aQ >= aM)) | |
214 | 214 | then aP | |
215 | 215 | else throw("List size exceeds 6") | |
216 | 216 | ||
217 | 217 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
218 | 218 | } | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | func aT (aH) = { | |
222 | 222 | let aU = aH[as] | |
223 | 223 | if ((aU == "")) | |
224 | 224 | then 0 | |
225 | 225 | else { | |
226 | 226 | func aI (aJ,aK) = (aJ + parseIntValue(aK)) | |
227 | 227 | ||
228 | 228 | let aL = split_4C(aU, "_") | |
229 | 229 | let aM = size(aL) | |
230 | 230 | let aN = 0 | |
231 | 231 | func aO (aP,aQ) = if ((aQ >= aM)) | |
232 | 232 | then aP | |
233 | 233 | else aI(aP, aL[aQ]) | |
234 | 234 | ||
235 | 235 | func aR (aP,aQ) = if ((aQ >= aM)) | |
236 | 236 | then aP | |
237 | 237 | else throw("List size exceeds 50") | |
238 | 238 | ||
239 | 239 | aR(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
240 | 240 | } | |
241 | 241 | } | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func aV (aW,W,aX,aY) = { | |
245 | 245 | let aZ = U(aW, W) | |
246 | 246 | let ba = valueOrElse(getInteger(aZ), 0) | |
247 | 247 | let bb = if ((ba > B)) | |
248 | 248 | then 0 | |
249 | 249 | else if (((ba + aX) > B)) | |
250 | 250 | then (B - ba) | |
251 | 251 | else aX | |
252 | 252 | let bc = (fraction(bb, ((E * C) - fraction(((100 * ba) + (50 * bb)), C, B)), d) + fraction((aX - bb), C, c)) | |
253 | 253 | let bd = (aY - (aY / 100)) | |
254 | 254 | if (((bd * aX) > (bc * c))) | |
255 | 255 | then throw((((((((((("Actual price = " + toString(bc)) + " / ") + toString(aX)) + " < minPrice = ") + toString(aY)) + ", (") + aW) + ", ") + K[W]) + ")")) | |
256 | 256 | else $Tuple2(IntegerEntry(aZ, (ba + aX)), bc) | |
257 | 257 | } | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func be (aW,bf,aX,bg) = { | |
261 | 261 | let aZ = U(aW, bf) | |
262 | 262 | let ba = valueOrElse(getInteger(aZ), 0) | |
263 | 263 | let bh = if ((ba > B)) | |
264 | 264 | then min([aX, (ba - B)]) | |
265 | 265 | else 0 | |
266 | 266 | let bi = min([ba, (aX - bh)]) | |
267 | 267 | let bj = (bi + bh) | |
268 | 268 | let bk = (fraction(bi, ((F * C) - fraction(((100 * ba) - (50 * bi)), C, B)), d) + fraction(bh, (2 * C), c)) | |
269 | 269 | let bl = (bg + (bg / 100)) | |
270 | 270 | if (((bk * c) > (bl * bj))) | |
271 | 271 | then throw((((((((((("Actual price = " + toString(bk)) + " / ") + toString(bj)) + " > maxPrice = ") + toString(bg)) + ", (") + aW) + ", ") + L[bf]) + ")")) | |
272 | 272 | else $Tuple3(IntegerEntry(aZ, (ba - bj)), bk, bj) | |
273 | 273 | } | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | func bm (bn) = { | |
277 | 277 | let aC = split(valueOrElse(getString(y, bn), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
278 | 278 | [toString(valueOrElse(parseInt(aC[al]), 0)), if ((size(split(aC[am], "_")) == A)) | |
279 | 279 | then aC[am] | |
280 | 280 | else "0_0_0_0_0_0", if ((size(split(aC[an], "_")) == A)) | |
281 | 281 | then aC[an] | |
282 | 282 | else "0_0_0_0_0_0", aC[ao]] | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func bo () = if (valueOrElse(getBoolean(y, ae()), false)) | |
287 | 287 | then throw("Contracts are under maintenance") | |
288 | 288 | else unit | |
289 | 289 | ||
290 | 290 | ||
291 | - | @Callable(bp) | |
292 | - | func constructorV1 (bq) = if ((bp.caller != this)) | |
291 | + | func bp (aJ,aK) = { | |
292 | + | let bq = aJ._1 | |
293 | + | let br = split(aK, "@") | |
294 | + | if ((size(br) != 2)) | |
295 | + | then throw("Incorrect order format, should be amount@price") | |
296 | + | else { | |
297 | + | let bs = parseIntValue(br[0]) | |
298 | + | let bt = parseIntValue(br[1]) | |
299 | + | let bu = fraction(bs, bt, c) | |
300 | + | let bv = parseIntValue(aJ._5[bq]) | |
301 | + | let bw = split(aJ._6[bq], "@") | |
302 | + | let bx = parseIntValue(bw[0]) | |
303 | + | let by = parseIntValue(bw[1]) | |
304 | + | if ((0 > by)) | |
305 | + | then throw("Price can't be negative") | |
306 | + | else { | |
307 | + | let bz = fraction(bx, by, c) | |
308 | + | if ((bs == 0)) | |
309 | + | then if ((bx > 0)) | |
310 | + | then $Tuple4((bq + 1), (aJ._2 :+ toString(bv)), (aJ._3 - bx), (aJ._4 - bz)) | |
311 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bx))), (aJ._3 + bx), aJ._4) | |
312 | + | else if ((bs > 0)) | |
313 | + | then if ((0 > bx)) | |
314 | + | then { | |
315 | + | let bA = (bs + bx) | |
316 | + | $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bx))), (aJ._3 + bA), (aJ._4 + bu)) | |
317 | + | } | |
318 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString(bv)), ((aJ._3 + bs) - bx), ((aJ._4 + bu) - bz)) | |
319 | + | else if ((0 > bx)) | |
320 | + | then { | |
321 | + | let bA = (bx - bs) | |
322 | + | if ((0 > (bv - bA))) | |
323 | + | then throw((((("Attempt to take " + toString(bA)) + " from warehouse, but only ") + toString(bv)) + " available")) | |
324 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv - bA))), (aJ._3 + bA), aJ._3) | |
325 | + | } | |
326 | + | else if ((0 > (bv + bs))) | |
327 | + | then throw((((("Attempt to take " + toString(-(bs))) + " from warehouse, but only ") + toString(bv)) + " available")) | |
328 | + | else $Tuple4((bq + 1), (aJ._2 :+ toString((bv + bs))), ((aJ._3 - bs) - bx), (aJ._4 - bz)) | |
329 | + | } | |
330 | + | } | |
331 | + | } | |
332 | + | ||
333 | + | ||
334 | + | func bB (aJ,bC) = { | |
335 | + | let bq = aJ._7 | |
336 | + | let bD = split(bC, "@") | |
337 | + | if ((size(bD) != 2)) | |
338 | + | then throw("Incorrect order format, should be amount@price") | |
339 | + | else { | |
340 | + | let bE = parseIntValue(bD[0]) | |
341 | + | let bF = parseIntValue(bD[1]) | |
342 | + | if ((0 > bF)) | |
343 | + | then throw("Price can't be negative") | |
344 | + | else { | |
345 | + | let bG = fraction(bE, bF, c) | |
346 | + | let bH = parseIntValue(aJ._8[bq]) | |
347 | + | let bv = parseIntValue(aJ._9[bq]) | |
348 | + | let bI = split(aJ._10[bq], "@") | |
349 | + | let bJ = parseIntValue(bI[0]) | |
350 | + | let bK = parseIntValue(bI[1]) | |
351 | + | if (if ((bE != 0)) | |
352 | + | then (bF != bK) | |
353 | + | else false) | |
354 | + | then throw(((((("Prices of " + M[bq]) + " don't match! WH price=") + toString(bK)) + ", your price=") + toString(bF))) | |
355 | + | else { | |
356 | + | let bL = fraction(bJ, bK, c) | |
357 | + | if ((bE == 0)) | |
358 | + | then $Tuple10((aJ._1 :+ toString(bv)), (aJ._2 :+ aJ._10[bq]), (aJ._3 :+ toString(bH)), aJ._4, aJ._5, aJ._6, (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
359 | + | else if ((bE > 0)) | |
360 | + | then if ((0 > bJ)) | |
361 | + | then if ((bE > -(bJ))) | |
362 | + | then throw(((((("Attempt to buy " + toString(bE)) + " of ") + M[bq]) + ", but warehouse only sells ") + toString(-(bJ)))) | |
363 | + | else $Tuple10((aJ._1 :+ toString(bv)), (aJ._2 :+ ((toString((bJ + bE)) + "@") + toString(bK))), (aJ._3 :+ toString((bH + bE))), (aJ._4 + bE), aJ._5, (aJ._6 + bG), (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
364 | + | else throw((("Attempt to buy " + M[bq]) + " while warehouse doesn't sell it")) | |
365 | + | else if ((bJ > 0)) | |
366 | + | then if ((-(bE) > bJ)) | |
367 | + | then throw(((((("Attempt to sell " + toString(-(bE))) + " of ") + M[bq]) + ", but warehouse only buys ") + toString(bJ))) | |
368 | + | else if ((-(bE) > bH)) | |
369 | + | then throw(((((("Attempt to sell " + toString(-(bE))) + ", but you only have ") + toString(bH)) + " of ") + M[bq])) | |
370 | + | else $Tuple10((aJ._1 :+ toString((bv - bE))), (aJ._2 :+ ((toString((bJ + bE)) + "@") + toString(bK))), (aJ._3 :+ toString((bH + bE))), (aJ._4 - bE), (aJ._5 - bG), aJ._6, (aJ._7 + 1), aJ._8, aJ._9, aJ._10) | |
371 | + | else throw((("Attempt to sell " + M[bq]) + " while warehouse doesn't buy it")) | |
372 | + | } | |
373 | + | } | |
374 | + | } | |
375 | + | } | |
376 | + | ||
377 | + | ||
378 | + | @Callable(bM) | |
379 | + | func constructorV1 (bN) = if ((bM.caller != this)) | |
293 | 380 | then throw("Permission denied") | |
294 | - | else [StringEntry(r(), | |
381 | + | else [StringEntry(r(), bN)] | |
295 | 382 | ||
296 | 383 | ||
297 | 384 | ||
298 | - | @Callable( | |
299 | - | func sellResources ( | |
300 | - | let | |
301 | - | if (( | |
385 | + | @Callable(bM) | |
386 | + | func sellResources (bO,bP) = { | |
387 | + | let bQ = bo() | |
388 | + | if ((bQ == bQ)) | |
302 | 389 | then { | |
303 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
304 | - | if ((size( | |
390 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
391 | + | if ((size(bM.payments) != 0)) | |
305 | 392 | then throw("sellResources doesn't require any payments") | |
306 | 393 | else { | |
307 | - | let | |
308 | - | if (( | |
309 | - | then throw(("Duck location type should be Factory, but is " + | |
394 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
395 | + | if ((bR[aj] != "F")) | |
396 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
310 | 397 | else { | |
311 | - | let aW = | |
312 | - | let | |
313 | - | let | |
314 | - | func | |
315 | - | then throw(((((("You have " + | |
316 | - | else if ((0 > | |
317 | - | then throw(((("You tried to sell negative amount of " + K[ | |
318 | - | else if (( | |
398 | + | let aW = bR[ak] | |
399 | + | let bS = bm(ab(ac)) | |
400 | + | let bT = split(bS[am], "_") | |
401 | + | func bU (aJ,bq) = if ((bO[bq] > parseIntValue(bT[bq]))) | |
402 | + | then throw(((((("You have " + bT[bq]) + " of ") + K[bq]) + ", but tried to sell ") + toString(bO[bq]))) | |
403 | + | else if ((0 > bO[bq])) | |
404 | + | then throw(((("You tried to sell negative amount of " + K[bq]) + ": ") + toString(bO[bq]))) | |
405 | + | else if ((bO[bq] > 0)) | |
319 | 406 | then { | |
320 | - | let | |
321 | - | $Tuple3((aJ._1 :+ | |
407 | + | let bV = aV(aW, bq, bO[bq], bP[bq]) | |
408 | + | $Tuple3((aJ._1 :+ bV._1), (aJ._2 :+ toString((parseIntValue(bT[bq]) - bO[bq]))), (aJ._3 + bV._2)) | |
322 | 409 | } | |
323 | - | else $Tuple3(aJ._1, (aJ._2 :+ | |
410 | + | else $Tuple3(aJ._1, (aJ._2 :+ bT[bq]), aJ._3) | |
324 | 411 | ||
325 | - | let | |
412 | + | let bW = { | |
326 | 413 | let aL = [0, 1, 2, 3, 4, 5] | |
327 | 414 | let aM = size(aL) | |
328 | 415 | let aN = $Tuple3(nil, nil, 0) | |
329 | 416 | func aO (aP,aQ) = if ((aQ >= aM)) | |
330 | 417 | then aP | |
331 | - | else | |
418 | + | else bU(aP, aL[aQ]) | |
332 | 419 | ||
333 | 420 | func aR (aP,aQ) = if ((aQ >= aM)) | |
334 | 421 | then aP | |
335 | 422 | else throw("List size exceeds 6") | |
336 | 423 | ||
337 | 424 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
338 | 425 | } | |
339 | - | let | |
340 | - | let | |
341 | - | $Tuple2(( | |
426 | + | let bX = makeString([bS[al], makeString(bW._2, "_"), bS[an], bS[ao]], ":") | |
427 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
428 | + | $Tuple2((bW._1 :+ ScriptTransfer(bM.caller, bW._3, f)), bY) | |
342 | 429 | } | |
343 | 430 | } | |
344 | 431 | } | |
345 | 432 | else throw("Strict value is not equal to itself.") | |
346 | 433 | } | |
347 | 434 | ||
348 | 435 | ||
349 | 436 | ||
350 | - | @Callable( | |
351 | - | func buyMaterials ( | |
352 | - | let | |
353 | - | if (( | |
437 | + | @Callable(bM) | |
438 | + | func buyMaterials (bO,bZ) = { | |
439 | + | let bQ = bo() | |
440 | + | if ((bQ == bQ)) | |
354 | 441 | then { | |
355 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
356 | - | if ((size( | |
442 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
443 | + | if ((size(bM.payments) != 1)) | |
357 | 444 | then throw("exactly 1 payment must be attached") | |
358 | 445 | else { | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | if (( | |
446 | + | let ca = bM.payments[0] | |
447 | + | let cb = ca.amount | |
448 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
449 | + | if ((cc != f)) | |
363 | 450 | then throw("USDN payments only!") | |
364 | 451 | else { | |
365 | - | let | |
366 | - | if (( | |
367 | - | then throw(("Duck location type should be Factory, but is " + | |
452 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
453 | + | if ((bR[aj] != "F")) | |
454 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
368 | 455 | else { | |
369 | - | let aW = | |
370 | - | let | |
371 | - | let | |
372 | - | func | |
373 | - | then throw(((("You tried to buy negative amount of " + L[ | |
374 | - | else if (( | |
456 | + | let aW = bR[ak] | |
457 | + | let bS = bm(ab(ac)) | |
458 | + | let cd = split(bS[an], "_") | |
459 | + | func ce (aJ,bq) = if ((0 > bO[bq])) | |
460 | + | then throw(((("You tried to buy negative amount of " + L[bq]) + ": ") + toString(bO[bq]))) | |
461 | + | else if ((bO[bq] > 0)) | |
375 | 462 | then { | |
376 | - | let | |
377 | - | $Tuple3((aJ._1 :+ | |
463 | + | let bV = be(aW, bq, bO[bq], bZ[bq]) | |
464 | + | $Tuple3((aJ._1 :+ bV._1), (aJ._2 :+ toString((parseIntValue(cd[bq]) + bV._3))), (aJ._3 + bV._2)) | |
378 | 465 | } | |
379 | - | else $Tuple3(aJ._1, (aJ._2 :+ | |
466 | + | else $Tuple3(aJ._1, (aJ._2 :+ cd[bq]), aJ._3) | |
380 | 467 | ||
381 | - | let | |
468 | + | let bW = { | |
382 | 469 | let aL = [0, 1, 2, 3, 4, 5] | |
383 | 470 | let aM = size(aL) | |
384 | 471 | let aN = $Tuple3(nil, nil, 0) | |
385 | 472 | func aO (aP,aQ) = if ((aQ >= aM)) | |
386 | 473 | then aP | |
387 | - | else | |
474 | + | else ce(aP, aL[aQ]) | |
388 | 475 | ||
389 | 476 | func aR (aP,aQ) = if ((aQ >= aM)) | |
390 | 477 | then aP | |
391 | 478 | else throw("List size exceeds 6") | |
392 | 479 | ||
393 | 480 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
394 | 481 | } | |
395 | - | if (( | |
396 | - | then throw(((("Insufficient payment! Attached=" + toString( | |
482 | + | if ((bW._3 > cb)) | |
483 | + | then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3))) | |
397 | 484 | else { | |
398 | - | let | |
399 | - | let | |
400 | - | let t = if ((( | |
401 | - | then [ScriptTransfer( | |
485 | + | let bX = makeString([bS[al], bS[am], makeString(bW._2, "_"), bS[ao]], ":") | |
486 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
487 | + | let t = if (((cb - bW._3) > 0)) | |
488 | + | then [ScriptTransfer(bM.caller, (cb - bW._3), f)] | |
402 | 489 | else nil | |
403 | - | $Tuple2(( | |
490 | + | $Tuple2((bW._1 ++ t), bY) | |
404 | 491 | } | |
405 | 492 | } | |
406 | 493 | } | |
407 | 494 | } | |
408 | 495 | } | |
409 | 496 | else throw("Strict value is not equal to itself.") | |
410 | 497 | } | |
411 | 498 | ||
412 | 499 | ||
413 | 500 | ||
414 | - | @Callable( | |
415 | - | func exchangeResources ( | |
416 | - | let | |
417 | - | if (( | |
501 | + | @Callable(bM) | |
502 | + | func exchangeResources (bO) = { | |
503 | + | let bQ = bo() | |
504 | + | if ((bQ == bQ)) | |
418 | 505 | then { | |
419 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
420 | - | if ((size( | |
506 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
507 | + | if ((size(bM.payments) != 1)) | |
421 | 508 | then throw("exactly 1 payment must be attached") | |
422 | 509 | else { | |
423 | - | let | |
424 | - | let | |
425 | - | let | |
426 | - | if (( | |
510 | + | let ca = bM.payments[0] | |
511 | + | let cb = ca.amount | |
512 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
513 | + | if ((cc != f)) | |
427 | 514 | then throw("USDN payments only!") | |
428 | 515 | else { | |
429 | - | let | |
430 | - | if (( | |
431 | - | then throw(("Duck location type should be Factory, but is " + | |
516 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
517 | + | if ((bR[aj] != "F")) | |
518 | + | then throw(("Duck location type should be Factory, but is " + bR[aj])) | |
432 | 519 | else { | |
433 | - | let aW = | |
434 | - | let | |
435 | - | let | |
436 | - | let | |
437 | - | func | |
438 | - | let aZ = U(aW, | |
520 | + | let aW = bR[ak] | |
521 | + | let bS = bm(ab(ac)) | |
522 | + | let bT = split(bS[am], "_") | |
523 | + | let cd = split(bS[an], "_") | |
524 | + | func cf (aJ,bq) = { | |
525 | + | let aZ = U(aW, bq) | |
439 | 526 | let ba = valueOrElse(getInteger(aZ), 0) | |
440 | - | let | |
441 | - | if (( | |
442 | - | then throw(((((("You have " + | |
443 | - | else if ((0 > | |
444 | - | then throw(((("You tried to exchange negative amount of " + K[ | |
445 | - | else if (( | |
446 | - | then $Tuple4((aJ._1 :+ toString((parseIntValue( | |
447 | - | else $Tuple4((aJ._1 :+ | |
527 | + | let cg = bO[bq] | |
528 | + | if ((cg > parseIntValue(bT[bq]))) | |
529 | + | then throw(((((("You have " + bT[bq]) + " of ") + K[bq]) + ", but tried to exchange ") + toString(cg))) | |
530 | + | else if ((0 > cg)) | |
531 | + | then throw(((("You tried to exchange negative amount of " + K[bq]) + ": ") + toString(cg))) | |
532 | + | else if ((cg > 0)) | |
533 | + | then $Tuple4((aJ._1 :+ toString((parseIntValue(bT[bq]) - cg))), (aJ._2 :+ toString((parseIntValue(cd[bq]) + cg))), (aJ._3 + fraction(cg, C, c)), (aJ._4 :+ IntegerEntry(aZ, ba))) | |
534 | + | else $Tuple4((aJ._1 :+ bT[bq]), (aJ._2 :+ cd[bq]), aJ._3, aJ._4) | |
448 | 535 | } | |
449 | 536 | ||
450 | - | let | |
537 | + | let bW = { | |
451 | 538 | let aL = [0, 1, 2, 3, 4, 5] | |
452 | 539 | let aM = size(aL) | |
453 | 540 | let aN = $Tuple4(nil, nil, 0, nil) | |
454 | 541 | func aO (aP,aQ) = if ((aQ >= aM)) | |
455 | 542 | then aP | |
456 | - | else | |
543 | + | else cf(aP, aL[aQ]) | |
457 | 544 | ||
458 | 545 | func aR (aP,aQ) = if ((aQ >= aM)) | |
459 | 546 | then aP | |
460 | 547 | else throw("List size exceeds 6") | |
461 | 548 | ||
462 | 549 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
463 | 550 | } | |
464 | - | if (( | |
465 | - | then throw(((("Insufficient payment! Attached=" + toString( | |
551 | + | if ((bW._3 > cb)) | |
552 | + | then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3))) | |
466 | 553 | else { | |
467 | - | let | |
468 | - | let | |
469 | - | let t = if ((( | |
470 | - | then [ScriptTransfer( | |
554 | + | let bX = makeString([bS[al], makeString(bW._1, "_"), makeString(bW._2, "_"), bS[ao]], ":") | |
555 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
556 | + | let t = if (((cb - bW._3) > 0)) | |
557 | + | then [ScriptTransfer(bM.caller, (cb - bW._3), f)] | |
471 | 558 | else nil | |
472 | - | $Tuple2((t ++ | |
559 | + | $Tuple2((t ++ bW._4), bY) | |
473 | 560 | } | |
474 | 561 | } | |
475 | 562 | } | |
476 | 563 | } | |
477 | 564 | } | |
478 | 565 | else throw("Strict value is not equal to itself.") | |
479 | 566 | } | |
480 | 567 | ||
481 | 568 | ||
482 | 569 | ||
483 | - | @Callable( | |
484 | - | func buyGoods ( | |
485 | - | let | |
486 | - | if (( | |
487 | - | then if ((size( | |
570 | + | @Callable(bM) | |
571 | + | func buyGoods (ch,ci,cj) = { | |
572 | + | let bQ = bo() | |
573 | + | if ((bQ == bQ)) | |
574 | + | then if ((size(bM.payments) != 0)) | |
488 | 575 | then throw("buyGoods doesn't require any payments") | |
489 | - | else if ((0 > | |
576 | + | else if ((0 > cj)) | |
490 | 577 | then throw("Quantity should be positive") | |
491 | 578 | else { | |
492 | - | let ac = valueOrErrorMessage(getString(y, Z(toString( | |
493 | - | let | |
494 | - | if (( | |
495 | - | then throw(("Duck location type should be Manufactory, but is " + | |
579 | + | let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked") | |
580 | + | let bR = split(valueOrElse(getString(y, ad(ac)), z), "_") | |
581 | + | if ((bR[aj] != "M")) | |
582 | + | then throw(("Duck location type should be Manufactory, but is " + bR[aj])) | |
496 | 583 | else { | |
497 | - | let | |
498 | - | let | |
499 | - | let | |
500 | - | if (if ((0 > | |
584 | + | let ck = bR[ai] | |
585 | + | let bS = bm(ab(ac)) | |
586 | + | let cd = split(bS[an], "_") | |
587 | + | if (if ((0 > ch)) | |
501 | 588 | then true | |
502 | - | else ( | |
503 | - | then throw(("Unknown product idx=" + toString( | |
589 | + | else (ch >= size(O))) | |
590 | + | then throw(("Unknown product idx=" + toString(ch))) | |
504 | 591 | else { | |
505 | - | let | |
506 | - | if ((N[ | |
507 | - | then throw(((("This product is available in " + N[ | |
592 | + | let cl = (ch % size(N)) | |
593 | + | if ((N[cl] != ck)) | |
594 | + | then throw(((("This product is available in " + N[cl]) + ", but you are in ") + ck)) | |
508 | 595 | else { | |
509 | - | let | |
510 | - | if ((size( | |
511 | - | then throw(("Fatal: unknown recipe: " + O[ | |
596 | + | let cm = split(O[ch], "_") | |
597 | + | if ((size(cm) != (A + 2))) | |
598 | + | then throw(("Fatal: unknown recipe: " + O[ch])) | |
512 | 599 | else { | |
513 | - | let | |
600 | + | let cn = if ((bS[ao] == "")) | |
514 | 601 | then nil | |
515 | - | else split( | |
516 | - | func | |
517 | - | let | |
518 | - | let | |
519 | - | then split( | |
602 | + | else split(bS[ao], "_") | |
603 | + | func co (aJ,cp) = { | |
604 | + | let cq = aJ._2 | |
605 | + | let cr = if ((size(cn) > cq)) | |
606 | + | then split(cn[cq], ",") | |
520 | 607 | else ["0", "0", "0"] | |
521 | - | let | |
522 | - | let | |
523 | - | let | |
524 | - | let | |
525 | - | let | |
526 | - | let | |
527 | - | let aX = ( | |
528 | - | let | |
608 | + | let cs = cr[0] | |
609 | + | let ct = parseIntValue(cs) | |
610 | + | let cu = cr[1] | |
611 | + | let cv = parseIntValue(cu) | |
612 | + | let cw = cr[2] | |
613 | + | let cx = parseIntValue(cw) | |
614 | + | let aX = (cj * parseIntValue(cm[7])) | |
615 | + | let cy = if ((cq == ch)) | |
529 | 616 | then { | |
530 | - | let g = | |
617 | + | let g = ci | |
531 | 618 | if ((1 == g)) | |
532 | - | then ((((toString(( | |
619 | + | then ((((toString((ct + aX)) + ",") + cu) + ",") + cw) | |
533 | 620 | else if ((2 == g)) | |
534 | - | then (((( | |
621 | + | then ((((cs + ",") + toString((cv + aX))) + ",") + cw) | |
535 | 622 | else if ((3 == g)) | |
536 | - | then (((( | |
537 | - | else throw(("Product level should be 1..3, not " + toString( | |
623 | + | then ((((cs + ",") + cu) + ",") + toString((cx + aX))) | |
624 | + | else throw(("Product level should be 1..3, not " + toString(ci))) | |
538 | 625 | } | |
539 | - | else (((( | |
540 | - | $Tuple2((aJ._1 :+ | |
626 | + | else ((((cs + ",") + cu) + ",") + cw) | |
627 | + | $Tuple2((aJ._1 :+ cy), (cq + 1)) | |
541 | 628 | } | |
542 | 629 | ||
543 | - | let | |
630 | + | let cz = ( let aL = O | |
544 | 631 | let aM = size(aL) | |
545 | 632 | let aN = $Tuple2(nil, 0) | |
546 | 633 | func aO (aP,aQ) = if ((aQ >= aM)) | |
547 | 634 | then aP | |
548 | - | else | |
635 | + | else co(aP, aL[aQ]) | |
549 | 636 | ||
550 | 637 | func aR (aP,aQ) = if ((aQ >= aM)) | |
551 | 638 | then aP | |
552 | 639 | else throw("List size exceeds 50") | |
553 | 640 | ||
554 | 641 | aR(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50))._1 | |
555 | - | func | |
556 | - | let | |
557 | - | let | |
558 | - | if (( | |
559 | - | then throw(((((((("You have " + | |
560 | - | else if (( | |
561 | - | then (aJ :+ toString(( | |
562 | - | else (aJ :+ | |
642 | + | func cA (aJ,bq) = { | |
643 | + | let cB = (parseIntValue(cm[bq]) * cj) | |
644 | + | let cC = parseIntValue(cd[bq]) | |
645 | + | if ((cB > cC)) | |
646 | + | then throw(((((((("You have " + cd[bq]) + " of ") + L[bq]) + ", but recipe requires ") + toString(cB)) + " for quantity ") + toString(cj))) | |
647 | + | else if ((cB > 0)) | |
648 | + | then (aJ :+ toString((cC - cB))) | |
649 | + | else (aJ :+ cd[bq]) | |
563 | 650 | } | |
564 | 651 | ||
565 | - | let | |
652 | + | let bW = { | |
566 | 653 | let aL = [0, 1, 2, 3, 4, 5] | |
567 | 654 | let aM = size(aL) | |
568 | 655 | let aN = nil | |
569 | - | func | |
656 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
570 | 657 | then aP | |
571 | - | else | |
658 | + | else cA(aP, aL[aQ]) | |
572 | 659 | ||
573 | - | func | |
660 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
574 | 661 | then aP | |
575 | 662 | else throw("List size exceeds 6") | |
576 | 663 | ||
577 | - | | |
664 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
578 | 665 | } | |
579 | - | let | |
580 | - | let | |
581 | - | $Tuple2(nil, | |
666 | + | let bX = makeString([bS[al], bS[am], makeString(bW, "_"), makeString(cz, "_")], ":") | |
667 | + | let bY = ax(invoke(y, "updateBackpack", [ac, bX], nil)) | |
668 | + | $Tuple2(nil, bY) | |
582 | 669 | } | |
583 | 670 | } | |
584 | 671 | } | |
585 | 672 | } | |
586 | 673 | } | |
587 | 674 | else throw("Strict value is not equal to itself.") | |
588 | 675 | } | |
589 | 676 | ||
590 | 677 | ||
591 | 678 | ||
592 | - | @Callable( | |
593 | - | func acceptServicePayment ( | |
594 | - | let | |
595 | - | if (( | |
596 | - | then if ((size( | |
679 | + | @Callable(bM) | |
680 | + | func acceptServicePayment (cF) = { | |
681 | + | let bQ = bo() | |
682 | + | if ((bQ == bQ)) | |
683 | + | then if ((size(bM.payments) != 1)) | |
597 | 684 | then throw("exactly 1 payment must be attached") | |
598 | 685 | else { | |
599 | - | let | |
600 | - | let | |
601 | - | let | |
602 | - | if (( | |
686 | + | let ca = bM.payments[0] | |
687 | + | let cb = ca.amount | |
688 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
689 | + | if ((cc != f)) | |
603 | 690 | then throw("USDN payments only!") | |
604 | 691 | else { | |
605 | - | let | |
606 | - | let g = | |
692 | + | let cG = { | |
693 | + | let g = cF | |
607 | 694 | if (("LAND_RENAME" == g)) | |
608 | 695 | then 10000000 | |
609 | 696 | else throw("Unknown service!") | |
610 | 697 | } | |
611 | - | if (( | |
612 | - | then throw(((( | |
613 | - | else $Tuple2(nil, | |
698 | + | if ((cb != cG)) | |
699 | + | then throw((((cF + " costs ") + toString(cG)) + " USDN")) | |
700 | + | else $Tuple2(nil, cb) | |
614 | 701 | } | |
615 | 702 | } | |
616 | 703 | else throw("Strict value is not equal to itself.") | |
617 | 704 | } | |
618 | 705 | ||
619 | 706 | ||
620 | 707 | ||
621 | - | @Callable( | |
622 | - | func setWarehouseOrder ( | |
623 | - | let | |
624 | - | let | |
625 | - | let | |
708 | + | @Callable(bM) | |
709 | + | func setWarehouseOrder (cH,Y) = { | |
710 | + | let cI = bM.originCaller | |
711 | + | let cJ = toString(cI) | |
712 | + | let cK = value(assetInfo(fromBase58String(Y))) | |
626 | 713 | if (!(isDefined(getInteger(y, ah(Y))))) | |
627 | - | then throw((("NFT " + | |
714 | + | then throw((("NFT " + cK.name) + " is not staked")) | |
628 | 715 | else { | |
629 | - | let | |
630 | - | if (( | |
716 | + | let cL = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + cK.name) + " is orphaned")) | |
717 | + | if ((cL != cJ)) | |
631 | 718 | then throw((G + " is not yours")) | |
632 | 719 | else { | |
633 | - | let | |
634 | - | if ((size( | |
720 | + | let cM = split_4C(cH, ":") | |
721 | + | if ((size(cM) != 3)) | |
635 | 722 | then throw("cargoListStr should contain exactly 2 ':' separators") | |
636 | 723 | else { | |
637 | - | let | |
638 | - | let | |
639 | - | let | |
724 | + | let cN = split(cM[0], "_") | |
725 | + | let cO = split(cM[1], "_") | |
726 | + | let cP = if ((cM[2] == "")) | |
640 | 727 | then nil | |
641 | - | else split( | |
642 | - | if ((size( | |
728 | + | else split(cM[2], "_") | |
729 | + | if ((size(cN) != A)) | |
643 | 730 | then throw("All 6 resources should be passed") | |
644 | - | else if ((size( | |
731 | + | else if ((size(cO) != A)) | |
645 | 732 | then throw("All 6 materials should be passed") | |
646 | 733 | else { | |
647 | - | let | |
648 | - | let aH = split_4C( | |
649 | - | let | |
650 | - | let | |
651 | - | let | |
734 | + | let cQ = ax(invoke(y, "getWarehouseREADONLY", [Y], nil)) | |
735 | + | let aH = split_4C(cQ, ":") | |
736 | + | let cR = split(aH[aq], "_") | |
737 | + | let cS = split(aH[ar], "_") | |
738 | + | let cT = if ((aH[as] == "")) | |
652 | 739 | then nil | |
653 | 740 | else split(aH[as], "_") | |
654 | - | let | |
655 | - | let | |
656 | - | let | |
657 | - | let | |
658 | - | let | |
741 | + | let cU = aG(aH) | |
742 | + | let cV = aS(aH) | |
743 | + | let cW = aT(aH) | |
744 | + | let cX = parseIntValue(aH[at]) | |
745 | + | let cY = ((((aD(aH[ap]) - cU) - cV) - cW) - cX) | |
659 | 746 | let aB = X(Y) | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
747 | + | let cZ = aA(aB) | |
748 | + | let da = split(cZ[au], "_") | |
749 | + | let db = split(cZ[av], "_") | |
750 | + | let dc = if ((cZ[aw] == "")) | |
664 | 751 | then nil | |
665 | - | else split(cD[aw], "_") | |
666 | - | let cH = 0 | |
667 | - | func cI (aJ,aK) = { | |
668 | - | let by = aJ._1 | |
669 | - | let cJ = split(aK, "@") | |
670 | - | if ((size(cJ) != 2)) | |
671 | - | then throw("Incorrect order format, should be amount@price") | |
672 | - | else { | |
673 | - | let cK = parseIntValue(cJ[0]) | |
674 | - | let cL = parseIntValue(cJ[1]) | |
675 | - | let cM = fraction(cK, cL, c) | |
676 | - | let cN = parseIntValue(cv[by]) | |
677 | - | let cO = split(cE[by], "@") | |
678 | - | let cP = parseIntValue(cO[0]) | |
679 | - | let cQ = parseIntValue(cO[1]) | |
680 | - | if ((0 > cQ)) | |
681 | - | then throw("Price can't be negative") | |
682 | - | else { | |
683 | - | let cR = fraction(cP, cQ, c) | |
684 | - | if ((cK == 0)) | |
685 | - | then if ((cP > 0)) | |
686 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cN)), (aJ._3 - cP), (aJ._4 - cR)) | |
687 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN - cP))), (aJ._3 + cP), aJ._4) | |
688 | - | else if ((cK > 0)) | |
689 | - | then if ((0 > cP)) | |
690 | - | then { | |
691 | - | let cS = (cK + cP) | |
692 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cN - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
693 | - | } | |
694 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cN)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
695 | - | else if ((0 > cP)) | |
696 | - | then { | |
697 | - | let cS = (cP - cK) | |
698 | - | if ((0 > (cN - cS))) | |
699 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cN)) + " available")) | |
700 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN - cS))), (aJ._3 + cS), aJ._4) | |
701 | - | } | |
702 | - | else if ((0 > (cN + cK))) | |
703 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cN)) + " available")) | |
704 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cN + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
705 | - | } | |
706 | - | } | |
707 | - | } | |
708 | - | ||
709 | - | let cT = { | |
710 | - | let aL = cr | |
752 | + | else split(cZ[aw], "_") | |
753 | + | let dd = 0 | |
754 | + | let de = { | |
755 | + | let aL = cN | |
711 | 756 | let aM = size(aL) | |
712 | - | let aN = $ | |
757 | + | let aN = $Tuple6(0, nil, 0, 0, cR, da) | |
713 | 758 | func aO (aP,aQ) = if ((aQ >= aM)) | |
714 | 759 | then aP | |
715 | - | else | |
760 | + | else bp(aP, aL[aQ]) | |
716 | 761 | ||
717 | 762 | func aR (aP,aQ) = if ((aQ >= aM)) | |
718 | 763 | then aP | |
719 | 764 | else throw("List size exceeds 6") | |
720 | 765 | ||
721 | 766 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
722 | 767 | } | |
723 | - | func cU (aJ,aK) = { | |
724 | - | let by = aJ._1 | |
725 | - | let cJ = split(aK, "@") | |
726 | - | if ((size(cJ) != 2)) | |
727 | - | then throw("Incorrect order format, should be amount@price") | |
728 | - | else { | |
729 | - | let cK = parseIntValue(cJ[0]) | |
730 | - | let cL = parseIntValue(cJ[1]) | |
731 | - | let cM = fraction(cK, cL, c) | |
732 | - | let cV = parseIntValue(cw[by]) | |
733 | - | let cO = split(cF[by], "@") | |
734 | - | let cP = parseIntValue(cO[0]) | |
735 | - | let cQ = parseIntValue(cO[1]) | |
736 | - | if ((0 > cQ)) | |
737 | - | then throw("Price can't be negative") | |
738 | - | else { | |
739 | - | let cR = fraction(cP, cQ, c) | |
740 | - | if ((cK == 0)) | |
741 | - | then if ((cP > 0)) | |
742 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cV)), (aJ._3 - cP), (aJ._4 - cR)) | |
743 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV - cP))), (aJ._3 + cP), aJ._4) | |
744 | - | else if ((cK > 0)) | |
745 | - | then if ((0 > cP)) | |
746 | - | then { | |
747 | - | let cS = (cK + cP) | |
748 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cV - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
749 | - | } | |
750 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cV)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
751 | - | else if ((0 > cP)) | |
752 | - | then { | |
753 | - | let cS = (cP - cK) | |
754 | - | if ((0 > (cV - cS))) | |
755 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cV)) + " available")) | |
756 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV - cS))), (aJ._3 + cS), aJ._4) | |
757 | - | } | |
758 | - | else if ((0 > (cV + cK))) | |
759 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cV)) + " available")) | |
760 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cV + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
761 | - | } | |
762 | - | } | |
763 | - | } | |
768 | + | let bj = { | |
769 | + | let aL = cO | |
770 | + | let aM = size(aL) | |
771 | + | let aN = $Tuple6(0, nil, de._3, de._4, cS, db) | |
772 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
773 | + | then aP | |
774 | + | else bp(aP, aL[aQ]) | |
764 | 775 | ||
765 | - | let bj = { | |
766 | - | let aL = cs | |
767 | - | let aM = size(aL) | |
768 | - | let aN = $Tuple4(0, nil, cT._3, cT._4) | |
769 | - | func ch (aP,aQ) = if ((aQ >= aM)) | |
770 | - | then aP | |
771 | - | else cU(aP, aL[aQ]) | |
772 | - | ||
773 | - | func ci (aP,aQ) = if ((aQ >= aM)) | |
776 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
774 | 777 | then aP | |
775 | 778 | else throw("List size exceeds 6") | |
776 | 779 | ||
777 | - | | |
780 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
778 | 781 | } | |
779 | - | func cW (aJ,aK) = { | |
780 | - | let by = aJ._1 | |
781 | - | let cJ = split(aK, "@") | |
782 | - | if ((size(cJ) != 2)) | |
783 | - | then throw("Incorrect order format, should be amount@price") | |
784 | - | else { | |
785 | - | let cK = parseIntValue(cJ[0]) | |
786 | - | let cL = parseIntValue(cJ[1]) | |
787 | - | let cM = fraction(cK, cL, c) | |
788 | - | let cX = parseIntValue(cx[by]) | |
789 | - | let cO = split(cG[by], "@") | |
790 | - | let cP = parseIntValue(cO[0]) | |
791 | - | let cQ = parseIntValue(cO[1]) | |
792 | - | if ((0 > cQ)) | |
793 | - | then throw("Price can't be negative") | |
794 | - | else { | |
795 | - | let cR = fraction(cP, cQ, c) | |
796 | - | if ((cK == 0)) | |
797 | - | then if ((cP > 0)) | |
798 | - | then $Tuple4((by + 1), (aJ._2 :+ toString(cX)), (aJ._3 - cP), (aJ._4 - cR)) | |
799 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX - cP))), (aJ._3 + cP), aJ._4) | |
800 | - | else if ((cK > 0)) | |
801 | - | then if ((0 > cP)) | |
802 | - | then { | |
803 | - | let cS = (cK + cP) | |
804 | - | $Tuple4((by + 1), (aJ._2 :+ toString((cX - cP))), (aJ._3 + cS), (aJ._4 + cM)) | |
805 | - | } | |
806 | - | else $Tuple4((by + 1), (aJ._2 :+ toString(cX)), ((aJ._3 + cK) - cP), ((aJ._4 + cM) - cR)) | |
807 | - | else if ((0 > cP)) | |
808 | - | then { | |
809 | - | let cS = (cP - cK) | |
810 | - | if ((0 > (cX - cS))) | |
811 | - | then throw((((("Attempt to take " + toString(cS)) + " from warehouse, but only ") + toString(cX)) + " available")) | |
812 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX - cS))), (aJ._3 + cS), aJ._3) | |
813 | - | } | |
814 | - | else if ((0 > (cX + cK))) | |
815 | - | then throw((((("Attempt to take " + toString(-(cK))) + " from warehouse, but only ") + toString(cX)) + " available")) | |
816 | - | else $Tuple4((by + 1), (aJ._2 :+ toString((cX + cK))), ((aJ._3 - cK) - cP), (aJ._4 - cR)) | |
817 | - | } | |
818 | - | } | |
819 | - | } | |
782 | + | let aC = { | |
783 | + | let aL = cP | |
784 | + | let aM = size(aL) | |
785 | + | let aN = $Tuple6(0, nil, bj._3, bj._4, cT, dc) | |
786 | + | func df (aP,aQ) = if ((aQ >= aM)) | |
787 | + | then aP | |
788 | + | else bp(aP, aL[aQ]) | |
820 | 789 | ||
821 | - | let aC = { | |
822 | - | let aL = ct | |
823 | - | let aM = size(aL) | |
824 | - | let aN = $Tuple4(0, nil, bj._3, bj._4) | |
825 | - | func cY (aP,aQ) = if ((aQ >= aM)) | |
826 | - | then aP | |
827 | - | else cW(aP, aL[aQ]) | |
828 | - | ||
829 | - | func cZ (aP,aQ) = if ((aQ >= aM)) | |
790 | + | func dg (aP,aQ) = if ((aQ >= aM)) | |
830 | 791 | then aP | |
831 | 792 | else throw("List size exceeds 50") | |
832 | 793 | ||
833 | - | | |
794 | + | dg(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
834 | 795 | } | |
835 | - | let | |
836 | - | if (( | |
837 | - | then throw((((("Attempt to reserve " + toString( | |
796 | + | let dh = aC._3 | |
797 | + | if ((dh > cY)) | |
798 | + | then throw((((("Attempt to reserve " + toString(dh)) + " space, but only ") + toString(cY)) + " warehouse space left")) | |
838 | 799 | else { | |
839 | - | let | |
840 | - | let | |
841 | - | if (( | |
800 | + | let di = makeString_2C([aH[ap], makeString(de._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_"), toString(dh)], ":") | |
801 | + | let dj = invoke(y, "saveWarehouse", [di, Y], nil) | |
802 | + | if ((dj == dj)) | |
842 | 803 | then { | |
843 | - | let | |
844 | - | if (( | |
845 | - | then if ((size( | |
804 | + | let dk = aC._4 | |
805 | + | if ((dk > 0)) | |
806 | + | then if ((size(bM.payments) != 1)) | |
846 | 807 | then throw("exactly 1 payment must be attached") | |
847 | 808 | else { | |
848 | - | let | |
849 | - | let | |
850 | - | let | |
851 | - | if (( | |
809 | + | let ca = bM.payments[0] | |
810 | + | let cb = ca.amount | |
811 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
812 | + | if ((cc != f)) | |
852 | 813 | then throw("USDN payments only!") | |
853 | - | else if (( | |
854 | - | then throw(("Payment needed is " + toString( | |
855 | - | else [StringEntry(aB, | |
814 | + | else if ((cb != dk)) | |
815 | + | then throw(("Payment needed is " + toString(dk))) | |
816 | + | else [StringEntry(aB, cH)] | |
856 | 817 | } | |
857 | - | else if (( | |
858 | - | then if ((size( | |
818 | + | else if ((dk == 0)) | |
819 | + | then if ((size(bM.payments) != 0)) | |
859 | 820 | then throw("No payments needed") | |
860 | - | else [StringEntry(aB, | |
861 | - | else if ((size( | |
821 | + | else [StringEntry(aB, cH)] | |
822 | + | else if ((size(bM.payments) != 0)) | |
862 | 823 | then throw("No payments needed") | |
863 | - | else [ScriptTransfer( | |
824 | + | else [ScriptTransfer(cI, -(dk), f), StringEntry(aB, cH)] | |
864 | 825 | } | |
865 | 826 | else throw("Strict value is not equal to itself.") | |
866 | 827 | } | |
867 | 828 | } | |
868 | 829 | } | |
869 | 830 | } | |
870 | 831 | } | |
871 | 832 | } | |
872 | 833 | ||
873 | 834 | ||
874 | 835 | ||
875 | - | @Callable( | |
876 | - | func acceptWarehouseOrder ( | |
877 | - | let | |
878 | - | let | |
879 | - | let | |
880 | - | let | |
881 | - | let | |
882 | - | if (( | |
883 | - | then throw((("Duck location type is " + | |
884 | - | else if (( | |
885 | - | then throw(((("Your staked duck is " + | |
836 | + | @Callable(bM) | |
837 | + | func acceptWarehouseOrder (dl,Y,ac) = { | |
838 | + | let dm = bM.originCaller | |
839 | + | let dn = toString(dm) | |
840 | + | let do = valueOrErrorMessage(getString(y, Z(dn)), "You don't have a duck staked") | |
841 | + | let bR = valueOrElse(getString(y, ad(do)), z) | |
842 | + | let dp = split(value(bR), "_") | |
843 | + | if ((dp[aj] != "L")) | |
844 | + | then throw((("Duck location type is " + dp[aj]) + ", but should be L")) | |
845 | + | else if ((do != ac)) | |
846 | + | then throw(((("Your staked duck is " + do) + ", but passed ") + ac)) | |
886 | 847 | else { | |
887 | - | let | |
848 | + | let dq = value(assetInfo(fromBase58String(Y))) | |
888 | 849 | if (!(isDefined(getInteger(y, ah(Y))))) | |
889 | - | then throw((("NFT " + | |
850 | + | then throw((("NFT " + dq.name) + " is not staked")) | |
890 | 851 | else { | |
891 | - | let | |
892 | - | if (( | |
852 | + | let dr = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dq.name) + " is orphaned")) | |
853 | + | if ((dr == dn)) | |
893 | 854 | then throw("You cannot trade with yourself") | |
894 | 855 | else { | |
895 | - | let | |
896 | - | if ((size( | |
856 | + | let ds = split_4C(dl, ":") | |
857 | + | if ((size(ds) != 3)) | |
897 | 858 | then throw("bpOrderStr should contain exactly 2 ':' separators") | |
898 | 859 | else { | |
899 | - | let | |
900 | - | let | |
901 | - | let | |
860 | + | let dt = split(ds[0], "_") | |
861 | + | let du = split(ds[1], "_") | |
862 | + | let dv = if ((ds[2] == "")) | |
902 | 863 | then nil | |
903 | - | else split( | |
904 | - | if ((size( | |
864 | + | else split(ds[2], "_") | |
865 | + | if ((size(dt) != A)) | |
905 | 866 | then throw("All 6 resources should be passed") | |
906 | - | else if ((size( | |
867 | + | else if ((size(du) != A)) | |
907 | 868 | then throw("All 6 materials should be passed") | |
908 | 869 | else { | |
909 | - | let | |
910 | - | let aH = split_4C( | |
911 | - | let | |
912 | - | let | |
913 | - | let | |
870 | + | let cQ = ax(invoke(y, "getWarehouseREADONLY", [Y], nil)) | |
871 | + | let aH = split_4C(cQ, ":") | |
872 | + | let cR = split(aH[aq], "_") | |
873 | + | let cS = split(aH[ar], "_") | |
874 | + | let cT = if ((aH[as] == "")) | |
914 | 875 | then nil | |
915 | 876 | else split(aH[as], "_") | |
916 | - | let | |
917 | - | let | |
918 | - | let | |
919 | - | let | |
920 | - | let | |
877 | + | let cU = aG(aH) | |
878 | + | let cV = aS(aH) | |
879 | + | let cW = aT(aH) | |
880 | + | let cX = parseIntValue(aH[at]) | |
881 | + | let cY = ((((aD(aH[ap]) - cU) - cV) - cW) - cX) | |
921 | 882 | let bn = ab(ac) | |
922 | - | let | |
923 | - | let | |
924 | - | let | |
925 | - | let | |
883 | + | let bS = bm(bn) | |
884 | + | let dw = split(bS[am], "_") | |
885 | + | let dx = split(bS[an], "_") | |
886 | + | let dy = if ((bS[ao] == "")) | |
926 | 887 | then nil | |
927 | - | else split( | |
888 | + | else split(bS[ao], "_") | |
928 | 889 | let aB = X(Y) | |
929 | - | let | |
930 | - | let | |
931 | - | let | |
932 | - | let | |
890 | + | let dz = aA(aB) | |
891 | + | let dA = split(dz[au], "_") | |
892 | + | let dB = split(dz[av], "_") | |
893 | + | let dC = if ((dz[aw] == "")) | |
933 | 894 | then nil | |
934 | - | else split(ds[aw], "_") | |
935 | - | let cH = 0 | |
936 | - | func cI (aJ,by) = { | |
937 | - | let dw = split(dm[by], "@") | |
938 | - | if ((size(dw) != 2)) | |
939 | - | then throw("Incorrect order format, should be amount@price") | |
940 | - | else { | |
941 | - | let dx = parseIntValue(dw[0]) | |
942 | - | let dy = parseIntValue(dw[1]) | |
943 | - | if ((0 > dy)) | |
944 | - | then throw("Price can't be negative") | |
945 | - | else { | |
946 | - | let dz = fraction(dx, dy, c) | |
947 | - | let dA = parseIntValue(dp[by]) | |
948 | - | let cN = parseIntValue(cv[by]) | |
949 | - | let dB = split(dt[by], "@") | |
950 | - | let dC = parseIntValue(dB[0]) | |
951 | - | let dD = parseIntValue(dB[1]) | |
952 | - | if (if ((dx != 0)) | |
953 | - | then (dy != dD) | |
954 | - | else false) | |
955 | - | then throw(((((("Prices of " + K[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
956 | - | else { | |
957 | - | let dE = fraction(dC, dD, c) | |
958 | - | if ((dx == 0)) | |
959 | - | then $Tuple6((aJ._1 :+ cv[by]), (aJ._2 :+ dt[by]), (aJ._3 :+ dp[by]), aJ._4, aJ._5, aJ._6) | |
960 | - | else if ((dx > 0)) | |
961 | - | then if ((0 > dC)) | |
962 | - | then if ((dx > -(dC))) | |
963 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + K[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
964 | - | else $Tuple6((aJ._1 :+ cv[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dA + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz)) | |
965 | - | else throw((("Attempt to buy " + K[by]) + " while warehouse doesn't sell it")) | |
966 | - | else if ((dC > 0)) | |
967 | - | then if ((-(dx) > dC)) | |
968 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + K[by]) + ", but warehouse only buys ") + toString(dC))) | |
969 | - | else if ((-(dx) > dA)) | |
970 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dp[by]) + " of ") + K[by])) | |
971 | - | else $Tuple6((aJ._1 :+ toString((cN - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dA + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6) | |
972 | - | else throw((("Attempt to sell " + K[by]) + " while warehouse doesn't buy it")) | |
973 | - | } | |
974 | - | } | |
975 | - | } | |
976 | - | } | |
977 | - | ||
978 | - | let cT = { | |
979 | - | let aL = [0, 1, 2, 3, 4, 5] | |
895 | + | else split(dz[aw], "_") | |
896 | + | let dd = 0 | |
897 | + | let de = { | |
898 | + | let aL = dt | |
980 | 899 | let aM = size(aL) | |
981 | - | let aN = $ | |
900 | + | let aN = $Tuple10(nil, nil, nil, 0, 0, 0, 0, dw, cR, dA) | |
982 | 901 | func aO (aP,aQ) = if ((aQ >= aM)) | |
983 | 902 | then aP | |
984 | - | else | |
903 | + | else bB(aP, aL[aQ]) | |
985 | 904 | ||
986 | 905 | func aR (aP,aQ) = if ((aQ >= aM)) | |
987 | 906 | then aP | |
988 | 907 | else throw("List size exceeds 6") | |
989 | 908 | ||
990 | 909 | aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6) | |
991 | 910 | } | |
992 | - | func cU (aJ,by) = { | |
993 | - | let dF = split(dn[by], "@") | |
994 | - | if ((size(dF) != 2)) | |
995 | - | then throw("Incorrect order format, should be amount@price") | |
996 | - | else { | |
997 | - | let dx = parseIntValue(dF[0]) | |
998 | - | let dy = parseIntValue(dF[1]) | |
999 | - | if ((0 > dy)) | |
1000 | - | then throw("Price can't be negative") | |
1001 | - | else { | |
1002 | - | let dz = fraction(dx, dy, c) | |
1003 | - | let dG = parseIntValue(dq[by]) | |
1004 | - | let cV = parseIntValue(cw[by]) | |
1005 | - | let dB = split(du[by], "@") | |
1006 | - | let dC = parseIntValue(dB[0]) | |
1007 | - | let dD = parseIntValue(dB[1]) | |
1008 | - | if (if ((dx != 0)) | |
1009 | - | then (dy != dD) | |
1010 | - | else false) | |
1011 | - | then throw(((((("Prices of " + L[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
1012 | - | else { | |
1013 | - | let dE = fraction(dC, dD, c) | |
1014 | - | if ((dx == 0)) | |
1015 | - | then $Tuple6((aJ._1 :+ cw[by]), (aJ._2 :+ du[by]), (aJ._3 :+ dq[by]), aJ._4, aJ._5, aJ._6) | |
1016 | - | else if ((dx > 0)) | |
1017 | - | then if ((0 > dC)) | |
1018 | - | then if ((dx > -(dC))) | |
1019 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + L[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
1020 | - | else $Tuple6((aJ._1 :+ cw[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dG + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz)) | |
1021 | - | else throw((("Attempt to buy " + L[by]) + " while warehouse doesn't sell it")) | |
1022 | - | else if ((dC > 0)) | |
1023 | - | then if ((-(dx) > dC)) | |
1024 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + L[by]) + ", but warehouse only buys ") + toString(dC))) | |
1025 | - | else if ((-(dx) > dG)) | |
1026 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dq[by]) + " of ") + L[by])) | |
1027 | - | else $Tuple6((aJ._1 :+ toString((cV - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dG + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6) | |
1028 | - | else throw((("Attempt to sell " + L[by]) + " while warehouse doesn't buy it")) | |
1029 | - | } | |
1030 | - | } | |
1031 | - | } | |
1032 | - | } | |
911 | + | let bj = { | |
912 | + | let aL = du | |
913 | + | let aM = size(aL) | |
914 | + | let aN = $Tuple10(nil, nil, nil, de._4, de._5, de._6, 0, dx, cS, dB) | |
915 | + | func cD (aP,aQ) = if ((aQ >= aM)) | |
916 | + | then aP | |
917 | + | else bB(aP, aL[aQ]) | |
1033 | 918 | ||
1034 | - | let bj = { | |
1035 | - | let aL = [0, 1, 2, 3, 4, 5] | |
1036 | - | let aM = size(aL) | |
1037 | - | let aN = $Tuple6(nil, nil, nil, cT._4, cT._5, cT._6) | |
1038 | - | func ch (aP,aQ) = if ((aQ >= aM)) | |
1039 | - | then aP | |
1040 | - | else cU(aP, aL[aQ]) | |
1041 | - | ||
1042 | - | func ci (aP,aQ) = if ((aQ >= aM)) | |
919 | + | func cE (aP,aQ) = if ((aQ >= aM)) | |
1043 | 920 | then aP | |
1044 | 921 | else throw("List size exceeds 6") | |
1045 | 922 | ||
1046 | - | | |
923 | + | cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6) | |
1047 | 924 | } | |
1048 | - | func cW (aJ,dH) = { | |
1049 | - | let by = aJ._7 | |
1050 | - | let dI = split(dH, "@") | |
1051 | - | if ((size(dI) != 2)) | |
1052 | - | then throw("Incorrect order format, should be amount@price") | |
1053 | - | else { | |
1054 | - | let dx = parseIntValue(dI[0]) | |
1055 | - | let dy = parseIntValue(dI[1]) | |
1056 | - | if ((0 > dy)) | |
1057 | - | then throw("Price can't be negative") | |
1058 | - | else { | |
1059 | - | let dz = fraction(dx, dy, c) | |
1060 | - | let dJ = parseIntValue(dr[by]) | |
1061 | - | let cX = parseIntValue(cx[by]) | |
1062 | - | let dB = split(dv[by], "@") | |
1063 | - | let dC = parseIntValue(dB[0]) | |
1064 | - | let dD = parseIntValue(dB[1]) | |
1065 | - | if (if ((dx != 0)) | |
1066 | - | then (dy != dD) | |
1067 | - | else false) | |
1068 | - | then throw(((((("Prices of " + M[by]) + " don't match! WH price=") + toString(dD)) + ", your price=") + toString(dy))) | |
1069 | - | else { | |
1070 | - | let dE = fraction(dC, dD, c) | |
1071 | - | if ((dx == 0)) | |
1072 | - | then $Tuple7((aJ._1 :+ cx[by]), (aJ._2 :+ dv[by]), (aJ._3 :+ dr[by]), aJ._4, aJ._5, aJ._6, (aJ._7 + 1)) | |
1073 | - | else if ((dx > 0)) | |
1074 | - | then if ((0 > dC)) | |
1075 | - | then if ((dx > -(dC))) | |
1076 | - | then throw(((((("Attempt to buy " + toString(dx)) + " of ") + M[by]) + ", but warehouse only sells ") + toString(-(dC)))) | |
1077 | - | else $Tuple7((aJ._1 :+ cx[by]), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dJ + dx))), (aJ._4 + dx), aJ._5, (aJ._6 + dz), (aJ._7 + 1)) | |
1078 | - | else throw((("Attempt to buy " + M[by]) + " while warehouse doesn't sell it")) | |
1079 | - | else if ((dC > 0)) | |
1080 | - | then if ((-(dx) > dC)) | |
1081 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + " of ") + M[by]) + ", but warehouse only buys ") + toString(dC))) | |
1082 | - | else if ((-(dx) > dJ)) | |
1083 | - | then throw(((((("Attempt to sell " + toString(-(dx))) + ", but you only have ") + dr[by]) + " of ") + M[by])) | |
1084 | - | else $Tuple7((aJ._1 :+ toString((cX - dx))), (aJ._2 :+ ((toString((dC + dx)) + "@") + toString(dD))), (aJ._3 :+ toString((dJ + dx))), (aJ._4 - dx), (aJ._5 - dz), aJ._6, (aJ._7 + 1)) | |
1085 | - | else throw((("Attempt to sell " + M[by]) + " while warehouse doesn't buy it")) | |
1086 | - | } | |
1087 | - | } | |
1088 | - | } | |
1089 | - | } | |
925 | + | let aC = { | |
926 | + | let aL = dv | |
927 | + | let aM = size(aL) | |
928 | + | let aN = $Tuple10(nil, nil, nil, bj._4, bj._5, bj._6, 0, dy, cT, dC) | |
929 | + | func df (aP,aQ) = if ((aQ >= aM)) | |
930 | + | then aP | |
931 | + | else bB(aP, aL[aQ]) | |
1090 | 932 | ||
1091 | - | let aC = { | |
1092 | - | let aL = do | |
1093 | - | let aM = size(aL) | |
1094 | - | let aN = $Tuple7(nil, nil, nil, bj._4, bj._5, bj._6, 0) | |
1095 | - | func cY (aP,aQ) = if ((aQ >= aM)) | |
1096 | - | then aP | |
1097 | - | else cW(aP, aL[aQ]) | |
1098 | - | ||
1099 | - | func cZ (aP,aQ) = if ((aQ >= aM)) | |
933 | + | func dg (aP,aQ) = if ((aQ >= aM)) | |
1100 | 934 | then aP | |
1101 | 935 | else throw("List size exceeds 50") | |
1102 | 936 | ||
1103 | - | | |
937 | + | dg(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(df(aN, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
1104 | 938 | } | |
1105 | - | let | |
1106 | - | let | |
939 | + | let dh = aC._4 | |
940 | + | let dD = if ((0 > (cX - dh))) | |
1107 | 941 | then 0 | |
1108 | - | else ( | |
1109 | - | let | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | if (( | |
942 | + | else (cX - dh) | |
943 | + | let di = makeString_2C([aH[ap], makeString(de._1, "_"), makeString(bj._1, "_"), makeString(aC._1, "_"), toString(dD)], ":") | |
944 | + | let dE = makeString_2C([makeString(de._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_")], ":") | |
945 | + | let dF = makeString_2C([bS[al], makeString(de._3, "_"), makeString(bj._3, "_"), makeString(aC._3, "_")], ":") | |
946 | + | let dj = invoke(y, "saveWarehouse", [di, Y], nil) | |
947 | + | if ((dj == dj)) | |
1114 | 948 | then { | |
1115 | - | let | |
1116 | - | if (( | |
949 | + | let dG = invoke(y, "updateBackpack", [ac, dF], nil) | |
950 | + | if ((dG == dG)) | |
1117 | 951 | then { | |
1118 | - | let | |
1119 | - | let | |
1120 | - | let | |
1121 | - | let | |
1122 | - | then ( | |
1123 | - | else | |
1124 | - | let | |
1125 | - | let | |
1126 | - | if (( | |
1127 | - | then if ((size( | |
952 | + | let dH = [StringEntry(aB, dE)] | |
953 | + | let dI = fraction(aC._5, J, b) | |
954 | + | let dJ = aC._5 | |
955 | + | let dK = if ((dJ > 0)) | |
956 | + | then (dH :+ ScriptTransfer(dm, (aC._5 - dI), f)) | |
957 | + | else dH | |
958 | + | let dL = fraction(aC._6, J, b) | |
959 | + | let dM = aC._6 | |
960 | + | if ((dM > 0)) | |
961 | + | then if ((size(bM.payments) != 1)) | |
1128 | 962 | then throw("exactly 1 payment must be attached") | |
1129 | 963 | else { | |
1130 | - | let | |
1131 | - | let | |
1132 | - | let | |
1133 | - | if (( | |
964 | + | let ca = bM.payments[0] | |
965 | + | let cb = ca.amount | |
966 | + | let cc = valueOrErrorMessage(ca.assetId, "WAVES can't be used as payment") | |
967 | + | if ((cc != f)) | |
1134 | 968 | then throw("USDN payments only!") | |
1135 | - | else if (( | |
1136 | - | then throw(("Payment needed is " + toString( | |
1137 | - | else ( | |
969 | + | else if ((cb != dM)) | |
970 | + | then throw(("Payment needed is " + toString(dM))) | |
971 | + | else (dK :+ ScriptTransfer(addressFromStringValue(dr), (aC._6 - dL), f)) | |
1138 | 972 | } | |
1139 | - | else if ((size( | |
973 | + | else if ((size(bM.payments) != 0)) | |
1140 | 974 | then throw("No payments needed") | |
1141 | - | else | |
975 | + | else dK | |
1142 | 976 | } | |
1143 | 977 | else throw("Strict value is not equal to itself.") | |
1144 | 978 | } | |
1145 | 979 | else throw("Strict value is not equal to itself.") | |
1146 | 980 | } | |
1147 | 981 | } | |
1148 | 982 | } | |
1149 | 983 | } | |
1150 | 984 | } | |
1151 | 985 | } | |
1152 | 986 | ||
1153 | 987 |
github/deemru/w8io/169f3d6 445.08 ms ◑