tx · Gt715AXgjyyUeq3fSX3czVf8VE4tjAac4vUHmiv6bmp5

3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep:  -0.03600000 Waves

2023.08.01 02:17 [2690706] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves

{ "type": 13, "id": "Gt715AXgjyyUeq3fSX3czVf8VE4tjAac4vUHmiv6bmp5", "fee": 3600000, "feeAssetId": null, "timestamp": 1690845454200, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "4wQXvogrWUUirWrh8jZuXgS7cqDLuwbCsPz7yx3wezraeYFwxximWipf67DQn14KRYkrwTWaaoynVGETRgvVZwdp" ], "script": "base64:BgI7CAISBAoCCBgSAwoBCBIECgIRERIECgIRERIDCgEREgQKAgEBEgQKAggIEgUKAwgICBIDCgEREgMKAQhSAAd4cFRyYWRlAJBOAAd4cENyYWZ0AJBOAAp4cFNlbGxUb0VzAJBOAAZ4cFNob3AAkE4ACkxBTkRQUkVGSVgCBExBTkQABk5VTVJFUwAGAA9ERUZBVUxUTE9DQVRJT04CD0FmcmljYV9GX0FmcmljYQAQUkVTT1VSQ0VQUklDRU1JTgDVtQIADUVTTUFYUEFDS0FHRVMAAwAJRVNCVVlDT0VGAAQACHJlc1R5cGVzCQDMCAICA09pbAkAzAgCAgNPcmUJAMwIAgIEV29vZAkAzAgCAgRTYW5kCQDMCAICBENsYXkJAMwIAgIHT3JnYW5pYwUDbmlsAAhtYXRUeXBlcwkAzAgCAgRGdWVsCQDMCAICBU1ldGFsCQDMCAICBVBsYW5rCQDMCAICBUdsYXNzCQDMCAICB1BsYXN0aWMJAMwIAgIHUHJvdGVpbgUDbmlsAAlwcm9kVHlwZXMJAMwIAgIQRmlyc3QgQWlkIEtpdCBMMQkAzAgCAhBGaXJzdCBBaWQgS2l0IEwyCQDM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UGbWVyZ2VkAl8yBQt1c2R0QXNzZXRJZAUDbmlsCQCVCgMFBmJwU2F2ZQUMcHJvbG9nUmVzdWx0BQtzdGF0c1Jlc3VsdAFpAQ91cGRhdGVFc1N0b3JhZ2UBCm5ld1N0b3JhZ2UDCQECIT0CCAUBaQZjYWxsZXIFD3N0YWtpbmdDb250cmFjdAkAAgECEVBlcm1pc3Npb24gZGVuaWVkCQCUCgIJAMwIAgkBC1N0cmluZ0VudHJ5AgkBDmtleUVzV2FyZWhvdXNlAAUKbmV3U3RvcmFnZQUDbmlsBQpuZXdTdG9yYWdlAGiKr90=", "height": 2690706, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 61mWhTJ6ootfGoKXpB9Uq2bWGBdaDTRB5LBbUgs6P88a Next: 67Z7yg8MeaGFHDS5RG2KPGpGArrooViCzg5ihYD2geWB Diff:
OldNewDifferences
176176
177177 func az (aA,aB) = {
178178 let aC = pow(10, 0, aB, 0, 0, DOWN)
179- ((toString((aA / aC)) + ".") + toString((aA % aC)))
179+ let aD = toString((aA % aC))
180+ let aE = size(aD)
181+ let aF = take(toString(aC), aE)
182+ (((toString((aA / aC)) + ".") + aF) + aD)
180183 }
181184
182185
183-let aD = 10000000000
186+let aG = 10000000000
184187
185-let aE = 200
188+let aH = 200
186189
187-let aF = 300
190+let aI = 300
188191
189-let aG = 10000
192+let aJ = 10000
190193
191-func aH (aI,aJ) = ((("factoryWhByContinentAndRes_" + aI) + "_") + toString(aJ))
194+func aK (aL,aM) = ((("factoryWhByContinentAndRes_" + aL) + "_") + toString(aM))
192195
193196
194-let aK = 0
197+let aN = 0
195198
196-let aL = 1
199+let aO = 1
197200
198-let aM = 2
201+let aP = 2
199202
200-func aN (aO) = {
201- let aP = split(valueOrElse(getString(aO), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":")
202-[if ((size(split(aP[aK], "_")) == f))
203- then aP[aK]
204- else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aP[aL], "_")) == f))
205- then aP[aL]
206- else "0@0_0@0_0@0_0@0_0@0_0@0", aP[aM]]
203+func aQ (aR) = {
204+ let aS = split(valueOrElse(getString(aR), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":")
205+[if ((size(split(aS[aN], "_")) == f))
206+ then aS[aN]
207+ else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aS[aO], "_")) == f))
208+ then aS[aO]
209+ else "0@0_0@0_0@0_0@0_0@0_0@0", aS[aP]]
207210 }
208211
209212
210-func aQ (aR,aS,aT) = if (aT)
213+func aT (aU,aV,aW) = if (aW)
211214 then {
212- let aU = if ((aR >= 0))
213- then (((aR + aS) - 1) / aS)
214- else -((((-(aR) + aS) - 1) / aS))
215- (aU * ae)
215+ let aX = if ((aU >= 0))
216+ then (((aU + aV) - 1) / aV)
217+ else -((((-(aU) + aV) - 1) / aV))
218+ (aX * ae)
216219 }
217- else aR
220+ else aU
218221
219222
220-func aV (aW,aJ,aR,aX) = {
221- let aY = aH(aW, aJ)
222- let aZ = valueOrElse(getInteger(aY), 0)
223- let ba = if ((aZ > aD))
223+func aY (aZ,aM,aU,ba) = {
224+ let bb = aK(aZ, aM)
225+ let bc = valueOrElse(getInteger(bb), 0)
226+ let bd = if ((bc > aG))
224227 then 0
225- else if (((aZ + aR) > aD))
226- then (aD - aZ)
227- else aR
228- let bb = (fraction(ba, ((aE * h) - fraction(((100 * aZ) + (50 * ba)), h, aD)), af) + fraction((aR - ba), h, ae))
229- let bc = (aX - (aX / 100))
230- if (((bc * aR) > (bb * ae)))
231- then throw((((((((((("Actual price = " + toString(bb)) + " / ") + toString(aR)) + " < minPrice = ") + toString(aX)) + ", (") + aW) + ", ") + k[aJ]) + ")"))
232- else $Tuple2(IntegerEntry(aY, (aZ + aR)), bb)
228+ else if (((bc + aU) > aG))
229+ then (aG - bc)
230+ else aU
231+ let be = (fraction(bd, ((aH * h) - fraction(((100 * bc) + (50 * bd)), h, aG)), af) + fraction((aU - bd), h, ae))
232+ let bf = (ba - (ba / 100))
233+ if (((bf * aU) > (be * ae)))
234+ then throw((((((((((("Actual price = " + toString(be)) + " / ") + toString(aU)) + " < minPrice = ") + toString(ba)) + ", (") + aZ) + ", ") + k[aM]) + ")"))
235+ else $Tuple2(IntegerEntry(bb, (bc + aU)), be)
233236 }
234237
235238
236-func bd (aW,be,aR,bf) = {
237- let aY = aH(aW, be)
238- let aZ = valueOrElse(getInteger(aY), 0)
239- let bg = if ((aZ > aD))
240- then min([aR, (aZ - aD)])
239+func bg (aZ,bh,aU,bi) = {
240+ let bb = aK(aZ, bh)
241+ let bc = valueOrElse(getInteger(bb), 0)
242+ let bj = if ((bc > aG))
243+ then min([aU, (bc - aG)])
241244 else 0
242- let bh = min([aZ, (aR - bg)])
243- let bi = (bh + bg)
244- let bj = (fraction(bh, ((aF * h) - fraction(((100 * aZ) - (50 * bh)), h, aD)), af) + fraction(bg, (2 * h), ae))
245- let bk = (bf + (bf / 100))
246- if (((bj * ae) > (bk * bi)))
247- then throw((((((((((("Actual price = " + toString(bj)) + " / ") + toString(bi)) + " > maxPrice = ") + toString(bf)) + ", (") + aW) + ", ") + l[be]) + ")"))
248- else $Tuple3(IntegerEntry(aY, (aZ - bi)), bj, bi)
245+ let bk = min([bc, (aU - bj)])
246+ let bl = (bk + bj)
247+ let bm = (fraction(bk, ((aI * h) - fraction(((100 * bc) - (50 * bk)), h, aG)), af) + fraction(bj, (2 * h), ae))
248+ let bn = (bi + (bi / 100))
249+ if (((bm * ae) > (bn * bl)))
250+ then throw((((((((((("Actual price = " + toString(bm)) + " / ") + toString(bl)) + " > maxPrice = ") + toString(bi)) + ", (") + aZ) + ", ") + l[bh]) + ")"))
251+ else $Tuple3(IntegerEntry(bb, (bc - bl)), bm, bl)
249252 }
250253
251254
252-func bl (bm) = {
253- let aP = split(valueOrElse(getString(at, bm), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
254-[toString(valueOrElse(parseInt(aP[B]), 0)), if ((size(split(aP[C], "_")) == f))
255- then aP[C]
256- else "0_0_0_0_0_0", if ((size(split(aP[D], "_")) == f))
257- then aP[D]
258- else "0_0_0_0_0_0", aP[E]]
255+func bo (bp) = {
256+ let aS = split(valueOrElse(getString(at, bp), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
257+[toString(valueOrElse(parseInt(aS[B]), 0)), if ((size(split(aS[C], "_")) == f))
258+ then aS[C]
259+ else "0_0_0_0_0_0", if ((size(split(aS[D], "_")) == f))
260+ then aS[D]
261+ else "0_0_0_0_0_0", aS[E]]
259262 }
260263
261264
262-func bn () = if (valueOrElse(getBoolean(at, P()), false))
265+func bq () = if (valueOrElse(getBoolean(at, P()), false))
263266 then throw("Contracts are under maintenance")
264267 else unit
265268
266269
267-func bo () = ax(invoke(at, "saveLastTx", nil, nil))
270+func br () = ax(invoke(at, "saveLastTx", nil, nil))
268271
269272
270-func bp (bq,br) = {
271- let bs = bq._1
272- let bt = bq._8
273- let bu = split(br, "@")
274- if ((size(bu) != 2))
273+func bs (bt,bu) = {
274+ let bv = bt._1
275+ let bw = bt._8
276+ let bx = split(bu, "@")
277+ if ((size(bx) != 2))
275278 then throw("Incorrect order format, should be amount@price")
276279 else {
277- let bv = parseIntValue(bu[0])
278- let bw = parseIntValue(bu[1])
279- let bx = fraction(bv, bw, ae)
280- let by = aQ(bv, t, bt)
281- let bz = if ((size(bq._6) > bs))
282- then parseIntValue(bq._6[bs])
280+ let by = parseIntValue(bx[0])
281+ let bz = parseIntValue(bx[1])
282+ let bA = fraction(by, bz, ae)
283+ let bB = aT(by, t, bw)
284+ let bC = if ((size(bt._6) > bv))
285+ then parseIntValue(bt._6[bv])
283286 else 0
284- let bA = split(if ((size(bq._7) > bs))
285- then bq._7[bs]
287+ let bD = split(if ((size(bt._7) > bv))
288+ then bt._7[bv]
286289 else "0@0", "@")
287- let bB = parseIntValue(bA[0])
288- let bC = parseIntValue(bA[1])
289- if (if ((0 > bC))
290+ let bE = parseIntValue(bD[0])
291+ let bF = parseIntValue(bD[1])
292+ if (if ((0 > bF))
290293 then true
291- else (0 > bw))
294+ else (0 > bz))
292295 then throw("Price can't be negative")
293296 else {
294- let bD = fraction(bB, bC, ae)
295- if ((bv == 0))
296- then if ((bB > 0))
297- then $Tuple9((bs + 1), (bq._2 :+ toString(bz)), bq._3, bq._4, (bq._5 - bD), bq._6, bq._7, bt, (bq._9 + aQ(bz, t, bt)))
298- else $Tuple9((bs + 1), (bq._2 :+ toString((bz - bB))), bq._3, bq._4, bq._5, bq._6, bq._7, bt, (bq._9 + aQ((bz - bB), t, bt)))
299- else if ((bv > 0))
300- then if ((0 > bB))
301- then $Tuple9((bs + 1), (bq._2 :+ toString((bz - bB))), (bq._3 + by), bq._4, (bq._5 + bx), bq._6, bq._7, bt, aQ((bz - bB), t, bt))
302- else $Tuple9((bs + 1), (bq._2 :+ toString(bz)), (bq._3 + by), bq._4, ((bq._5 + bx) - bD), bq._6, bq._7, bt, aQ(bz, t, bt))
303- else if ((0 > bB))
297+ let bG = fraction(bE, bF, ae)
298+ if ((by == 0))
299+ then if ((bE > 0))
300+ then $Tuple9((bv + 1), (bt._2 :+ toString(bC)), bt._3, bt._4, (bt._5 - bG), bt._6, bt._7, bw, (bt._9 + aT(bC, t, bw)))
301+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC - bE))), bt._3, bt._4, bt._5, bt._6, bt._7, bw, (bt._9 + aT((bC - bE), t, bw)))
302+ else if ((by > 0))
303+ then if ((0 > bE))
304+ then $Tuple9((bv + 1), (bt._2 :+ toString((bC - bE))), (bt._3 + bB), bt._4, (bt._5 + bA), bt._6, bt._7, bw, aT((bC - bE), t, bw))
305+ else $Tuple9((bv + 1), (bt._2 :+ toString(bC)), (bt._3 + bB), bt._4, ((bt._5 + bA) - bG), bt._6, bt._7, bw, aT(bC, t, bw))
306+ else if ((0 > bE))
304307 then {
305- let bE = (bB - bv)
306- if ((0 > (bz - bE)))
307- then throw((((("Attempt to take " + toString(bE)) + " from warehouse, but only ") + toString(bz)) + " available"))
308- else $Tuple9((bs + 1), (bq._2 :+ toString((bz - bE))), bq._3, (bq._4 - by), bq._5, bq._6, bq._7, bt, aQ((bz - bE), t, bt))
308+ let bH = (bE - by)
309+ if ((0 > (bC - bH)))
310+ then throw((((("Attempt to take " + toString(bH)) + " from warehouse, but only ") + toString(bC)) + " available"))
311+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC - bH))), bt._3, (bt._4 - bB), bt._5, bt._6, bt._7, bw, aT((bC - bH), t, bw))
309312 }
310- else if ((0 > (bz + bv)))
311- then throw((((("Attempt to take " + toString(-(bv))) + " from warehouse, but only ") + toString(bz)) + " available"))
312- else $Tuple9((bs + 1), (bq._2 :+ toString((bz + bv))), bq._3, (bq._4 - by), (bq._5 - bD), bq._6, bq._7, bt, aQ((bz + bv), t, bt))
313+ else if ((0 > (bC + by)))
314+ then throw((((("Attempt to take " + toString(-(by))) + " from warehouse, but only ") + toString(bC)) + " available"))
315+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC + by))), bt._3, (bt._4 - bB), (bt._5 - bG), bt._6, bt._7, bw, aT((bC + by), t, bw))
313316 }
314317 }
315318 }
316319
317320
318-func bF (bG,bH,bI) = {
319- let bJ = split(bG[v], "_")
320- let bK = split(bG[w], "_")
321- let bL = if ((bG[x] == ""))
321+func bI (bJ,bK,bL) = {
322+ let bM = split(bJ[v], "_")
323+ let bN = split(bJ[w], "_")
324+ let bO = if ((bJ[x] == ""))
322325 then nil
323- else split(bG[x], "_")
324- let bM = split(bH[aK], "_")
325- let bN = split(bH[aL], "_")
326- let bO = if ((bH[aM] == ""))
326+ else split(bJ[x], "_")
327+ let bP = split(bK[aN], "_")
328+ let bQ = split(bK[aO], "_")
329+ let bR = if ((bK[aP] == ""))
327330 then nil
328- else split(bH[aM], "_")
329- if ((size(bI) != 3))
331+ else split(bK[aP], "_")
332+ if ((size(bL) != 3))
330333 then throw("newOrderStr should contain exactly 2 ':' separators")
331334 else {
332- let bP = split(bI[0], "_")
333- let bQ = split(bI[1], "_")
334- let bR = if ((bI[2] == ""))
335+ let bS = split(bL[0], "_")
336+ let bT = split(bL[1], "_")
337+ let bU = if ((bL[2] == ""))
335338 then nil
336- else split(bI[2], "_")
337- if ((size(bP) != f))
339+ else split(bL[2], "_")
340+ if ((size(bS) != f))
338341 then throw("All 6 resources should be passed")
339- else if ((size(bQ) != f))
342+ else if ((size(bT) != f))
340343 then throw("All 6 materials should be passed")
341344 else {
342- let bS = {
343- let bT = bP
344- let bU = size(bT)
345- let bV = $Tuple9(0, nil, 0, 0, 0, bJ, bM, false, 0)
346- func bW (bX,bY) = if ((bY >= bU))
347- then bX
348- else bp(bX, bT[bY])
345+ let bV = {
346+ let bW = bS
347+ let bX = size(bW)
348+ let bY = $Tuple9(0, nil, 0, 0, 0, bM, bP, false, 0)
349+ func bZ (ca,cb) = if ((cb >= bX))
350+ then ca
351+ else bs(ca, bW[cb])
349352
350- func bZ (bX,bY) = if ((bY >= bU))
351- then bX
353+ func cc (ca,cb) = if ((cb >= bX))
354+ then ca
352355 else throw("List size exceeds 6")
353356
354- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
357+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
355358 }
356- let bi = {
357- let bT = bQ
358- let bU = size(bT)
359- let bV = $Tuple9(0, nil, bS._3, bS._4, bS._5, bK, bN, false, bS._9)
360- func ca (bX,bY) = if ((bY >= bU))
361- then bX
362- else bp(bX, bT[bY])
359+ let bl = {
360+ let bW = bT
361+ let bX = size(bW)
362+ let bY = $Tuple9(0, nil, bV._3, bV._4, bV._5, bN, bQ, false, bV._9)
363+ func cd (ca,cb) = if ((cb >= bX))
364+ then ca
365+ else bs(ca, bW[cb])
363366
364- func cb (bX,bY) = if ((bY >= bU))
365- then bX
367+ func ce (ca,cb) = if ((cb >= bX))
368+ then ca
366369 else throw("List size exceeds 6")
367370
368- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
371+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
369372 }
370- let aP = if ((size(bR) != 0))
373+ let aS = if ((size(bU) != 0))
371374 then {
372- let bT = bR
373- let bU = size(bT)
374- let bV = $Tuple9(0, nil, bi._3, bi._4, bi._5, bL, bO, true, bi._9)
375- func cc (bX,bY) = if ((bY >= bU))
376- then bX
377- else bp(bX, bT[bY])
375+ let bW = bU
376+ let bX = size(bW)
377+ let bY = $Tuple9(0, nil, bl._3, bl._4, bl._5, bO, bR, true, bl._9)
378+ func cf (ca,cb) = if ((cb >= bX))
379+ then ca
380+ else bs(ca, bW[cb])
378381
379- func cd (bX,bY) = if ((bY >= bU))
380- then bX
382+ func cg (ca,cb) = if ((cb >= bX))
383+ then ca
381384 else throw("List size exceeds 50")
382385
383- cd(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(bV, 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)
386+ cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(bY, 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)
384387 }
385- else $Tuple9(0, bL, bi._3, bi._4, bi._5, bL, bO, true, bi._9)
386- $Tuple7(bS._2, bi._2, aP._2, aP._3, aP._4, aP._5, aP._9)
388+ else $Tuple9(0, bO, bl._3, bl._4, bl._5, bO, bR, true, bl._9)
389+ $Tuple7(bV._2, bl._2, aS._2, aS._3, aS._4, aS._5, aS._9)
387390 }
388391 }
389392 }
390393
391394
392-func ce (bq,cf) = {
393- let bs = bq._7
394- let bt = bq._12
395- let cg = split(cf, "@")
396- if ((size(cg) != 2))
395+func ch (bt,ci) = {
396+ let bv = bt._7
397+ let bw = bt._12
398+ let cj = split(ci, "@")
399+ if ((size(cj) != 2))
397400 then throw("Incorrect order format, should be amount@price")
398401 else {
399- let ch = parseIntValue(cg[0])
400- let ci = parseIntValue(cg[1])
401- if ((0 > ci))
402+ let ck = parseIntValue(cj[0])
403+ let cl = parseIntValue(cj[1])
404+ if ((0 > cl))
402405 then throw("Price can't be negative")
403406 else {
404- let cj = fraction(ch, ci, ae)
405- let ck = if ((size(bq._8) > bs))
406- then parseIntValue(bq._8[bs])
407+ let cm = fraction(ck, cl, ae)
408+ let cn = if ((size(bt._8) > bv))
409+ then parseIntValue(bt._8[bv])
407410 else 0
408- let bz = if ((size(bq._9) > bs))
409- then parseIntValue(bq._9[bs])
411+ let bC = if ((size(bt._9) > bv))
412+ then parseIntValue(bt._9[bv])
410413 else 0
411- let cl = if ((size(bq._10) > bs))
412- then bq._10[bs]
414+ let co = if ((size(bt._10) > bv))
415+ then bt._10[bv]
413416 else "0@0"
414- let cm = split(cl, "@")
415- let cn = parseIntValue(cm[0])
416- let co = parseIntValue(cm[1])
417- if (if ((ch != 0))
418- then (ci != co)
417+ let cp = split(co, "@")
418+ let cq = parseIntValue(cp[0])
419+ let cr = parseIntValue(cp[1])
420+ if (if ((ck != 0))
421+ then (cl != cr)
419422 else false)
420- then throw(((((("Prices of " + bq._11[bs]) + " don't match! WH price=") + toString(co)) + ", your price=") + toString(ci)))
423+ then throw(((((("Prices of " + bt._11[bv]) + " don't match! WH price=") + toString(cr)) + ", your price=") + toString(cl)))
421424 else {
422- let cp = fraction(cn, co, ae)
423- let cq = aQ(ch, t, bt)
424- if ((ch == 0))
425- then $Tuple13((bq._1 :+ toString(bz)), (bq._2 :+ cl), (bq._3 :+ toString(ck)), bq._4, bq._5, bq._6, (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, bq._13)
426- else if ((ch > 0))
427- then if ((0 > cn))
428- then if ((ch > -(cn)))
429- then throw(((((("Attempt to buy " + toString(ch)) + " of ") + bq._11[bs]) + ", but warehouse only sells ") + toString(-(cn))))
430- else $Tuple13((bq._1 :+ toString(bz)), (bq._2 :+ ((toString((cn + ch)) + "@") + toString(co))), (bq._3 :+ toString((ck + ch))), (bq._4 + cq), bq._5, (bq._6 + cj), (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, (bq._13 + (if (bt)
431- then (ch * ae)
432- else ch)))
433- else throw((("Attempt to buy " + bq._11[bs]) + " while warehouse doesn't sell it"))
434- else if ((cn > 0))
435- then if ((-(ch) > cn))
436- then throw(((((("Attempt to sell " + toString(-(ch))) + " of ") + bq._11[bs]) + ", but warehouse only buys ") + toString(cn)))
437- else if ((-(ch) > ck))
438- then throw(((((("Attempt to sell " + toString(-(ch))) + ", but you only have ") + toString(ck)) + " of ") + bq._11[bs]))
439- else $Tuple13((bq._1 :+ toString((bz - ch))), (bq._2 :+ ((toString((cn + ch)) + "@") + toString(co))), (bq._3 :+ toString((ck + ch))), (bq._4 - cq), (bq._5 - cj), bq._6, (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, (bq._13 - (if (bt)
440- then (ch * ae)
441- else ch)))
442- else throw((("Attempt to sell " + bq._11[bs]) + " while warehouse doesn't buy it"))
425+ let cs = fraction(cq, cr, ae)
426+ let ct = aT(ck, t, bw)
427+ if ((ck == 0))
428+ then $Tuple13((bt._1 :+ toString(bC)), (bt._2 :+ co), (bt._3 :+ toString(cn)), bt._4, bt._5, bt._6, (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, bt._13)
429+ else if ((ck > 0))
430+ then if ((0 > cq))
431+ then if ((ck > -(cq)))
432+ then throw(((((("Attempt to buy " + toString(ck)) + " of ") + bt._11[bv]) + ", but warehouse only sells ") + toString(-(cq))))
433+ else $Tuple13((bt._1 :+ toString(bC)), (bt._2 :+ ((toString((cq + ck)) + "@") + toString(cr))), (bt._3 :+ toString((cn + ck))), (bt._4 + ct), bt._5, (bt._6 + cm), (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, (bt._13 + (if (bw)
434+ then (ck * ae)
435+ else ck)))
436+ else throw((("Attempt to buy " + bt._11[bv]) + " while warehouse doesn't sell it"))
437+ else if ((cq > 0))
438+ then if ((-(ck) > cq))
439+ then throw(((((("Attempt to sell " + toString(-(ck))) + " of ") + bt._11[bv]) + ", but warehouse only buys ") + toString(cq)))
440+ else if ((-(ck) > cn))
441+ then throw(((((("Attempt to sell " + toString(-(ck))) + ", but you only have ") + toString(cn)) + " of ") + bt._11[bv]))
442+ else $Tuple13((bt._1 :+ toString((bC - ck))), (bt._2 :+ ((toString((cq + ck)) + "@") + toString(cr))), (bt._3 :+ toString((cn + ck))), (bt._4 - ct), (bt._5 - cm), bt._6, (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, (bt._13 - (if (bw)
443+ then (ck * ae)
444+ else ck)))
445+ else throw((("Attempt to sell " + bt._11[bv]) + " while warehouse doesn't buy it"))
443446 }
444447 }
445448 }
446449 }
447450
448451
449-@Callable(cr)
450-func recalcLockedVolumeREADONLY (R,cs) = {
451- let bH = aN(Q(R))
452- let ct = bF(cs, bH, bH)
453- $Tuple2(nil, (ct._4 + ct._5))
452+@Callable(cu)
453+func recalcLockedVolumeREADONLY (R,cv) = {
454+ let bK = aQ(Q(R))
455+ let cw = bI(cv, bK, bK)
456+ $Tuple2(nil, (cw._4 + cw._5))
454457 }
455458
456459
457460
458-@Callable(cr)
459-func constructorV1 (cu) = if ((cr.caller != this))
461+@Callable(cu)
462+func constructorV1 (cx) = if ((cu.caller != this))
460463 then throw("Permission denied")
461- else [StringEntry(am(), cu)]
464+ else [StringEntry(am(), cx)]
462465
463466
464467
465-@Callable(cr)
466-func sellResources (cv,cw) = {
467- let cx = bo()
468- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
469- if ((size(cr.payments) != 0))
468+@Callable(cu)
469+func sellResources (cy,cz) = {
470+ let cA = br()
471+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
472+ if ((size(cu.payments) != 0))
470473 then throw("sellResources doesn't require any payments")
471474 else {
472- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
473- if ((cy[U] != "F"))
474- then throw(("Duck location type should be Factory, but is " + cy[U]))
475+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
476+ if ((cB[U] != "F"))
477+ then throw(("Duck location type should be Factory, but is " + cB[U]))
475478 else {
476- let aW = cy[V]
477- let cz = bl(M(N))
478- let cA = split(cz[C], "_")
479- func cB (bq,bs) = if ((cv[bs] > parseIntValue(cA[bs])))
480- then throw(((((("You have " + cA[bs]) + " of ") + k[bs]) + ", but tried to sell ") + toString(cv[bs])))
481- else if ((0 > cv[bs]))
482- then throw(((("You tried to sell negative amount of " + k[bs]) + ": ") + toString(cv[bs])))
483- else if ((cv[bs] > 0))
479+ let aZ = cB[V]
480+ let cC = bo(M(N))
481+ let cD = split(cC[C], "_")
482+ func cE (bt,bv) = if ((cy[bv] > parseIntValue(cD[bv])))
483+ then throw(((((("You have " + cD[bv]) + " of ") + k[bv]) + ", but tried to sell ") + toString(cy[bv])))
484+ else if ((0 > cy[bv]))
485+ then throw(((("You tried to sell negative amount of " + k[bv]) + ": ") + toString(cy[bv])))
486+ else if ((cy[bv] > 0))
484487 then {
485- let cC = aV(aW, bs, cv[bs], cw[bs])
486- $Tuple4((bq._1 :+ cC._1), (bq._2 :+ toString((parseIntValue(cA[bs]) - cv[bs]))), (bq._3 + cC._2), (bq._4 + cv[bs]))
488+ let cF = aY(aZ, bv, cy[bv], cz[bv])
489+ $Tuple4((bt._1 :+ cF._1), (bt._2 :+ toString((parseIntValue(cD[bv]) - cy[bv]))), (bt._3 + cF._2), (bt._4 + cy[bv]))
487490 }
488- else $Tuple4(bq._1, (bq._2 :+ cA[bs]), bq._3, bq._4)
491+ else $Tuple4(bt._1, (bt._2 :+ cD[bv]), bt._3, bt._4)
489492
490- let cD = {
491- let bT = [0, 1, 2, 3, 4, 5]
492- let bU = size(bT)
493- let bV = $Tuple4(nil, nil, 0, 0)
494- func bW (bX,bY) = if ((bY >= bU))
495- then bX
496- else cB(bX, bT[bY])
493+ let cG = {
494+ let bW = [0, 1, 2, 3, 4, 5]
495+ let bX = size(bW)
496+ let bY = $Tuple4(nil, nil, 0, 0)
497+ func bZ (ca,cb) = if ((cb >= bX))
498+ then ca
499+ else cE(ca, bW[cb])
497500
498- func bZ (bX,bY) = if ((bY >= bU))
499- then bX
501+ func cc (ca,cb) = if ((cb >= bX))
502+ then ca
500503 else throw("List size exceeds 6")
501504
502- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
505+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
503506 }
504- let cE = makeString([cz[B], makeString(cD._2, "_"), cz[D], cz[E]], ":")
505- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
506- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._4, ae)], nil))
507- $Tuple2((cD._1 :+ ScriptTransfer(cr.caller, cD._3, Z)), $Tuple3(cF, cx, cG))
507+ let cH = makeString([cC[B], makeString(cG._2, "_"), cC[D], cC[E]], ":")
508+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
509+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._4, ae)], nil))
510+ $Tuple2((cG._1 :+ ScriptTransfer(cu.caller, cG._3, Z)), $Tuple3(cI, cA, cJ))
508511 }
509512 }
510513 }
511514
512515
513516
514-@Callable(cr)
515-func buyMaterials (cv,cH) = {
516- let cx = bo()
517- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
518- if ((size(cr.payments) != 1))
517+@Callable(cu)
518+func buyMaterials (cy,cK) = {
519+ let cA = br()
520+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
521+ if ((size(cu.payments) != 1))
519522 then throw("exactly 1 payment must be attached")
520523 else {
521- let cI = cr.payments[0]
522- let cJ = cI.amount
523- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
524- if ((cK != Z))
524+ let cL = cu.payments[0]
525+ let cM = cL.amount
526+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
527+ if ((cN != Z))
525528 then throw("USDT payments only!")
526529 else {
527- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
528- if ((cy[U] != "F"))
529- then throw(("Duck location type should be Factory, but is " + cy[U]))
530+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
531+ if ((cB[U] != "F"))
532+ then throw(("Duck location type should be Factory, but is " + cB[U]))
530533 else {
531- let aW = cy[V]
532- let cz = bl(M(N))
533- let cL = split(cz[D], "_")
534- func cM (bq,bs) = if ((0 > cv[bs]))
535- then throw(((("You tried to buy negative amount of " + l[bs]) + ": ") + toString(cv[bs])))
536- else if ((cv[bs] > 0))
534+ let aZ = cB[V]
535+ let cC = bo(M(N))
536+ let cO = split(cC[D], "_")
537+ func cP (bt,bv) = if ((0 > cy[bv]))
538+ then throw(((("You tried to buy negative amount of " + l[bv]) + ": ") + toString(cy[bv])))
539+ else if ((cy[bv] > 0))
537540 then {
538- let cC = bd(aW, bs, cv[bs], cH[bs])
539- $Tuple4((bq._1 :+ cC._1), (bq._2 :+ toString((parseIntValue(cL[bs]) + cC._3))), (bq._3 + cC._2), (bq._4 + cv[bs]))
541+ let cF = bg(aZ, bv, cy[bv], cK[bv])
542+ $Tuple4((bt._1 :+ cF._1), (bt._2 :+ toString((parseIntValue(cO[bv]) + cF._3))), (bt._3 + cF._2), (bt._4 + cy[bv]))
540543 }
541- else $Tuple4(bq._1, (bq._2 :+ cL[bs]), bq._3, bq._4)
544+ else $Tuple4(bt._1, (bt._2 :+ cO[bv]), bt._3, bt._4)
542545
543- let cD = {
544- let bT = [0, 1, 2, 3, 4, 5]
545- let bU = size(bT)
546- let bV = $Tuple4(nil, nil, 0, 0)
547- func bW (bX,bY) = if ((bY >= bU))
548- then bX
549- else cM(bX, bT[bY])
546+ let cG = {
547+ let bW = [0, 1, 2, 3, 4, 5]
548+ let bX = size(bW)
549+ let bY = $Tuple4(nil, nil, 0, 0)
550+ func bZ (ca,cb) = if ((cb >= bX))
551+ then ca
552+ else cP(ca, bW[cb])
550553
551- func bZ (bX,bY) = if ((bY >= bU))
552- then bX
554+ func cc (ca,cb) = if ((cb >= bX))
555+ then ca
553556 else throw("List size exceeds 6")
554557
555- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
558+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
556559 }
557- if ((cD._3 > cJ))
558- then throw(((("Insufficient payment! Attached=" + toString(cJ)) + ", required=") + toString(cD._3)))
560+ if ((cG._3 > cM))
561+ then throw(((("Insufficient payment! Attached=" + toString(cM)) + ", required=") + toString(cG._3)))
559562 else {
560- let cE = makeString([cz[B], cz[C], makeString(cD._2, "_"), cz[E]], ":")
561- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
562- let ao = if (((cJ - cD._3) > 0))
563- then [ScriptTransfer(cr.caller, (cJ - cD._3), Z)]
563+ let cH = makeString([cC[B], cC[C], makeString(cG._2, "_"), cC[E]], ":")
564+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
565+ let ao = if (((cM - cG._3) > 0))
566+ then [ScriptTransfer(cu.caller, (cM - cG._3), Z)]
564567 else nil
565- let cN = (cD._3 / 100)
566- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._4, ae)], nil))
567- $Tuple2(((cD._1 ++ ao) :+ ScriptTransfer(as, cN, Z)), $Tuple3(cF, cx, cG))
568+ let cQ = (cG._3 / 100)
569+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._4, ae)], nil))
570+ $Tuple2(((cG._1 ++ ao) :+ ScriptTransfer(as, cQ, Z)), $Tuple3(cI, cA, cJ))
568571 }
569572 }
570573 }
573576
574577
575578
576-@Callable(cr)
577-func exchangeResources (cv) = {
578- let cx = bo()
579- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
580- if ((size(cr.payments) != 1))
579+@Callable(cu)
580+func exchangeResources (cy) = {
581+ let cA = br()
582+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
583+ if ((size(cu.payments) != 1))
581584 then throw("exactly 1 payment must be attached")
582585 else {
583- let cI = cr.payments[0]
584- let cJ = cI.amount
585- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
586- if ((cK != Z))
586+ let cL = cu.payments[0]
587+ let cM = cL.amount
588+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
589+ if ((cN != Z))
587590 then throw("USDT payments only!")
588591 else {
589- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
590- if ((cy[U] != "F"))
591- then throw(("Duck location type should be Factory, but is " + cy[U]))
592+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
593+ if ((cB[U] != "F"))
594+ then throw(("Duck location type should be Factory, but is " + cB[U]))
592595 else {
593- let aW = cy[V]
594- let cz = bl(M(N))
595- let cA = split(cz[C], "_")
596- let cL = split(cz[D], "_")
597- func cO (bq,bs) = {
598- let aY = aH(aW, bs)
599- let aZ = valueOrElse(getInteger(aY), 0)
600- let cP = cv[bs]
601- if ((cP > parseIntValue(cA[bs])))
602- then throw(((((("You have " + cA[bs]) + " of ") + k[bs]) + ", but tried to exchange ") + toString(cP)))
603- else if ((0 > cP))
604- then throw(((("You tried to exchange negative amount of " + k[bs]) + ": ") + toString(cP)))
605- else if ((cP > 0))
606- then $Tuple5((bq._1 :+ toString((parseIntValue(cA[bs]) - cP))), (bq._2 :+ toString((parseIntValue(cL[bs]) + cP))), (bq._3 + fraction(cP, h, ae)), (bq._4 :+ IntegerEntry(aY, aZ)), (bq._5 + cP))
607- else $Tuple5((bq._1 :+ cA[bs]), (bq._2 :+ cL[bs]), bq._3, bq._4, bq._5)
596+ let aZ = cB[V]
597+ let cC = bo(M(N))
598+ let cD = split(cC[C], "_")
599+ let cO = split(cC[D], "_")
600+ func cR (bt,bv) = {
601+ let bb = aK(aZ, bv)
602+ let bc = valueOrElse(getInteger(bb), 0)
603+ let cS = cy[bv]
604+ if ((cS > parseIntValue(cD[bv])))
605+ then throw(((((("You have " + cD[bv]) + " of ") + k[bv]) + ", but tried to exchange ") + toString(cS)))
606+ else if ((0 > cS))
607+ then throw(((("You tried to exchange negative amount of " + k[bv]) + ": ") + toString(cS)))
608+ else if ((cS > 0))
609+ then $Tuple5((bt._1 :+ toString((parseIntValue(cD[bv]) - cS))), (bt._2 :+ toString((parseIntValue(cO[bv]) + cS))), (bt._3 + fraction(cS, h, ae)), (bt._4 :+ IntegerEntry(bb, bc)), (bt._5 + cS))
610+ else $Tuple5((bt._1 :+ cD[bv]), (bt._2 :+ cO[bv]), bt._3, bt._4, bt._5)
608611 }
609612
610- let cD = {
611- let bT = [0, 1, 2, 3, 4, 5]
612- let bU = size(bT)
613- let bV = $Tuple5(nil, nil, 0, nil, 0)
614- func bW (bX,bY) = if ((bY >= bU))
615- then bX
616- else cO(bX, bT[bY])
613+ let cG = {
614+ let bW = [0, 1, 2, 3, 4, 5]
615+ let bX = size(bW)
616+ let bY = $Tuple5(nil, nil, 0, nil, 0)
617+ func bZ (ca,cb) = if ((cb >= bX))
618+ then ca
619+ else cR(ca, bW[cb])
617620
618- func bZ (bX,bY) = if ((bY >= bU))
619- then bX
621+ func cc (ca,cb) = if ((cb >= bX))
622+ then ca
620623 else throw("List size exceeds 6")
621624
622- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
625+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
623626 }
624- if ((cD._3 > cJ))
625- then throw(((("Insufficient payment! Attached=" + toString(cJ)) + ", required=") + toString(cD._3)))
627+ if ((cG._3 > cM))
628+ then throw(((("Insufficient payment! Attached=" + toString(cM)) + ", required=") + toString(cG._3)))
626629 else {
627- let cE = makeString([cz[B], makeString(cD._1, "_"), makeString(cD._2, "_"), cz[E]], ":")
628- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
629- let ao = if (((cJ - cD._3) > 0))
630- then [ScriptTransfer(cr.caller, (cJ - cD._3), Z)]
630+ let cH = makeString([cC[B], makeString(cG._1, "_"), makeString(cG._2, "_"), cC[E]], ":")
631+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
632+ let ao = if (((cM - cG._3) > 0))
633+ then [ScriptTransfer(cu.caller, (cM - cG._3), Z)]
631634 else nil
632- let cN = (cD._3 / 100)
633- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._5, ae)], nil))
634- $Tuple2(((ao ++ cD._4) :+ ScriptTransfer(as, cN, Z)), $Tuple3(cF, cx, cG))
635+ let cQ = (cG._3 / 100)
636+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._5, ae)], nil))
637+ $Tuple2(((ao ++ cG._4) :+ ScriptTransfer(as, cQ, Z)), $Tuple3(cI, cA, cJ))
635638 }
636639 }
637640 }
640643
641644
642645
643-@Callable(cr)
644-func craftGoods (cQ,cR) = {
645- let cx = bo()
646- if ((size(cr.payments) != 1))
646+@Callable(cu)
647+func craftGoods (cT,cU) = {
648+ let cA = br()
649+ if ((size(cu.payments) != 1))
647650 then throw("exactly 1 payment must be attached")
648651 else {
649- let cI = cr.payments[0]
650- let cJ = cI.amount
651- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
652- if ((cK != Z))
652+ let cL = cu.payments[0]
653+ let cM = cL.amount
654+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
655+ if ((cN != Z))
653656 then throw("USDT payments only!")
654- else if ((cJ != ad))
657+ else if ((cM != ad))
655658 then throw("exactly 1 USDT must be attached as payment")
656- else if ((0 >= cR))
659+ else if ((0 >= cU))
657660 then throw("Quantity should be positive")
658661 else {
659- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
660- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
661- if ((cy[U] != "M"))
662- then throw(("Duck location type should be Manufactory, but is " + cy[U]))
662+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
663+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
664+ if ((cB[U] != "M"))
665+ then throw(("Duck location type should be Manufactory, but is " + cB[U]))
663666 else {
664- let cS = cy[T]
665- let cz = bl(M(N))
666- let cL = split(cz[D], "_")
667- if (if ((0 > cQ))
667+ let cV = cB[T]
668+ let cC = bo(M(N))
669+ let cO = split(cC[D], "_")
670+ if (if ((0 > cT))
668671 then true
669- else (cQ >= size(p)))
670- then throw(("Unknown product idx=" + toString(cQ)))
672+ else (cT >= size(p)))
673+ then throw(("Unknown product idx=" + toString(cT)))
671674 else {
672- let X = split(p[cQ], "_")
675+ let X = split(p[cT], "_")
673676 if ((size(X) != s))
674- then throw(("Fatal: unknown recipe: " + p[cQ]))
677+ then throw(("Fatal: unknown recipe: " + p[cT]))
675678 else {
676- let cT = parseIntValue(X[r])
677- if ((n[cT] != cS))
678- then throw(((("This product is available in " + n[cT]) + ", but you are in ") + cS))
679+ let cW = parseIntValue(X[r])
680+ if ((n[cW] != cV))
681+ then throw(((("This product is available in " + n[cW]) + ", but you are in ") + cV))
679682 else {
680- let cU = if ((cz[E] == ""))
683+ let cX = if ((cC[E] == ""))
681684 then nil
682- else split(cz[E], "_")
683- func cV (bq,cW) = {
684- let ay = bq._2
685- let cX = if ((size(cU) > ay))
686- then cU[ay]
685+ else split(cC[E], "_")
686+ func cY (bt,cZ) = {
687+ let ay = bt._2
688+ let da = if ((size(cX) > ay))
689+ then cX[ay]
687690 else "0"
688- let cY = parseIntValue(cX)
689- let aR = (cR * t)
690- let cZ = if ((ay == cQ))
691- then toString((cY + aR))
692- else cX
693- $Tuple2((bq._1 :+ cZ), (ay + 1))
691+ let db = parseIntValue(da)
692+ let aU = (cU * t)
693+ let dc = if ((ay == cT))
694+ then toString((db + aU))
695+ else da
696+ $Tuple2((bt._1 :+ dc), (ay + 1))
694697 }
695698
696- let da = ( let bT = p
697- let bU = size(bT)
698- let bV = $Tuple2(nil, 0)
699- func bW (bX,bY) = if ((bY >= bU))
700- then bX
701- else cV(bX, bT[bY])
699+ let dd = ( let bW = p
700+ let bX = size(bW)
701+ let bY = $Tuple2(nil, 0)
702+ func bZ (ca,cb) = if ((cb >= bX))
703+ then ca
704+ else cY(ca, bW[cb])
702705
703- func bZ (bX,bY) = if ((bY >= bU))
704- then bX
706+ func cc (ca,cb) = if ((cb >= bX))
707+ then ca
705708 else throw("List size exceeds 50")
706709
707- bZ(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bV, 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
708- func db (bq,bs) = {
709- let dc = ((parseIntValue(X[bs]) * ad) * cR)
710- let dd = parseIntValue(cL[bs])
711- if ((dc > dd))
712- then throw(((((((("You have " + az(dd, 8)) + " of ") + l[bs]) + ", but recipe requires ") + az(dc, 8)) + " for quantity ") + toString(cR)))
713- else if ((dc > 0))
714- then $Tuple2((bq._1 :+ toString((dd - dc))), (bq._2 + dc))
715- else $Tuple2((bq._1 :+ cL[bs]), bq._2)
710+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bY, 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
711+ func de (bt,bv) = {
712+ let df = ((parseIntValue(X[bv]) * ad) * cU)
713+ let dg = parseIntValue(cO[bv])
714+ if ((df > dg))
715+ then throw(((((((("You have " + az(dg, 8)) + " of ") + l[bv]) + ", but recipe requires ") + az(df, 8)) + " for quantity ") + toString(cU)))
716+ else if ((df > 0))
717+ then $Tuple2((bt._1 :+ toString((dg - df))), (bt._2 + df))
718+ else $Tuple2((bt._1 :+ cO[bv]), bt._2)
716719 }
717720
718- let cD = {
719- let bT = [0, 1, 2, 3, 4, 5]
720- let bU = size(bT)
721- let bV = $Tuple2(nil, 0)
722- func ca (bX,bY) = if ((bY >= bU))
723- then bX
724- else db(bX, bT[bY])
721+ let cG = {
722+ let bW = [0, 1, 2, 3, 4, 5]
723+ let bX = size(bW)
724+ let bY = $Tuple2(nil, 0)
725+ func cd (ca,cb) = if ((cb >= bX))
726+ then ca
727+ else de(ca, bW[cb])
725728
726- func cb (bX,bY) = if ((bY >= bU))
727- then bX
729+ func ce (ca,cb) = if ((cb >= bX))
730+ then ca
728731 else throw("List size exceeds 6")
729732
730- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
733+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
731734 }
732- let cE = makeString([cz[B], cz[C], makeString(cD._1, "_"), makeString(da, "_")], ":")
733- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
734- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(b, cD._2, ae)], nil))
735- $Tuple2(nil, $Tuple3(cF, cx, cG))
735+ let cH = makeString([cC[B], cC[C], makeString(cG._1, "_"), makeString(dd, "_")], ":")
736+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
737+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(b, cG._2, ae)], nil))
738+ $Tuple2(nil, $Tuple3(cI, cA, cJ))
736739 }
737740 }
738741 }
743746
744747
745748
746-@Callable(cr)
747-func setWarehouseOrder (de,R) = {
748- let df = cr.originCaller
749- let J = toString(df)
750- let cF = if ((df != as))
751- then bn()
749+@Callable(cu)
750+func setWarehouseOrder (dh,R) = {
751+ let di = cu.originCaller
752+ let J = toString(di)
753+ let cI = if ((di != as))
754+ then bq()
752755 else false
753- let dg = value(assetInfo(fromBase58String(R)))
756+ let dj = value(assetInfo(fromBase58String(R)))
754757 if (!(isDefined(getInteger(at, H(R)))))
755- then throw((("NFT " + dg.name) + " is not staked"))
758+ then throw((("NFT " + dj.name) + " is not staked"))
756759 else {
757- let dh = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dg.name) + " is orphaned"))
758- if (if ((df != as))
759- then (dh != J)
760+ let dk = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dj.name) + " is orphaned"))
761+ if (if ((di != as))
762+ then (dk != J)
760763 else false)
761764 then throw((e + " is not yours"))
762765 else {
763- let di = split_4C(de, ":")
764- let cs = au(invoke(at, "getWarehouseREADONLY", [R], nil))
765- let bG = split_4C(cs, ":")
766- let dj = split(bG[y], "_")
767- let dk = parseIntValue(dj[A])
768- let aO = Q(R)
769- let bH = aN(aO)
770- let ct = bF(bG, bH, di)
771- let dl = ct._4
772- let dm = ct._5
773- let dn = ct._7
774- let do = (dl + dm)
775- let dp = ((dk - dn) - do)
776- if ((0 > dp))
777- then throw((((((("Attempt to reserve " + toString(dl)) + " space for buy orders, and ") + toString(dm)) + " space for sell orders (and occupied=") + toString(dn)) + "), leads to negative free space"))
766+ let dl = split_4C(dh, ":")
767+ let cv = au(invoke(at, "getWarehouseREADONLY", [R], nil))
768+ let bJ = split_4C(cv, ":")
769+ let dm = split(bJ[y], "_")
770+ let dn = parseIntValue(dm[A])
771+ let aR = Q(R)
772+ let bK = aQ(aR)
773+ let cw = bI(bJ, bK, dl)
774+ let do = cw._4
775+ let dp = cw._5
776+ let dq = cw._7
777+ let dr = (do + dp)
778+ let ds = ((dn - dq) - dr)
779+ if ((0 > ds))
780+ then throw((((((("Attempt to reserve " + toString(do)) + " space for buy orders, and ") + toString(dp)) + " space for sell orders (and occupied=") + toString(dq)) + "), leads to negative free space"))
778781 else {
779- let dq = makeString_2C([bG[u], makeString(ct._1, "_"), makeString(ct._2, "_"), makeString(ct._3, "_"), toString(do)], ":")
780- let dr = au(invoke(at, "saveWarehouse", [dq, R], nil))
781- let ds = ct._6
782- let dt = if ((ds > 0))
783- then if ((size(cr.payments) != 1))
782+ let dt = makeString_2C([bJ[u], makeString(cw._1, "_"), makeString(cw._2, "_"), makeString(cw._3, "_"), toString(dr)], ":")
783+ let du = au(invoke(at, "saveWarehouse", [dt, R], nil))
784+ let dv = cw._6
785+ let dw = if ((dv > 0))
786+ then if ((size(cu.payments) != 1))
784787 then throw("exactly 1 payment must be attached")
785788 else {
786- let cI = cr.payments[0]
787- let cJ = cI.amount
788- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
789- if ((cK != Z))
789+ let cL = cu.payments[0]
790+ let cM = cL.amount
791+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
792+ if ((cN != Z))
790793 then throw("USDT payments only!")
791- else if ((cJ != ds))
792- then throw(("Payment needed is " + toString(ds)))
793- else [StringEntry(aO, de)]
794+ else if ((cM != dv))
795+ then throw(("Payment needed is " + toString(dv)))
796+ else [StringEntry(aR, dh)]
794797 }
795- else if ((ds == 0))
796- then if ((size(cr.payments) != 0))
798+ else if ((dv == 0))
799+ then if ((size(cu.payments) != 0))
797800 then throw("No payments needed")
798- else [StringEntry(aO, de)]
799- else if ((size(cr.payments) != 0))
801+ else [StringEntry(aR, dh)]
802+ else if ((size(cu.payments) != 0))
800803 then throw("No payments needed")
801- else [ScriptTransfer(addressFromStringValue(dh), -(ds), Z), StringEntry(aO, de)]
802- $Tuple2(dt, $Tuple2(cF, dr))
804+ else [ScriptTransfer(addressFromStringValue(dk), -(dv), Z), StringEntry(aR, dh)]
805+ $Tuple2(dw, $Tuple2(cI, du))
803806 }
804807 }
805808 }
807810
808811
809812
810-@Callable(cr)
811-func acceptWarehouseOrder (du,R,N) = {
812- let cx = bo()
813- let dv = cr.originCaller
814- let dw = toString(dv)
815- let dx = valueOrErrorMessage(getString(at, K(dw)), "You don't have a duck staked")
816- let cy = valueOrElse(getString(at, O(dx)), g)
817- let dy = split(value(cy), "_")
818- if ((dy[U] != "L"))
819- then throw((("Duck location type is " + dy[U]) + ", but should be L"))
820- else if ((dx != N))
821- then throw(((("Your staked duck is " + dx) + ", but passed ") + N))
813+@Callable(cu)
814+func acceptWarehouseOrder (dx,R,N) = {
815+ let cA = br()
816+ let dy = cu.originCaller
817+ let dz = toString(dy)
818+ let dA = valueOrErrorMessage(getString(at, K(dz)), "You don't have a duck staked")
819+ let cB = valueOrElse(getString(at, O(dA)), g)
820+ let dB = split(value(cB), "_")
821+ if ((dB[U] != "L"))
822+ then throw((("Duck location type is " + dB[U]) + ", but should be L"))
823+ else if ((dA != N))
824+ then throw(((("Your staked duck is " + dA) + ", but passed ") + N))
822825 else {
823- let dz = value(assetInfo(fromBase58String(R)))
826+ let dC = value(assetInfo(fromBase58String(R)))
824827 if (!(isDefined(getInteger(at, H(R)))))
825- then throw((("NFT " + dz.name) + " is not staked"))
828+ then throw((("NFT " + dC.name) + " is not staked"))
826829 else {
827- let dA = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dz.name) + " is orphaned"))
828- if ((dA == dw))
830+ let dD = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dC.name) + " is orphaned"))
831+ if ((dD == dz))
829832 then throw("You cannot trade with yourself")
830833 else {
831- let dB = split_4C(du, ":")
832- if ((size(dB) != 3))
834+ let dE = split_4C(dx, ":")
835+ if ((size(dE) != 3))
833836 then throw("bpOrderStr should contain exactly 2 ':' separators")
834837 else {
835- let dC = split(dB[0], "_")
836- let dD = split(dB[1], "_")
837- let dE = if ((dB[2] == ""))
838+ let dF = split(dE[0], "_")
839+ let dG = split(dE[1], "_")
840+ let dH = if ((dE[2] == ""))
838841 then nil
839- else split(dB[2], "_")
840- if ((size(dC) != f))
842+ else split(dE[2], "_")
843+ if ((size(dF) != f))
841844 then throw("All 6 resources should be passed")
842- else if ((size(dD) != f))
845+ else if ((size(dG) != f))
843846 then throw("All 6 materials should be passed")
844847 else {
845- let cs = au(invoke(at, "getWarehouseREADONLY", [R], nil))
846- let bG = split_4C(cs, ":")
847- let bJ = split(bG[v], "_")
848- let bK = split(bG[w], "_")
849- let bL = if ((bG[x] == ""))
848+ let cv = au(invoke(at, "getWarehouseREADONLY", [R], nil))
849+ let bJ = split_4C(cv, ":")
850+ let bM = split(bJ[v], "_")
851+ let bN = split(bJ[w], "_")
852+ let bO = if ((bJ[x] == ""))
850853 then nil
851- else split(bG[x], "_")
852- let dF = parseIntValue(split(bG[y], "_")[z])
853- let bm = M(N)
854- let cz = bl(bm)
855- let dG = split(cz[C], "_")
856- let dH = split(cz[D], "_")
857- let dI = if ((cz[E] == ""))
854+ else split(bJ[x], "_")
855+ let dI = parseIntValue(split(bJ[y], "_")[z])
856+ let bp = M(N)
857+ let cC = bo(bp)
858+ let dJ = split(cC[C], "_")
859+ let dK = split(cC[D], "_")
860+ let dL = if ((cC[E] == ""))
858861 then nil
859- else split(cz[E], "_")
860- let aO = Q(R)
861- let dJ = aN(aO)
862- let dK = split(dJ[aK], "_")
863- let dL = split(dJ[aL], "_")
864- let dM = if ((dJ[aM] == ""))
862+ else split(cC[E], "_")
863+ let aR = Q(R)
864+ let dM = aQ(aR)
865+ let dN = split(dM[aN], "_")
866+ let dO = split(dM[aO], "_")
867+ let dP = if ((dM[aP] == ""))
865868 then nil
866- else split(dJ[aM], "_")
867- let bS = {
868- let bT = dC
869- let bU = size(bT)
870- let bV = $Tuple13(nil, nil, nil, 0, 0, 0, 0, dG, bJ, dK, k, false, 0)
871- func bW (bX,bY) = if ((bY >= bU))
872- then bX
873- else ce(bX, bT[bY])
869+ else split(dM[aP], "_")
870+ let bV = {
871+ let bW = dF
872+ let bX = size(bW)
873+ let bY = $Tuple13(nil, nil, nil, 0, 0, 0, 0, dJ, bM, dN, k, false, 0)
874+ func bZ (ca,cb) = if ((cb >= bX))
875+ then ca
876+ else ch(ca, bW[cb])
874877
875- func bZ (bX,bY) = if ((bY >= bU))
876- then bX
878+ func cc (ca,cb) = if ((cb >= bX))
879+ then ca
877880 else throw("List size exceeds 6")
878881
879- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
882+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
880883 }
881- let bi = {
882- let bT = dD
883- let bU = size(bT)
884- let bV = $Tuple13(nil, nil, nil, bS._4, bS._5, bS._6, 0, dH, bK, dL, l, false, bS._13)
885- func ca (bX,bY) = if ((bY >= bU))
886- then bX
887- else ce(bX, bT[bY])
884+ let bl = {
885+ let bW = dG
886+ let bX = size(bW)
887+ let bY = $Tuple13(nil, nil, nil, bV._4, bV._5, bV._6, 0, dK, bN, dO, l, false, bV._13)
888+ func cd (ca,cb) = if ((cb >= bX))
889+ then ca
890+ else ch(ca, bW[cb])
888891
889- func cb (bX,bY) = if ((bY >= bU))
890- then bX
892+ func ce (ca,cb) = if ((cb >= bX))
893+ then ca
891894 else throw("List size exceeds 6")
892895
893- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
896+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
894897 }
895- let aP = if ((size(dE) != 0))
898+ let aS = if ((size(dH) != 0))
896899 then {
897- let bT = dE
898- let bU = size(bT)
899- let bV = $Tuple13(nil, nil, nil, bi._4, bi._5, bi._6, 0, dI, bL, dM, m, true, bi._13)
900- func cc (bX,bY) = if ((bY >= bU))
901- then bX
902- else ce(bX, bT[bY])
900+ let bW = dH
901+ let bX = size(bW)
902+ let bY = $Tuple13(nil, nil, nil, bl._4, bl._5, bl._6, 0, dL, bO, dP, m, true, bl._13)
903+ func cf (ca,cb) = if ((cb >= bX))
904+ then ca
905+ else ch(ca, bW[cb])
903906
904- func cd (bX,bY) = if ((bY >= bU))
905- then bX
907+ func cg (ca,cb) = if ((cb >= bX))
908+ then ca
906909 else throw("List size exceeds 50")
907910
908- cd(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(bV, 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)
911+ cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(bY, 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)
909912 }
910- else $Tuple13(bL, dM, dI, bi._4, bi._5, bi._6, 0, dI, bL, dM, m, true, bi._13)
911- let dN = aP._4
912- let dO = if ((0 > (dF - dN)))
913+ else $Tuple13(bO, dP, dL, bl._4, bl._5, bl._6, 0, dL, bO, dP, m, true, bl._13)
914+ let dQ = aS._4
915+ let dR = if ((0 > (dI - dQ)))
913916 then 0
914- else (dF - dN)
915- let dq = makeString_2C([bG[u], makeString(bS._1, "_"), makeString(bi._1, "_"), makeString(aP._1, "_"), toString(dO)], ":")
916- let dP = makeString_2C([makeString(bS._2, "_"), makeString(bi._2, "_"), makeString(aP._2, "_")], ":")
917- let dQ = makeString_2C([cz[B], makeString(bS._3, "_"), makeString(bi._3, "_"), makeString(aP._3, "_")], ":")
918- let dr = au(invoke(at, "saveWarehouse", [dq, R], nil))
919- let dR = au(invoke(at, "updateBackpack", [N, dQ], nil))
920- let dS = ax(invoke(at, "updateDuckStats", [N, fraction(d, aP._13, ae)], nil))
921- let dT = ax(invoke(at, "updateAccStats", [dA, fraction(d, aP._13, ae)], nil))
922- let dt = [StringEntry(aO, dP)]
923- let dU = aP._5
924- let dV = if ((dU > 0))
917+ else (dI - dQ)
918+ let dt = makeString_2C([bJ[u], makeString(bV._1, "_"), makeString(bl._1, "_"), makeString(aS._1, "_"), toString(dR)], ":")
919+ let dS = makeString_2C([makeString(bV._2, "_"), makeString(bl._2, "_"), makeString(aS._2, "_")], ":")
920+ let dT = makeString_2C([cC[B], makeString(bV._3, "_"), makeString(bl._3, "_"), makeString(aS._3, "_")], ":")
921+ let du = au(invoke(at, "saveWarehouse", [dt, R], nil))
922+ let dU = au(invoke(at, "updateBackpack", [N, dT], nil))
923+ let dV = ax(invoke(at, "updateDuckStats", [N, fraction(d, aS._13, ae)], nil))
924+ let dW = ax(invoke(at, "updateAccStats", [dD, fraction(d, aS._13, ae)], nil))
925+ let dw = [StringEntry(aR, dS)]
926+ let dX = aS._5
927+ let dY = if ((dX > 0))
925928 then {
926- let dW = fraction(aP._5, aG, ad)
927- let dX = I(dw)
928- let dY = getString(at, dX)
929- if (isDefined(dY))
930- then (((dt :+ ScriptTransfer(dv, (aP._5 - (3 * dW)), Z)) :+ ScriptTransfer(as, dW, Z)) :+ ScriptTransfer(addressFromStringValue(value(dY)), dW, Z))
931- else ((dt :+ ScriptTransfer(dv, (aP._5 - (3 * dW)), Z)) :+ ScriptTransfer(as, dW, Z))
929+ let dZ = fraction(aS._5, aJ, ad)
930+ let ea = I(dz)
931+ let eb = getString(at, ea)
932+ if (isDefined(eb))
933+ then (((dw :+ ScriptTransfer(dy, (aS._5 - (3 * dZ)), Z)) :+ ScriptTransfer(as, dZ, Z)) :+ ScriptTransfer(addressFromStringValue(value(eb)), dZ, Z))
934+ else ((dw :+ ScriptTransfer(dy, (aS._5 - (3 * dZ)), Z)) :+ ScriptTransfer(as, dZ, Z))
932935 }
933- else dt
934- let dZ = aP._6
935- let ea = if ((dZ > 0))
936- then if ((size(cr.payments) != 1))
936+ else dw
937+ let ec = aS._6
938+ let ed = if ((ec > 0))
939+ then if ((size(cu.payments) != 1))
937940 then throw("exactly 1 payment must be attached")
938941 else {
939- let cI = cr.payments[0]
940- let cJ = cI.amount
941- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
942- if ((cK != Z))
942+ let cL = cu.payments[0]
943+ let cM = cL.amount
944+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
945+ if ((cN != Z))
943946 then throw("USDT payments only!")
944- else if ((cJ != dZ))
945- then throw(("Payment needed is " + toString(dZ)))
946- else if ((ag > cJ))
947+ else if ((cM != ec))
948+ then throw(("Payment needed is " + toString(ec)))
949+ else if ((ag > cM))
947950 then throw(("Payment should be at least " + toString(ag)))
948951 else {
949- let eb = fraction(aP._6, aG, ad)
950- let dX = I(dA)
951- let dY = getString(at, dX)
952- if (isDefined(dY))
953- then (((dV :+ ScriptTransfer(addressFromStringValue(dA), (aP._6 - (3 * eb)), Z)) :+ ScriptTransfer(as, eb, Z)) :+ ScriptTransfer(addressFromStringValue(value(dY)), eb, Z))
954- else ((dV :+ ScriptTransfer(addressFromStringValue(dA), (aP._6 - (3 * eb)), Z)) :+ ScriptTransfer(as, eb, Z))
952+ let ee = fraction(aS._6, aJ, ad)
953+ let ea = I(dD)
954+ let eb = getString(at, ea)
955+ if (isDefined(eb))
956+ then (((dY :+ ScriptTransfer(addressFromStringValue(dD), (aS._6 - (3 * ee)), Z)) :+ ScriptTransfer(as, ee, Z)) :+ ScriptTransfer(addressFromStringValue(value(eb)), ee, Z))
957+ else ((dY :+ ScriptTransfer(addressFromStringValue(dD), (aS._6 - (3 * ee)), Z)) :+ ScriptTransfer(as, ee, Z))
955958 }
956959 }
957- else if ((size(cr.payments) != 0))
960+ else if ((size(cu.payments) != 0))
958961 then throw("No payments needed")
959- else dV
960- $Tuple2(ea, $Tuple5(cx, dr, dR, dS, dT))
962+ else dY
963+ $Tuple2(ed, $Tuple5(cA, du, dU, dV, dW))
961964 }
962965 }
963966 }
967970
968971
969972
970-@Callable(cr)
971-func sellProductsToES (cv) = {
972- let cx = bo()
973- if ((size(cr.payments) != 0))
973+@Callable(cu)
974+func sellProductsToES (cy) = {
975+ let cA = br()
976+ if ((size(cu.payments) != 0))
974977 then throw("No payments needed")
975978 else {
976- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
977- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
978- if ((cy[U] != "A"))
979- then throw(("Duck location type should be Airport, but is " + cy[U]))
979+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
980+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
981+ if ((cB[U] != "A"))
982+ then throw(("Duck location type should be Airport, but is " + cB[U]))
980983 else {
981- let cz = bl(M(N))
982- let cU = if ((cz[E] == ""))
984+ let cC = bo(M(N))
985+ let cX = if ((cC[E] == ""))
983986 then nil
984- else split(cz[E], "_")
985- let ec = S()
986- let ed = getString(ec)
987- let ee = if (isDefined(ed))
988- then split(value(ed), "_")
987+ else split(cC[E], "_")
988+ let ef = S()
989+ let eg = getString(ef)
990+ let eh = if (isDefined(eg))
991+ then split(value(eg), "_")
989992 else nil
990- func ef (bq,eg) = {
991- let bs = bq._1
992- let cR = if ((size(cv) > bs))
993- then cv[bs]
993+ func ei (bt,ej) = {
994+ let bv = bt._1
995+ let cU = if ((size(cy) > bv))
996+ then cy[bv]
994997 else 0
995- if ((0 > cR))
998+ if ((0 > cU))
996999 then throw("Quantity cannot be negative")
9971000 else {
998- let X = split(eg, "_")
1001+ let X = split(ej, "_")
9991002 if ((size(X) != s))
1000- then throw(("Fatal: unknown recipe: " + eg))
1003+ then throw(("Fatal: unknown recipe: " + ej))
10011004 else {
1002- let eh = (i * t)
1003- let ei = if ((size(ee) > bs))
1004- then parseIntValue(ee[bs])
1005+ let ek = (i * t)
1006+ let el = if ((size(eh) > bv))
1007+ then parseIntValue(eh[bv])
10051008 else 0
1006- let ej = (eh - ei)
1007- if ((cR > ej))
1008- then throw(((("Warehouse can buy only " + toString(ej)) + " of ") + m[bs]))
1009+ let em = (ek - el)
1010+ if ((cU > em))
1011+ then throw(((("Warehouse can buy only " + toString(em)) + " of ") + m[bv]))
10091012 else {
1010- let ek = W(X)
1011- let el = fraction((ek * j), h, (ae * t))
1012- let em = if ((size(cU) > bs))
1013- then parseIntValue(cU[bs])
1013+ let en = W(X)
1014+ let eo = fraction((en * j), h, (ae * t))
1015+ let ep = if ((size(cX) > bv))
1016+ then parseIntValue(cX[bv])
10141017 else 0
1015- if ((cR > em))
1016- then throw(((("You have only " + toString(em)) + " of ") + m[bs]))
1017- else $Tuple5((bs + 1), (bq._2 + (el * cR)), (bq._3 :+ toString((em - cR))), (bq._4 :+ toString((ei + cR))), (bq._5 + (ek * cR)))
1018+ if ((cU > ep))
1019+ then throw(((("You have only " + toString(ep)) + " of ") + m[bv]))
1020+ else $Tuple5((bv + 1), (bt._2 + (eo * cU)), (bt._3 :+ toString((ep - cU))), (bt._4 :+ toString((el + cU))), (bt._5 + (en * cU)))
10181021 }
10191022 }
10201023 }
10211024 }
10221025
1023- let cD = {
1024- let bT = p
1025- let bU = size(bT)
1026- let bV = $Tuple5(0, 0, nil, nil, 0)
1027- func bW (bX,bY) = if ((bY >= bU))
1028- then bX
1029- else ef(bX, bT[bY])
1026+ let cG = {
1027+ let bW = p
1028+ let bX = size(bW)
1029+ let bY = $Tuple5(0, 0, nil, nil, 0)
1030+ func bZ (ca,cb) = if ((cb >= bX))
1031+ then ca
1032+ else ei(ca, bW[cb])
10301033
1031- func bZ (bX,bY) = if ((bY >= bU))
1032- then bX
1034+ func cc (ca,cb) = if ((cb >= bX))
1035+ then ca
10331036 else throw("List size exceeds 50")
10341037
1035- bZ(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bV, 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)
1038+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bY, 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)
10361039 }
1037- let dQ = makeString_2C([cz[B], cz[C], cz[D], makeString(cD._3, "_")], ":")
1038- let dR = au(invoke(at, "updateBackpack", [N, dQ], nil))
1039- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(c, cD._5, (ae * 10))], nil))
1040- $Tuple2([StringEntry(ec, makeString(cD._4, "_")), ScriptTransfer(cr.caller, cD._2, Z)], $Tuple3(dR, cx, cG))
1040+ let dT = makeString_2C([cC[B], cC[C], cC[D], makeString(cG._3, "_")], ":")
1041+ let dU = au(invoke(at, "updateBackpack", [N, dT], nil))
1042+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(c, cG._5, (ae * 10))], nil))
1043+ $Tuple2([StringEntry(ef, makeString(cG._4, "_")), ScriptTransfer(cu.caller, cG._2, Z)], $Tuple3(dU, cA, cJ))
10411044 }
10421045 }
10431046 }
10441047
10451048
10461049
1047-@Callable(cr)
1048-func updateEsStorage (en) = if ((cr.caller != at))
1050+@Callable(cu)
1051+func updateEsStorage (eq) = if ((cu.caller != at))
10491052 then throw("Permission denied")
1050- else $Tuple2([StringEntry(S(), en)], en)
1053+ else $Tuple2([StringEntry(S(), eq)], eq)
10511054
10521055
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 10000
55
66 let b = 10000
77
88 let c = 10000
99
1010 let d = 10000
1111
1212 let e = "LAND"
1313
1414 let f = 6
1515
1616 let g = "Africa_F_Africa"
1717
1818 let h = 39637
1919
2020 let i = 3
2121
2222 let j = 4
2323
2424 let k = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"]
2525
2626 let l = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"]
2727
2828 let m = ["First Aid Kit L1", "First Aid Kit L2", "First Aid Kit L3", "Backpack L1", "Backpack L2", "Backpack L3", "Food Ration L1", "Food Ration L2", "Food Ration L3", "Jet Pack L1", "Jet Pack L2", "Jet Pack L3", "Shield L1", "Shield L2", "Shield L3"]
2929
3030 let n = ["Americas", "Europe", "Asia", "Africa", "Oceania"]
3131
3232 let o = 10000000
3333
3434 let p = ["8_8_8_17_17_42_12_0_30_0,0,0,0,0,0,0_", "8_8_8_17_17_42_24_0_60_0,0,5,2,0,0,0_", "8_8_8_17_17_42_36_0_120_0,0,10,4,0,0,0_", "8_19_19_8_27_19_26_1_20_0,0,0,0,0,0,0_001", "8_19_19_8_27_19_52_1_40_0,0,0,0,0,0,0_001", "8_19_19_8_27_19_78_1_80_0,0,0,0,0,0,0_001", "8_8_8_8_8_60_13_2_2_0,0,0,0,0,0,0_", "8_8_8_8_8_60_26_2_4_0,0,0,0,0,0,0_", "8_8_8_8_8_60_39_2_8_0,0,0,0,0,0,0_", "30_30_3_17_17_3_30_3_30_0,0,0,0,0,0,0_111", "30_30_3_17_17_3_60_3_50_0,0,0,0,0,0,0_111", "30_30_3_17_17_3_90_3_70_0,0,0,0,0,0,0_111", "18_18_10_18_18_18_11_4_30_0,0,0,0,0,0,0_201", "18_18_10_18_18_18_22_4_50_0,0,0,0,0,0,0_201", "18_18_10_18_18_18_33_4_70_0,0,0,0,0,0,0_201"]
3535
3636 let q = 6
3737
3838 let r = 7
3939
4040 let s = 11
4141
4242 let t = 10
4343
4444 let u = 0
4545
4646 let v = 1
4747
4848 let w = 2
4949
5050 let x = 3
5151
5252 let y = 4
5353
5454 let z = 0
5555
5656 let A = 3
5757
5858 let B = 0
5959
6060 let C = 1
6161
6262 let D = 2
6363
6464 let E = 3
6565
6666 func F (G) = ("nftOwner_" + G)
6767
6868
6969 func H (G) = ("stakedTime_" + G)
7070
7171
7272 func I (J) = ("accRefBy_" + J)
7373
7474
7575 func K (L) = ("stakedDuckByOwner_" + L)
7676
7777
7878 func M (N) = ("backPack_" + N)
7979
8080
8181 func O (N) = ("duckLocation_" + N)
8282
8383
8484 func P () = "contractsBlocked"
8585
8686
8787 func Q (R) = ("landOrder_" + R)
8888
8989
9090 func S () = "emergencyWarehouseProducts"
9191
9292
9393 let T = 0
9494
9595 let U = 1
9696
9797 let V = 2
9898
9999 func W (X) = (parseIntValue(X[q]) * o)
100100
101101
102102 let Y = take(drop(this.bytes, 1), 1)
103103
104104 let Z = {
105105 let aa = Y
106106 if ((base58'2W' == aa))
107107 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
108108 else if ((base58'2T' == aa))
109109 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
110110 else throw("Unknown chain")
111111 }
112112
113113 let ab = {
114114 let aa = Y
115115 if ((base58'2W' == aa))
116116 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
117117 else if ((base58'2T' == aa))
118118 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
119119 else throw("Unknown chain")
120120 }
121121
122122 let ac = "__"
123123
124124 let ad = 1000000
125125
126126 let ae = 100000000
127127
128128 let af = 10000000000
129129
130130 let ag = 100000
131131
132132 func ah (ai,aj) = valueOrErrorMessage(getString(ai, aj), makeString(["mandatory ", toString(ai), ".", aj, " is not defined"], ""))
133133
134134
135135 let ak = 1
136136
137137 func al () = "%s__restConfig"
138138
139139
140140 func am () = "%s__restAddr"
141141
142142
143143 func an (ao) = split_4C(ah(ao, al()), ac)
144144
145145
146146 func ap (aq,ar) = valueOrErrorMessage(addressFromString(aq[ar]), ("Rest cfg doesn't contain address at index " + toString(ar)))
147147
148148
149149 let as = addressFromStringValue(valueOrElse(getString(this, am()), ab))
150150
151151 let aq = an(as)
152152
153153 let at = ap(aq, ak)
154154
155155 func au (av) = {
156156 let aa = av
157157 if ($isInstanceOf(aa, "String"))
158158 then {
159159 let aw = aa
160160 aw
161161 }
162162 else throw("fail to cast into String")
163163 }
164164
165165
166166 func ax (av) = {
167167 let aa = av
168168 if ($isInstanceOf(aa, "Int"))
169169 then {
170170 let ay = aa
171171 ay
172172 }
173173 else throw("fail to cast into Int")
174174 }
175175
176176
177177 func az (aA,aB) = {
178178 let aC = pow(10, 0, aB, 0, 0, DOWN)
179- ((toString((aA / aC)) + ".") + toString((aA % aC)))
179+ let aD = toString((aA % aC))
180+ let aE = size(aD)
181+ let aF = take(toString(aC), aE)
182+ (((toString((aA / aC)) + ".") + aF) + aD)
180183 }
181184
182185
183-let aD = 10000000000
186+let aG = 10000000000
184187
185-let aE = 200
188+let aH = 200
186189
187-let aF = 300
190+let aI = 300
188191
189-let aG = 10000
192+let aJ = 10000
190193
191-func aH (aI,aJ) = ((("factoryWhByContinentAndRes_" + aI) + "_") + toString(aJ))
194+func aK (aL,aM) = ((("factoryWhByContinentAndRes_" + aL) + "_") + toString(aM))
192195
193196
194-let aK = 0
197+let aN = 0
195198
196-let aL = 1
199+let aO = 1
197200
198-let aM = 2
201+let aP = 2
199202
200-func aN (aO) = {
201- let aP = split(valueOrElse(getString(aO), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":")
202-[if ((size(split(aP[aK], "_")) == f))
203- then aP[aK]
204- else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aP[aL], "_")) == f))
205- then aP[aL]
206- else "0@0_0@0_0@0_0@0_0@0_0@0", aP[aM]]
203+func aQ (aR) = {
204+ let aS = split(valueOrElse(getString(aR), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":")
205+[if ((size(split(aS[aN], "_")) == f))
206+ then aS[aN]
207+ else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(aS[aO], "_")) == f))
208+ then aS[aO]
209+ else "0@0_0@0_0@0_0@0_0@0_0@0", aS[aP]]
207210 }
208211
209212
210-func aQ (aR,aS,aT) = if (aT)
213+func aT (aU,aV,aW) = if (aW)
211214 then {
212- let aU = if ((aR >= 0))
213- then (((aR + aS) - 1) / aS)
214- else -((((-(aR) + aS) - 1) / aS))
215- (aU * ae)
215+ let aX = if ((aU >= 0))
216+ then (((aU + aV) - 1) / aV)
217+ else -((((-(aU) + aV) - 1) / aV))
218+ (aX * ae)
216219 }
217- else aR
220+ else aU
218221
219222
220-func aV (aW,aJ,aR,aX) = {
221- let aY = aH(aW, aJ)
222- let aZ = valueOrElse(getInteger(aY), 0)
223- let ba = if ((aZ > aD))
223+func aY (aZ,aM,aU,ba) = {
224+ let bb = aK(aZ, aM)
225+ let bc = valueOrElse(getInteger(bb), 0)
226+ let bd = if ((bc > aG))
224227 then 0
225- else if (((aZ + aR) > aD))
226- then (aD - aZ)
227- else aR
228- let bb = (fraction(ba, ((aE * h) - fraction(((100 * aZ) + (50 * ba)), h, aD)), af) + fraction((aR - ba), h, ae))
229- let bc = (aX - (aX / 100))
230- if (((bc * aR) > (bb * ae)))
231- then throw((((((((((("Actual price = " + toString(bb)) + " / ") + toString(aR)) + " < minPrice = ") + toString(aX)) + ", (") + aW) + ", ") + k[aJ]) + ")"))
232- else $Tuple2(IntegerEntry(aY, (aZ + aR)), bb)
228+ else if (((bc + aU) > aG))
229+ then (aG - bc)
230+ else aU
231+ let be = (fraction(bd, ((aH * h) - fraction(((100 * bc) + (50 * bd)), h, aG)), af) + fraction((aU - bd), h, ae))
232+ let bf = (ba - (ba / 100))
233+ if (((bf * aU) > (be * ae)))
234+ then throw((((((((((("Actual price = " + toString(be)) + " / ") + toString(aU)) + " < minPrice = ") + toString(ba)) + ", (") + aZ) + ", ") + k[aM]) + ")"))
235+ else $Tuple2(IntegerEntry(bb, (bc + aU)), be)
233236 }
234237
235238
236-func bd (aW,be,aR,bf) = {
237- let aY = aH(aW, be)
238- let aZ = valueOrElse(getInteger(aY), 0)
239- let bg = if ((aZ > aD))
240- then min([aR, (aZ - aD)])
239+func bg (aZ,bh,aU,bi) = {
240+ let bb = aK(aZ, bh)
241+ let bc = valueOrElse(getInteger(bb), 0)
242+ let bj = if ((bc > aG))
243+ then min([aU, (bc - aG)])
241244 else 0
242- let bh = min([aZ, (aR - bg)])
243- let bi = (bh + bg)
244- let bj = (fraction(bh, ((aF * h) - fraction(((100 * aZ) - (50 * bh)), h, aD)), af) + fraction(bg, (2 * h), ae))
245- let bk = (bf + (bf / 100))
246- if (((bj * ae) > (bk * bi)))
247- then throw((((((((((("Actual price = " + toString(bj)) + " / ") + toString(bi)) + " > maxPrice = ") + toString(bf)) + ", (") + aW) + ", ") + l[be]) + ")"))
248- else $Tuple3(IntegerEntry(aY, (aZ - bi)), bj, bi)
245+ let bk = min([bc, (aU - bj)])
246+ let bl = (bk + bj)
247+ let bm = (fraction(bk, ((aI * h) - fraction(((100 * bc) - (50 * bk)), h, aG)), af) + fraction(bj, (2 * h), ae))
248+ let bn = (bi + (bi / 100))
249+ if (((bm * ae) > (bn * bl)))
250+ then throw((((((((((("Actual price = " + toString(bm)) + " / ") + toString(bl)) + " > maxPrice = ") + toString(bi)) + ", (") + aZ) + ", ") + l[bh]) + ")"))
251+ else $Tuple3(IntegerEntry(bb, (bc - bl)), bm, bl)
249252 }
250253
251254
252-func bl (bm) = {
253- let aP = split(valueOrElse(getString(at, bm), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
254-[toString(valueOrElse(parseInt(aP[B]), 0)), if ((size(split(aP[C], "_")) == f))
255- then aP[C]
256- else "0_0_0_0_0_0", if ((size(split(aP[D], "_")) == f))
257- then aP[D]
258- else "0_0_0_0_0_0", aP[E]]
255+func bo (bp) = {
256+ let aS = split(valueOrElse(getString(at, bp), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
257+[toString(valueOrElse(parseInt(aS[B]), 0)), if ((size(split(aS[C], "_")) == f))
258+ then aS[C]
259+ else "0_0_0_0_0_0", if ((size(split(aS[D], "_")) == f))
260+ then aS[D]
261+ else "0_0_0_0_0_0", aS[E]]
259262 }
260263
261264
262-func bn () = if (valueOrElse(getBoolean(at, P()), false))
265+func bq () = if (valueOrElse(getBoolean(at, P()), false))
263266 then throw("Contracts are under maintenance")
264267 else unit
265268
266269
267-func bo () = ax(invoke(at, "saveLastTx", nil, nil))
270+func br () = ax(invoke(at, "saveLastTx", nil, nil))
268271
269272
270-func bp (bq,br) = {
271- let bs = bq._1
272- let bt = bq._8
273- let bu = split(br, "@")
274- if ((size(bu) != 2))
273+func bs (bt,bu) = {
274+ let bv = bt._1
275+ let bw = bt._8
276+ let bx = split(bu, "@")
277+ if ((size(bx) != 2))
275278 then throw("Incorrect order format, should be amount@price")
276279 else {
277- let bv = parseIntValue(bu[0])
278- let bw = parseIntValue(bu[1])
279- let bx = fraction(bv, bw, ae)
280- let by = aQ(bv, t, bt)
281- let bz = if ((size(bq._6) > bs))
282- then parseIntValue(bq._6[bs])
280+ let by = parseIntValue(bx[0])
281+ let bz = parseIntValue(bx[1])
282+ let bA = fraction(by, bz, ae)
283+ let bB = aT(by, t, bw)
284+ let bC = if ((size(bt._6) > bv))
285+ then parseIntValue(bt._6[bv])
283286 else 0
284- let bA = split(if ((size(bq._7) > bs))
285- then bq._7[bs]
287+ let bD = split(if ((size(bt._7) > bv))
288+ then bt._7[bv]
286289 else "0@0", "@")
287- let bB = parseIntValue(bA[0])
288- let bC = parseIntValue(bA[1])
289- if (if ((0 > bC))
290+ let bE = parseIntValue(bD[0])
291+ let bF = parseIntValue(bD[1])
292+ if (if ((0 > bF))
290293 then true
291- else (0 > bw))
294+ else (0 > bz))
292295 then throw("Price can't be negative")
293296 else {
294- let bD = fraction(bB, bC, ae)
295- if ((bv == 0))
296- then if ((bB > 0))
297- then $Tuple9((bs + 1), (bq._2 :+ toString(bz)), bq._3, bq._4, (bq._5 - bD), bq._6, bq._7, bt, (bq._9 + aQ(bz, t, bt)))
298- else $Tuple9((bs + 1), (bq._2 :+ toString((bz - bB))), bq._3, bq._4, bq._5, bq._6, bq._7, bt, (bq._9 + aQ((bz - bB), t, bt)))
299- else if ((bv > 0))
300- then if ((0 > bB))
301- then $Tuple9((bs + 1), (bq._2 :+ toString((bz - bB))), (bq._3 + by), bq._4, (bq._5 + bx), bq._6, bq._7, bt, aQ((bz - bB), t, bt))
302- else $Tuple9((bs + 1), (bq._2 :+ toString(bz)), (bq._3 + by), bq._4, ((bq._5 + bx) - bD), bq._6, bq._7, bt, aQ(bz, t, bt))
303- else if ((0 > bB))
297+ let bG = fraction(bE, bF, ae)
298+ if ((by == 0))
299+ then if ((bE > 0))
300+ then $Tuple9((bv + 1), (bt._2 :+ toString(bC)), bt._3, bt._4, (bt._5 - bG), bt._6, bt._7, bw, (bt._9 + aT(bC, t, bw)))
301+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC - bE))), bt._3, bt._4, bt._5, bt._6, bt._7, bw, (bt._9 + aT((bC - bE), t, bw)))
302+ else if ((by > 0))
303+ then if ((0 > bE))
304+ then $Tuple9((bv + 1), (bt._2 :+ toString((bC - bE))), (bt._3 + bB), bt._4, (bt._5 + bA), bt._6, bt._7, bw, aT((bC - bE), t, bw))
305+ else $Tuple9((bv + 1), (bt._2 :+ toString(bC)), (bt._3 + bB), bt._4, ((bt._5 + bA) - bG), bt._6, bt._7, bw, aT(bC, t, bw))
306+ else if ((0 > bE))
304307 then {
305- let bE = (bB - bv)
306- if ((0 > (bz - bE)))
307- then throw((((("Attempt to take " + toString(bE)) + " from warehouse, but only ") + toString(bz)) + " available"))
308- else $Tuple9((bs + 1), (bq._2 :+ toString((bz - bE))), bq._3, (bq._4 - by), bq._5, bq._6, bq._7, bt, aQ((bz - bE), t, bt))
308+ let bH = (bE - by)
309+ if ((0 > (bC - bH)))
310+ then throw((((("Attempt to take " + toString(bH)) + " from warehouse, but only ") + toString(bC)) + " available"))
311+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC - bH))), bt._3, (bt._4 - bB), bt._5, bt._6, bt._7, bw, aT((bC - bH), t, bw))
309312 }
310- else if ((0 > (bz + bv)))
311- then throw((((("Attempt to take " + toString(-(bv))) + " from warehouse, but only ") + toString(bz)) + " available"))
312- else $Tuple9((bs + 1), (bq._2 :+ toString((bz + bv))), bq._3, (bq._4 - by), (bq._5 - bD), bq._6, bq._7, bt, aQ((bz + bv), t, bt))
313+ else if ((0 > (bC + by)))
314+ then throw((((("Attempt to take " + toString(-(by))) + " from warehouse, but only ") + toString(bC)) + " available"))
315+ else $Tuple9((bv + 1), (bt._2 :+ toString((bC + by))), bt._3, (bt._4 - bB), (bt._5 - bG), bt._6, bt._7, bw, aT((bC + by), t, bw))
313316 }
314317 }
315318 }
316319
317320
318-func bF (bG,bH,bI) = {
319- let bJ = split(bG[v], "_")
320- let bK = split(bG[w], "_")
321- let bL = if ((bG[x] == ""))
321+func bI (bJ,bK,bL) = {
322+ let bM = split(bJ[v], "_")
323+ let bN = split(bJ[w], "_")
324+ let bO = if ((bJ[x] == ""))
322325 then nil
323- else split(bG[x], "_")
324- let bM = split(bH[aK], "_")
325- let bN = split(bH[aL], "_")
326- let bO = if ((bH[aM] == ""))
326+ else split(bJ[x], "_")
327+ let bP = split(bK[aN], "_")
328+ let bQ = split(bK[aO], "_")
329+ let bR = if ((bK[aP] == ""))
327330 then nil
328- else split(bH[aM], "_")
329- if ((size(bI) != 3))
331+ else split(bK[aP], "_")
332+ if ((size(bL) != 3))
330333 then throw("newOrderStr should contain exactly 2 ':' separators")
331334 else {
332- let bP = split(bI[0], "_")
333- let bQ = split(bI[1], "_")
334- let bR = if ((bI[2] == ""))
335+ let bS = split(bL[0], "_")
336+ let bT = split(bL[1], "_")
337+ let bU = if ((bL[2] == ""))
335338 then nil
336- else split(bI[2], "_")
337- if ((size(bP) != f))
339+ else split(bL[2], "_")
340+ if ((size(bS) != f))
338341 then throw("All 6 resources should be passed")
339- else if ((size(bQ) != f))
342+ else if ((size(bT) != f))
340343 then throw("All 6 materials should be passed")
341344 else {
342- let bS = {
343- let bT = bP
344- let bU = size(bT)
345- let bV = $Tuple9(0, nil, 0, 0, 0, bJ, bM, false, 0)
346- func bW (bX,bY) = if ((bY >= bU))
347- then bX
348- else bp(bX, bT[bY])
345+ let bV = {
346+ let bW = bS
347+ let bX = size(bW)
348+ let bY = $Tuple9(0, nil, 0, 0, 0, bM, bP, false, 0)
349+ func bZ (ca,cb) = if ((cb >= bX))
350+ then ca
351+ else bs(ca, bW[cb])
349352
350- func bZ (bX,bY) = if ((bY >= bU))
351- then bX
353+ func cc (ca,cb) = if ((cb >= bX))
354+ then ca
352355 else throw("List size exceeds 6")
353356
354- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
357+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
355358 }
356- let bi = {
357- let bT = bQ
358- let bU = size(bT)
359- let bV = $Tuple9(0, nil, bS._3, bS._4, bS._5, bK, bN, false, bS._9)
360- func ca (bX,bY) = if ((bY >= bU))
361- then bX
362- else bp(bX, bT[bY])
359+ let bl = {
360+ let bW = bT
361+ let bX = size(bW)
362+ let bY = $Tuple9(0, nil, bV._3, bV._4, bV._5, bN, bQ, false, bV._9)
363+ func cd (ca,cb) = if ((cb >= bX))
364+ then ca
365+ else bs(ca, bW[cb])
363366
364- func cb (bX,bY) = if ((bY >= bU))
365- then bX
367+ func ce (ca,cb) = if ((cb >= bX))
368+ then ca
366369 else throw("List size exceeds 6")
367370
368- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
371+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
369372 }
370- let aP = if ((size(bR) != 0))
373+ let aS = if ((size(bU) != 0))
371374 then {
372- let bT = bR
373- let bU = size(bT)
374- let bV = $Tuple9(0, nil, bi._3, bi._4, bi._5, bL, bO, true, bi._9)
375- func cc (bX,bY) = if ((bY >= bU))
376- then bX
377- else bp(bX, bT[bY])
375+ let bW = bU
376+ let bX = size(bW)
377+ let bY = $Tuple9(0, nil, bl._3, bl._4, bl._5, bO, bR, true, bl._9)
378+ func cf (ca,cb) = if ((cb >= bX))
379+ then ca
380+ else bs(ca, bW[cb])
378381
379- func cd (bX,bY) = if ((bY >= bU))
380- then bX
382+ func cg (ca,cb) = if ((cb >= bX))
383+ then ca
381384 else throw("List size exceeds 50")
382385
383- cd(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(bV, 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)
386+ cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(bY, 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)
384387 }
385- else $Tuple9(0, bL, bi._3, bi._4, bi._5, bL, bO, true, bi._9)
386- $Tuple7(bS._2, bi._2, aP._2, aP._3, aP._4, aP._5, aP._9)
388+ else $Tuple9(0, bO, bl._3, bl._4, bl._5, bO, bR, true, bl._9)
389+ $Tuple7(bV._2, bl._2, aS._2, aS._3, aS._4, aS._5, aS._9)
387390 }
388391 }
389392 }
390393
391394
392-func ce (bq,cf) = {
393- let bs = bq._7
394- let bt = bq._12
395- let cg = split(cf, "@")
396- if ((size(cg) != 2))
395+func ch (bt,ci) = {
396+ let bv = bt._7
397+ let bw = bt._12
398+ let cj = split(ci, "@")
399+ if ((size(cj) != 2))
397400 then throw("Incorrect order format, should be amount@price")
398401 else {
399- let ch = parseIntValue(cg[0])
400- let ci = parseIntValue(cg[1])
401- if ((0 > ci))
402+ let ck = parseIntValue(cj[0])
403+ let cl = parseIntValue(cj[1])
404+ if ((0 > cl))
402405 then throw("Price can't be negative")
403406 else {
404- let cj = fraction(ch, ci, ae)
405- let ck = if ((size(bq._8) > bs))
406- then parseIntValue(bq._8[bs])
407+ let cm = fraction(ck, cl, ae)
408+ let cn = if ((size(bt._8) > bv))
409+ then parseIntValue(bt._8[bv])
407410 else 0
408- let bz = if ((size(bq._9) > bs))
409- then parseIntValue(bq._9[bs])
411+ let bC = if ((size(bt._9) > bv))
412+ then parseIntValue(bt._9[bv])
410413 else 0
411- let cl = if ((size(bq._10) > bs))
412- then bq._10[bs]
414+ let co = if ((size(bt._10) > bv))
415+ then bt._10[bv]
413416 else "0@0"
414- let cm = split(cl, "@")
415- let cn = parseIntValue(cm[0])
416- let co = parseIntValue(cm[1])
417- if (if ((ch != 0))
418- then (ci != co)
417+ let cp = split(co, "@")
418+ let cq = parseIntValue(cp[0])
419+ let cr = parseIntValue(cp[1])
420+ if (if ((ck != 0))
421+ then (cl != cr)
419422 else false)
420- then throw(((((("Prices of " + bq._11[bs]) + " don't match! WH price=") + toString(co)) + ", your price=") + toString(ci)))
423+ then throw(((((("Prices of " + bt._11[bv]) + " don't match! WH price=") + toString(cr)) + ", your price=") + toString(cl)))
421424 else {
422- let cp = fraction(cn, co, ae)
423- let cq = aQ(ch, t, bt)
424- if ((ch == 0))
425- then $Tuple13((bq._1 :+ toString(bz)), (bq._2 :+ cl), (bq._3 :+ toString(ck)), bq._4, bq._5, bq._6, (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, bq._13)
426- else if ((ch > 0))
427- then if ((0 > cn))
428- then if ((ch > -(cn)))
429- then throw(((((("Attempt to buy " + toString(ch)) + " of ") + bq._11[bs]) + ", but warehouse only sells ") + toString(-(cn))))
430- else $Tuple13((bq._1 :+ toString(bz)), (bq._2 :+ ((toString((cn + ch)) + "@") + toString(co))), (bq._3 :+ toString((ck + ch))), (bq._4 + cq), bq._5, (bq._6 + cj), (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, (bq._13 + (if (bt)
431- then (ch * ae)
432- else ch)))
433- else throw((("Attempt to buy " + bq._11[bs]) + " while warehouse doesn't sell it"))
434- else if ((cn > 0))
435- then if ((-(ch) > cn))
436- then throw(((((("Attempt to sell " + toString(-(ch))) + " of ") + bq._11[bs]) + ", but warehouse only buys ") + toString(cn)))
437- else if ((-(ch) > ck))
438- then throw(((((("Attempt to sell " + toString(-(ch))) + ", but you only have ") + toString(ck)) + " of ") + bq._11[bs]))
439- else $Tuple13((bq._1 :+ toString((bz - ch))), (bq._2 :+ ((toString((cn + ch)) + "@") + toString(co))), (bq._3 :+ toString((ck + ch))), (bq._4 - cq), (bq._5 - cj), bq._6, (bq._7 + 1), bq._8, bq._9, bq._10, bq._11, bt, (bq._13 - (if (bt)
440- then (ch * ae)
441- else ch)))
442- else throw((("Attempt to sell " + bq._11[bs]) + " while warehouse doesn't buy it"))
425+ let cs = fraction(cq, cr, ae)
426+ let ct = aT(ck, t, bw)
427+ if ((ck == 0))
428+ then $Tuple13((bt._1 :+ toString(bC)), (bt._2 :+ co), (bt._3 :+ toString(cn)), bt._4, bt._5, bt._6, (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, bt._13)
429+ else if ((ck > 0))
430+ then if ((0 > cq))
431+ then if ((ck > -(cq)))
432+ then throw(((((("Attempt to buy " + toString(ck)) + " of ") + bt._11[bv]) + ", but warehouse only sells ") + toString(-(cq))))
433+ else $Tuple13((bt._1 :+ toString(bC)), (bt._2 :+ ((toString((cq + ck)) + "@") + toString(cr))), (bt._3 :+ toString((cn + ck))), (bt._4 + ct), bt._5, (bt._6 + cm), (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, (bt._13 + (if (bw)
434+ then (ck * ae)
435+ else ck)))
436+ else throw((("Attempt to buy " + bt._11[bv]) + " while warehouse doesn't sell it"))
437+ else if ((cq > 0))
438+ then if ((-(ck) > cq))
439+ then throw(((((("Attempt to sell " + toString(-(ck))) + " of ") + bt._11[bv]) + ", but warehouse only buys ") + toString(cq)))
440+ else if ((-(ck) > cn))
441+ then throw(((((("Attempt to sell " + toString(-(ck))) + ", but you only have ") + toString(cn)) + " of ") + bt._11[bv]))
442+ else $Tuple13((bt._1 :+ toString((bC - ck))), (bt._2 :+ ((toString((cq + ck)) + "@") + toString(cr))), (bt._3 :+ toString((cn + ck))), (bt._4 - ct), (bt._5 - cm), bt._6, (bt._7 + 1), bt._8, bt._9, bt._10, bt._11, bw, (bt._13 - (if (bw)
443+ then (ck * ae)
444+ else ck)))
445+ else throw((("Attempt to sell " + bt._11[bv]) + " while warehouse doesn't buy it"))
443446 }
444447 }
445448 }
446449 }
447450
448451
449-@Callable(cr)
450-func recalcLockedVolumeREADONLY (R,cs) = {
451- let bH = aN(Q(R))
452- let ct = bF(cs, bH, bH)
453- $Tuple2(nil, (ct._4 + ct._5))
452+@Callable(cu)
453+func recalcLockedVolumeREADONLY (R,cv) = {
454+ let bK = aQ(Q(R))
455+ let cw = bI(cv, bK, bK)
456+ $Tuple2(nil, (cw._4 + cw._5))
454457 }
455458
456459
457460
458-@Callable(cr)
459-func constructorV1 (cu) = if ((cr.caller != this))
461+@Callable(cu)
462+func constructorV1 (cx) = if ((cu.caller != this))
460463 then throw("Permission denied")
461- else [StringEntry(am(), cu)]
464+ else [StringEntry(am(), cx)]
462465
463466
464467
465-@Callable(cr)
466-func sellResources (cv,cw) = {
467- let cx = bo()
468- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
469- if ((size(cr.payments) != 0))
468+@Callable(cu)
469+func sellResources (cy,cz) = {
470+ let cA = br()
471+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
472+ if ((size(cu.payments) != 0))
470473 then throw("sellResources doesn't require any payments")
471474 else {
472- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
473- if ((cy[U] != "F"))
474- then throw(("Duck location type should be Factory, but is " + cy[U]))
475+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
476+ if ((cB[U] != "F"))
477+ then throw(("Duck location type should be Factory, but is " + cB[U]))
475478 else {
476- let aW = cy[V]
477- let cz = bl(M(N))
478- let cA = split(cz[C], "_")
479- func cB (bq,bs) = if ((cv[bs] > parseIntValue(cA[bs])))
480- then throw(((((("You have " + cA[bs]) + " of ") + k[bs]) + ", but tried to sell ") + toString(cv[bs])))
481- else if ((0 > cv[bs]))
482- then throw(((("You tried to sell negative amount of " + k[bs]) + ": ") + toString(cv[bs])))
483- else if ((cv[bs] > 0))
479+ let aZ = cB[V]
480+ let cC = bo(M(N))
481+ let cD = split(cC[C], "_")
482+ func cE (bt,bv) = if ((cy[bv] > parseIntValue(cD[bv])))
483+ then throw(((((("You have " + cD[bv]) + " of ") + k[bv]) + ", but tried to sell ") + toString(cy[bv])))
484+ else if ((0 > cy[bv]))
485+ then throw(((("You tried to sell negative amount of " + k[bv]) + ": ") + toString(cy[bv])))
486+ else if ((cy[bv] > 0))
484487 then {
485- let cC = aV(aW, bs, cv[bs], cw[bs])
486- $Tuple4((bq._1 :+ cC._1), (bq._2 :+ toString((parseIntValue(cA[bs]) - cv[bs]))), (bq._3 + cC._2), (bq._4 + cv[bs]))
488+ let cF = aY(aZ, bv, cy[bv], cz[bv])
489+ $Tuple4((bt._1 :+ cF._1), (bt._2 :+ toString((parseIntValue(cD[bv]) - cy[bv]))), (bt._3 + cF._2), (bt._4 + cy[bv]))
487490 }
488- else $Tuple4(bq._1, (bq._2 :+ cA[bs]), bq._3, bq._4)
491+ else $Tuple4(bt._1, (bt._2 :+ cD[bv]), bt._3, bt._4)
489492
490- let cD = {
491- let bT = [0, 1, 2, 3, 4, 5]
492- let bU = size(bT)
493- let bV = $Tuple4(nil, nil, 0, 0)
494- func bW (bX,bY) = if ((bY >= bU))
495- then bX
496- else cB(bX, bT[bY])
493+ let cG = {
494+ let bW = [0, 1, 2, 3, 4, 5]
495+ let bX = size(bW)
496+ let bY = $Tuple4(nil, nil, 0, 0)
497+ func bZ (ca,cb) = if ((cb >= bX))
498+ then ca
499+ else cE(ca, bW[cb])
497500
498- func bZ (bX,bY) = if ((bY >= bU))
499- then bX
501+ func cc (ca,cb) = if ((cb >= bX))
502+ then ca
500503 else throw("List size exceeds 6")
501504
502- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
505+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
503506 }
504- let cE = makeString([cz[B], makeString(cD._2, "_"), cz[D], cz[E]], ":")
505- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
506- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._4, ae)], nil))
507- $Tuple2((cD._1 :+ ScriptTransfer(cr.caller, cD._3, Z)), $Tuple3(cF, cx, cG))
507+ let cH = makeString([cC[B], makeString(cG._2, "_"), cC[D], cC[E]], ":")
508+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
509+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._4, ae)], nil))
510+ $Tuple2((cG._1 :+ ScriptTransfer(cu.caller, cG._3, Z)), $Tuple3(cI, cA, cJ))
508511 }
509512 }
510513 }
511514
512515
513516
514-@Callable(cr)
515-func buyMaterials (cv,cH) = {
516- let cx = bo()
517- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
518- if ((size(cr.payments) != 1))
517+@Callable(cu)
518+func buyMaterials (cy,cK) = {
519+ let cA = br()
520+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
521+ if ((size(cu.payments) != 1))
519522 then throw("exactly 1 payment must be attached")
520523 else {
521- let cI = cr.payments[0]
522- let cJ = cI.amount
523- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
524- if ((cK != Z))
524+ let cL = cu.payments[0]
525+ let cM = cL.amount
526+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
527+ if ((cN != Z))
525528 then throw("USDT payments only!")
526529 else {
527- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
528- if ((cy[U] != "F"))
529- then throw(("Duck location type should be Factory, but is " + cy[U]))
530+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
531+ if ((cB[U] != "F"))
532+ then throw(("Duck location type should be Factory, but is " + cB[U]))
530533 else {
531- let aW = cy[V]
532- let cz = bl(M(N))
533- let cL = split(cz[D], "_")
534- func cM (bq,bs) = if ((0 > cv[bs]))
535- then throw(((("You tried to buy negative amount of " + l[bs]) + ": ") + toString(cv[bs])))
536- else if ((cv[bs] > 0))
534+ let aZ = cB[V]
535+ let cC = bo(M(N))
536+ let cO = split(cC[D], "_")
537+ func cP (bt,bv) = if ((0 > cy[bv]))
538+ then throw(((("You tried to buy negative amount of " + l[bv]) + ": ") + toString(cy[bv])))
539+ else if ((cy[bv] > 0))
537540 then {
538- let cC = bd(aW, bs, cv[bs], cH[bs])
539- $Tuple4((bq._1 :+ cC._1), (bq._2 :+ toString((parseIntValue(cL[bs]) + cC._3))), (bq._3 + cC._2), (bq._4 + cv[bs]))
541+ let cF = bg(aZ, bv, cy[bv], cK[bv])
542+ $Tuple4((bt._1 :+ cF._1), (bt._2 :+ toString((parseIntValue(cO[bv]) + cF._3))), (bt._3 + cF._2), (bt._4 + cy[bv]))
540543 }
541- else $Tuple4(bq._1, (bq._2 :+ cL[bs]), bq._3, bq._4)
544+ else $Tuple4(bt._1, (bt._2 :+ cO[bv]), bt._3, bt._4)
542545
543- let cD = {
544- let bT = [0, 1, 2, 3, 4, 5]
545- let bU = size(bT)
546- let bV = $Tuple4(nil, nil, 0, 0)
547- func bW (bX,bY) = if ((bY >= bU))
548- then bX
549- else cM(bX, bT[bY])
546+ let cG = {
547+ let bW = [0, 1, 2, 3, 4, 5]
548+ let bX = size(bW)
549+ let bY = $Tuple4(nil, nil, 0, 0)
550+ func bZ (ca,cb) = if ((cb >= bX))
551+ then ca
552+ else cP(ca, bW[cb])
550553
551- func bZ (bX,bY) = if ((bY >= bU))
552- then bX
554+ func cc (ca,cb) = if ((cb >= bX))
555+ then ca
553556 else throw("List size exceeds 6")
554557
555- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
558+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
556559 }
557- if ((cD._3 > cJ))
558- then throw(((("Insufficient payment! Attached=" + toString(cJ)) + ", required=") + toString(cD._3)))
560+ if ((cG._3 > cM))
561+ then throw(((("Insufficient payment! Attached=" + toString(cM)) + ", required=") + toString(cG._3)))
559562 else {
560- let cE = makeString([cz[B], cz[C], makeString(cD._2, "_"), cz[E]], ":")
561- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
562- let ao = if (((cJ - cD._3) > 0))
563- then [ScriptTransfer(cr.caller, (cJ - cD._3), Z)]
563+ let cH = makeString([cC[B], cC[C], makeString(cG._2, "_"), cC[E]], ":")
564+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
565+ let ao = if (((cM - cG._3) > 0))
566+ then [ScriptTransfer(cu.caller, (cM - cG._3), Z)]
564567 else nil
565- let cN = (cD._3 / 100)
566- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._4, ae)], nil))
567- $Tuple2(((cD._1 ++ ao) :+ ScriptTransfer(as, cN, Z)), $Tuple3(cF, cx, cG))
568+ let cQ = (cG._3 / 100)
569+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._4, ae)], nil))
570+ $Tuple2(((cG._1 ++ ao) :+ ScriptTransfer(as, cQ, Z)), $Tuple3(cI, cA, cJ))
568571 }
569572 }
570573 }
571574 }
572575 }
573576
574577
575578
576-@Callable(cr)
577-func exchangeResources (cv) = {
578- let cx = bo()
579- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
580- if ((size(cr.payments) != 1))
579+@Callable(cu)
580+func exchangeResources (cy) = {
581+ let cA = br()
582+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
583+ if ((size(cu.payments) != 1))
581584 then throw("exactly 1 payment must be attached")
582585 else {
583- let cI = cr.payments[0]
584- let cJ = cI.amount
585- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
586- if ((cK != Z))
586+ let cL = cu.payments[0]
587+ let cM = cL.amount
588+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
589+ if ((cN != Z))
587590 then throw("USDT payments only!")
588591 else {
589- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
590- if ((cy[U] != "F"))
591- then throw(("Duck location type should be Factory, but is " + cy[U]))
592+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
593+ if ((cB[U] != "F"))
594+ then throw(("Duck location type should be Factory, but is " + cB[U]))
592595 else {
593- let aW = cy[V]
594- let cz = bl(M(N))
595- let cA = split(cz[C], "_")
596- let cL = split(cz[D], "_")
597- func cO (bq,bs) = {
598- let aY = aH(aW, bs)
599- let aZ = valueOrElse(getInteger(aY), 0)
600- let cP = cv[bs]
601- if ((cP > parseIntValue(cA[bs])))
602- then throw(((((("You have " + cA[bs]) + " of ") + k[bs]) + ", but tried to exchange ") + toString(cP)))
603- else if ((0 > cP))
604- then throw(((("You tried to exchange negative amount of " + k[bs]) + ": ") + toString(cP)))
605- else if ((cP > 0))
606- then $Tuple5((bq._1 :+ toString((parseIntValue(cA[bs]) - cP))), (bq._2 :+ toString((parseIntValue(cL[bs]) + cP))), (bq._3 + fraction(cP, h, ae)), (bq._4 :+ IntegerEntry(aY, aZ)), (bq._5 + cP))
607- else $Tuple5((bq._1 :+ cA[bs]), (bq._2 :+ cL[bs]), bq._3, bq._4, bq._5)
596+ let aZ = cB[V]
597+ let cC = bo(M(N))
598+ let cD = split(cC[C], "_")
599+ let cO = split(cC[D], "_")
600+ func cR (bt,bv) = {
601+ let bb = aK(aZ, bv)
602+ let bc = valueOrElse(getInteger(bb), 0)
603+ let cS = cy[bv]
604+ if ((cS > parseIntValue(cD[bv])))
605+ then throw(((((("You have " + cD[bv]) + " of ") + k[bv]) + ", but tried to exchange ") + toString(cS)))
606+ else if ((0 > cS))
607+ then throw(((("You tried to exchange negative amount of " + k[bv]) + ": ") + toString(cS)))
608+ else if ((cS > 0))
609+ then $Tuple5((bt._1 :+ toString((parseIntValue(cD[bv]) - cS))), (bt._2 :+ toString((parseIntValue(cO[bv]) + cS))), (bt._3 + fraction(cS, h, ae)), (bt._4 :+ IntegerEntry(bb, bc)), (bt._5 + cS))
610+ else $Tuple5((bt._1 :+ cD[bv]), (bt._2 :+ cO[bv]), bt._3, bt._4, bt._5)
608611 }
609612
610- let cD = {
611- let bT = [0, 1, 2, 3, 4, 5]
612- let bU = size(bT)
613- let bV = $Tuple5(nil, nil, 0, nil, 0)
614- func bW (bX,bY) = if ((bY >= bU))
615- then bX
616- else cO(bX, bT[bY])
613+ let cG = {
614+ let bW = [0, 1, 2, 3, 4, 5]
615+ let bX = size(bW)
616+ let bY = $Tuple5(nil, nil, 0, nil, 0)
617+ func bZ (ca,cb) = if ((cb >= bX))
618+ then ca
619+ else cR(ca, bW[cb])
617620
618- func bZ (bX,bY) = if ((bY >= bU))
619- then bX
621+ func cc (ca,cb) = if ((cb >= bX))
622+ then ca
620623 else throw("List size exceeds 6")
621624
622- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
625+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
623626 }
624- if ((cD._3 > cJ))
625- then throw(((("Insufficient payment! Attached=" + toString(cJ)) + ", required=") + toString(cD._3)))
627+ if ((cG._3 > cM))
628+ then throw(((("Insufficient payment! Attached=" + toString(cM)) + ", required=") + toString(cG._3)))
626629 else {
627- let cE = makeString([cz[B], makeString(cD._1, "_"), makeString(cD._2, "_"), cz[E]], ":")
628- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
629- let ao = if (((cJ - cD._3) > 0))
630- then [ScriptTransfer(cr.caller, (cJ - cD._3), Z)]
630+ let cH = makeString([cC[B], makeString(cG._1, "_"), makeString(cG._2, "_"), cC[E]], ":")
631+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
632+ let ao = if (((cM - cG._3) > 0))
633+ then [ScriptTransfer(cu.caller, (cM - cG._3), Z)]
631634 else nil
632- let cN = (cD._3 / 100)
633- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(a, cD._5, ae)], nil))
634- $Tuple2(((ao ++ cD._4) :+ ScriptTransfer(as, cN, Z)), $Tuple3(cF, cx, cG))
635+ let cQ = (cG._3 / 100)
636+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(a, cG._5, ae)], nil))
637+ $Tuple2(((ao ++ cG._4) :+ ScriptTransfer(as, cQ, Z)), $Tuple3(cI, cA, cJ))
635638 }
636639 }
637640 }
638641 }
639642 }
640643
641644
642645
643-@Callable(cr)
644-func craftGoods (cQ,cR) = {
645- let cx = bo()
646- if ((size(cr.payments) != 1))
646+@Callable(cu)
647+func craftGoods (cT,cU) = {
648+ let cA = br()
649+ if ((size(cu.payments) != 1))
647650 then throw("exactly 1 payment must be attached")
648651 else {
649- let cI = cr.payments[0]
650- let cJ = cI.amount
651- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
652- if ((cK != Z))
652+ let cL = cu.payments[0]
653+ let cM = cL.amount
654+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
655+ if ((cN != Z))
653656 then throw("USDT payments only!")
654- else if ((cJ != ad))
657+ else if ((cM != ad))
655658 then throw("exactly 1 USDT must be attached as payment")
656- else if ((0 >= cR))
659+ else if ((0 >= cU))
657660 then throw("Quantity should be positive")
658661 else {
659- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
660- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
661- if ((cy[U] != "M"))
662- then throw(("Duck location type should be Manufactory, but is " + cy[U]))
662+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
663+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
664+ if ((cB[U] != "M"))
665+ then throw(("Duck location type should be Manufactory, but is " + cB[U]))
663666 else {
664- let cS = cy[T]
665- let cz = bl(M(N))
666- let cL = split(cz[D], "_")
667- if (if ((0 > cQ))
667+ let cV = cB[T]
668+ let cC = bo(M(N))
669+ let cO = split(cC[D], "_")
670+ if (if ((0 > cT))
668671 then true
669- else (cQ >= size(p)))
670- then throw(("Unknown product idx=" + toString(cQ)))
672+ else (cT >= size(p)))
673+ then throw(("Unknown product idx=" + toString(cT)))
671674 else {
672- let X = split(p[cQ], "_")
675+ let X = split(p[cT], "_")
673676 if ((size(X) != s))
674- then throw(("Fatal: unknown recipe: " + p[cQ]))
677+ then throw(("Fatal: unknown recipe: " + p[cT]))
675678 else {
676- let cT = parseIntValue(X[r])
677- if ((n[cT] != cS))
678- then throw(((("This product is available in " + n[cT]) + ", but you are in ") + cS))
679+ let cW = parseIntValue(X[r])
680+ if ((n[cW] != cV))
681+ then throw(((("This product is available in " + n[cW]) + ", but you are in ") + cV))
679682 else {
680- let cU = if ((cz[E] == ""))
683+ let cX = if ((cC[E] == ""))
681684 then nil
682- else split(cz[E], "_")
683- func cV (bq,cW) = {
684- let ay = bq._2
685- let cX = if ((size(cU) > ay))
686- then cU[ay]
685+ else split(cC[E], "_")
686+ func cY (bt,cZ) = {
687+ let ay = bt._2
688+ let da = if ((size(cX) > ay))
689+ then cX[ay]
687690 else "0"
688- let cY = parseIntValue(cX)
689- let aR = (cR * t)
690- let cZ = if ((ay == cQ))
691- then toString((cY + aR))
692- else cX
693- $Tuple2((bq._1 :+ cZ), (ay + 1))
691+ let db = parseIntValue(da)
692+ let aU = (cU * t)
693+ let dc = if ((ay == cT))
694+ then toString((db + aU))
695+ else da
696+ $Tuple2((bt._1 :+ dc), (ay + 1))
694697 }
695698
696- let da = ( let bT = p
697- let bU = size(bT)
698- let bV = $Tuple2(nil, 0)
699- func bW (bX,bY) = if ((bY >= bU))
700- then bX
701- else cV(bX, bT[bY])
699+ let dd = ( let bW = p
700+ let bX = size(bW)
701+ let bY = $Tuple2(nil, 0)
702+ func bZ (ca,cb) = if ((cb >= bX))
703+ then ca
704+ else cY(ca, bW[cb])
702705
703- func bZ (bX,bY) = if ((bY >= bU))
704- then bX
706+ func cc (ca,cb) = if ((cb >= bX))
707+ then ca
705708 else throw("List size exceeds 50")
706709
707- bZ(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bV, 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
708- func db (bq,bs) = {
709- let dc = ((parseIntValue(X[bs]) * ad) * cR)
710- let dd = parseIntValue(cL[bs])
711- if ((dc > dd))
712- then throw(((((((("You have " + az(dd, 8)) + " of ") + l[bs]) + ", but recipe requires ") + az(dc, 8)) + " for quantity ") + toString(cR)))
713- else if ((dc > 0))
714- then $Tuple2((bq._1 :+ toString((dd - dc))), (bq._2 + dc))
715- else $Tuple2((bq._1 :+ cL[bs]), bq._2)
710+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bY, 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
711+ func de (bt,bv) = {
712+ let df = ((parseIntValue(X[bv]) * ad) * cU)
713+ let dg = parseIntValue(cO[bv])
714+ if ((df > dg))
715+ then throw(((((((("You have " + az(dg, 8)) + " of ") + l[bv]) + ", but recipe requires ") + az(df, 8)) + " for quantity ") + toString(cU)))
716+ else if ((df > 0))
717+ then $Tuple2((bt._1 :+ toString((dg - df))), (bt._2 + df))
718+ else $Tuple2((bt._1 :+ cO[bv]), bt._2)
716719 }
717720
718- let cD = {
719- let bT = [0, 1, 2, 3, 4, 5]
720- let bU = size(bT)
721- let bV = $Tuple2(nil, 0)
722- func ca (bX,bY) = if ((bY >= bU))
723- then bX
724- else db(bX, bT[bY])
721+ let cG = {
722+ let bW = [0, 1, 2, 3, 4, 5]
723+ let bX = size(bW)
724+ let bY = $Tuple2(nil, 0)
725+ func cd (ca,cb) = if ((cb >= bX))
726+ then ca
727+ else de(ca, bW[cb])
725728
726- func cb (bX,bY) = if ((bY >= bU))
727- then bX
729+ func ce (ca,cb) = if ((cb >= bX))
730+ then ca
728731 else throw("List size exceeds 6")
729732
730- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
733+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
731734 }
732- let cE = makeString([cz[B], cz[C], makeString(cD._1, "_"), makeString(da, "_")], ":")
733- let cF = au(invoke(at, "updateBackpack", [N, cE], nil))
734- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(b, cD._2, ae)], nil))
735- $Tuple2(nil, $Tuple3(cF, cx, cG))
735+ let cH = makeString([cC[B], cC[C], makeString(cG._1, "_"), makeString(dd, "_")], ":")
736+ let cI = au(invoke(at, "updateBackpack", [N, cH], nil))
737+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(b, cG._2, ae)], nil))
738+ $Tuple2(nil, $Tuple3(cI, cA, cJ))
736739 }
737740 }
738741 }
739742 }
740743 }
741744 }
742745 }
743746
744747
745748
746-@Callable(cr)
747-func setWarehouseOrder (de,R) = {
748- let df = cr.originCaller
749- let J = toString(df)
750- let cF = if ((df != as))
751- then bn()
749+@Callable(cu)
750+func setWarehouseOrder (dh,R) = {
751+ let di = cu.originCaller
752+ let J = toString(di)
753+ let cI = if ((di != as))
754+ then bq()
752755 else false
753- let dg = value(assetInfo(fromBase58String(R)))
756+ let dj = value(assetInfo(fromBase58String(R)))
754757 if (!(isDefined(getInteger(at, H(R)))))
755- then throw((("NFT " + dg.name) + " is not staked"))
758+ then throw((("NFT " + dj.name) + " is not staked"))
756759 else {
757- let dh = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dg.name) + " is orphaned"))
758- if (if ((df != as))
759- then (dh != J)
760+ let dk = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dj.name) + " is orphaned"))
761+ if (if ((di != as))
762+ then (dk != J)
760763 else false)
761764 then throw((e + " is not yours"))
762765 else {
763- let di = split_4C(de, ":")
764- let cs = au(invoke(at, "getWarehouseREADONLY", [R], nil))
765- let bG = split_4C(cs, ":")
766- let dj = split(bG[y], "_")
767- let dk = parseIntValue(dj[A])
768- let aO = Q(R)
769- let bH = aN(aO)
770- let ct = bF(bG, bH, di)
771- let dl = ct._4
772- let dm = ct._5
773- let dn = ct._7
774- let do = (dl + dm)
775- let dp = ((dk - dn) - do)
776- if ((0 > dp))
777- then throw((((((("Attempt to reserve " + toString(dl)) + " space for buy orders, and ") + toString(dm)) + " space for sell orders (and occupied=") + toString(dn)) + "), leads to negative free space"))
766+ let dl = split_4C(dh, ":")
767+ let cv = au(invoke(at, "getWarehouseREADONLY", [R], nil))
768+ let bJ = split_4C(cv, ":")
769+ let dm = split(bJ[y], "_")
770+ let dn = parseIntValue(dm[A])
771+ let aR = Q(R)
772+ let bK = aQ(aR)
773+ let cw = bI(bJ, bK, dl)
774+ let do = cw._4
775+ let dp = cw._5
776+ let dq = cw._7
777+ let dr = (do + dp)
778+ let ds = ((dn - dq) - dr)
779+ if ((0 > ds))
780+ then throw((((((("Attempt to reserve " + toString(do)) + " space for buy orders, and ") + toString(dp)) + " space for sell orders (and occupied=") + toString(dq)) + "), leads to negative free space"))
778781 else {
779- let dq = makeString_2C([bG[u], makeString(ct._1, "_"), makeString(ct._2, "_"), makeString(ct._3, "_"), toString(do)], ":")
780- let dr = au(invoke(at, "saveWarehouse", [dq, R], nil))
781- let ds = ct._6
782- let dt = if ((ds > 0))
783- then if ((size(cr.payments) != 1))
782+ let dt = makeString_2C([bJ[u], makeString(cw._1, "_"), makeString(cw._2, "_"), makeString(cw._3, "_"), toString(dr)], ":")
783+ let du = au(invoke(at, "saveWarehouse", [dt, R], nil))
784+ let dv = cw._6
785+ let dw = if ((dv > 0))
786+ then if ((size(cu.payments) != 1))
784787 then throw("exactly 1 payment must be attached")
785788 else {
786- let cI = cr.payments[0]
787- let cJ = cI.amount
788- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
789- if ((cK != Z))
789+ let cL = cu.payments[0]
790+ let cM = cL.amount
791+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
792+ if ((cN != Z))
790793 then throw("USDT payments only!")
791- else if ((cJ != ds))
792- then throw(("Payment needed is " + toString(ds)))
793- else [StringEntry(aO, de)]
794+ else if ((cM != dv))
795+ then throw(("Payment needed is " + toString(dv)))
796+ else [StringEntry(aR, dh)]
794797 }
795- else if ((ds == 0))
796- then if ((size(cr.payments) != 0))
798+ else if ((dv == 0))
799+ then if ((size(cu.payments) != 0))
797800 then throw("No payments needed")
798- else [StringEntry(aO, de)]
799- else if ((size(cr.payments) != 0))
801+ else [StringEntry(aR, dh)]
802+ else if ((size(cu.payments) != 0))
800803 then throw("No payments needed")
801- else [ScriptTransfer(addressFromStringValue(dh), -(ds), Z), StringEntry(aO, de)]
802- $Tuple2(dt, $Tuple2(cF, dr))
804+ else [ScriptTransfer(addressFromStringValue(dk), -(dv), Z), StringEntry(aR, dh)]
805+ $Tuple2(dw, $Tuple2(cI, du))
803806 }
804807 }
805808 }
806809 }
807810
808811
809812
810-@Callable(cr)
811-func acceptWarehouseOrder (du,R,N) = {
812- let cx = bo()
813- let dv = cr.originCaller
814- let dw = toString(dv)
815- let dx = valueOrErrorMessage(getString(at, K(dw)), "You don't have a duck staked")
816- let cy = valueOrElse(getString(at, O(dx)), g)
817- let dy = split(value(cy), "_")
818- if ((dy[U] != "L"))
819- then throw((("Duck location type is " + dy[U]) + ", but should be L"))
820- else if ((dx != N))
821- then throw(((("Your staked duck is " + dx) + ", but passed ") + N))
813+@Callable(cu)
814+func acceptWarehouseOrder (dx,R,N) = {
815+ let cA = br()
816+ let dy = cu.originCaller
817+ let dz = toString(dy)
818+ let dA = valueOrErrorMessage(getString(at, K(dz)), "You don't have a duck staked")
819+ let cB = valueOrElse(getString(at, O(dA)), g)
820+ let dB = split(value(cB), "_")
821+ if ((dB[U] != "L"))
822+ then throw((("Duck location type is " + dB[U]) + ", but should be L"))
823+ else if ((dA != N))
824+ then throw(((("Your staked duck is " + dA) + ", but passed ") + N))
822825 else {
823- let dz = value(assetInfo(fromBase58String(R)))
826+ let dC = value(assetInfo(fromBase58String(R)))
824827 if (!(isDefined(getInteger(at, H(R)))))
825- then throw((("NFT " + dz.name) + " is not staked"))
828+ then throw((("NFT " + dC.name) + " is not staked"))
826829 else {
827- let dA = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dz.name) + " is orphaned"))
828- if ((dA == dw))
830+ let dD = valueOrErrorMessage(getString(at, F(R)), (("NFT " + dC.name) + " is orphaned"))
831+ if ((dD == dz))
829832 then throw("You cannot trade with yourself")
830833 else {
831- let dB = split_4C(du, ":")
832- if ((size(dB) != 3))
834+ let dE = split_4C(dx, ":")
835+ if ((size(dE) != 3))
833836 then throw("bpOrderStr should contain exactly 2 ':' separators")
834837 else {
835- let dC = split(dB[0], "_")
836- let dD = split(dB[1], "_")
837- let dE = if ((dB[2] == ""))
838+ let dF = split(dE[0], "_")
839+ let dG = split(dE[1], "_")
840+ let dH = if ((dE[2] == ""))
838841 then nil
839- else split(dB[2], "_")
840- if ((size(dC) != f))
842+ else split(dE[2], "_")
843+ if ((size(dF) != f))
841844 then throw("All 6 resources should be passed")
842- else if ((size(dD) != f))
845+ else if ((size(dG) != f))
843846 then throw("All 6 materials should be passed")
844847 else {
845- let cs = au(invoke(at, "getWarehouseREADONLY", [R], nil))
846- let bG = split_4C(cs, ":")
847- let bJ = split(bG[v], "_")
848- let bK = split(bG[w], "_")
849- let bL = if ((bG[x] == ""))
848+ let cv = au(invoke(at, "getWarehouseREADONLY", [R], nil))
849+ let bJ = split_4C(cv, ":")
850+ let bM = split(bJ[v], "_")
851+ let bN = split(bJ[w], "_")
852+ let bO = if ((bJ[x] == ""))
850853 then nil
851- else split(bG[x], "_")
852- let dF = parseIntValue(split(bG[y], "_")[z])
853- let bm = M(N)
854- let cz = bl(bm)
855- let dG = split(cz[C], "_")
856- let dH = split(cz[D], "_")
857- let dI = if ((cz[E] == ""))
854+ else split(bJ[x], "_")
855+ let dI = parseIntValue(split(bJ[y], "_")[z])
856+ let bp = M(N)
857+ let cC = bo(bp)
858+ let dJ = split(cC[C], "_")
859+ let dK = split(cC[D], "_")
860+ let dL = if ((cC[E] == ""))
858861 then nil
859- else split(cz[E], "_")
860- let aO = Q(R)
861- let dJ = aN(aO)
862- let dK = split(dJ[aK], "_")
863- let dL = split(dJ[aL], "_")
864- let dM = if ((dJ[aM] == ""))
862+ else split(cC[E], "_")
863+ let aR = Q(R)
864+ let dM = aQ(aR)
865+ let dN = split(dM[aN], "_")
866+ let dO = split(dM[aO], "_")
867+ let dP = if ((dM[aP] == ""))
865868 then nil
866- else split(dJ[aM], "_")
867- let bS = {
868- let bT = dC
869- let bU = size(bT)
870- let bV = $Tuple13(nil, nil, nil, 0, 0, 0, 0, dG, bJ, dK, k, false, 0)
871- func bW (bX,bY) = if ((bY >= bU))
872- then bX
873- else ce(bX, bT[bY])
869+ else split(dM[aP], "_")
870+ let bV = {
871+ let bW = dF
872+ let bX = size(bW)
873+ let bY = $Tuple13(nil, nil, nil, 0, 0, 0, 0, dJ, bM, dN, k, false, 0)
874+ func bZ (ca,cb) = if ((cb >= bX))
875+ then ca
876+ else ch(ca, bW[cb])
874877
875- func bZ (bX,bY) = if ((bY >= bU))
876- then bX
878+ func cc (ca,cb) = if ((cb >= bX))
879+ then ca
877880 else throw("List size exceeds 6")
878881
879- bZ(bW(bW(bW(bW(bW(bW(bV, 0), 1), 2), 3), 4), 5), 6)
882+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bY, 0), 1), 2), 3), 4), 5), 6)
880883 }
881- let bi = {
882- let bT = dD
883- let bU = size(bT)
884- let bV = $Tuple13(nil, nil, nil, bS._4, bS._5, bS._6, 0, dH, bK, dL, l, false, bS._13)
885- func ca (bX,bY) = if ((bY >= bU))
886- then bX
887- else ce(bX, bT[bY])
884+ let bl = {
885+ let bW = dG
886+ let bX = size(bW)
887+ let bY = $Tuple13(nil, nil, nil, bV._4, bV._5, bV._6, 0, dK, bN, dO, l, false, bV._13)
888+ func cd (ca,cb) = if ((cb >= bX))
889+ then ca
890+ else ch(ca, bW[cb])
888891
889- func cb (bX,bY) = if ((bY >= bU))
890- then bX
892+ func ce (ca,cb) = if ((cb >= bX))
893+ then ca
891894 else throw("List size exceeds 6")
892895
893- cb(ca(ca(ca(ca(ca(ca(bV, 0), 1), 2), 3), 4), 5), 6)
896+ ce(cd(cd(cd(cd(cd(cd(bY, 0), 1), 2), 3), 4), 5), 6)
894897 }
895- let aP = if ((size(dE) != 0))
898+ let aS = if ((size(dH) != 0))
896899 then {
897- let bT = dE
898- let bU = size(bT)
899- let bV = $Tuple13(nil, nil, nil, bi._4, bi._5, bi._6, 0, dI, bL, dM, m, true, bi._13)
900- func cc (bX,bY) = if ((bY >= bU))
901- then bX
902- else ce(bX, bT[bY])
900+ let bW = dH
901+ let bX = size(bW)
902+ let bY = $Tuple13(nil, nil, nil, bl._4, bl._5, bl._6, 0, dL, bO, dP, m, true, bl._13)
903+ func cf (ca,cb) = if ((cb >= bX))
904+ then ca
905+ else ch(ca, bW[cb])
903906
904- func cd (bX,bY) = if ((bY >= bU))
905- then bX
907+ func cg (ca,cb) = if ((cb >= bX))
908+ then ca
906909 else throw("List size exceeds 50")
907910
908- cd(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(cc(bV, 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)
911+ cg(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(cf(bY, 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)
909912 }
910- else $Tuple13(bL, dM, dI, bi._4, bi._5, bi._6, 0, dI, bL, dM, m, true, bi._13)
911- let dN = aP._4
912- let dO = if ((0 > (dF - dN)))
913+ else $Tuple13(bO, dP, dL, bl._4, bl._5, bl._6, 0, dL, bO, dP, m, true, bl._13)
914+ let dQ = aS._4
915+ let dR = if ((0 > (dI - dQ)))
913916 then 0
914- else (dF - dN)
915- let dq = makeString_2C([bG[u], makeString(bS._1, "_"), makeString(bi._1, "_"), makeString(aP._1, "_"), toString(dO)], ":")
916- let dP = makeString_2C([makeString(bS._2, "_"), makeString(bi._2, "_"), makeString(aP._2, "_")], ":")
917- let dQ = makeString_2C([cz[B], makeString(bS._3, "_"), makeString(bi._3, "_"), makeString(aP._3, "_")], ":")
918- let dr = au(invoke(at, "saveWarehouse", [dq, R], nil))
919- let dR = au(invoke(at, "updateBackpack", [N, dQ], nil))
920- let dS = ax(invoke(at, "updateDuckStats", [N, fraction(d, aP._13, ae)], nil))
921- let dT = ax(invoke(at, "updateAccStats", [dA, fraction(d, aP._13, ae)], nil))
922- let dt = [StringEntry(aO, dP)]
923- let dU = aP._5
924- let dV = if ((dU > 0))
917+ else (dI - dQ)
918+ let dt = makeString_2C([bJ[u], makeString(bV._1, "_"), makeString(bl._1, "_"), makeString(aS._1, "_"), toString(dR)], ":")
919+ let dS = makeString_2C([makeString(bV._2, "_"), makeString(bl._2, "_"), makeString(aS._2, "_")], ":")
920+ let dT = makeString_2C([cC[B], makeString(bV._3, "_"), makeString(bl._3, "_"), makeString(aS._3, "_")], ":")
921+ let du = au(invoke(at, "saveWarehouse", [dt, R], nil))
922+ let dU = au(invoke(at, "updateBackpack", [N, dT], nil))
923+ let dV = ax(invoke(at, "updateDuckStats", [N, fraction(d, aS._13, ae)], nil))
924+ let dW = ax(invoke(at, "updateAccStats", [dD, fraction(d, aS._13, ae)], nil))
925+ let dw = [StringEntry(aR, dS)]
926+ let dX = aS._5
927+ let dY = if ((dX > 0))
925928 then {
926- let dW = fraction(aP._5, aG, ad)
927- let dX = I(dw)
928- let dY = getString(at, dX)
929- if (isDefined(dY))
930- then (((dt :+ ScriptTransfer(dv, (aP._5 - (3 * dW)), Z)) :+ ScriptTransfer(as, dW, Z)) :+ ScriptTransfer(addressFromStringValue(value(dY)), dW, Z))
931- else ((dt :+ ScriptTransfer(dv, (aP._5 - (3 * dW)), Z)) :+ ScriptTransfer(as, dW, Z))
929+ let dZ = fraction(aS._5, aJ, ad)
930+ let ea = I(dz)
931+ let eb = getString(at, ea)
932+ if (isDefined(eb))
933+ then (((dw :+ ScriptTransfer(dy, (aS._5 - (3 * dZ)), Z)) :+ ScriptTransfer(as, dZ, Z)) :+ ScriptTransfer(addressFromStringValue(value(eb)), dZ, Z))
934+ else ((dw :+ ScriptTransfer(dy, (aS._5 - (3 * dZ)), Z)) :+ ScriptTransfer(as, dZ, Z))
932935 }
933- else dt
934- let dZ = aP._6
935- let ea = if ((dZ > 0))
936- then if ((size(cr.payments) != 1))
936+ else dw
937+ let ec = aS._6
938+ let ed = if ((ec > 0))
939+ then if ((size(cu.payments) != 1))
937940 then throw("exactly 1 payment must be attached")
938941 else {
939- let cI = cr.payments[0]
940- let cJ = cI.amount
941- let cK = valueOrErrorMessage(cI.assetId, "WAVES can't be used as payment")
942- if ((cK != Z))
942+ let cL = cu.payments[0]
943+ let cM = cL.amount
944+ let cN = valueOrErrorMessage(cL.assetId, "WAVES can't be used as payment")
945+ if ((cN != Z))
943946 then throw("USDT payments only!")
944- else if ((cJ != dZ))
945- then throw(("Payment needed is " + toString(dZ)))
946- else if ((ag > cJ))
947+ else if ((cM != ec))
948+ then throw(("Payment needed is " + toString(ec)))
949+ else if ((ag > cM))
947950 then throw(("Payment should be at least " + toString(ag)))
948951 else {
949- let eb = fraction(aP._6, aG, ad)
950- let dX = I(dA)
951- let dY = getString(at, dX)
952- if (isDefined(dY))
953- then (((dV :+ ScriptTransfer(addressFromStringValue(dA), (aP._6 - (3 * eb)), Z)) :+ ScriptTransfer(as, eb, Z)) :+ ScriptTransfer(addressFromStringValue(value(dY)), eb, Z))
954- else ((dV :+ ScriptTransfer(addressFromStringValue(dA), (aP._6 - (3 * eb)), Z)) :+ ScriptTransfer(as, eb, Z))
952+ let ee = fraction(aS._6, aJ, ad)
953+ let ea = I(dD)
954+ let eb = getString(at, ea)
955+ if (isDefined(eb))
956+ then (((dY :+ ScriptTransfer(addressFromStringValue(dD), (aS._6 - (3 * ee)), Z)) :+ ScriptTransfer(as, ee, Z)) :+ ScriptTransfer(addressFromStringValue(value(eb)), ee, Z))
957+ else ((dY :+ ScriptTransfer(addressFromStringValue(dD), (aS._6 - (3 * ee)), Z)) :+ ScriptTransfer(as, ee, Z))
955958 }
956959 }
957- else if ((size(cr.payments) != 0))
960+ else if ((size(cu.payments) != 0))
958961 then throw("No payments needed")
959- else dV
960- $Tuple2(ea, $Tuple5(cx, dr, dR, dS, dT))
962+ else dY
963+ $Tuple2(ed, $Tuple5(cA, du, dU, dV, dW))
961964 }
962965 }
963966 }
964967 }
965968 }
966969 }
967970
968971
969972
970-@Callable(cr)
971-func sellProductsToES (cv) = {
972- let cx = bo()
973- if ((size(cr.payments) != 0))
973+@Callable(cu)
974+func sellProductsToES (cy) = {
975+ let cA = br()
976+ if ((size(cu.payments) != 0))
974977 then throw("No payments needed")
975978 else {
976- let N = valueOrErrorMessage(getString(at, K(toString(cr.caller))), "You don't have a duck staked")
977- let cy = split(valueOrElse(getString(at, O(N)), g), "_")
978- if ((cy[U] != "A"))
979- then throw(("Duck location type should be Airport, but is " + cy[U]))
979+ let N = valueOrErrorMessage(getString(at, K(toString(cu.caller))), "You don't have a duck staked")
980+ let cB = split(valueOrElse(getString(at, O(N)), g), "_")
981+ if ((cB[U] != "A"))
982+ then throw(("Duck location type should be Airport, but is " + cB[U]))
980983 else {
981- let cz = bl(M(N))
982- let cU = if ((cz[E] == ""))
984+ let cC = bo(M(N))
985+ let cX = if ((cC[E] == ""))
983986 then nil
984- else split(cz[E], "_")
985- let ec = S()
986- let ed = getString(ec)
987- let ee = if (isDefined(ed))
988- then split(value(ed), "_")
987+ else split(cC[E], "_")
988+ let ef = S()
989+ let eg = getString(ef)
990+ let eh = if (isDefined(eg))
991+ then split(value(eg), "_")
989992 else nil
990- func ef (bq,eg) = {
991- let bs = bq._1
992- let cR = if ((size(cv) > bs))
993- then cv[bs]
993+ func ei (bt,ej) = {
994+ let bv = bt._1
995+ let cU = if ((size(cy) > bv))
996+ then cy[bv]
994997 else 0
995- if ((0 > cR))
998+ if ((0 > cU))
996999 then throw("Quantity cannot be negative")
9971000 else {
998- let X = split(eg, "_")
1001+ let X = split(ej, "_")
9991002 if ((size(X) != s))
1000- then throw(("Fatal: unknown recipe: " + eg))
1003+ then throw(("Fatal: unknown recipe: " + ej))
10011004 else {
1002- let eh = (i * t)
1003- let ei = if ((size(ee) > bs))
1004- then parseIntValue(ee[bs])
1005+ let ek = (i * t)
1006+ let el = if ((size(eh) > bv))
1007+ then parseIntValue(eh[bv])
10051008 else 0
1006- let ej = (eh - ei)
1007- if ((cR > ej))
1008- then throw(((("Warehouse can buy only " + toString(ej)) + " of ") + m[bs]))
1009+ let em = (ek - el)
1010+ if ((cU > em))
1011+ then throw(((("Warehouse can buy only " + toString(em)) + " of ") + m[bv]))
10091012 else {
1010- let ek = W(X)
1011- let el = fraction((ek * j), h, (ae * t))
1012- let em = if ((size(cU) > bs))
1013- then parseIntValue(cU[bs])
1013+ let en = W(X)
1014+ let eo = fraction((en * j), h, (ae * t))
1015+ let ep = if ((size(cX) > bv))
1016+ then parseIntValue(cX[bv])
10141017 else 0
1015- if ((cR > em))
1016- then throw(((("You have only " + toString(em)) + " of ") + m[bs]))
1017- else $Tuple5((bs + 1), (bq._2 + (el * cR)), (bq._3 :+ toString((em - cR))), (bq._4 :+ toString((ei + cR))), (bq._5 + (ek * cR)))
1018+ if ((cU > ep))
1019+ then throw(((("You have only " + toString(ep)) + " of ") + m[bv]))
1020+ else $Tuple5((bv + 1), (bt._2 + (eo * cU)), (bt._3 :+ toString((ep - cU))), (bt._4 :+ toString((el + cU))), (bt._5 + (en * cU)))
10181021 }
10191022 }
10201023 }
10211024 }
10221025
1023- let cD = {
1024- let bT = p
1025- let bU = size(bT)
1026- let bV = $Tuple5(0, 0, nil, nil, 0)
1027- func bW (bX,bY) = if ((bY >= bU))
1028- then bX
1029- else ef(bX, bT[bY])
1026+ let cG = {
1027+ let bW = p
1028+ let bX = size(bW)
1029+ let bY = $Tuple5(0, 0, nil, nil, 0)
1030+ func bZ (ca,cb) = if ((cb >= bX))
1031+ then ca
1032+ else ei(ca, bW[cb])
10301033
1031- func bZ (bX,bY) = if ((bY >= bU))
1032- then bX
1034+ func cc (ca,cb) = if ((cb >= bX))
1035+ then ca
10331036 else throw("List size exceeds 50")
10341037
1035- bZ(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bW(bV, 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)
1038+ cc(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bZ(bY, 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)
10361039 }
1037- let dQ = makeString_2C([cz[B], cz[C], cz[D], makeString(cD._3, "_")], ":")
1038- let dR = au(invoke(at, "updateBackpack", [N, dQ], nil))
1039- let cG = ax(invoke(at, "updateDuckStats", [N, fraction(c, cD._5, (ae * 10))], nil))
1040- $Tuple2([StringEntry(ec, makeString(cD._4, "_")), ScriptTransfer(cr.caller, cD._2, Z)], $Tuple3(dR, cx, cG))
1040+ let dT = makeString_2C([cC[B], cC[C], cC[D], makeString(cG._3, "_")], ":")
1041+ let dU = au(invoke(at, "updateBackpack", [N, dT], nil))
1042+ let cJ = ax(invoke(at, "updateDuckStats", [N, fraction(c, cG._5, (ae * 10))], nil))
1043+ $Tuple2([StringEntry(ef, makeString(cG._4, "_")), ScriptTransfer(cu.caller, cG._2, Z)], $Tuple3(dU, cA, cJ))
10411044 }
10421045 }
10431046 }
10441047
10451048
10461049
1047-@Callable(cr)
1048-func updateEsStorage (en) = if ((cr.caller != at))
1050+@Callable(cu)
1051+func updateEsStorage (eq) = if ((cu.caller != at))
10491052 then throw("Permission denied")
1050- else $Tuple2([StringEntry(S(), en)], en)
1053+ else $Tuple2([StringEntry(S(), eq)], eq)
10511054
10521055

github/deemru/w8io/169f3d6 
775.42 ms