tx · 5AocGxGUL8Cpu81wwo8QubDVwVVPzbDo2AJ8nao8KQwN 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep: -0.03600000 Waves 2023.07.12 16:54 [2662772] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves
{ "type": 13, "id": "5AocGxGUL8Cpu81wwo8QubDVwVVPzbDo2AJ8nao8KQwN", "fee": 3600000, "feeAssetId": null, "timestamp": 1689170133797, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "3NwgENcxC7yP1KhzpVjz4B7ggH6Dab9NsMHpLEHnuhnpuUsts876oEr8441RQUnFFAQtoDxTPpYkhcTuAjjMik84" ], "script": "base64:BgI7CAISBAoCCBgSAwoBCBIECgIRERIECgIRERIDCgEREgQKAgEBEgQKAggIEgUKAwgICBIDCgEREgMKAQhRAAd4cFRyYWRlAKCNBgAHeHBDcmFmdACgjQYACnhwU2VsbFRvRXMAoI0GAAZ4cFNob3AAoI0GAApMQU5EUFJFRklYAgRMQU5EAAZOVU1SRVMABgAPREVGQVVMVExPQ0FUSU9OAg9BZnJpY2FfRl9BZnJpY2EAEFJFU09VUkNFUFJJQ0VNSU4A1bUCAA1FU01BWFBBQ0tBR0VTAAMACUVTQlVZQ09FRgAEAAhyZXNUeXBlcwkAzAgCAgNPaWwJAMwIAgIDT3JlCQDMCAICBFdvb2QJAMwIAgIEU2FuZAkAzAgCAgRDbGF5CQDMCAICB09yZ2FuaWMFA25pbAAIbWF0VHlwZXMJAMwIAgIERnVlbAkAzAgCAgVNZXRhbAkAzAgCAgVQbGFuawkAzAgCAgVHbGFzcwkAzAgCAgdQbGFzdGljCQDMCAICB1Byb3RlaW4FA25pbAAJcHJvZFR5cGVzCQDMCAICEEZpcnN0IEFpZCBLaXQgTDEJAMwIAgIQRmlyc3QgQWlkIEt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n5T Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
31 | 31 | ||
32 | - | let productionMatrix = [" | |
32 | + | let productionMatrix = ["8_8_8_17_17_42_12_0", "8_8_8_17_17_42_24_0", "8_8_8_17_17_42_36_0", "8_19_19_8_27_19_26_1", "8_19_19_8_27_19_52_1", "8_19_19_8_27_19_78_1", "8_8_8_8_8_60_13_2", "8_8_8_8_8_60_26_2", "8_8_8_8_8_60_39_2", "30_30_3_17_17_3_30_3", "30_30_3_17_17_3_60_3", "30_30_3_17_17_3_90_3", "18_18_10_18_18_18_11_4", "18_18_10_18_18_18_22_4", "18_18_10_18_18_18_33_4"] | |
33 | 33 | ||
34 | - | let | |
34 | + | let rIdxCoeff = 6 | |
35 | 35 | ||
36 | - | let recipeIdxContinent = 8 | |
36 | + | let rIdxContinent = 7 | |
37 | + | ||
38 | + | let recipeSize = 8 | |
39 | + | ||
40 | + | let productPkgSize = 10 | |
37 | 41 | ||
38 | 42 | let whIdxLevels = 0 | |
39 | 43 | ||
90 | 94 | ||
91 | 95 | let locIdxId = 2 | |
92 | 96 | ||
93 | - | func getRecipeMaterials (recipe) = { | |
94 | - | func addMat (ac,j) = (ac + parseIntValue(recipe[j])) | |
95 | - | ||
96 | - | let $l = [0, 1, 2, 3, 4, 5] | |
97 | - | let $s = size($l) | |
98 | - | let $acc0 = 0 | |
99 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | - | then $a | |
101 | - | else addMat($a, $l[$i]) | |
102 | - | ||
103 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | - | then $a | |
105 | - | else throw("List size exceeds 6") | |
106 | - | ||
107 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
108 | - | } | |
97 | + | func getRecipeMaterials (recipe) = parseIntValue(recipe[rIdxCoeff]) | |
109 | 98 | ||
110 | 99 | ||
111 | 100 | let chain = take(drop(this.bytes, 1), 1) | |
131 | 120 | let SEP = "__" | |
132 | 121 | ||
133 | 122 | let MULT6 = 1000000 | |
134 | - | ||
135 | - | let MULT7 = 10000000 | |
136 | 123 | ||
137 | 124 | let MULT8 = 100000000 | |
138 | 125 | ||
177 | 164 | case _ => | |
178 | 165 | throw("fail to cast into Int") | |
179 | 166 | } | |
167 | + | ||
168 | + | ||
169 | + | func fixedPoint (val,decimals) = { | |
170 | + | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
171 | + | ((toString((val / tenPow)) + ".") + toString((val % tenPow))) | |
172 | + | } | |
180 | 173 | ||
181 | 174 | ||
182 | 175 | let FACTORYMAXWAREHOUSE = 10000000000 | |
271 | 264 | func setCommon (acc,item) = { | |
272 | 265 | let j = acc._1 | |
273 | 266 | let isProd = acc._8 | |
274 | - | let pkgSize = if (isProd) | |
275 | - | then parseIntValue(split(productionMatrix[j], "_")[recipeIdxPacksize]) | |
276 | - | else 0 | |
277 | 267 | let itemParts = split(item, "@") | |
278 | 268 | if ((size(itemParts) != 2)) | |
279 | 269 | then throw("Incorrect order format, should be amount@price") | |
281 | 271 | let newOrdAm = parseIntValue(itemParts[0]) | |
282 | 272 | let newOrdPr = parseIntValue(itemParts[1]) | |
283 | 273 | let newOrdUsd = fraction(newOrdAm, newOrdPr, MULT8) | |
284 | - | let newOrdVol = toVolume(newOrdAm, | |
274 | + | let newOrdVol = toVolume(newOrdAm, productPkgSize, isProd) | |
285 | 275 | let whInit = if ((size(acc._6) > j)) | |
286 | 276 | then parseIntValue(acc._6[j]) | |
287 | 277 | else 0 | |
298 | 288 | let curOrdUsd = fraction(curOrdAm, curOrdPr, MULT8) | |
299 | 289 | if ((newOrdAm == 0)) | |
300 | 290 | then if ((curOrdAm > 0)) | |
301 | - | then $Tuple9((j + 1), (acc._2 :+ toString(whInit)), acc._3, acc._4, (acc._5 - curOrdUsd), acc._6, acc._7, isProd, (acc._9 + toVolume(whInit, | |
302 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), acc._3, acc._4, acc._5, acc._6, acc._7, isProd, (acc._9 + toVolume((whInit - curOrdAm), | |
291 | + | then $Tuple9((j + 1), (acc._2 :+ toString(whInit)), acc._3, acc._4, (acc._5 - curOrdUsd), acc._6, acc._7, isProd, (acc._9 + toVolume(whInit, productPkgSize, isProd))) | |
292 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), acc._3, acc._4, acc._5, acc._6, acc._7, isProd, (acc._9 + toVolume((whInit - curOrdAm), productPkgSize, isProd))) | |
303 | 293 | else if ((newOrdAm > 0)) | |
304 | 294 | then if ((0 > curOrdAm)) | |
305 | - | then $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), (acc._3 + newOrdVol), acc._4, (acc._5 + newOrdUsd), acc._6, acc._7, isProd, toVolume((whInit - curOrdAm), | |
306 | - | else $Tuple9((j + 1), (acc._2 :+ toString(whInit)), (acc._3 + newOrdVol), acc._4, ((acc._5 + newOrdUsd) - curOrdUsd), acc._6, acc._7, isProd, toVolume(whInit, | |
295 | + | then $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), (acc._3 + newOrdVol), acc._4, (acc._5 + newOrdUsd), acc._6, acc._7, isProd, toVolume((whInit - curOrdAm), productPkgSize, isProd)) | |
296 | + | else $Tuple9((j + 1), (acc._2 :+ toString(whInit)), (acc._3 + newOrdVol), acc._4, ((acc._5 + newOrdUsd) - curOrdUsd), acc._6, acc._7, isProd, toVolume(whInit, productPkgSize, isProd)) | |
307 | 297 | else if ((0 > curOrdAm)) | |
308 | 298 | then { | |
309 | 299 | let amDiff = (curOrdAm - newOrdAm) | |
310 | 300 | if ((0 > (whInit - amDiff))) | |
311 | 301 | then throw((((("Attempt to take " + toString(amDiff)) + " from warehouse, but only ") + toString(whInit)) + " available")) | |
312 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - amDiff))), acc._3, (acc._4 - newOrdVol), acc._5, acc._6, acc._7, isProd, toVolume((whInit - amDiff), | |
302 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - amDiff))), acc._3, (acc._4 - newOrdVol), acc._5, acc._6, acc._7, isProd, toVolume((whInit - amDiff), productPkgSize, isProd)) | |
313 | 303 | } | |
314 | 304 | else if ((0 > (whInit + newOrdAm))) | |
315 | 305 | then throw((((("Attempt to take " + toString(-(newOrdAm))) + " from warehouse, but only ") + toString(whInit)) + " available")) | |
316 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit + newOrdAm))), acc._3, (acc._4 - newOrdVol), (acc._5 - curOrdUsd), acc._6, acc._7, isProd, toVolume((whInit + newOrdAm), | |
306 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit + newOrdAm))), acc._3, (acc._4 - newOrdVol), (acc._5 - curOrdUsd), acc._6, acc._7, isProd, toVolume((whInit + newOrdAm), productPkgSize, isProd)) | |
317 | 307 | } | |
318 | 308 | } | |
319 | 309 | } | |
396 | 386 | func acceptCommon (acc,bpOrdItem) = { | |
397 | 387 | let j = acc._7 | |
398 | 388 | let isProd = acc._12 | |
399 | - | let pkgSize = if (isProd) | |
400 | - | then parseIntValue(split(productionMatrix[j], "_")[recipeIdxPacksize]) | |
401 | - | else 0 | |
402 | 389 | let bpOrdParts = split(bpOrdItem, "@") | |
403 | 390 | if ((size(bpOrdParts) != 2)) | |
404 | 391 | then throw("Incorrect order format, should be amount@price") | |
427 | 414 | then throw(((((("Prices of " + acc._11[j]) + " don't match! WH price=") + toString(whOrdPr)) + ", your price=") + toString(bpOrdPr))) | |
428 | 415 | else { | |
429 | 416 | let whOrdUsd = fraction(whOrdAm, whOrdPr, MULT8) | |
430 | - | let deltaVol = toVolume(bpOrdAm, | |
417 | + | let deltaVol = toVolume(bpOrdAm, productPkgSize, isProd) | |
431 | 418 | if ((bpOrdAm == 0)) | |
432 | 419 | then $Tuple13((acc._1 :+ toString(whInit)), (acc._2 :+ whOrdInit), (acc._3 :+ toString(bpInit)), acc._4, acc._5, acc._6, (acc._7 + 1), acc._8, acc._9, acc._10, acc._11, isProd, acc._13) | |
433 | 420 | else if ((bpOrdAm > 0)) | |
677 | 664 | then throw(("Unknown product idx=" + toString(productIdx))) | |
678 | 665 | else { | |
679 | 666 | let recipe = split(productionMatrix[productIdx], "_") | |
680 | - | if ((size(recipe) != | |
667 | + | if ((size(recipe) != recipeSize)) | |
681 | 668 | then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx])) | |
682 | 669 | else { | |
683 | - | let productContIdx = parseIntValue(recipe[ | |
670 | + | let productContIdx = parseIntValue(recipe[rIdxContinent]) | |
684 | 671 | if ((continents[productContIdx] != cont)) | |
685 | 672 | then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont)) | |
686 | 673 | else { | |
693 | 680 | then prodList[n] | |
694 | 681 | else "0" | |
695 | 682 | let x = parseIntValue(xs) | |
696 | - | let amount = (quantity * | |
683 | + | let amount = (quantity * productPkgSize) | |
697 | 684 | let y = if ((n == productIdx)) | |
698 | 685 | then toString((x + amount)) | |
699 | 686 | else xs | |
713 | 700 | ||
714 | 701 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 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 | |
715 | 702 | func producer (acc,j) = { | |
716 | - | let needMat = ((parseIntValue(recipe[j]) * | |
703 | + | let needMat = ((parseIntValue(recipe[j]) * MULT6) * quantity) | |
717 | 704 | let haveMat = parseIntValue(matList[j]) | |
718 | 705 | if ((needMat > haveMat)) | |
719 | - | then throw(((((((("You have " + | |
706 | + | then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity))) | |
720 | 707 | else if ((needMat > 0)) | |
721 | 708 | then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat)) | |
722 | 709 | else $Tuple2((acc._1 :+ matList[j]), acc._2) | |
1003 | 990 | then throw("Quantity cannot be negative") | |
1004 | 991 | else { | |
1005 | 992 | let recipe = split(recipeStr, "_") | |
1006 | - | if ((size(recipe) != | |
993 | + | if ((size(recipe) != recipeSize)) | |
1007 | 994 | then throw(("Fatal: unknown recipe: " + recipeStr)) | |
1008 | 995 | else { | |
1009 | - | let packSize = parseIntValue(recipe[recipeIdxPacksize]) | |
1010 | - | let maxAmount = (ESMAXPACKAGES * packSize) | |
996 | + | let maxAmount = (ESMAXPACKAGES * productPkgSize) | |
1011 | 997 | let existAmount = if ((size(existAmounts) > j)) | |
1012 | 998 | then parseIntValue(existAmounts[j]) | |
1013 | 999 | else 0 | |
1016 | 1002 | then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j])) | |
1017 | 1003 | else { | |
1018 | 1004 | let totalMat = getRecipeMaterials(recipe) | |
1019 | - | let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (10 * | |
1005 | + | let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (10 * productPkgSize)) | |
1020 | 1006 | let bpProdAmount = if ((size(prodList) > j)) | |
1021 | 1007 | then parseIntValue(prodList[j]) | |
1022 | 1008 | else 0 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let xpTrade = 100000 | |
5 | 5 | ||
6 | 6 | let xpCraft = 100000 | |
7 | 7 | ||
8 | 8 | let xpSellToEs = 100000 | |
9 | 9 | ||
10 | 10 | let xpShop = 100000 | |
11 | 11 | ||
12 | 12 | let LANDPREFIX = "LAND" | |
13 | 13 | ||
14 | 14 | let NUMRES = 6 | |
15 | 15 | ||
16 | 16 | let DEFAULTLOCATION = "Africa_F_Africa" | |
17 | 17 | ||
18 | 18 | let RESOURCEPRICEMIN = 39637 | |
19 | 19 | ||
20 | 20 | let ESMAXPACKAGES = 3 | |
21 | 21 | ||
22 | 22 | let ESBUYCOEF = 4 | |
23 | 23 | ||
24 | 24 | let resTypes = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"] | |
25 | 25 | ||
26 | 26 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
27 | 27 | ||
28 | 28 | let prodTypes = ["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"] | |
29 | 29 | ||
30 | 30 | let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
31 | 31 | ||
32 | - | let productionMatrix = [" | |
32 | + | let productionMatrix = ["8_8_8_17_17_42_12_0", "8_8_8_17_17_42_24_0", "8_8_8_17_17_42_36_0", "8_19_19_8_27_19_26_1", "8_19_19_8_27_19_52_1", "8_19_19_8_27_19_78_1", "8_8_8_8_8_60_13_2", "8_8_8_8_8_60_26_2", "8_8_8_8_8_60_39_2", "30_30_3_17_17_3_30_3", "30_30_3_17_17_3_60_3", "30_30_3_17_17_3_90_3", "18_18_10_18_18_18_11_4", "18_18_10_18_18_18_22_4", "18_18_10_18_18_18_33_4"] | |
33 | 33 | ||
34 | - | let | |
34 | + | let rIdxCoeff = 6 | |
35 | 35 | ||
36 | - | let recipeIdxContinent = 8 | |
36 | + | let rIdxContinent = 7 | |
37 | + | ||
38 | + | let recipeSize = 8 | |
39 | + | ||
40 | + | let productPkgSize = 10 | |
37 | 41 | ||
38 | 42 | let whIdxLevels = 0 | |
39 | 43 | ||
40 | 44 | let whIdxRes = 1 | |
41 | 45 | ||
42 | 46 | let whIdxMat = 2 | |
43 | 47 | ||
44 | 48 | let whIdxProd = 3 | |
45 | 49 | ||
46 | 50 | let whIdxLOFT = 4 | |
47 | 51 | ||
48 | 52 | let volLocked = 0 | |
49 | 53 | ||
50 | 54 | let volTotal = 3 | |
51 | 55 | ||
52 | 56 | let bpIdxLevel = 0 | |
53 | 57 | ||
54 | 58 | let bpIdxRes = 1 | |
55 | 59 | ||
56 | 60 | let bpIdxMat = 2 | |
57 | 61 | ||
58 | 62 | let bpIdxProd = 3 | |
59 | 63 | ||
60 | 64 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
61 | 65 | ||
62 | 66 | ||
63 | 67 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
64 | 68 | ||
65 | 69 | ||
66 | 70 | func keyAddressRefBy (addr) = ("accRefBy_" + addr) | |
67 | 71 | ||
68 | 72 | ||
69 | 73 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
70 | 74 | ||
71 | 75 | ||
72 | 76 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
73 | 77 | ||
74 | 78 | ||
75 | 79 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
76 | 80 | ||
77 | 81 | ||
78 | 82 | func keyBlocked () = "contractsBlocked" | |
79 | 83 | ||
80 | 84 | ||
81 | 85 | func keyOrderByLand (landAssetId) = ("landOrder_" + landAssetId) | |
82 | 86 | ||
83 | 87 | ||
84 | 88 | func keyEsWarehouse () = "emergencyWarehouseProducts" | |
85 | 89 | ||
86 | 90 | ||
87 | 91 | let locIdxContinent = 0 | |
88 | 92 | ||
89 | 93 | let locIdxType = 1 | |
90 | 94 | ||
91 | 95 | let locIdxId = 2 | |
92 | 96 | ||
93 | - | func getRecipeMaterials (recipe) = { | |
94 | - | func addMat (ac,j) = (ac + parseIntValue(recipe[j])) | |
95 | - | ||
96 | - | let $l = [0, 1, 2, 3, 4, 5] | |
97 | - | let $s = size($l) | |
98 | - | let $acc0 = 0 | |
99 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | - | then $a | |
101 | - | else addMat($a, $l[$i]) | |
102 | - | ||
103 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | - | then $a | |
105 | - | else throw("List size exceeds 6") | |
106 | - | ||
107 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
108 | - | } | |
97 | + | func getRecipeMaterials (recipe) = parseIntValue(recipe[rIdxCoeff]) | |
109 | 98 | ||
110 | 99 | ||
111 | 100 | let chain = take(drop(this.bytes, 1), 1) | |
112 | 101 | ||
113 | 102 | let usdtAssetId = match chain { | |
114 | 103 | case _ => | |
115 | 104 | if ((base58'2W' == $match0)) | |
116 | 105 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
117 | 106 | else if ((base58'2T' == $match0)) | |
118 | 107 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
119 | 108 | else throw("Unknown chain") | |
120 | 109 | } | |
121 | 110 | ||
122 | 111 | let defaultRestAddressStr = match chain { | |
123 | 112 | case _ => | |
124 | 113 | if ((base58'2W' == $match0)) | |
125 | 114 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
126 | 115 | else if ((base58'2T' == $match0)) | |
127 | 116 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
128 | 117 | else throw("Unknown chain") | |
129 | 118 | } | |
130 | 119 | ||
131 | 120 | let SEP = "__" | |
132 | 121 | ||
133 | 122 | let MULT6 = 1000000 | |
134 | - | ||
135 | - | let MULT7 = 10000000 | |
136 | 123 | ||
137 | 124 | let MULT8 = 100000000 | |
138 | 125 | ||
139 | 126 | let MULT10 = 10000000000 | |
140 | 127 | ||
141 | 128 | let MINSHOPPAYMENT = 100000 | |
142 | 129 | ||
143 | 130 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
144 | 131 | ||
145 | 132 | ||
146 | 133 | let IdxCfgStakingDapp = 1 | |
147 | 134 | ||
148 | 135 | func keyRestCfg () = "%s__restConfig" | |
149 | 136 | ||
150 | 137 | ||
151 | 138 | func keyRestAddress () = "%s__restAddr" | |
152 | 139 | ||
153 | 140 | ||
154 | 141 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
155 | 142 | ||
156 | 143 | ||
157 | 144 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
158 | 145 | ||
159 | 146 | ||
160 | 147 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
161 | 148 | ||
162 | 149 | let restCfg = readRestCfgOrFail(restContract) | |
163 | 150 | ||
164 | 151 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
165 | 152 | ||
166 | 153 | func asString (v) = match v { | |
167 | 154 | case s: String => | |
168 | 155 | s | |
169 | 156 | case _ => | |
170 | 157 | throw("fail to cast into String") | |
171 | 158 | } | |
172 | 159 | ||
173 | 160 | ||
174 | 161 | func asInt (v) = match v { | |
175 | 162 | case n: Int => | |
176 | 163 | n | |
177 | 164 | case _ => | |
178 | 165 | throw("fail to cast into Int") | |
179 | 166 | } | |
167 | + | ||
168 | + | ||
169 | + | func fixedPoint (val,decimals) = { | |
170 | + | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
171 | + | ((toString((val / tenPow)) + ".") + toString((val % tenPow))) | |
172 | + | } | |
180 | 173 | ||
181 | 174 | ||
182 | 175 | let FACTORYMAXWAREHOUSE = 10000000000 | |
183 | 176 | ||
184 | 177 | let SELLMULTIPLIER = 200 | |
185 | 178 | ||
186 | 179 | let BUYMULTIPLIER = 300 | |
187 | 180 | ||
188 | 181 | let AUCTIONFEE = 10000 | |
189 | 182 | ||
190 | 183 | func keyFactoryWarehouseByIdAndType (factoryId,resType) = ((("factoryWhByContinentAndRes_" + factoryId) + "_") + toString(resType)) | |
191 | 184 | ||
192 | 185 | ||
193 | 186 | let ordIdxRes = 0 | |
194 | 187 | ||
195 | 188 | let ordIdxMat = 1 | |
196 | 189 | ||
197 | 190 | let ordIdxProd = 2 | |
198 | 191 | ||
199 | 192 | func getOrder (ordKey) = { | |
200 | 193 | let p = split(valueOrElse(getString(ordKey), "0@0_0@0_0@0_0@0_0@0_0@0:0@0_0@0_0@0_0@0_0@0_0@0:"), ":") | |
201 | 194 | [if ((size(split(p[ordIdxRes], "_")) == NUMRES)) | |
202 | 195 | then p[ordIdxRes] | |
203 | 196 | else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(p[ordIdxMat], "_")) == NUMRES)) | |
204 | 197 | then p[ordIdxMat] | |
205 | 198 | else "0@0_0@0_0@0_0@0_0@0_0@0", p[ordIdxProd]] | |
206 | 199 | } | |
207 | 200 | ||
208 | 201 | ||
209 | 202 | func toVolume (amount,pkgSize,isProduct) = if (isProduct) | |
210 | 203 | then { | |
211 | 204 | let pkgs = if ((amount >= 0)) | |
212 | 205 | then (((amount + pkgSize) - 1) / pkgSize) | |
213 | 206 | else -((((-(amount) + pkgSize) - 1) / pkgSize)) | |
214 | 207 | (pkgs * MULT8) | |
215 | 208 | } | |
216 | 209 | else amount | |
217 | 210 | ||
218 | 211 | ||
219 | 212 | func sellInternal (locId,resType,amount,minPrice) = { | |
220 | 213 | let whKey = keyFactoryWarehouseByIdAndType(locId, resType) | |
221 | 214 | let w0 = valueOrElse(getInteger(whKey), 0) | |
222 | 215 | let r0 = if ((w0 > FACTORYMAXWAREHOUSE)) | |
223 | 216 | then 0 | |
224 | 217 | else if (((w0 + amount) > FACTORYMAXWAREHOUSE)) | |
225 | 218 | then (FACTORYMAXWAREHOUSE - w0) | |
226 | 219 | else amount | |
227 | 220 | let usdtReceived = (fraction(r0, ((SELLMULTIPLIER * RESOURCEPRICEMIN) - fraction(((100 * w0) + (50 * r0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction((amount - r0), RESOURCEPRICEMIN, MULT8)) | |
228 | 221 | let min99 = (minPrice - (minPrice / 100)) | |
229 | 222 | if (((min99 * amount) > (usdtReceived * MULT8))) | |
230 | 223 | then throw((((((((((("Actual price = " + toString(usdtReceived)) + " / ") + toString(amount)) + " < minPrice = ") + toString(minPrice)) + ", (") + locId) + ", ") + resTypes[resType]) + ")")) | |
231 | 224 | else $Tuple2(IntegerEntry(whKey, (w0 + amount)), usdtReceived) | |
232 | 225 | } | |
233 | 226 | ||
234 | 227 | ||
235 | 228 | func buyInternal (locId,matType,amount,maxPrice) = { | |
236 | 229 | let whKey = keyFactoryWarehouseByIdAndType(locId, matType) | |
237 | 230 | let w0 = valueOrElse(getInteger(whKey), 0) | |
238 | 231 | let m1 = if ((w0 > FACTORYMAXWAREHOUSE)) | |
239 | 232 | then min([amount, (w0 - FACTORYMAXWAREHOUSE)]) | |
240 | 233 | else 0 | |
241 | 234 | let m0 = min([w0, (amount - m1)]) | |
242 | 235 | let m = (m0 + m1) | |
243 | 236 | let usdtSpent = (fraction(m0, ((BUYMULTIPLIER * RESOURCEPRICEMIN) - fraction(((100 * w0) - (50 * m0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction(m1, (2 * RESOURCEPRICEMIN), MULT8)) | |
244 | 237 | let max101 = (maxPrice + (maxPrice / 100)) | |
245 | 238 | if (((usdtSpent * MULT8) > (max101 * m))) | |
246 | 239 | then throw((((((((((("Actual price = " + toString(usdtSpent)) + " / ") + toString(m)) + " > maxPrice = ") + toString(maxPrice)) + ", (") + locId) + ", ") + matTypes[matType]) + ")")) | |
247 | 240 | else $Tuple3(IntegerEntry(whKey, (w0 - m)), usdtSpent, m) | |
248 | 241 | } | |
249 | 242 | ||
250 | 243 | ||
251 | 244 | func getBackpack (bpKey) = { | |
252 | 245 | let p = split(valueOrElse(getString(stakingContract, bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
253 | 246 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
254 | 247 | then p[bpIdxRes] | |
255 | 248 | else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES)) | |
256 | 249 | then p[bpIdxMat] | |
257 | 250 | else "0_0_0_0_0_0", p[bpIdxProd]] | |
258 | 251 | } | |
259 | 252 | ||
260 | 253 | ||
261 | 254 | func checkBlocked () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false)) | |
262 | 255 | then throw("Contracts are under maintenance") | |
263 | 256 | else unit | |
264 | 257 | ||
265 | 258 | ||
266 | 259 | func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false)) | |
267 | 260 | then throw("Contracts are under maintenance") | |
268 | 261 | else asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
269 | 262 | ||
270 | 263 | ||
271 | 264 | func setCommon (acc,item) = { | |
272 | 265 | let j = acc._1 | |
273 | 266 | let isProd = acc._8 | |
274 | - | let pkgSize = if (isProd) | |
275 | - | then parseIntValue(split(productionMatrix[j], "_")[recipeIdxPacksize]) | |
276 | - | else 0 | |
277 | 267 | let itemParts = split(item, "@") | |
278 | 268 | if ((size(itemParts) != 2)) | |
279 | 269 | then throw("Incorrect order format, should be amount@price") | |
280 | 270 | else { | |
281 | 271 | let newOrdAm = parseIntValue(itemParts[0]) | |
282 | 272 | let newOrdPr = parseIntValue(itemParts[1]) | |
283 | 273 | let newOrdUsd = fraction(newOrdAm, newOrdPr, MULT8) | |
284 | - | let newOrdVol = toVolume(newOrdAm, | |
274 | + | let newOrdVol = toVolume(newOrdAm, productPkgSize, isProd) | |
285 | 275 | let whInit = if ((size(acc._6) > j)) | |
286 | 276 | then parseIntValue(acc._6[j]) | |
287 | 277 | else 0 | |
288 | 278 | let curOrdParts = split(if ((size(acc._7) > j)) | |
289 | 279 | then acc._7[j] | |
290 | 280 | else "0@0", "@") | |
291 | 281 | let curOrdAm = parseIntValue(curOrdParts[0]) | |
292 | 282 | let curOrdPr = parseIntValue(curOrdParts[1]) | |
293 | 283 | if (if ((0 > curOrdPr)) | |
294 | 284 | then true | |
295 | 285 | else (0 > newOrdPr)) | |
296 | 286 | then throw("Price can't be negative") | |
297 | 287 | else { | |
298 | 288 | let curOrdUsd = fraction(curOrdAm, curOrdPr, MULT8) | |
299 | 289 | if ((newOrdAm == 0)) | |
300 | 290 | then if ((curOrdAm > 0)) | |
301 | - | then $Tuple9((j + 1), (acc._2 :+ toString(whInit)), acc._3, acc._4, (acc._5 - curOrdUsd), acc._6, acc._7, isProd, (acc._9 + toVolume(whInit, | |
302 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), acc._3, acc._4, acc._5, acc._6, acc._7, isProd, (acc._9 + toVolume((whInit - curOrdAm), | |
291 | + | then $Tuple9((j + 1), (acc._2 :+ toString(whInit)), acc._3, acc._4, (acc._5 - curOrdUsd), acc._6, acc._7, isProd, (acc._9 + toVolume(whInit, productPkgSize, isProd))) | |
292 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), acc._3, acc._4, acc._5, acc._6, acc._7, isProd, (acc._9 + toVolume((whInit - curOrdAm), productPkgSize, isProd))) | |
303 | 293 | else if ((newOrdAm > 0)) | |
304 | 294 | then if ((0 > curOrdAm)) | |
305 | - | then $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), (acc._3 + newOrdVol), acc._4, (acc._5 + newOrdUsd), acc._6, acc._7, isProd, toVolume((whInit - curOrdAm), | |
306 | - | else $Tuple9((j + 1), (acc._2 :+ toString(whInit)), (acc._3 + newOrdVol), acc._4, ((acc._5 + newOrdUsd) - curOrdUsd), acc._6, acc._7, isProd, toVolume(whInit, | |
295 | + | then $Tuple9((j + 1), (acc._2 :+ toString((whInit - curOrdAm))), (acc._3 + newOrdVol), acc._4, (acc._5 + newOrdUsd), acc._6, acc._7, isProd, toVolume((whInit - curOrdAm), productPkgSize, isProd)) | |
296 | + | else $Tuple9((j + 1), (acc._2 :+ toString(whInit)), (acc._3 + newOrdVol), acc._4, ((acc._5 + newOrdUsd) - curOrdUsd), acc._6, acc._7, isProd, toVolume(whInit, productPkgSize, isProd)) | |
307 | 297 | else if ((0 > curOrdAm)) | |
308 | 298 | then { | |
309 | 299 | let amDiff = (curOrdAm - newOrdAm) | |
310 | 300 | if ((0 > (whInit - amDiff))) | |
311 | 301 | then throw((((("Attempt to take " + toString(amDiff)) + " from warehouse, but only ") + toString(whInit)) + " available")) | |
312 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - amDiff))), acc._3, (acc._4 - newOrdVol), acc._5, acc._6, acc._7, isProd, toVolume((whInit - amDiff), | |
302 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit - amDiff))), acc._3, (acc._4 - newOrdVol), acc._5, acc._6, acc._7, isProd, toVolume((whInit - amDiff), productPkgSize, isProd)) | |
313 | 303 | } | |
314 | 304 | else if ((0 > (whInit + newOrdAm))) | |
315 | 305 | then throw((((("Attempt to take " + toString(-(newOrdAm))) + " from warehouse, but only ") + toString(whInit)) + " available")) | |
316 | - | else $Tuple9((j + 1), (acc._2 :+ toString((whInit + newOrdAm))), acc._3, (acc._4 - newOrdVol), (acc._5 - curOrdUsd), acc._6, acc._7, isProd, toVolume((whInit + newOrdAm), | |
306 | + | else $Tuple9((j + 1), (acc._2 :+ toString((whInit + newOrdAm))), acc._3, (acc._4 - newOrdVol), (acc._5 - curOrdUsd), acc._6, acc._7, isProd, toVolume((whInit + newOrdAm), productPkgSize, isProd)) | |
317 | 307 | } | |
318 | 308 | } | |
319 | 309 | } | |
320 | 310 | ||
321 | 311 | ||
322 | 312 | func setInternal (currentWh,currentOrd,newOrd) = { | |
323 | 313 | let currWhRes = split(currentWh[whIdxRes], "_") | |
324 | 314 | let currWhMat = split(currentWh[whIdxMat], "_") | |
325 | 315 | let currWhProd = if ((currentWh[whIdxProd] == "")) | |
326 | 316 | then nil | |
327 | 317 | else split(currentWh[whIdxProd], "_") | |
328 | 318 | let currentOrdRes = split(currentOrd[ordIdxRes], "_") | |
329 | 319 | let currentOrdMat = split(currentOrd[ordIdxMat], "_") | |
330 | 320 | let currentOrdProd = if ((currentOrd[ordIdxProd] == "")) | |
331 | 321 | then nil | |
332 | 322 | else split(currentOrd[ordIdxProd], "_") | |
333 | 323 | if ((size(newOrd) != 3)) | |
334 | 324 | then throw("newOrderStr should contain exactly 2 ':' separators") | |
335 | 325 | else { | |
336 | 326 | let resParts = split(newOrd[0], "_") | |
337 | 327 | let matParts = split(newOrd[1], "_") | |
338 | 328 | let prodParts = if ((newOrd[2] == "")) | |
339 | 329 | then nil | |
340 | 330 | else split(newOrd[2], "_") | |
341 | 331 | if ((size(resParts) != NUMRES)) | |
342 | 332 | then throw("All 6 resources should be passed") | |
343 | 333 | else if ((size(matParts) != NUMRES)) | |
344 | 334 | then throw("All 6 materials should be passed") | |
345 | 335 | else { | |
346 | 336 | let r = { | |
347 | 337 | let $l = resParts | |
348 | 338 | let $s = size($l) | |
349 | 339 | let $acc0 = $Tuple9(0, nil, 0, 0, 0, currWhRes, currentOrdRes, false, 0) | |
350 | 340 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
351 | 341 | then $a | |
352 | 342 | else setCommon($a, $l[$i]) | |
353 | 343 | ||
354 | 344 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
355 | 345 | then $a | |
356 | 346 | else throw("List size exceeds 6") | |
357 | 347 | ||
358 | 348 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
359 | 349 | } | |
360 | 350 | let m = { | |
361 | 351 | let $l = matParts | |
362 | 352 | let $s = size($l) | |
363 | 353 | let $acc0 = $Tuple9(0, nil, r._3, r._4, r._5, currWhMat, currentOrdMat, false, r._9) | |
364 | 354 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
365 | 355 | then $a | |
366 | 356 | else setCommon($a, $l[$i]) | |
367 | 357 | ||
368 | 358 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
369 | 359 | then $a | |
370 | 360 | else throw("List size exceeds 6") | |
371 | 361 | ||
372 | 362 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
373 | 363 | } | |
374 | 364 | let p = if ((size(prodParts) != 0)) | |
375 | 365 | then { | |
376 | 366 | let $l = prodParts | |
377 | 367 | let $s = size($l) | |
378 | 368 | let $acc0 = $Tuple9(0, nil, m._3, m._4, m._5, currWhProd, currentOrdProd, true, m._9) | |
379 | 369 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
380 | 370 | then $a | |
381 | 371 | else setCommon($a, $l[$i]) | |
382 | 372 | ||
383 | 373 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
384 | 374 | then $a | |
385 | 375 | else throw("List size exceeds 50") | |
386 | 376 | ||
387 | 377 | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 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) | |
388 | 378 | } | |
389 | 379 | else $Tuple9(0, currWhProd, m._3, m._4, m._5, currWhProd, currentOrdProd, true, m._9) | |
390 | 380 | $Tuple7(r._2, m._2, p._2, p._3, p._4, p._5, p._9) | |
391 | 381 | } | |
392 | 382 | } | |
393 | 383 | } | |
394 | 384 | ||
395 | 385 | ||
396 | 386 | func acceptCommon (acc,bpOrdItem) = { | |
397 | 387 | let j = acc._7 | |
398 | 388 | let isProd = acc._12 | |
399 | - | let pkgSize = if (isProd) | |
400 | - | then parseIntValue(split(productionMatrix[j], "_")[recipeIdxPacksize]) | |
401 | - | else 0 | |
402 | 389 | let bpOrdParts = split(bpOrdItem, "@") | |
403 | 390 | if ((size(bpOrdParts) != 2)) | |
404 | 391 | then throw("Incorrect order format, should be amount@price") | |
405 | 392 | else { | |
406 | 393 | let bpOrdAm = parseIntValue(bpOrdParts[0]) | |
407 | 394 | let bpOrdPr = parseIntValue(bpOrdParts[1]) | |
408 | 395 | if ((0 > bpOrdPr)) | |
409 | 396 | then throw("Price can't be negative") | |
410 | 397 | else { | |
411 | 398 | let bpOrdUsd = fraction(bpOrdAm, bpOrdPr, MULT8) | |
412 | 399 | let bpInit = if ((size(acc._8) > j)) | |
413 | 400 | then parseIntValue(acc._8[j]) | |
414 | 401 | else 0 | |
415 | 402 | let whInit = if ((size(acc._9) > j)) | |
416 | 403 | then parseIntValue(acc._9[j]) | |
417 | 404 | else 0 | |
418 | 405 | let whOrdInit = if ((size(acc._10) > j)) | |
419 | 406 | then acc._10[j] | |
420 | 407 | else "0@0" | |
421 | 408 | let whOrdParts = split(whOrdInit, "@") | |
422 | 409 | let whOrdAm = parseIntValue(whOrdParts[0]) | |
423 | 410 | let whOrdPr = parseIntValue(whOrdParts[1]) | |
424 | 411 | if (if ((bpOrdAm != 0)) | |
425 | 412 | then (bpOrdPr != whOrdPr) | |
426 | 413 | else false) | |
427 | 414 | then throw(((((("Prices of " + acc._11[j]) + " don't match! WH price=") + toString(whOrdPr)) + ", your price=") + toString(bpOrdPr))) | |
428 | 415 | else { | |
429 | 416 | let whOrdUsd = fraction(whOrdAm, whOrdPr, MULT8) | |
430 | - | let deltaVol = toVolume(bpOrdAm, | |
417 | + | let deltaVol = toVolume(bpOrdAm, productPkgSize, isProd) | |
431 | 418 | if ((bpOrdAm == 0)) | |
432 | 419 | then $Tuple13((acc._1 :+ toString(whInit)), (acc._2 :+ whOrdInit), (acc._3 :+ toString(bpInit)), acc._4, acc._5, acc._6, (acc._7 + 1), acc._8, acc._9, acc._10, acc._11, isProd, acc._13) | |
433 | 420 | else if ((bpOrdAm > 0)) | |
434 | 421 | then if ((0 > whOrdAm)) | |
435 | 422 | then if ((bpOrdAm > -(whOrdAm))) | |
436 | 423 | then throw(((((("Attempt to buy " + toString(bpOrdAm)) + " of ") + acc._11[j]) + ", but warehouse only sells ") + toString(-(whOrdAm)))) | |
437 | 424 | else $Tuple13((acc._1 :+ toString(whInit)), (acc._2 :+ ((toString((whOrdAm + bpOrdAm)) + "@") + toString(whOrdPr))), (acc._3 :+ toString((bpInit + bpOrdAm))), (acc._4 + deltaVol), acc._5, (acc._6 + bpOrdUsd), (acc._7 + 1), acc._8, acc._9, acc._10, acc._11, isProd, (acc._13 + (if (isProd) | |
438 | 425 | then (bpOrdAm * MULT8) | |
439 | 426 | else bpOrdAm))) | |
440 | 427 | else throw((("Attempt to buy " + acc._11[j]) + " while warehouse doesn't sell it")) | |
441 | 428 | else if ((whOrdAm > 0)) | |
442 | 429 | then if ((-(bpOrdAm) > whOrdAm)) | |
443 | 430 | then throw(((((("Attempt to sell " + toString(-(bpOrdAm))) + " of ") + acc._11[j]) + ", but warehouse only buys ") + toString(whOrdAm))) | |
444 | 431 | else if ((-(bpOrdAm) > bpInit)) | |
445 | 432 | then throw(((((("Attempt to sell " + toString(-(bpOrdAm))) + ", but you only have ") + toString(bpInit)) + " of ") + acc._11[j])) | |
446 | 433 | else $Tuple13((acc._1 :+ toString((whInit - bpOrdAm))), (acc._2 :+ ((toString((whOrdAm + bpOrdAm)) + "@") + toString(whOrdPr))), (acc._3 :+ toString((bpInit + bpOrdAm))), (acc._4 - deltaVol), (acc._5 - bpOrdUsd), acc._6, (acc._7 + 1), acc._8, acc._9, acc._10, acc._11, isProd, (acc._13 - (if (isProd) | |
447 | 434 | then (bpOrdAm * MULT8) | |
448 | 435 | else bpOrdAm))) | |
449 | 436 | else throw((("Attempt to sell " + acc._11[j]) + " while warehouse doesn't buy it")) | |
450 | 437 | } | |
451 | 438 | } | |
452 | 439 | } | |
453 | 440 | } | |
454 | 441 | ||
455 | 442 | ||
456 | 443 | @Callable(i) | |
457 | 444 | func recalcLockedVolumeREADONLY (landAssetId,wh) = { | |
458 | 445 | let currentOrd = getOrder(keyOrderByLand(landAssetId)) | |
459 | 446 | let z = setInternal(wh, currentOrd, currentOrd) | |
460 | 447 | $Tuple2(nil, (z._4 + z._5)) | |
461 | 448 | } | |
462 | 449 | ||
463 | 450 | ||
464 | 451 | ||
465 | 452 | @Callable(i) | |
466 | 453 | func constructorV1 (restAddr) = if ((i.caller != this)) | |
467 | 454 | then throw("Permission denied") | |
468 | 455 | else [StringEntry(keyRestAddress(), restAddr)] | |
469 | 456 | ||
470 | 457 | ||
471 | 458 | ||
472 | 459 | @Callable(i) | |
473 | 460 | func sellResources (amounts,minPrices) = { | |
474 | 461 | let prologResult = prolog() | |
475 | 462 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
476 | 463 | if ((size(i.payments) != 0)) | |
477 | 464 | then throw("sellResources doesn't require any payments") | |
478 | 465 | else { | |
479 | 466 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
480 | 467 | if ((curLocation[locIdxType] != "F")) | |
481 | 468 | then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType])) | |
482 | 469 | else { | |
483 | 470 | let locId = curLocation[locIdxId] | |
484 | 471 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
485 | 472 | let resList = split(currentPack[bpIdxRes], "_") | |
486 | 473 | func adder (acc,j) = if ((amounts[j] > parseIntValue(resList[j]))) | |
487 | 474 | then throw(((((("You have " + resList[j]) + " of ") + resTypes[j]) + ", but tried to sell ") + toString(amounts[j]))) | |
488 | 475 | else if ((0 > amounts[j])) | |
489 | 476 | then throw(((("You tried to sell negative amount of " + resTypes[j]) + ": ") + toString(amounts[j]))) | |
490 | 477 | else if ((amounts[j] > 0)) | |
491 | 478 | then { | |
492 | 479 | let b = sellInternal(locId, j, amounts[j], minPrices[j]) | |
493 | 480 | $Tuple4((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(resList[j]) - amounts[j]))), (acc._3 + b._2), (acc._4 + amounts[j])) | |
494 | 481 | } | |
495 | 482 | else $Tuple4(acc._1, (acc._2 :+ resList[j]), acc._3, acc._4) | |
496 | 483 | ||
497 | 484 | let merged = { | |
498 | 485 | let $l = [0, 1, 2, 3, 4, 5] | |
499 | 486 | let $s = size($l) | |
500 | 487 | let $acc0 = $Tuple4(nil, nil, 0, 0) | |
501 | 488 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
502 | 489 | then $a | |
503 | 490 | else adder($a, $l[$i]) | |
504 | 491 | ||
505 | 492 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
506 | 493 | then $a | |
507 | 494 | else throw("List size exceeds 6") | |
508 | 495 | ||
509 | 496 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
510 | 497 | } | |
511 | 498 | let newPack = makeString([currentPack[bpIdxLevel], makeString(merged._2, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":") | |
512 | 499 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
513 | 500 | let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, merged._4, MULT8)], nil)) | |
514 | 501 | $Tuple2((merged._1 :+ ScriptTransfer(i.caller, merged._3, usdtAssetId)), $Tuple3(result, prologResult, statsResult)) | |
515 | 502 | } | |
516 | 503 | } | |
517 | 504 | } | |
518 | 505 | ||
519 | 506 | ||
520 | 507 | ||
521 | 508 | @Callable(i) | |
522 | 509 | func buyMaterials (amounts,maxPrices) = { | |
523 | 510 | let prologResult = prolog() | |
524 | 511 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
525 | 512 | if ((size(i.payments) != 1)) | |
526 | 513 | then throw("exactly 1 payment must be attached") | |
527 | 514 | else { | |
528 | 515 | let pmt = i.payments[0] | |
529 | 516 | let amt = pmt.amount | |
530 | 517 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
531 | 518 | if ((pmtAssetId != usdtAssetId)) | |
532 | 519 | then throw("USDT payments only!") | |
533 | 520 | else { | |
534 | 521 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
535 | 522 | if ((curLocation[locIdxType] != "F")) | |
536 | 523 | then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType])) | |
537 | 524 | else { | |
538 | 525 | let locId = curLocation[locIdxId] | |
539 | 526 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
540 | 527 | let matList = split(currentPack[bpIdxMat], "_") | |
541 | 528 | func mUpdater (acc,j) = if ((0 > amounts[j])) | |
542 | 529 | then throw(((("You tried to buy negative amount of " + matTypes[j]) + ": ") + toString(amounts[j]))) | |
543 | 530 | else if ((amounts[j] > 0)) | |
544 | 531 | then { | |
545 | 532 | let b = buyInternal(locId, j, amounts[j], maxPrices[j]) | |
546 | 533 | $Tuple4((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(matList[j]) + b._3))), (acc._3 + b._2), (acc._4 + amounts[j])) | |
547 | 534 | } | |
548 | 535 | else $Tuple4(acc._1, (acc._2 :+ matList[j]), acc._3, acc._4) | |
549 | 536 | ||
550 | 537 | let merged = { | |
551 | 538 | let $l = [0, 1, 2, 3, 4, 5] | |
552 | 539 | let $s = size($l) | |
553 | 540 | let $acc0 = $Tuple4(nil, nil, 0, 0) | |
554 | 541 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
555 | 542 | then $a | |
556 | 543 | else mUpdater($a, $l[$i]) | |
557 | 544 | ||
558 | 545 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
559 | 546 | then $a | |
560 | 547 | else throw("List size exceeds 6") | |
561 | 548 | ||
562 | 549 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
563 | 550 | } | |
564 | 551 | if ((merged._3 > amt)) | |
565 | 552 | then throw(((("Insufficient payment! Attached=" + toString(amt)) + ", required=") + toString(merged._3))) | |
566 | 553 | else { | |
567 | 554 | let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._2, "_"), currentPack[bpIdxProd]], ":") | |
568 | 555 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
569 | 556 | let rest = if (((amt - merged._3) > 0)) | |
570 | 557 | then [ScriptTransfer(i.caller, (amt - merged._3), usdtAssetId)] | |
571 | 558 | else nil | |
572 | 559 | let activitiesAmount = (merged._3 / 100) | |
573 | 560 | let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, merged._4, MULT8)], nil)) | |
574 | 561 | $Tuple2(((merged._1 ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(result, prologResult, statsResult)) | |
575 | 562 | } | |
576 | 563 | } | |
577 | 564 | } | |
578 | 565 | } | |
579 | 566 | } | |
580 | 567 | ||
581 | 568 | ||
582 | 569 | ||
583 | 570 | @Callable(i) | |
584 | 571 | func exchangeResources (amounts) = { | |
585 | 572 | let prologResult = prolog() | |
586 | 573 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
587 | 574 | if ((size(i.payments) != 1)) | |
588 | 575 | then throw("exactly 1 payment must be attached") | |
589 | 576 | else { | |
590 | 577 | let pmt = i.payments[0] | |
591 | 578 | let amt = pmt.amount | |
592 | 579 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
593 | 580 | if ((pmtAssetId != usdtAssetId)) | |
594 | 581 | then throw("USDT payments only!") | |
595 | 582 | else { | |
596 | 583 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
597 | 584 | if ((curLocation[locIdxType] != "F")) | |
598 | 585 | then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType])) | |
599 | 586 | else { | |
600 | 587 | let locId = curLocation[locIdxId] | |
601 | 588 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
602 | 589 | let resList = split(currentPack[bpIdxRes], "_") | |
603 | 590 | let matList = split(currentPack[bpIdxMat], "_") | |
604 | 591 | func exchanger (acc,j) = { | |
605 | 592 | let whKey = keyFactoryWarehouseByIdAndType(locId, j) | |
606 | 593 | let w0 = valueOrElse(getInteger(whKey), 0) | |
607 | 594 | let amj = amounts[j] | |
608 | 595 | if ((amj > parseIntValue(resList[j]))) | |
609 | 596 | then throw(((((("You have " + resList[j]) + " of ") + resTypes[j]) + ", but tried to exchange ") + toString(amj))) | |
610 | 597 | else if ((0 > amj)) | |
611 | 598 | then throw(((("You tried to exchange negative amount of " + resTypes[j]) + ": ") + toString(amj))) | |
612 | 599 | else if ((amj > 0)) | |
613 | 600 | then $Tuple5((acc._1 :+ toString((parseIntValue(resList[j]) - amj))), (acc._2 :+ toString((parseIntValue(matList[j]) + amj))), (acc._3 + fraction(amj, RESOURCEPRICEMIN, MULT8)), (acc._4 :+ IntegerEntry(whKey, w0)), (acc._5 + amj)) | |
614 | 601 | else $Tuple5((acc._1 :+ resList[j]), (acc._2 :+ matList[j]), acc._3, acc._4, acc._5) | |
615 | 602 | } | |
616 | 603 | ||
617 | 604 | let merged = { | |
618 | 605 | let $l = [0, 1, 2, 3, 4, 5] | |
619 | 606 | let $s = size($l) | |
620 | 607 | let $acc0 = $Tuple5(nil, nil, 0, nil, 0) | |
621 | 608 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
622 | 609 | then $a | |
623 | 610 | else exchanger($a, $l[$i]) | |
624 | 611 | ||
625 | 612 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
626 | 613 | then $a | |
627 | 614 | else throw("List size exceeds 6") | |
628 | 615 | ||
629 | 616 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
630 | 617 | } | |
631 | 618 | if ((merged._3 > amt)) | |
632 | 619 | then throw(((("Insufficient payment! Attached=" + toString(amt)) + ", required=") + toString(merged._3))) | |
633 | 620 | else { | |
634 | 621 | let newPack = makeString([currentPack[bpIdxLevel], makeString(merged._1, "_"), makeString(merged._2, "_"), currentPack[bpIdxProd]], ":") | |
635 | 622 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
636 | 623 | let rest = if (((amt - merged._3) > 0)) | |
637 | 624 | then [ScriptTransfer(i.caller, (amt - merged._3), usdtAssetId)] | |
638 | 625 | else nil | |
639 | 626 | let activitiesAmount = (merged._3 / 100) | |
640 | 627 | let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, merged._5, MULT8)], nil)) | |
641 | 628 | $Tuple2(((rest ++ merged._4) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(result, prologResult, statsResult)) | |
642 | 629 | } | |
643 | 630 | } | |
644 | 631 | } | |
645 | 632 | } | |
646 | 633 | } | |
647 | 634 | ||
648 | 635 | ||
649 | 636 | ||
650 | 637 | @Callable(i) | |
651 | 638 | func craftGoods (productIdx,quantity) = { | |
652 | 639 | let prologResult = prolog() | |
653 | 640 | if ((size(i.payments) != 1)) | |
654 | 641 | then throw("exactly 1 payment must be attached") | |
655 | 642 | else { | |
656 | 643 | let pmt = i.payments[0] | |
657 | 644 | let amt = pmt.amount | |
658 | 645 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
659 | 646 | if ((pmtAssetId != usdtAssetId)) | |
660 | 647 | then throw("USDT payments only!") | |
661 | 648 | else if ((amt != MULT6)) | |
662 | 649 | then throw("exactly 1 USDT must be attached as payment") | |
663 | 650 | else if ((0 >= quantity)) | |
664 | 651 | then throw("Quantity should be positive") | |
665 | 652 | else { | |
666 | 653 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
667 | 654 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
668 | 655 | if ((curLocation[locIdxType] != "M")) | |
669 | 656 | then throw(("Duck location type should be Manufactory, but is " + curLocation[locIdxType])) | |
670 | 657 | else { | |
671 | 658 | let cont = curLocation[locIdxContinent] | |
672 | 659 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
673 | 660 | let matList = split(currentPack[bpIdxMat], "_") | |
674 | 661 | if (if ((0 > productIdx)) | |
675 | 662 | then true | |
676 | 663 | else (productIdx >= size(productionMatrix))) | |
677 | 664 | then throw(("Unknown product idx=" + toString(productIdx))) | |
678 | 665 | else { | |
679 | 666 | let recipe = split(productionMatrix[productIdx], "_") | |
680 | - | if ((size(recipe) != | |
667 | + | if ((size(recipe) != recipeSize)) | |
681 | 668 | then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx])) | |
682 | 669 | else { | |
683 | - | let productContIdx = parseIntValue(recipe[ | |
670 | + | let productContIdx = parseIntValue(recipe[rIdxContinent]) | |
684 | 671 | if ((continents[productContIdx] != cont)) | |
685 | 672 | then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont)) | |
686 | 673 | else { | |
687 | 674 | let prodList = if ((currentPack[bpIdxProd] == "")) | |
688 | 675 | then nil | |
689 | 676 | else split(currentPack[bpIdxProd], "_") | |
690 | 677 | func filler (acc,ignoredItem) = { | |
691 | 678 | let n = acc._2 | |
692 | 679 | let xs = if ((size(prodList) > n)) | |
693 | 680 | then prodList[n] | |
694 | 681 | else "0" | |
695 | 682 | let x = parseIntValue(xs) | |
696 | - | let amount = (quantity * | |
683 | + | let amount = (quantity * productPkgSize) | |
697 | 684 | let y = if ((n == productIdx)) | |
698 | 685 | then toString((x + amount)) | |
699 | 686 | else xs | |
700 | 687 | $Tuple2((acc._1 :+ y), (n + 1)) | |
701 | 688 | } | |
702 | 689 | ||
703 | 690 | let bpProd = ( let $l = productionMatrix | |
704 | 691 | let $s = size($l) | |
705 | 692 | let $acc0 = $Tuple2(nil, 0) | |
706 | 693 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
707 | 694 | then $a | |
708 | 695 | else filler($a, $l[$i]) | |
709 | 696 | ||
710 | 697 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
711 | 698 | then $a | |
712 | 699 | else throw("List size exceeds 50") | |
713 | 700 | ||
714 | 701 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 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 | |
715 | 702 | func producer (acc,j) = { | |
716 | - | let needMat = ((parseIntValue(recipe[j]) * | |
703 | + | let needMat = ((parseIntValue(recipe[j]) * MULT6) * quantity) | |
717 | 704 | let haveMat = parseIntValue(matList[j]) | |
718 | 705 | if ((needMat > haveMat)) | |
719 | - | then throw(((((((("You have " + | |
706 | + | then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity))) | |
720 | 707 | else if ((needMat > 0)) | |
721 | 708 | then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat)) | |
722 | 709 | else $Tuple2((acc._1 :+ matList[j]), acc._2) | |
723 | 710 | } | |
724 | 711 | ||
725 | 712 | let merged = { | |
726 | 713 | let $l = [0, 1, 2, 3, 4, 5] | |
727 | 714 | let $s = size($l) | |
728 | 715 | let $acc0 = $Tuple2(nil, 0) | |
729 | 716 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
730 | 717 | then $a | |
731 | 718 | else producer($a, $l[$i]) | |
732 | 719 | ||
733 | 720 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
734 | 721 | then $a | |
735 | 722 | else throw("List size exceeds 6") | |
736 | 723 | ||
737 | 724 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
738 | 725 | } | |
739 | 726 | let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._1, "_"), makeString(bpProd, "_")], ":") | |
740 | 727 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
741 | 728 | let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpCraft, merged._2, MULT8)], nil)) | |
742 | 729 | $Tuple2(nil, $Tuple3(result, prologResult, statsResult)) | |
743 | 730 | } | |
744 | 731 | } | |
745 | 732 | } | |
746 | 733 | } | |
747 | 734 | } | |
748 | 735 | } | |
749 | 736 | } | |
750 | 737 | ||
751 | 738 | ||
752 | 739 | ||
753 | 740 | @Callable(i) | |
754 | 741 | func setWarehouseOrder (newOrderStr,landAssetId) = { | |
755 | 742 | let user = i.originCaller | |
756 | 743 | let addr = toString(user) | |
757 | 744 | let result = if ((user != restContract)) | |
758 | 745 | then checkBlocked() | |
759 | 746 | else false | |
760 | 747 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
761 | 748 | if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId))))) | |
762 | 749 | then throw((("NFT " + asset.name) + " is not staked")) | |
763 | 750 | else { | |
764 | 751 | let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned")) | |
765 | 752 | if (if ((user != restContract)) | |
766 | 753 | then (owner != addr) | |
767 | 754 | else false) | |
768 | 755 | then throw((LANDPREFIX + " is not yours")) | |
769 | 756 | else { | |
770 | 757 | let newOrder = split_4C(newOrderStr, ":") | |
771 | 758 | let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil)) | |
772 | 759 | let currentWh = split_4C(wh, ":") | |
773 | 760 | let loft = split(currentWh[whIdxLOFT], "_") | |
774 | 761 | let whTotal = parseIntValue(loft[volTotal]) | |
775 | 762 | let ordKey = keyOrderByLand(landAssetId) | |
776 | 763 | let currentOrd = getOrder(ordKey) | |
777 | 764 | let z = setInternal(currentWh, currentOrd, newOrder) | |
778 | 765 | let buyVolSaldo = z._4 | |
779 | 766 | let sellVolSaldo = z._5 | |
780 | 767 | let whOccupied = z._7 | |
781 | 768 | let whLocked = (buyVolSaldo + sellVolSaldo) | |
782 | 769 | let whFree = ((whTotal - whOccupied) - whLocked) | |
783 | 770 | if ((0 > whFree)) | |
784 | 771 | then throw((((((("Attempt to reserve " + toString(buyVolSaldo)) + " space for buy orders, and ") + toString(sellVolSaldo)) + " space for sell orders (and occupied=") + toString(whOccupied)) + "), leads to negative free space")) | |
785 | 772 | else { | |
786 | 773 | let whStr = makeString_2C([currentWh[whIdxLevels], makeString(z._1, "_"), makeString(z._2, "_"), makeString(z._3, "_"), toString(whLocked)], ":") | |
787 | 774 | let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil)) | |
788 | 775 | let usdSaldo = z._6 | |
789 | 776 | let actions = if ((usdSaldo > 0)) | |
790 | 777 | then if ((size(i.payments) != 1)) | |
791 | 778 | then throw("exactly 1 payment must be attached") | |
792 | 779 | else { | |
793 | 780 | let pmt = i.payments[0] | |
794 | 781 | let amt = pmt.amount | |
795 | 782 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
796 | 783 | if ((pmtAssetId != usdtAssetId)) | |
797 | 784 | then throw("USDT payments only!") | |
798 | 785 | else if ((amt != usdSaldo)) | |
799 | 786 | then throw(("Payment needed is " + toString(usdSaldo))) | |
800 | 787 | else [StringEntry(ordKey, newOrderStr)] | |
801 | 788 | } | |
802 | 789 | else if ((usdSaldo == 0)) | |
803 | 790 | then if ((size(i.payments) != 0)) | |
804 | 791 | then throw("No payments needed") | |
805 | 792 | else [StringEntry(ordKey, newOrderStr)] | |
806 | 793 | else if ((size(i.payments) != 0)) | |
807 | 794 | then throw("No payments needed") | |
808 | 795 | else [ScriptTransfer(addressFromStringValue(owner), -(usdSaldo), usdtAssetId), StringEntry(ordKey, newOrderStr)] | |
809 | 796 | $Tuple2(actions, $Tuple2(result, whSave)) | |
810 | 797 | } | |
811 | 798 | } | |
812 | 799 | } | |
813 | 800 | } | |
814 | 801 | ||
815 | 802 | ||
816 | 803 | ||
817 | 804 | @Callable(i) | |
818 | 805 | func acceptWarehouseOrder (bpOrderStr,landAssetId,duckAssetId) = { | |
819 | 806 | let prologResult = prolog() | |
820 | 807 | let caller = i.originCaller | |
821 | 808 | let callerAddr = toString(caller) | |
822 | 809 | let stakedDuckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked") | |
823 | 810 | let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(stakedDuckAssetId)), DEFAULTLOCATION) | |
824 | 811 | let loc = split(value(curLocation), "_") | |
825 | 812 | if ((loc[locIdxType] != "L")) | |
826 | 813 | then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L")) | |
827 | 814 | else if ((stakedDuckAssetId != duckAssetId)) | |
828 | 815 | then throw(((("Your staked duck is " + stakedDuckAssetId) + ", but passed ") + duckAssetId)) | |
829 | 816 | else { | |
830 | 817 | let landAsset = value(assetInfo(fromBase58String(landAssetId))) | |
831 | 818 | if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId))))) | |
832 | 819 | then throw((("NFT " + landAsset.name) + " is not staked")) | |
833 | 820 | else { | |
834 | 821 | let landOwner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + landAsset.name) + " is orphaned")) | |
835 | 822 | if ((landOwner == callerAddr)) | |
836 | 823 | then throw("You cannot trade with yourself") | |
837 | 824 | else { | |
838 | 825 | let bpOrderParts = split_4C(bpOrderStr, ":") | |
839 | 826 | if ((size(bpOrderParts) != 3)) | |
840 | 827 | then throw("bpOrderStr should contain exactly 2 ':' separators") | |
841 | 828 | else { | |
842 | 829 | let bpOrdRes = split(bpOrderParts[0], "_") | |
843 | 830 | let bpOrdMat = split(bpOrderParts[1], "_") | |
844 | 831 | let bpOrdProd = if ((bpOrderParts[2] == "")) | |
845 | 832 | then nil | |
846 | 833 | else split(bpOrderParts[2], "_") | |
847 | 834 | if ((size(bpOrdRes) != NUMRES)) | |
848 | 835 | then throw("All 6 resources should be passed") | |
849 | 836 | else if ((size(bpOrdMat) != NUMRES)) | |
850 | 837 | then throw("All 6 materials should be passed") | |
851 | 838 | else { | |
852 | 839 | let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil)) | |
853 | 840 | let currentWh = split_4C(wh, ":") | |
854 | 841 | let currWhRes = split(currentWh[whIdxRes], "_") | |
855 | 842 | let currWhMat = split(currentWh[whIdxMat], "_") | |
856 | 843 | let currWhProd = if ((currentWh[whIdxProd] == "")) | |
857 | 844 | then nil | |
858 | 845 | else split(currentWh[whIdxProd], "_") | |
859 | 846 | let currWhLockedVol = parseIntValue(split(currentWh[whIdxLOFT], "_")[volLocked]) | |
860 | 847 | let bpKey = keyBackpackByDuck(duckAssetId) | |
861 | 848 | let currentPack = getBackpack(bpKey) | |
862 | 849 | let bpResList = split(currentPack[bpIdxRes], "_") | |
863 | 850 | let bpMatList = split(currentPack[bpIdxMat], "_") | |
864 | 851 | let bpProdList = if ((currentPack[bpIdxProd] == "")) | |
865 | 852 | then nil | |
866 | 853 | else split(currentPack[bpIdxProd], "_") | |
867 | 854 | let ordKey = keyOrderByLand(landAssetId) | |
868 | 855 | let whOrd = getOrder(ordKey) | |
869 | 856 | let whOrdRes = split(whOrd[ordIdxRes], "_") | |
870 | 857 | let whOrdMat = split(whOrd[ordIdxMat], "_") | |
871 | 858 | let whOrdProd = if ((whOrd[ordIdxProd] == "")) | |
872 | 859 | then nil | |
873 | 860 | else split(whOrd[ordIdxProd], "_") | |
874 | 861 | let r = { | |
875 | 862 | let $l = bpOrdRes | |
876 | 863 | let $s = size($l) | |
877 | 864 | let $acc0 = $Tuple13(nil, nil, nil, 0, 0, 0, 0, bpResList, currWhRes, whOrdRes, resTypes, false, 0) | |
878 | 865 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
879 | 866 | then $a | |
880 | 867 | else acceptCommon($a, $l[$i]) | |
881 | 868 | ||
882 | 869 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
883 | 870 | then $a | |
884 | 871 | else throw("List size exceeds 6") | |
885 | 872 | ||
886 | 873 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
887 | 874 | } | |
888 | 875 | let m = { | |
889 | 876 | let $l = bpOrdMat | |
890 | 877 | let $s = size($l) | |
891 | 878 | let $acc0 = $Tuple13(nil, nil, nil, r._4, r._5, r._6, 0, bpMatList, currWhMat, whOrdMat, matTypes, false, r._13) | |
892 | 879 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
893 | 880 | then $a | |
894 | 881 | else acceptCommon($a, $l[$i]) | |
895 | 882 | ||
896 | 883 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
897 | 884 | then $a | |
898 | 885 | else throw("List size exceeds 6") | |
899 | 886 | ||
900 | 887 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
901 | 888 | } | |
902 | 889 | let p = if ((size(bpOrdProd) != 0)) | |
903 | 890 | then { | |
904 | 891 | let $l = bpOrdProd | |
905 | 892 | let $s = size($l) | |
906 | 893 | let $acc0 = $Tuple13(nil, nil, nil, m._4, m._5, m._6, 0, bpProdList, currWhProd, whOrdProd, prodTypes, true, m._13) | |
907 | 894 | func $f2_1 ($a,$i) = if (($i >= $s)) | |
908 | 895 | then $a | |
909 | 896 | else acceptCommon($a, $l[$i]) | |
910 | 897 | ||
911 | 898 | func $f2_2 ($a,$i) = if (($i >= $s)) | |
912 | 899 | then $a | |
913 | 900 | else throw("List size exceeds 50") | |
914 | 901 | ||
915 | 902 | $f2_2($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($f2_1($acc0, 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) | |
916 | 903 | } | |
917 | 904 | else $Tuple13(currWhProd, whOrdProd, bpProdList, m._4, m._5, m._6, 0, bpProdList, currWhProd, whOrdProd, prodTypes, true, m._13) | |
918 | 905 | let volSaldo = p._4 | |
919 | 906 | let newLockedVol = if ((0 > (currWhLockedVol - volSaldo))) | |
920 | 907 | then 0 | |
921 | 908 | else (currWhLockedVol - volSaldo) | |
922 | 909 | let whStr = makeString_2C([currentWh[whIdxLevels], makeString(r._1, "_"), makeString(m._1, "_"), makeString(p._1, "_"), toString(newLockedVol)], ":") | |
923 | 910 | let newWhOrdStr = makeString_2C([makeString(r._2, "_"), makeString(m._2, "_"), makeString(p._2, "_")], ":") | |
924 | 911 | let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(r._3, "_"), makeString(m._3, "_"), makeString(p._3, "_")], ":") | |
925 | 912 | let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil)) | |
926 | 913 | let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil)) | |
927 | 914 | let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, p._13, MULT8)], nil)) | |
928 | 915 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [landOwner, fraction(xpShop, p._13, MULT8)], nil)) | |
929 | 916 | let actions = [StringEntry(ordKey, newWhOrdStr)] | |
930 | 917 | let usdWh2BpSaldo = p._5 | |
931 | 918 | let actions1 = if ((usdWh2BpSaldo > 0)) | |
932 | 919 | then { | |
933 | 920 | let usdWh2BpFee = fraction(p._5, AUCTIONFEE, MULT6) | |
934 | 921 | let refByKey = keyAddressRefBy(callerAddr) | |
935 | 922 | let refBy = getString(stakingContract, refByKey) | |
936 | 923 | if (isDefined(refBy)) | |
937 | 924 | then (((actions :+ ScriptTransfer(caller, (p._5 - (3 * usdWh2BpFee)), usdtAssetId)) :+ ScriptTransfer(restContract, usdWh2BpFee, usdtAssetId)) :+ ScriptTransfer(addressFromStringValue(value(refBy)), usdWh2BpFee, usdtAssetId)) | |
938 | 925 | else ((actions :+ ScriptTransfer(caller, (p._5 - (3 * usdWh2BpFee)), usdtAssetId)) :+ ScriptTransfer(restContract, usdWh2BpFee, usdtAssetId)) | |
939 | 926 | } | |
940 | 927 | else actions | |
941 | 928 | let usdBp2WhSaldo = p._6 | |
942 | 929 | let actions2 = if ((usdBp2WhSaldo > 0)) | |
943 | 930 | then if ((size(i.payments) != 1)) | |
944 | 931 | then throw("exactly 1 payment must be attached") | |
945 | 932 | else { | |
946 | 933 | let pmt = i.payments[0] | |
947 | 934 | let amt = pmt.amount | |
948 | 935 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
949 | 936 | if ((pmtAssetId != usdtAssetId)) | |
950 | 937 | then throw("USDT payments only!") | |
951 | 938 | else if ((amt != usdBp2WhSaldo)) | |
952 | 939 | then throw(("Payment needed is " + toString(usdBp2WhSaldo))) | |
953 | 940 | else if ((MINSHOPPAYMENT > amt)) | |
954 | 941 | then throw(("Payment should be at least " + toString(MINSHOPPAYMENT))) | |
955 | 942 | else { | |
956 | 943 | let usdBp2WhFee = fraction(p._6, AUCTIONFEE, MULT6) | |
957 | 944 | let refByKey = keyAddressRefBy(landOwner) | |
958 | 945 | let refBy = getString(stakingContract, refByKey) | |
959 | 946 | if (isDefined(refBy)) | |
960 | 947 | then (((actions1 :+ ScriptTransfer(addressFromStringValue(landOwner), (p._6 - (3 * usdBp2WhFee)), usdtAssetId)) :+ ScriptTransfer(restContract, usdBp2WhFee, usdtAssetId)) :+ ScriptTransfer(addressFromStringValue(value(refBy)), usdBp2WhFee, usdtAssetId)) | |
961 | 948 | else ((actions1 :+ ScriptTransfer(addressFromStringValue(landOwner), (p._6 - (3 * usdBp2WhFee)), usdtAssetId)) :+ ScriptTransfer(restContract, usdBp2WhFee, usdtAssetId)) | |
962 | 949 | } | |
963 | 950 | } | |
964 | 951 | else if ((size(i.payments) != 0)) | |
965 | 952 | then throw("No payments needed") | |
966 | 953 | else actions1 | |
967 | 954 | $Tuple2(actions2, $Tuple5(prologResult, whSave, bpSave, duckStatsResult, accStatsResult)) | |
968 | 955 | } | |
969 | 956 | } | |
970 | 957 | } | |
971 | 958 | } | |
972 | 959 | } | |
973 | 960 | } | |
974 | 961 | ||
975 | 962 | ||
976 | 963 | ||
977 | 964 | @Callable(i) | |
978 | 965 | func sellProductsToES (amounts) = { | |
979 | 966 | let prologResult = prolog() | |
980 | 967 | if ((size(i.payments) != 0)) | |
981 | 968 | then throw("No payments needed") | |
982 | 969 | else { | |
983 | 970 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
984 | 971 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
985 | 972 | if ((curLocation[locIdxType] != "A")) | |
986 | 973 | then throw(("Duck location type should be Airport, but is " + curLocation[locIdxType])) | |
987 | 974 | else { | |
988 | 975 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
989 | 976 | let prodList = if ((currentPack[bpIdxProd] == "")) | |
990 | 977 | then nil | |
991 | 978 | else split(currentPack[bpIdxProd], "_") | |
992 | 979 | let esKey = keyEsWarehouse() | |
993 | 980 | let existStr = getString(esKey) | |
994 | 981 | let existAmounts = if (isDefined(existStr)) | |
995 | 982 | then split(value(existStr), "_") | |
996 | 983 | else nil | |
997 | 984 | func moveProd (acc,recipeStr) = { | |
998 | 985 | let j = acc._1 | |
999 | 986 | let quantity = if ((size(amounts) > j)) | |
1000 | 987 | then amounts[j] | |
1001 | 988 | else 0 | |
1002 | 989 | if ((0 > quantity)) | |
1003 | 990 | then throw("Quantity cannot be negative") | |
1004 | 991 | else { | |
1005 | 992 | let recipe = split(recipeStr, "_") | |
1006 | - | if ((size(recipe) != | |
993 | + | if ((size(recipe) != recipeSize)) | |
1007 | 994 | then throw(("Fatal: unknown recipe: " + recipeStr)) | |
1008 | 995 | else { | |
1009 | - | let packSize = parseIntValue(recipe[recipeIdxPacksize]) | |
1010 | - | let maxAmount = (ESMAXPACKAGES * packSize) | |
996 | + | let maxAmount = (ESMAXPACKAGES * productPkgSize) | |
1011 | 997 | let existAmount = if ((size(existAmounts) > j)) | |
1012 | 998 | then parseIntValue(existAmounts[j]) | |
1013 | 999 | else 0 | |
1014 | 1000 | let canBuy = (maxAmount - existAmount) | |
1015 | 1001 | if ((quantity > canBuy)) | |
1016 | 1002 | then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j])) | |
1017 | 1003 | else { | |
1018 | 1004 | let totalMat = getRecipeMaterials(recipe) | |
1019 | - | let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (10 * | |
1005 | + | let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (10 * productPkgSize)) | |
1020 | 1006 | let bpProdAmount = if ((size(prodList) > j)) | |
1021 | 1007 | then parseIntValue(prodList[j]) | |
1022 | 1008 | else 0 | |
1023 | 1009 | if ((quantity > bpProdAmount)) | |
1024 | 1010 | then throw(((("You have only " + toString(bpProdAmount)) + " of ") + prodTypes[j])) | |
1025 | 1011 | else $Tuple5((j + 1), (acc._2 + (unitPrice * quantity)), (acc._3 :+ toString((bpProdAmount - quantity))), (acc._4 :+ toString((existAmount + quantity))), (acc._5 + (totalMat * quantity))) | |
1026 | 1012 | } | |
1027 | 1013 | } | |
1028 | 1014 | } | |
1029 | 1015 | } | |
1030 | 1016 | ||
1031 | 1017 | let merged = { | |
1032 | 1018 | let $l = productionMatrix | |
1033 | 1019 | let $s = size($l) | |
1034 | 1020 | let $acc0 = $Tuple5(0, 0, nil, nil, 0) | |
1035 | 1021 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1036 | 1022 | then $a | |
1037 | 1023 | else moveProd($a, $l[$i]) | |
1038 | 1024 | ||
1039 | 1025 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1040 | 1026 | then $a | |
1041 | 1027 | else throw("List size exceeds 50") | |
1042 | 1028 | ||
1043 | 1029 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 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) | |
1044 | 1030 | } | |
1045 | 1031 | let newBpStr = makeString_2C([currentPack[bpIdxLevel], currentPack[bpIdxRes], currentPack[bpIdxMat], makeString(merged._3, "_")], ":") | |
1046 | 1032 | let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil)) | |
1047 | 1033 | let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpSellToEs, merged._5, (MULT8 * 10))], nil)) | |
1048 | 1034 | $Tuple2([StringEntry(esKey, makeString(merged._4, "_")), ScriptTransfer(i.caller, merged._2, usdtAssetId)], $Tuple3(bpSave, prologResult, statsResult)) | |
1049 | 1035 | } | |
1050 | 1036 | } | |
1051 | 1037 | } | |
1052 | 1038 | ||
1053 | 1039 | ||
1054 | 1040 | ||
1055 | 1041 | @Callable(i) | |
1056 | 1042 | func updateEsStorage (newStorage) = if ((i.caller != stakingContract)) | |
1057 | 1043 | then throw("Permission denied") | |
1058 | 1044 | else $Tuple2([StringEntry(keyEsWarehouse(), newStorage)], newStorage) | |
1059 | 1045 | ||
1060 | 1046 |
github/deemru/w8io/169f3d6 201.13 ms ◑