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:BgIxCAISAwoBCBIECgIRERIECgIRERIDCgEREgUKAwEBARIDCgEIEgQKAggIEgUKAwgICEsAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDgAgMLXLwAGTVVMVDEwAIDIr6AlAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkbkFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABILYmKcME9c5TkaQOS3UkL2SMUbH6369UKb1I0h0qsqrRAwkAAAIBAVQFByRtYXRjaDABIPd26vf3g8pl224T7gI7z1gplanB0Y3yS9ps2B1igMjeCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4BD2dldFN0cmluZ09yRmFpbAIHYWRkcmV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YWxkbwkAzQgCBQhhY3Rpb25zMQkBDlNjcmlwdFRyYW5zZmVyAwkBEUBleHRyTmF0aXZlKDEwNjIpAQUJbGFuZE93bmVyCQBlAggFAXACXzYFC3VzZEJwMldoRmVlBQt1c2RuQXNzZXRJZAMJAQIhPQIJAJADAQgFAWkIcGF5bWVudHMAAAkAAgECEk5vIHBheW1lbnRzIG5lZWRlZAUIYWN0aW9uczEJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AGDdwpQ==", "height": 2519988, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D8Ym5Yaxs2mf7dJkesir4SCVS5cdsTc711XgtTpfpg1A Next: H7sffFJyLftf7NJwoYGqNt59piPRhaiLsmqv9PLR1xJW Diff:
OldNewDifferences
288288 else unit
289289
290290
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))
293380 then throw("Permission denied")
294- else [StringEntry(r(), bq)]
381+ else [StringEntry(r(), bN)]
295382
296383
297384
298-@Callable(bp)
299-func sellResources (br,bs) = {
300- let bt = bo()
301- if ((bt == bt))
385+@Callable(bM)
386+func sellResources (bO,bP) = {
387+ let bQ = bo()
388+ if ((bQ == bQ))
302389 then {
303- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
304- if ((size(bp.payments) != 0))
390+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
391+ if ((size(bM.payments) != 0))
305392 then throw("sellResources doesn't require any payments")
306393 else {
307- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
308- if ((bu[aj] != "F"))
309- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
310397 else {
311- let aW = bu[ak]
312- let bv = bm(ab(ac))
313- let bw = split(bv[am], "_")
314- func bx (aJ,by) = if ((br[by] > parseIntValue(bw[by])))
315- then throw(((((("You have " + bw[by]) + " of ") + K[by]) + ", but tried to sell ") + toString(br[by])))
316- else if ((0 > br[by]))
317- then throw(((("You tried to sell negative amount of " + K[by]) + ": ") + toString(br[by])))
318- else if ((br[by] > 0))
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))
319406 then {
320- let bz = aV(aW, by, br[by], bs[by])
321- $Tuple3((aJ._1 :+ bz._1), (aJ._2 :+ toString((parseIntValue(bw[by]) - br[by]))), (aJ._3 + bz._2))
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))
322409 }
323- else $Tuple3(aJ._1, (aJ._2 :+ bw[by]), aJ._3)
410+ else $Tuple3(aJ._1, (aJ._2 :+ bT[bq]), aJ._3)
324411
325- let bA = {
412+ let bW = {
326413 let aL = [0, 1, 2, 3, 4, 5]
327414 let aM = size(aL)
328415 let aN = $Tuple3(nil, nil, 0)
329416 func aO (aP,aQ) = if ((aQ >= aM))
330417 then aP
331- else bx(aP, aL[aQ])
418+ else bU(aP, aL[aQ])
332419
333420 func aR (aP,aQ) = if ((aQ >= aM))
334421 then aP
336423
337424 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
338425 }
339- let bB = makeString([bv[al], makeString(bA._2, "_"), bv[an], bv[ao]], ":")
340- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
341- $Tuple2((bA._1 :+ ScriptTransfer(bp.caller, bA._3, f)), bC)
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)
342429 }
343430 }
344431 }
347434
348435
349436
350-@Callable(bp)
351-func buyMaterials (br,bD) = {
352- let bt = bo()
353- if ((bt == bt))
437+@Callable(bM)
438+func buyMaterials (bO,bZ) = {
439+ let bQ = bo()
440+ if ((bQ == bQ))
354441 then {
355- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
356- if ((size(bp.payments) != 1))
442+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
443+ if ((size(bM.payments) != 1))
357444 then throw("exactly 1 payment must be attached")
358445 else {
359- let bE = bp.payments[0]
360- let bF = bE.amount
361- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
362- if ((bG != f))
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))
363450 then throw("USDN payments only!")
364451 else {
365- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
366- if ((bu[aj] != "F"))
367- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
368455 else {
369- let aW = bu[ak]
370- let bv = bm(ab(ac))
371- let bH = split(bv[an], "_")
372- func bI (aJ,by) = if ((0 > br[by]))
373- then throw(((("You tried to buy negative amount of " + L[by]) + ": ") + toString(br[by])))
374- else if ((br[by] > 0))
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))
375462 then {
376- let bz = be(aW, by, br[by], bD[by])
377- $Tuple3((aJ._1 :+ bz._1), (aJ._2 :+ toString((parseIntValue(bH[by]) + bz._3))), (aJ._3 + bz._2))
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))
378465 }
379- else $Tuple3(aJ._1, (aJ._2 :+ bH[by]), aJ._3)
466+ else $Tuple3(aJ._1, (aJ._2 :+ cd[bq]), aJ._3)
380467
381- let bA = {
468+ let bW = {
382469 let aL = [0, 1, 2, 3, 4, 5]
383470 let aM = size(aL)
384471 let aN = $Tuple3(nil, nil, 0)
385472 func aO (aP,aQ) = if ((aQ >= aM))
386473 then aP
387- else bI(aP, aL[aQ])
474+ else ce(aP, aL[aQ])
388475
389476 func aR (aP,aQ) = if ((aQ >= aM))
390477 then aP
392479
393480 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
394481 }
395- if ((bA._3 > bF))
396- then throw(((("Insufficient payment! Attached=" + toString(bF)) + ", required=") + toString(bA._3)))
482+ if ((bW._3 > cb))
483+ then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3)))
397484 else {
398- let bB = makeString([bv[al], bv[am], makeString(bA._2, "_"), bv[ao]], ":")
399- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
400- let t = if (((bF - bA._3) > 0))
401- then [ScriptTransfer(bp.caller, (bF - bA._3), f)]
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)]
402489 else nil
403- $Tuple2((bA._1 ++ t), bC)
490+ $Tuple2((bW._1 ++ t), bY)
404491 }
405492 }
406493 }
411498
412499
413500
414-@Callable(bp)
415-func exchangeResources (br) = {
416- let bt = bo()
417- if ((bt == bt))
501+@Callable(bM)
502+func exchangeResources (bO) = {
503+ let bQ = bo()
504+ if ((bQ == bQ))
418505 then {
419- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
420- if ((size(bp.payments) != 1))
506+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
507+ if ((size(bM.payments) != 1))
421508 then throw("exactly 1 payment must be attached")
422509 else {
423- let bE = bp.payments[0]
424- let bF = bE.amount
425- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
426- if ((bG != f))
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))
427514 then throw("USDN payments only!")
428515 else {
429- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
430- if ((bu[aj] != "F"))
431- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
432519 else {
433- let aW = bu[ak]
434- let bv = bm(ab(ac))
435- let bw = split(bv[am], "_")
436- let bH = split(bv[an], "_")
437- func bJ (aJ,by) = {
438- let aZ = U(aW, by)
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)
439526 let ba = valueOrElse(getInteger(aZ), 0)
440- let bK = br[by]
441- if ((bK > parseIntValue(bw[by])))
442- then throw(((((("You have " + bw[by]) + " of ") + K[by]) + ", but tried to exchange ") + toString(bK)))
443- else if ((0 > bK))
444- then throw(((("You tried to exchange negative amount of " + K[by]) + ": ") + toString(bK)))
445- else if ((bK > 0))
446- then $Tuple4((aJ._1 :+ toString((parseIntValue(bw[by]) - bK))), (aJ._2 :+ toString((parseIntValue(bH[by]) + bK))), (aJ._3 + fraction(bK, C, c)), (aJ._4 :+ IntegerEntry(aZ, ba)))
447- else $Tuple4((aJ._1 :+ bw[by]), (aJ._2 :+ bH[by]), aJ._3, aJ._4)
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)
448535 }
449536
450- let bA = {
537+ let bW = {
451538 let aL = [0, 1, 2, 3, 4, 5]
452539 let aM = size(aL)
453540 let aN = $Tuple4(nil, nil, 0, nil)
454541 func aO (aP,aQ) = if ((aQ >= aM))
455542 then aP
456- else bJ(aP, aL[aQ])
543+ else cf(aP, aL[aQ])
457544
458545 func aR (aP,aQ) = if ((aQ >= aM))
459546 then aP
461548
462549 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
463550 }
464- if ((bA._3 > bF))
465- then throw(((("Insufficient payment! Attached=" + toString(bF)) + ", required=") + toString(bA._3)))
551+ if ((bW._3 > cb))
552+ then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3)))
466553 else {
467- let bB = makeString([bv[al], makeString(bA._1, "_"), makeString(bA._2, "_"), bv[ao]], ":")
468- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
469- let t = if (((bF - bA._3) > 0))
470- then [ScriptTransfer(bp.caller, (bF - bA._3), f)]
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)]
471558 else nil
472- $Tuple2((t ++ bA._4), bC)
559+ $Tuple2((t ++ bW._4), bY)
473560 }
474561 }
475562 }
480567
481568
482569
483-@Callable(bp)
484-func buyGoods (bL,bM,bN) = {
485- let bt = bo()
486- if ((bt == bt))
487- then if ((size(bp.payments) != 0))
570+@Callable(bM)
571+func buyGoods (ch,ci,cj) = {
572+ let bQ = bo()
573+ if ((bQ == bQ))
574+ then if ((size(bM.payments) != 0))
488575 then throw("buyGoods doesn't require any payments")
489- else if ((0 > bN))
576+ else if ((0 > cj))
490577 then throw("Quantity should be positive")
491578 else {
492- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
493- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
494- if ((bu[aj] != "M"))
495- then throw(("Duck location type should be Manufactory, but is " + bu[aj]))
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]))
496583 else {
497- let bO = bu[ai]
498- let bv = bm(ab(ac))
499- let bH = split(bv[an], "_")
500- if (if ((0 > bL))
584+ let ck = bR[ai]
585+ let bS = bm(ab(ac))
586+ let cd = split(bS[an], "_")
587+ if (if ((0 > ch))
501588 then true
502- else (bL >= size(O)))
503- then throw(("Unknown product idx=" + toString(bL)))
589+ else (ch >= size(O)))
590+ then throw(("Unknown product idx=" + toString(ch)))
504591 else {
505- let bP = (bL % size(N))
506- if ((N[bP] != bO))
507- then throw(((("This product is available in " + N[bP]) + ", but you are in ") + bO))
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))
508595 else {
509- let bQ = split(O[bL], "_")
510- if ((size(bQ) != (A + 2)))
511- then throw(("Fatal: unknown recipe: " + O[bL]))
596+ let cm = split(O[ch], "_")
597+ if ((size(cm) != (A + 2)))
598+ then throw(("Fatal: unknown recipe: " + O[ch]))
512599 else {
513- let bR = if ((bv[ao] == ""))
600+ let cn = if ((bS[ao] == ""))
514601 then nil
515- else split(bv[ao], "_")
516- func bS (aJ,bT) = {
517- let bU = aJ._2
518- let bV = if ((size(bR) > bU))
519- then split(bR[bU], ",")
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], ",")
520607 else ["0", "0", "0"]
521- let bW = bV[0]
522- let bX = parseIntValue(bW)
523- let bY = bV[1]
524- let bZ = parseIntValue(bY)
525- let ca = bV[2]
526- let cb = parseIntValue(ca)
527- let aX = (bN * parseIntValue(bQ[7]))
528- let cc = if ((bU == bL))
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))
529616 then {
530- let g = bM
617+ let g = ci
531618 if ((1 == g))
532- then ((((toString((bX + aX)) + ",") + bY) + ",") + ca)
619+ then ((((toString((ct + aX)) + ",") + cu) + ",") + cw)
533620 else if ((2 == g))
534- then ((((bW + ",") + toString((bZ + aX))) + ",") + ca)
621+ then ((((cs + ",") + toString((cv + aX))) + ",") + cw)
535622 else if ((3 == g))
536- then ((((bW + ",") + bY) + ",") + toString((cb + aX)))
537- else throw(("Product level should be 1..3, not " + toString(bM)))
623+ then ((((cs + ",") + cu) + ",") + toString((cx + aX)))
624+ else throw(("Product level should be 1..3, not " + toString(ci)))
538625 }
539- else ((((bW + ",") + bY) + ",") + ca)
540- $Tuple2((aJ._1 :+ cc), (bU + 1))
626+ else ((((cs + ",") + cu) + ",") + cw)
627+ $Tuple2((aJ._1 :+ cy), (cq + 1))
541628 }
542629
543- let cd = ( let aL = O
630+ let cz = ( let aL = O
544631 let aM = size(aL)
545632 let aN = $Tuple2(nil, 0)
546633 func aO (aP,aQ) = if ((aQ >= aM))
547634 then aP
548- else bS(aP, aL[aQ])
635+ else co(aP, aL[aQ])
549636
550637 func aR (aP,aQ) = if ((aQ >= aM))
551638 then aP
552639 else throw("List size exceeds 50")
553640
554641 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 ce (aJ,by) = {
556- let cf = (parseIntValue(bQ[by]) * bN)
557- let cg = parseIntValue(bH[by])
558- if ((cf > cg))
559- then throw(((((((("You have " + bH[by]) + " of ") + L[by]) + ", but recipe requires ") + toString(cf)) + " for quantity ") + toString(bN)))
560- else if ((cf > 0))
561- then (aJ :+ toString((cg - cf)))
562- else (aJ :+ bH[by])
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])
563650 }
564651
565- let bA = {
652+ let bW = {
566653 let aL = [0, 1, 2, 3, 4, 5]
567654 let aM = size(aL)
568655 let aN = nil
569- func ch (aP,aQ) = if ((aQ >= aM))
656+ func cD (aP,aQ) = if ((aQ >= aM))
570657 then aP
571- else ce(aP, aL[aQ])
658+ else cA(aP, aL[aQ])
572659
573- func ci (aP,aQ) = if ((aQ >= aM))
660+ func cE (aP,aQ) = if ((aQ >= aM))
574661 then aP
575662 else throw("List size exceeds 6")
576663
577- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
664+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
578665 }
579- let bB = makeString([bv[al], bv[am], makeString(bA, "_"), makeString(cd, "_")], ":")
580- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
581- $Tuple2(nil, bC)
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)
582669 }
583670 }
584671 }
589676
590677
591678
592-@Callable(bp)
593-func acceptServicePayment (cj) = {
594- let bt = bo()
595- if ((bt == bt))
596- then if ((size(bp.payments) != 1))
679+@Callable(bM)
680+func acceptServicePayment (cF) = {
681+ let bQ = bo()
682+ if ((bQ == bQ))
683+ then if ((size(bM.payments) != 1))
597684 then throw("exactly 1 payment must be attached")
598685 else {
599- let bE = bp.payments[0]
600- let bF = bE.amount
601- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
602- if ((bG != f))
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))
603690 then throw("USDN payments only!")
604691 else {
605- let ck = {
606- let g = cj
692+ let cG = {
693+ let g = cF
607694 if (("LAND_RENAME" == g))
608695 then 10000000
609696 else throw("Unknown service!")
610697 }
611- if ((bF != ck))
612- then throw((((cj + " costs ") + toString(ck)) + " USDN"))
613- else $Tuple2(nil, bF)
698+ if ((cb != cG))
699+ then throw((((cF + " costs ") + toString(cG)) + " USDN"))
700+ else $Tuple2(nil, cb)
614701 }
615702 }
616703 else throw("Strict value is not equal to itself.")
618705
619706
620707
621-@Callable(bp)
622-func setWarehouseOrder (cl,Y) = {
623- let cm = bp.originCaller
624- let cn = toString(cm)
625- let co = value(assetInfo(fromBase58String(Y)))
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)))
626713 if (!(isDefined(getInteger(y, ah(Y)))))
627- then throw((("NFT " + co.name) + " is not staked"))
714+ then throw((("NFT " + cK.name) + " is not staked"))
628715 else {
629- let cp = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + co.name) + " is orphaned"))
630- if ((cp != cn))
716+ let cL = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + cK.name) + " is orphaned"))
717+ if ((cL != cJ))
631718 then throw((G + " is not yours"))
632719 else {
633- let cq = split_4C(cl, ":")
634- if ((size(cq) != 3))
720+ let cM = split_4C(cH, ":")
721+ if ((size(cM) != 3))
635722 then throw("cargoListStr should contain exactly 2 ':' separators")
636723 else {
637- let cr = split(cq[0], "_")
638- let cs = split(cq[1], "_")
639- let ct = if ((cq[2] == ""))
724+ let cN = split(cM[0], "_")
725+ let cO = split(cM[1], "_")
726+ let cP = if ((cM[2] == ""))
640727 then nil
641- else split(cq[2], "_")
642- if ((size(cr) != A))
728+ else split(cM[2], "_")
729+ if ((size(cN) != A))
643730 then throw("All 6 resources should be passed")
644- else if ((size(cs) != A))
731+ else if ((size(cO) != A))
645732 then throw("All 6 materials should be passed")
646733 else {
647- let cu = ax(invoke(y, "getWarehouseREADONLY", [Y], nil))
648- let aH = split_4C(cu, ":")
649- let cv = split(aH[aq], "_")
650- let cw = split(aH[ar], "_")
651- let cx = if ((aH[as] == ""))
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] == ""))
652739 then nil
653740 else split(aH[as], "_")
654- let cy = aG(aH)
655- let cz = aS(aH)
656- let cA = aT(aH)
657- let cB = parseIntValue(aH[at])
658- let cC = ((((aD(aH[ap]) - cy) - cz) - cA) - cB)
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)
659746 let aB = X(Y)
660- let cD = aA(aB)
661- let cE = split(cD[au], "_")
662- let cF = split(cD[av], "_")
663- let cG = if ((cD[aw] == ""))
747+ let cZ = aA(aB)
748+ let da = split(cZ[au], "_")
749+ let db = split(cZ[av], "_")
750+ let dc = if ((cZ[aw] == ""))
664751 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
711756 let aM = size(aL)
712- let aN = $Tuple4(0, nil, 0, 0)
757+ let aN = $Tuple6(0, nil, 0, 0, cR, da)
713758 func aO (aP,aQ) = if ((aQ >= aM))
714759 then aP
715- else cI(aP, aL[aQ])
760+ else bp(aP, aL[aQ])
716761
717762 func aR (aP,aQ) = if ((aQ >= aM))
718763 then aP
720765
721766 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
722767 }
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])
764775
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))
774777 then aP
775778 else throw("List size exceeds 6")
776779
777- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
780+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
778781 }
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])
820789
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))
830791 then aP
831792 else throw("List size exceeds 50")
832793
833- cZ(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(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)
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)
834795 }
835- let da = aC._3
836- if ((da > cC))
837- then throw((((("Attempt to reserve " + toString(da)) + " space, but only ") + toString(cC)) + " warehouse space left"))
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"))
838799 else {
839- let db = makeString_2C([aH[ap], makeString(cT._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_"), toString(da)], ":")
840- let dc = invoke(y, "saveWarehouse", [db, Y], nil)
841- if ((dc == dc))
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))
842803 then {
843- let dd = aC._4
844- if ((dd > 0))
845- then if ((size(bp.payments) != 1))
804+ let dk = aC._4
805+ if ((dk > 0))
806+ then if ((size(bM.payments) != 1))
846807 then throw("exactly 1 payment must be attached")
847808 else {
848- let bE = bp.payments[0]
849- let bF = bE.amount
850- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
851- if ((bG != f))
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))
852813 then throw("USDN payments only!")
853- else if ((bF != dd))
854- then throw(("Payment needed is " + toString(dd)))
855- else [StringEntry(aB, cl)]
814+ else if ((cb != dk))
815+ then throw(("Payment needed is " + toString(dk)))
816+ else [StringEntry(aB, cH)]
856817 }
857- else if ((dd == 0))
858- then if ((size(bp.payments) != 0))
818+ else if ((dk == 0))
819+ then if ((size(bM.payments) != 0))
859820 then throw("No payments needed")
860- else [StringEntry(aB, cl)]
861- else if ((size(bp.payments) != 0))
821+ else [StringEntry(aB, cH)]
822+ else if ((size(bM.payments) != 0))
862823 then throw("No payments needed")
863- else [ScriptTransfer(cm, -(dd), f), StringEntry(aB, cl)]
824+ else [ScriptTransfer(cI, -(dk), f), StringEntry(aB, cH)]
864825 }
865826 else throw("Strict value is not equal to itself.")
866827 }
872833
873834
874835
875-@Callable(bp)
876-func acceptWarehouseOrder (de,Y,ac) = {
877- let df = bp.originCaller
878- let dg = toString(df)
879- let dh = valueOrErrorMessage(getString(y, Z(dg)), "You don't have a duck staked")
880- let bu = valueOrElse(getString(y, ad(dh)), z)
881- let di = split(value(bu), "_")
882- if ((di[aj] != "L"))
883- then throw((("Duck location type is " + di[aj]) + ", but should be L"))
884- else if ((dh != ac))
885- then throw(((("Your staked duck is " + dh) + ", but passed ") + ac))
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))
886847 else {
887- let dj = value(assetInfo(fromBase58String(Y)))
848+ let dq = value(assetInfo(fromBase58String(Y)))
888849 if (!(isDefined(getInteger(y, ah(Y)))))
889- then throw((("NFT " + dj.name) + " is not staked"))
850+ then throw((("NFT " + dq.name) + " is not staked"))
890851 else {
891- let dk = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dj.name) + " is orphaned"))
892- if ((dk == dg))
852+ let dr = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dq.name) + " is orphaned"))
853+ if ((dr == dn))
893854 then throw("You cannot trade with yourself")
894855 else {
895- let dl = split_4C(de, ":")
896- if ((size(dl) != 3))
856+ let ds = split_4C(dl, ":")
857+ if ((size(ds) != 3))
897858 then throw("bpOrderStr should contain exactly 2 ':' separators")
898859 else {
899- let dm = split(dl[0], "_")
900- let dn = split(dl[1], "_")
901- let do = if ((dl[2] == ""))
860+ let dt = split(ds[0], "_")
861+ let du = split(ds[1], "_")
862+ let dv = if ((ds[2] == ""))
902863 then nil
903- else split(dl[2], "_")
904- if ((size(dm) != A))
864+ else split(ds[2], "_")
865+ if ((size(dt) != A))
905866 then throw("All 6 resources should be passed")
906- else if ((size(dn) != A))
867+ else if ((size(du) != A))
907868 then throw("All 6 materials should be passed")
908869 else {
909- let cu = ax(invoke(y, "getWarehouseREADONLY", [Y], nil))
910- let aH = split_4C(cu, ":")
911- let cv = split(aH[aq], "_")
912- let cw = split(aH[ar], "_")
913- let cx = if ((aH[as] == ""))
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] == ""))
914875 then nil
915876 else split(aH[as], "_")
916- let cy = aG(aH)
917- let cz = aS(aH)
918- let cA = aT(aH)
919- let cB = parseIntValue(aH[at])
920- let cC = ((((aD(aH[ap]) - cy) - cz) - cA) - cB)
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)
921882 let bn = ab(ac)
922- let bv = bm(bn)
923- let dp = split(bv[am], "_")
924- let dq = split(bv[an], "_")
925- let dr = if ((bv[ao] == ""))
883+ let bS = bm(bn)
884+ let dw = split(bS[am], "_")
885+ let dx = split(bS[an], "_")
886+ let dy = if ((bS[ao] == ""))
926887 then nil
927- else split(bv[ao], "_")
888+ else split(bS[ao], "_")
928889 let aB = X(Y)
929- let ds = aA(aB)
930- let dt = split(ds[au], "_")
931- let du = split(ds[av], "_")
932- let dv = if ((ds[aw] == ""))
890+ let dz = aA(aB)
891+ let dA = split(dz[au], "_")
892+ let dB = split(dz[av], "_")
893+ let dC = if ((dz[aw] == ""))
933894 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
980899 let aM = size(aL)
981- let aN = $Tuple6(nil, nil, nil, 0, 0, 0)
900+ let aN = $Tuple10(nil, nil, nil, 0, 0, 0, 0, dw, cR, dA)
982901 func aO (aP,aQ) = if ((aQ >= aM))
983902 then aP
984- else cI(aP, aL[aQ])
903+ else bB(aP, aL[aQ])
985904
986905 func aR (aP,aQ) = if ((aQ >= aM))
987906 then aP
989908
990909 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
991910 }
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])
1033918
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))
1043920 then aP
1044921 else throw("List size exceeds 6")
1045922
1046- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
923+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
1047924 }
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])
1090932
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))
1100934 then aP
1101935 else throw("List size exceeds 50")
1102936
1103- cZ(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(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)
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)
1104938 }
1105- let da = aC._4
1106- let dK = if ((0 > (cB - da)))
939+ let dh = aC._4
940+ let dD = if ((0 > (cX - dh)))
1107941 then 0
1108- else (cB - da)
1109- let db = makeString_2C([aH[ap], makeString(cT._1, "_"), makeString(bj._1, "_"), makeString(aC._1, "_"), toString(dK)], ":")
1110- let dL = makeString_2C([makeString(cT._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_")], ":")
1111- let dM = makeString_2C([bv[al], makeString(cT._3, "_"), makeString(bj._3, "_"), makeString(aC._3, "_")], ":")
1112- let dc = invoke(y, "saveWarehouse", [db, Y], nil)
1113- if ((dc == dc))
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))
1114948 then {
1115- let dN = invoke(y, "updateBackpack", [ac, dM], nil)
1116- if ((dN == dN))
949+ let dG = invoke(y, "updateBackpack", [ac, dF], nil)
950+ if ((dG == dG))
1117951 then {
1118- let dO = [StringEntry(aB, dL)]
1119- let dP = fraction(aC._5, J, b)
1120- let dQ = aC._5
1121- let dR = if ((dQ > 0))
1122- then (dO :+ ScriptTransfer(df, (aC._5 - dP), f))
1123- else dO
1124- let dS = fraction(aC._6, J, b)
1125- let dT = aC._6
1126- if ((dT > 0))
1127- then if ((size(bp.payments) != 1))
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))
1128962 then throw("exactly 1 payment must be attached")
1129963 else {
1130- let bE = bp.payments[0]
1131- let bF = bE.amount
1132- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
1133- if ((bG != f))
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))
1134968 then throw("USDN payments only!")
1135- else if ((bF != dT))
1136- then throw(("Payment needed is " + toString(dT)))
1137- else (dR :+ ScriptTransfer(addressFromStringValue(dk), (aC._6 - dS), f))
969+ else if ((cb != dM))
970+ then throw(("Payment needed is " + toString(dM)))
971+ else (dK :+ ScriptTransfer(addressFromStringValue(dr), (aC._6 - dL), f))
1138972 }
1139- else if ((size(bp.payments) != 0))
973+ else if ((size(bM.payments) != 0))
1140974 then throw("No payments needed")
1141- else dR
975+ else dK
1142976 }
1143977 else throw("Strict value is not equal to itself.")
1144978 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "__"
55
66 let b = 1000000
77
88 let c = 100000000
99
1010 let d = 10000000000
1111
1212 let e = take(drop(this.bytes, 1), 1)
1313
1414 let f = {
1515 let g = e
1616 if ((base58'2W' == g))
1717 then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
1818 else if ((base58'2T' == g))
1919 then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
2020 else throw("Unknown chain")
2121 }
2222
2323 let h = {
2424 let g = e
2525 if ((base58'2W' == g))
2626 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
2727 else if ((base58'2T' == g))
2828 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
2929 else throw("Unknown chain")
3030 }
3131
3232 func i (j,k) = valueOrErrorMessage(getString(j, k), makeString(["mandatory ", toString(j), ".", k, " is not defined"], ""))
3333
3434
3535 func l (k,m) = valueOrElse(getInteger(this, k), m)
3636
3737
3838 let n = 1
3939
4040 let o = 2
4141
4242 let p = 3
4343
4444 func q () = "%s__restConfig"
4545
4646
4747 func r () = "%s__restAddr"
4848
4949
5050 func s (t) = split_4C(i(t, q()), a)
5151
5252
5353 func u (v,w) = valueOrErrorMessage(addressFromString(v[w]), ("Rest cfg doesn't contain address at index " + toString(w)))
5454
5555
5656 let x = addressFromStringValue(valueOrElse(getString(this, r()), h))
5757
5858 let v = s(x)
5959
6060 let y = u(v, n)
6161
6262 let z = "Africa_F_Africa"
6363
6464 let A = 6
6565
6666 let B = 10000000000
6767
6868 let C = 158549
6969
7070 let D = 10000
7171
7272 let E = 200
7373
7474 let F = 300
7575
7676 let G = "LAND"
7777
7878 let H = "DUCK"
7979
8080 let I = 10000000000
8181
8282 let J = 10000
8383
8484 let K = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"]
8585
8686 let L = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"]
8787
8888 let M = ["First Aid Kit", "Backpack", "Food Ration", "Jet Pack", "Radar"]
8989
9090 let N = ["Americas", "Europe", "Asia", "Africa", "Oceania"]
9191
9292 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"]
9393
9494 let P = 0
9595
9696 let Q = 1
9797
9898 let R = 2
9999
100100 let S = 3
101101
102102 let T = 4
103103
104104 func U (V,W) = ((("factoryWhByContinentAndRes_" + V) + "_") + toString(W))
105105
106106
107107 func X (Y) = ("landOrder_" + Y)
108108
109109
110110 func Z (aa) = ("stakedDuckByOwner_" + aa)
111111
112112
113113 func ab (ac) = ("backPack_" + ac)
114114
115115
116116 func ad (ac) = ("duckLocation_" + ac)
117117
118118
119119 func ae () = "contractsBlocked"
120120
121121
122122 func af (ag) = ("nftOwner_" + ag)
123123
124124
125125 func ah (ag) = ("stakedTime_" + ag)
126126
127127
128128 let ai = 0
129129
130130 let aj = 1
131131
132132 let ak = 2
133133
134134 let al = 0
135135
136136 let am = 1
137137
138138 let an = 2
139139
140140 let ao = 3
141141
142142 let ap = 0
143143
144144 let aq = 1
145145
146146 let ar = 2
147147
148148 let as = 3
149149
150150 let at = 4
151151
152152 let au = 0
153153
154154 let av = 1
155155
156156 let aw = 2
157157
158158 func ax (ay) = {
159159 let g = ay
160160 if ($isInstanceOf(g, "String"))
161161 then {
162162 let az = g
163163 az
164164 }
165165 else throw("fail to cast into String")
166166 }
167167
168168
169169 func aA (aB) = {
170170 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:"), ":")
171171 [if ((size(split(aC[au], "_")) == A))
172172 then aC[au]
173173 else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aC[av], "_")) == A))
174174 then aC[av]
175175 else "0@0_0@0_0@0_0@0_0@0_0@0", aC[aw]]
176176 }
177177
178178
179179 func aD (aE) = {
180180 let aF = split(aE, "_")
181181 ((I * (parseIntValue(aF[1]) + 1)) * parseIntValue(aF[0]))
182182 }
183183
184184
185185 func aG (aH) = {
186186 func aI (aJ,aK) = (aJ + parseIntValue(aK))
187187
188188 let aL = split(aH[aq], "_")
189189 let aM = size(aL)
190190 let aN = 0
191191 func aO (aP,aQ) = if ((aQ >= aM))
192192 then aP
193193 else aI(aP, aL[aQ])
194194
195195 func aR (aP,aQ) = if ((aQ >= aM))
196196 then aP
197197 else throw("List size exceeds 6")
198198
199199 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
200200 }
201201
202202
203203 func aS (aH) = {
204204 func aI (aJ,aK) = (aJ + parseIntValue(aK))
205205
206206 let aL = split(aH[ar], "_")
207207 let aM = size(aL)
208208 let aN = 0
209209 func aO (aP,aQ) = if ((aQ >= aM))
210210 then aP
211211 else aI(aP, aL[aQ])
212212
213213 func aR (aP,aQ) = if ((aQ >= aM))
214214 then aP
215215 else throw("List size exceeds 6")
216216
217217 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
218218 }
219219
220220
221221 func aT (aH) = {
222222 let aU = aH[as]
223223 if ((aU == ""))
224224 then 0
225225 else {
226226 func aI (aJ,aK) = (aJ + parseIntValue(aK))
227227
228228 let aL = split_4C(aU, "_")
229229 let aM = size(aL)
230230 let aN = 0
231231 func aO (aP,aQ) = if ((aQ >= aM))
232232 then aP
233233 else aI(aP, aL[aQ])
234234
235235 func aR (aP,aQ) = if ((aQ >= aM))
236236 then aP
237237 else throw("List size exceeds 50")
238238
239239 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)
240240 }
241241 }
242242
243243
244244 func aV (aW,W,aX,aY) = {
245245 let aZ = U(aW, W)
246246 let ba = valueOrElse(getInteger(aZ), 0)
247247 let bb = if ((ba > B))
248248 then 0
249249 else if (((ba + aX) > B))
250250 then (B - ba)
251251 else aX
252252 let bc = (fraction(bb, ((E * C) - fraction(((100 * ba) + (50 * bb)), C, B)), d) + fraction((aX - bb), C, c))
253253 let bd = (aY - (aY / 100))
254254 if (((bd * aX) > (bc * c)))
255255 then throw((((((((((("Actual price = " + toString(bc)) + " / ") + toString(aX)) + " < minPrice = ") + toString(aY)) + ", (") + aW) + ", ") + K[W]) + ")"))
256256 else $Tuple2(IntegerEntry(aZ, (ba + aX)), bc)
257257 }
258258
259259
260260 func be (aW,bf,aX,bg) = {
261261 let aZ = U(aW, bf)
262262 let ba = valueOrElse(getInteger(aZ), 0)
263263 let bh = if ((ba > B))
264264 then min([aX, (ba - B)])
265265 else 0
266266 let bi = min([ba, (aX - bh)])
267267 let bj = (bi + bh)
268268 let bk = (fraction(bi, ((F * C) - fraction(((100 * ba) - (50 * bi)), C, B)), d) + fraction(bh, (2 * C), c))
269269 let bl = (bg + (bg / 100))
270270 if (((bk * c) > (bl * bj)))
271271 then throw((((((((((("Actual price = " + toString(bk)) + " / ") + toString(bj)) + " > maxPrice = ") + toString(bg)) + ", (") + aW) + ", ") + L[bf]) + ")"))
272272 else $Tuple3(IntegerEntry(aZ, (ba - bj)), bk, bj)
273273 }
274274
275275
276276 func bm (bn) = {
277277 let aC = split(valueOrElse(getString(y, bn), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
278278 [toString(valueOrElse(parseInt(aC[al]), 0)), if ((size(split(aC[am], "_")) == A))
279279 then aC[am]
280280 else "0_0_0_0_0_0", if ((size(split(aC[an], "_")) == A))
281281 then aC[an]
282282 else "0_0_0_0_0_0", aC[ao]]
283283 }
284284
285285
286286 func bo () = if (valueOrElse(getBoolean(y, ae()), false))
287287 then throw("Contracts are under maintenance")
288288 else unit
289289
290290
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))
293380 then throw("Permission denied")
294- else [StringEntry(r(), bq)]
381+ else [StringEntry(r(), bN)]
295382
296383
297384
298-@Callable(bp)
299-func sellResources (br,bs) = {
300- let bt = bo()
301- if ((bt == bt))
385+@Callable(bM)
386+func sellResources (bO,bP) = {
387+ let bQ = bo()
388+ if ((bQ == bQ))
302389 then {
303- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
304- if ((size(bp.payments) != 0))
390+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
391+ if ((size(bM.payments) != 0))
305392 then throw("sellResources doesn't require any payments")
306393 else {
307- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
308- if ((bu[aj] != "F"))
309- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
310397 else {
311- let aW = bu[ak]
312- let bv = bm(ab(ac))
313- let bw = split(bv[am], "_")
314- func bx (aJ,by) = if ((br[by] > parseIntValue(bw[by])))
315- then throw(((((("You have " + bw[by]) + " of ") + K[by]) + ", but tried to sell ") + toString(br[by])))
316- else if ((0 > br[by]))
317- then throw(((("You tried to sell negative amount of " + K[by]) + ": ") + toString(br[by])))
318- else if ((br[by] > 0))
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))
319406 then {
320- let bz = aV(aW, by, br[by], bs[by])
321- $Tuple3((aJ._1 :+ bz._1), (aJ._2 :+ toString((parseIntValue(bw[by]) - br[by]))), (aJ._3 + bz._2))
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))
322409 }
323- else $Tuple3(aJ._1, (aJ._2 :+ bw[by]), aJ._3)
410+ else $Tuple3(aJ._1, (aJ._2 :+ bT[bq]), aJ._3)
324411
325- let bA = {
412+ let bW = {
326413 let aL = [0, 1, 2, 3, 4, 5]
327414 let aM = size(aL)
328415 let aN = $Tuple3(nil, nil, 0)
329416 func aO (aP,aQ) = if ((aQ >= aM))
330417 then aP
331- else bx(aP, aL[aQ])
418+ else bU(aP, aL[aQ])
332419
333420 func aR (aP,aQ) = if ((aQ >= aM))
334421 then aP
335422 else throw("List size exceeds 6")
336423
337424 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
338425 }
339- let bB = makeString([bv[al], makeString(bA._2, "_"), bv[an], bv[ao]], ":")
340- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
341- $Tuple2((bA._1 :+ ScriptTransfer(bp.caller, bA._3, f)), bC)
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)
342429 }
343430 }
344431 }
345432 else throw("Strict value is not equal to itself.")
346433 }
347434
348435
349436
350-@Callable(bp)
351-func buyMaterials (br,bD) = {
352- let bt = bo()
353- if ((bt == bt))
437+@Callable(bM)
438+func buyMaterials (bO,bZ) = {
439+ let bQ = bo()
440+ if ((bQ == bQ))
354441 then {
355- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
356- if ((size(bp.payments) != 1))
442+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
443+ if ((size(bM.payments) != 1))
357444 then throw("exactly 1 payment must be attached")
358445 else {
359- let bE = bp.payments[0]
360- let bF = bE.amount
361- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
362- if ((bG != f))
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))
363450 then throw("USDN payments only!")
364451 else {
365- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
366- if ((bu[aj] != "F"))
367- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
368455 else {
369- let aW = bu[ak]
370- let bv = bm(ab(ac))
371- let bH = split(bv[an], "_")
372- func bI (aJ,by) = if ((0 > br[by]))
373- then throw(((("You tried to buy negative amount of " + L[by]) + ": ") + toString(br[by])))
374- else if ((br[by] > 0))
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))
375462 then {
376- let bz = be(aW, by, br[by], bD[by])
377- $Tuple3((aJ._1 :+ bz._1), (aJ._2 :+ toString((parseIntValue(bH[by]) + bz._3))), (aJ._3 + bz._2))
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))
378465 }
379- else $Tuple3(aJ._1, (aJ._2 :+ bH[by]), aJ._3)
466+ else $Tuple3(aJ._1, (aJ._2 :+ cd[bq]), aJ._3)
380467
381- let bA = {
468+ let bW = {
382469 let aL = [0, 1, 2, 3, 4, 5]
383470 let aM = size(aL)
384471 let aN = $Tuple3(nil, nil, 0)
385472 func aO (aP,aQ) = if ((aQ >= aM))
386473 then aP
387- else bI(aP, aL[aQ])
474+ else ce(aP, aL[aQ])
388475
389476 func aR (aP,aQ) = if ((aQ >= aM))
390477 then aP
391478 else throw("List size exceeds 6")
392479
393480 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
394481 }
395- if ((bA._3 > bF))
396- then throw(((("Insufficient payment! Attached=" + toString(bF)) + ", required=") + toString(bA._3)))
482+ if ((bW._3 > cb))
483+ then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3)))
397484 else {
398- let bB = makeString([bv[al], bv[am], makeString(bA._2, "_"), bv[ao]], ":")
399- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
400- let t = if (((bF - bA._3) > 0))
401- then [ScriptTransfer(bp.caller, (bF - bA._3), f)]
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)]
402489 else nil
403- $Tuple2((bA._1 ++ t), bC)
490+ $Tuple2((bW._1 ++ t), bY)
404491 }
405492 }
406493 }
407494 }
408495 }
409496 else throw("Strict value is not equal to itself.")
410497 }
411498
412499
413500
414-@Callable(bp)
415-func exchangeResources (br) = {
416- let bt = bo()
417- if ((bt == bt))
501+@Callable(bM)
502+func exchangeResources (bO) = {
503+ let bQ = bo()
504+ if ((bQ == bQ))
418505 then {
419- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
420- if ((size(bp.payments) != 1))
506+ let ac = valueOrErrorMessage(getString(y, Z(toString(bM.caller))), "You don't have a duck staked")
507+ if ((size(bM.payments) != 1))
421508 then throw("exactly 1 payment must be attached")
422509 else {
423- let bE = bp.payments[0]
424- let bF = bE.amount
425- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
426- if ((bG != f))
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))
427514 then throw("USDN payments only!")
428515 else {
429- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
430- if ((bu[aj] != "F"))
431- then throw(("Duck location type should be Factory, but is " + bu[aj]))
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]))
432519 else {
433- let aW = bu[ak]
434- let bv = bm(ab(ac))
435- let bw = split(bv[am], "_")
436- let bH = split(bv[an], "_")
437- func bJ (aJ,by) = {
438- let aZ = U(aW, by)
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)
439526 let ba = valueOrElse(getInteger(aZ), 0)
440- let bK = br[by]
441- if ((bK > parseIntValue(bw[by])))
442- then throw(((((("You have " + bw[by]) + " of ") + K[by]) + ", but tried to exchange ") + toString(bK)))
443- else if ((0 > bK))
444- then throw(((("You tried to exchange negative amount of " + K[by]) + ": ") + toString(bK)))
445- else if ((bK > 0))
446- then $Tuple4((aJ._1 :+ toString((parseIntValue(bw[by]) - bK))), (aJ._2 :+ toString((parseIntValue(bH[by]) + bK))), (aJ._3 + fraction(bK, C, c)), (aJ._4 :+ IntegerEntry(aZ, ba)))
447- else $Tuple4((aJ._1 :+ bw[by]), (aJ._2 :+ bH[by]), aJ._3, aJ._4)
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)
448535 }
449536
450- let bA = {
537+ let bW = {
451538 let aL = [0, 1, 2, 3, 4, 5]
452539 let aM = size(aL)
453540 let aN = $Tuple4(nil, nil, 0, nil)
454541 func aO (aP,aQ) = if ((aQ >= aM))
455542 then aP
456- else bJ(aP, aL[aQ])
543+ else cf(aP, aL[aQ])
457544
458545 func aR (aP,aQ) = if ((aQ >= aM))
459546 then aP
460547 else throw("List size exceeds 6")
461548
462549 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
463550 }
464- if ((bA._3 > bF))
465- then throw(((("Insufficient payment! Attached=" + toString(bF)) + ", required=") + toString(bA._3)))
551+ if ((bW._3 > cb))
552+ then throw(((("Insufficient payment! Attached=" + toString(cb)) + ", required=") + toString(bW._3)))
466553 else {
467- let bB = makeString([bv[al], makeString(bA._1, "_"), makeString(bA._2, "_"), bv[ao]], ":")
468- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
469- let t = if (((bF - bA._3) > 0))
470- then [ScriptTransfer(bp.caller, (bF - bA._3), f)]
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)]
471558 else nil
472- $Tuple2((t ++ bA._4), bC)
559+ $Tuple2((t ++ bW._4), bY)
473560 }
474561 }
475562 }
476563 }
477564 }
478565 else throw("Strict value is not equal to itself.")
479566 }
480567
481568
482569
483-@Callable(bp)
484-func buyGoods (bL,bM,bN) = {
485- let bt = bo()
486- if ((bt == bt))
487- then if ((size(bp.payments) != 0))
570+@Callable(bM)
571+func buyGoods (ch,ci,cj) = {
572+ let bQ = bo()
573+ if ((bQ == bQ))
574+ then if ((size(bM.payments) != 0))
488575 then throw("buyGoods doesn't require any payments")
489- else if ((0 > bN))
576+ else if ((0 > cj))
490577 then throw("Quantity should be positive")
491578 else {
492- let ac = valueOrErrorMessage(getString(y, Z(toString(bp.caller))), "You don't have a duck staked")
493- let bu = split(valueOrElse(getString(y, ad(ac)), z), "_")
494- if ((bu[aj] != "M"))
495- then throw(("Duck location type should be Manufactory, but is " + bu[aj]))
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]))
496583 else {
497- let bO = bu[ai]
498- let bv = bm(ab(ac))
499- let bH = split(bv[an], "_")
500- if (if ((0 > bL))
584+ let ck = bR[ai]
585+ let bS = bm(ab(ac))
586+ let cd = split(bS[an], "_")
587+ if (if ((0 > ch))
501588 then true
502- else (bL >= size(O)))
503- then throw(("Unknown product idx=" + toString(bL)))
589+ else (ch >= size(O)))
590+ then throw(("Unknown product idx=" + toString(ch)))
504591 else {
505- let bP = (bL % size(N))
506- if ((N[bP] != bO))
507- then throw(((("This product is available in " + N[bP]) + ", but you are in ") + bO))
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))
508595 else {
509- let bQ = split(O[bL], "_")
510- if ((size(bQ) != (A + 2)))
511- then throw(("Fatal: unknown recipe: " + O[bL]))
596+ let cm = split(O[ch], "_")
597+ if ((size(cm) != (A + 2)))
598+ then throw(("Fatal: unknown recipe: " + O[ch]))
512599 else {
513- let bR = if ((bv[ao] == ""))
600+ let cn = if ((bS[ao] == ""))
514601 then nil
515- else split(bv[ao], "_")
516- func bS (aJ,bT) = {
517- let bU = aJ._2
518- let bV = if ((size(bR) > bU))
519- then split(bR[bU], ",")
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], ",")
520607 else ["0", "0", "0"]
521- let bW = bV[0]
522- let bX = parseIntValue(bW)
523- let bY = bV[1]
524- let bZ = parseIntValue(bY)
525- let ca = bV[2]
526- let cb = parseIntValue(ca)
527- let aX = (bN * parseIntValue(bQ[7]))
528- let cc = if ((bU == bL))
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))
529616 then {
530- let g = bM
617+ let g = ci
531618 if ((1 == g))
532- then ((((toString((bX + aX)) + ",") + bY) + ",") + ca)
619+ then ((((toString((ct + aX)) + ",") + cu) + ",") + cw)
533620 else if ((2 == g))
534- then ((((bW + ",") + toString((bZ + aX))) + ",") + ca)
621+ then ((((cs + ",") + toString((cv + aX))) + ",") + cw)
535622 else if ((3 == g))
536- then ((((bW + ",") + bY) + ",") + toString((cb + aX)))
537- else throw(("Product level should be 1..3, not " + toString(bM)))
623+ then ((((cs + ",") + cu) + ",") + toString((cx + aX)))
624+ else throw(("Product level should be 1..3, not " + toString(ci)))
538625 }
539- else ((((bW + ",") + bY) + ",") + ca)
540- $Tuple2((aJ._1 :+ cc), (bU + 1))
626+ else ((((cs + ",") + cu) + ",") + cw)
627+ $Tuple2((aJ._1 :+ cy), (cq + 1))
541628 }
542629
543- let cd = ( let aL = O
630+ let cz = ( let aL = O
544631 let aM = size(aL)
545632 let aN = $Tuple2(nil, 0)
546633 func aO (aP,aQ) = if ((aQ >= aM))
547634 then aP
548- else bS(aP, aL[aQ])
635+ else co(aP, aL[aQ])
549636
550637 func aR (aP,aQ) = if ((aQ >= aM))
551638 then aP
552639 else throw("List size exceeds 50")
553640
554641 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 ce (aJ,by) = {
556- let cf = (parseIntValue(bQ[by]) * bN)
557- let cg = parseIntValue(bH[by])
558- if ((cf > cg))
559- then throw(((((((("You have " + bH[by]) + " of ") + L[by]) + ", but recipe requires ") + toString(cf)) + " for quantity ") + toString(bN)))
560- else if ((cf > 0))
561- then (aJ :+ toString((cg - cf)))
562- else (aJ :+ bH[by])
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])
563650 }
564651
565- let bA = {
652+ let bW = {
566653 let aL = [0, 1, 2, 3, 4, 5]
567654 let aM = size(aL)
568655 let aN = nil
569- func ch (aP,aQ) = if ((aQ >= aM))
656+ func cD (aP,aQ) = if ((aQ >= aM))
570657 then aP
571- else ce(aP, aL[aQ])
658+ else cA(aP, aL[aQ])
572659
573- func ci (aP,aQ) = if ((aQ >= aM))
660+ func cE (aP,aQ) = if ((aQ >= aM))
574661 then aP
575662 else throw("List size exceeds 6")
576663
577- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
664+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
578665 }
579- let bB = makeString([bv[al], bv[am], makeString(bA, "_"), makeString(cd, "_")], ":")
580- let bC = ax(invoke(y, "updateBackpack", [ac, bB], nil))
581- $Tuple2(nil, bC)
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)
582669 }
583670 }
584671 }
585672 }
586673 }
587674 else throw("Strict value is not equal to itself.")
588675 }
589676
590677
591678
592-@Callable(bp)
593-func acceptServicePayment (cj) = {
594- let bt = bo()
595- if ((bt == bt))
596- then if ((size(bp.payments) != 1))
679+@Callable(bM)
680+func acceptServicePayment (cF) = {
681+ let bQ = bo()
682+ if ((bQ == bQ))
683+ then if ((size(bM.payments) != 1))
597684 then throw("exactly 1 payment must be attached")
598685 else {
599- let bE = bp.payments[0]
600- let bF = bE.amount
601- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
602- if ((bG != f))
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))
603690 then throw("USDN payments only!")
604691 else {
605- let ck = {
606- let g = cj
692+ let cG = {
693+ let g = cF
607694 if (("LAND_RENAME" == g))
608695 then 10000000
609696 else throw("Unknown service!")
610697 }
611- if ((bF != ck))
612- then throw((((cj + " costs ") + toString(ck)) + " USDN"))
613- else $Tuple2(nil, bF)
698+ if ((cb != cG))
699+ then throw((((cF + " costs ") + toString(cG)) + " USDN"))
700+ else $Tuple2(nil, cb)
614701 }
615702 }
616703 else throw("Strict value is not equal to itself.")
617704 }
618705
619706
620707
621-@Callable(bp)
622-func setWarehouseOrder (cl,Y) = {
623- let cm = bp.originCaller
624- let cn = toString(cm)
625- let co = value(assetInfo(fromBase58String(Y)))
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)))
626713 if (!(isDefined(getInteger(y, ah(Y)))))
627- then throw((("NFT " + co.name) + " is not staked"))
714+ then throw((("NFT " + cK.name) + " is not staked"))
628715 else {
629- let cp = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + co.name) + " is orphaned"))
630- if ((cp != cn))
716+ let cL = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + cK.name) + " is orphaned"))
717+ if ((cL != cJ))
631718 then throw((G + " is not yours"))
632719 else {
633- let cq = split_4C(cl, ":")
634- if ((size(cq) != 3))
720+ let cM = split_4C(cH, ":")
721+ if ((size(cM) != 3))
635722 then throw("cargoListStr should contain exactly 2 ':' separators")
636723 else {
637- let cr = split(cq[0], "_")
638- let cs = split(cq[1], "_")
639- let ct = if ((cq[2] == ""))
724+ let cN = split(cM[0], "_")
725+ let cO = split(cM[1], "_")
726+ let cP = if ((cM[2] == ""))
640727 then nil
641- else split(cq[2], "_")
642- if ((size(cr) != A))
728+ else split(cM[2], "_")
729+ if ((size(cN) != A))
643730 then throw("All 6 resources should be passed")
644- else if ((size(cs) != A))
731+ else if ((size(cO) != A))
645732 then throw("All 6 materials should be passed")
646733 else {
647- let cu = ax(invoke(y, "getWarehouseREADONLY", [Y], nil))
648- let aH = split_4C(cu, ":")
649- let cv = split(aH[aq], "_")
650- let cw = split(aH[ar], "_")
651- let cx = if ((aH[as] == ""))
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] == ""))
652739 then nil
653740 else split(aH[as], "_")
654- let cy = aG(aH)
655- let cz = aS(aH)
656- let cA = aT(aH)
657- let cB = parseIntValue(aH[at])
658- let cC = ((((aD(aH[ap]) - cy) - cz) - cA) - cB)
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)
659746 let aB = X(Y)
660- let cD = aA(aB)
661- let cE = split(cD[au], "_")
662- let cF = split(cD[av], "_")
663- let cG = if ((cD[aw] == ""))
747+ let cZ = aA(aB)
748+ let da = split(cZ[au], "_")
749+ let db = split(cZ[av], "_")
750+ let dc = if ((cZ[aw] == ""))
664751 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
711756 let aM = size(aL)
712- let aN = $Tuple4(0, nil, 0, 0)
757+ let aN = $Tuple6(0, nil, 0, 0, cR, da)
713758 func aO (aP,aQ) = if ((aQ >= aM))
714759 then aP
715- else cI(aP, aL[aQ])
760+ else bp(aP, aL[aQ])
716761
717762 func aR (aP,aQ) = if ((aQ >= aM))
718763 then aP
719764 else throw("List size exceeds 6")
720765
721766 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
722767 }
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])
764775
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))
774777 then aP
775778 else throw("List size exceeds 6")
776779
777- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
780+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
778781 }
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])
820789
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))
830791 then aP
831792 else throw("List size exceeds 50")
832793
833- cZ(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(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)
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)
834795 }
835- let da = aC._3
836- if ((da > cC))
837- then throw((((("Attempt to reserve " + toString(da)) + " space, but only ") + toString(cC)) + " warehouse space left"))
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"))
838799 else {
839- let db = makeString_2C([aH[ap], makeString(cT._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_"), toString(da)], ":")
840- let dc = invoke(y, "saveWarehouse", [db, Y], nil)
841- if ((dc == dc))
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))
842803 then {
843- let dd = aC._4
844- if ((dd > 0))
845- then if ((size(bp.payments) != 1))
804+ let dk = aC._4
805+ if ((dk > 0))
806+ then if ((size(bM.payments) != 1))
846807 then throw("exactly 1 payment must be attached")
847808 else {
848- let bE = bp.payments[0]
849- let bF = bE.amount
850- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
851- if ((bG != f))
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))
852813 then throw("USDN payments only!")
853- else if ((bF != dd))
854- then throw(("Payment needed is " + toString(dd)))
855- else [StringEntry(aB, cl)]
814+ else if ((cb != dk))
815+ then throw(("Payment needed is " + toString(dk)))
816+ else [StringEntry(aB, cH)]
856817 }
857- else if ((dd == 0))
858- then if ((size(bp.payments) != 0))
818+ else if ((dk == 0))
819+ then if ((size(bM.payments) != 0))
859820 then throw("No payments needed")
860- else [StringEntry(aB, cl)]
861- else if ((size(bp.payments) != 0))
821+ else [StringEntry(aB, cH)]
822+ else if ((size(bM.payments) != 0))
862823 then throw("No payments needed")
863- else [ScriptTransfer(cm, -(dd), f), StringEntry(aB, cl)]
824+ else [ScriptTransfer(cI, -(dk), f), StringEntry(aB, cH)]
864825 }
865826 else throw("Strict value is not equal to itself.")
866827 }
867828 }
868829 }
869830 }
870831 }
871832 }
872833
873834
874835
875-@Callable(bp)
876-func acceptWarehouseOrder (de,Y,ac) = {
877- let df = bp.originCaller
878- let dg = toString(df)
879- let dh = valueOrErrorMessage(getString(y, Z(dg)), "You don't have a duck staked")
880- let bu = valueOrElse(getString(y, ad(dh)), z)
881- let di = split(value(bu), "_")
882- if ((di[aj] != "L"))
883- then throw((("Duck location type is " + di[aj]) + ", but should be L"))
884- else if ((dh != ac))
885- then throw(((("Your staked duck is " + dh) + ", but passed ") + ac))
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))
886847 else {
887- let dj = value(assetInfo(fromBase58String(Y)))
848+ let dq = value(assetInfo(fromBase58String(Y)))
888849 if (!(isDefined(getInteger(y, ah(Y)))))
889- then throw((("NFT " + dj.name) + " is not staked"))
850+ then throw((("NFT " + dq.name) + " is not staked"))
890851 else {
891- let dk = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dj.name) + " is orphaned"))
892- if ((dk == dg))
852+ let dr = valueOrErrorMessage(getString(y, af(Y)), (("NFT " + dq.name) + " is orphaned"))
853+ if ((dr == dn))
893854 then throw("You cannot trade with yourself")
894855 else {
895- let dl = split_4C(de, ":")
896- if ((size(dl) != 3))
856+ let ds = split_4C(dl, ":")
857+ if ((size(ds) != 3))
897858 then throw("bpOrderStr should contain exactly 2 ':' separators")
898859 else {
899- let dm = split(dl[0], "_")
900- let dn = split(dl[1], "_")
901- let do = if ((dl[2] == ""))
860+ let dt = split(ds[0], "_")
861+ let du = split(ds[1], "_")
862+ let dv = if ((ds[2] == ""))
902863 then nil
903- else split(dl[2], "_")
904- if ((size(dm) != A))
864+ else split(ds[2], "_")
865+ if ((size(dt) != A))
905866 then throw("All 6 resources should be passed")
906- else if ((size(dn) != A))
867+ else if ((size(du) != A))
907868 then throw("All 6 materials should be passed")
908869 else {
909- let cu = ax(invoke(y, "getWarehouseREADONLY", [Y], nil))
910- let aH = split_4C(cu, ":")
911- let cv = split(aH[aq], "_")
912- let cw = split(aH[ar], "_")
913- let cx = if ((aH[as] == ""))
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] == ""))
914875 then nil
915876 else split(aH[as], "_")
916- let cy = aG(aH)
917- let cz = aS(aH)
918- let cA = aT(aH)
919- let cB = parseIntValue(aH[at])
920- let cC = ((((aD(aH[ap]) - cy) - cz) - cA) - cB)
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)
921882 let bn = ab(ac)
922- let bv = bm(bn)
923- let dp = split(bv[am], "_")
924- let dq = split(bv[an], "_")
925- let dr = if ((bv[ao] == ""))
883+ let bS = bm(bn)
884+ let dw = split(bS[am], "_")
885+ let dx = split(bS[an], "_")
886+ let dy = if ((bS[ao] == ""))
926887 then nil
927- else split(bv[ao], "_")
888+ else split(bS[ao], "_")
928889 let aB = X(Y)
929- let ds = aA(aB)
930- let dt = split(ds[au], "_")
931- let du = split(ds[av], "_")
932- let dv = if ((ds[aw] == ""))
890+ let dz = aA(aB)
891+ let dA = split(dz[au], "_")
892+ let dB = split(dz[av], "_")
893+ let dC = if ((dz[aw] == ""))
933894 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
980899 let aM = size(aL)
981- let aN = $Tuple6(nil, nil, nil, 0, 0, 0)
900+ let aN = $Tuple10(nil, nil, nil, 0, 0, 0, 0, dw, cR, dA)
982901 func aO (aP,aQ) = if ((aQ >= aM))
983902 then aP
984- else cI(aP, aL[aQ])
903+ else bB(aP, aL[aQ])
985904
986905 func aR (aP,aQ) = if ((aQ >= aM))
987906 then aP
988907 else throw("List size exceeds 6")
989908
990909 aR(aO(aO(aO(aO(aO(aO(aN, 0), 1), 2), 3), 4), 5), 6)
991910 }
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])
1033918
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))
1043920 then aP
1044921 else throw("List size exceeds 6")
1045922
1046- ci(ch(ch(ch(ch(ch(ch(aN, 0), 1), 2), 3), 4), 5), 6)
923+ cE(cD(cD(cD(cD(cD(cD(aN, 0), 1), 2), 3), 4), 5), 6)
1047924 }
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])
1090932
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))
1100934 then aP
1101935 else throw("List size exceeds 50")
1102936
1103- cZ(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(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)
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)
1104938 }
1105- let da = aC._4
1106- let dK = if ((0 > (cB - da)))
939+ let dh = aC._4
940+ let dD = if ((0 > (cX - dh)))
1107941 then 0
1108- else (cB - da)
1109- let db = makeString_2C([aH[ap], makeString(cT._1, "_"), makeString(bj._1, "_"), makeString(aC._1, "_"), toString(dK)], ":")
1110- let dL = makeString_2C([makeString(cT._2, "_"), makeString(bj._2, "_"), makeString(aC._2, "_")], ":")
1111- let dM = makeString_2C([bv[al], makeString(cT._3, "_"), makeString(bj._3, "_"), makeString(aC._3, "_")], ":")
1112- let dc = invoke(y, "saveWarehouse", [db, Y], nil)
1113- if ((dc == dc))
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))
1114948 then {
1115- let dN = invoke(y, "updateBackpack", [ac, dM], nil)
1116- if ((dN == dN))
949+ let dG = invoke(y, "updateBackpack", [ac, dF], nil)
950+ if ((dG == dG))
1117951 then {
1118- let dO = [StringEntry(aB, dL)]
1119- let dP = fraction(aC._5, J, b)
1120- let dQ = aC._5
1121- let dR = if ((dQ > 0))
1122- then (dO :+ ScriptTransfer(df, (aC._5 - dP), f))
1123- else dO
1124- let dS = fraction(aC._6, J, b)
1125- let dT = aC._6
1126- if ((dT > 0))
1127- then if ((size(bp.payments) != 1))
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))
1128962 then throw("exactly 1 payment must be attached")
1129963 else {
1130- let bE = bp.payments[0]
1131- let bF = bE.amount
1132- let bG = valueOrErrorMessage(bE.assetId, "WAVES can't be used as payment")
1133- if ((bG != f))
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))
1134968 then throw("USDN payments only!")
1135- else if ((bF != dT))
1136- then throw(("Payment needed is " + toString(dT)))
1137- else (dR :+ ScriptTransfer(addressFromStringValue(dk), (aC._6 - dS), f))
969+ else if ((cb != dM))
970+ then throw(("Payment needed is " + toString(dM)))
971+ else (dK :+ ScriptTransfer(addressFromStringValue(dr), (aC._6 - dL), f))
1138972 }
1139- else if ((size(bp.payments) != 0))
973+ else if ((size(bM.payments) != 0))
1140974 then throw("No payments needed")
1141- else dR
975+ else dK
1142976 }
1143977 else throw("Strict value is not equal to itself.")
1144978 }
1145979 else throw("Strict value is not equal to itself.")
1146980 }
1147981 }
1148982 }
1149983 }
1150984 }
1151985 }
1152986
1153987

github/deemru/w8io/169f3d6 
445.08 ms