tx · 7ULUxtdwr4y9e2TFrzHWyK3ibTrU538Y1pBkwpGNRwpy

3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep:  -0.05800000 Waves

2023.10.14 19:34 [2798535] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves

{ "type": 13, "id": "7ULUxtdwr4y9e2TFrzHWyK3ibTrU538Y1pBkwpGNRwpy", "fee": 5800000, "feeAssetId": null, "timestamp": 1697301309353, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "2qXxbVxbdshJAihYrgFU6yWT161yYvzaL7DvEmRhFGcn1RB4vMkkE6G2J5sSmZFZXLWBpfQh2er9pZKDSgSXGoXo" ], "script": "base64:BgKGAQgCEgQKAggYEgMKAQgSBAoCERESBAoCCAESAwoBARIFCgMREQgSBgoEEREICBIECgIRERIFCgMREQgSBgoEEREICBIDCgEREgMKARESBAoCEQgSBAoCAQESBAoCCAgSBQoDCAgIEgQKAggIEgUKAwgICBIDCgEREgMKAQgSAwoBARIDCgEIZwAHeHBUcmFkZQCQTgAHeHBDcmFmdACQTgAKeHBTZWxsVG9FcwCQTgAGeHBTaG9wAJBOAApMQU5EUFJFRklYAgRMQU5EAAZOVU1SRVMABgAPREVGQVVMVExPQ0FUSU9OAg9BZnJpY2FfRl9BZnJpY2EAEFJFU09VUkNFUFJJQ0VNSU4A1bUCAA1FU01BWFBBQ0tBR0VTAAoACUVTQlVZQ09FRgAEABVNSU5fVVNEVF9GRUVfREVMSVZFUlkA0IYDABdNSU5fVVNEVF9GRUVfREVMSVZFUlkxNQD4yQQAFVVTRFQyQUNSRVNfTVVMVElQTElFUgAKAAhyZXNUeXBlcwkAzAgCAgNPaWwJAMwIAgIDT3JlCQDMCAICBFdvb2QJAMwIAgIEU2FuZAkAzAgCAgRDbGF5CQDMCAICB09yZ2F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lMb2NrZWRLZXkJAGUCBQtsb2NrZWRUb3RhbAUVTUlOX1VTRFRfRkVFX0RFTElWRVJZBQNuaWwFC2FjcmVzUmVzdWx0AAuPkRQ=", "height": 2798535, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8eSJCWgEJfRnCYctmbGMCRkmqG78RysEbLFcwPJsKuQE Next: 7ALzi2wC8GDNAAek1dKHzwo6FJH5MbWWw29m4W4GqJKg Diff:
OldNewDifferences
289289 else unit
290290
291291
292-func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil))
292+func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
293293
294294
295295 func setCommon (acc,ignoredIterator) = {
716716 $Tuple3((acc._1 ++ x._1), (acc._2 + x._3), (acc._3 + x._4))
717717 }
718718
719- let $t02526125351 = {
719+ let $t02527025360 = {
720720 let $l = continents
721721 let $s = size($l)
722722 let $acc0 = $Tuple3(nil, 0, 0)
730730
731731 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
732732 }
733- let factoryActions = $t02526125351._1
734- let usdtReceived = $t02526125351._2
735- let totalRes = $t02526125351._3
733+ let factoryActions = $t02527025360._1
734+ let usdtReceived = $t02527025360._2
735+ let totalRes = $t02527025360._3
736736 let fee = fraction(usdtReceived, DELIVERY_FEE, MULT6)
737737 let activitiesAmount = (usdtReceived / 100)
738738 let usdtLeft = ((usdtReceived - activitiesAmount) - fee)
759759 @Callable(i)
760760 func sellResources (amounts,minPrices) = {
761761 let prologResult = prolog()
762- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
763- if ((size(i.payments) != 0))
764- then throw("sellResources doesn't require any payments")
765- else {
766- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
767- if ((curLocation[locIdxType] != "F"))
768- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
762+ if ((prologResult == prologResult))
763+ then {
764+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
765+ if ((size(i.payments) != 0))
766+ then throw("sellResources doesn't require any payments")
769767 else {
770- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
771- let resList = split(currentPack[bpIdxRes], "_")
772- let $t02680326929 = sellResourcesCommon(resList, curLocation[locIdxId], amounts, minPrices)
773- let factoryActions = $t02680326929._1
774- let newRes = $t02680326929._2
775- let usdtReceived = $t02680326929._3
776- let totalRes = $t02680326929._4
777- let activitiesAmount = (usdtReceived / 100)
778- let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
779- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
780- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
781- $Tuple2(((factoryActions :+ ScriptTransfer(i.caller, (usdtReceived - activitiesAmount), usdtAssetId)) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
768+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
769+ if ((curLocation[locIdxType] != "F"))
770+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
771+ else {
772+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
773+ let resList = split(currentPack[bpIdxRes], "_")
774+ let $t02681526941 = sellResourcesCommon(resList, curLocation[locIdxId], amounts, minPrices)
775+ let factoryActions = $t02681526941._1
776+ let newRes = $t02681526941._2
777+ let usdtReceived = $t02681526941._3
778+ let totalRes = $t02681526941._4
779+ let activitiesAmount = (usdtReceived / 100)
780+ let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
781+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
782+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
783+ $Tuple2(((factoryActions :+ ScriptTransfer(i.caller, (usdtReceived - activitiesAmount), usdtAssetId)) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
784+ }
782785 }
783786 }
787+ else throw("Strict value is not equal to itself.")
784788 }
785789
786790
789793 func sellResourcesWorld (addr,amount) = if ((i.caller != acresContract))
790794 then throw("Permission denied")
791795 else {
792- let $t02772127878 = sellResourcesWorldInternal(amount)
793- let factoryActions = $t02772127878._1
794- let usdtLeft = $t02772127878._2
795- let fee = $t02772127878._3
796- let activitiesAmount = $t02772127878._4
797- let totalRes = $t02772127878._5
796+ let $t02773327890 = sellResourcesWorldInternal(amount)
797+ let factoryActions = $t02773327890._1
798+ let usdtLeft = $t02773327890._2
799+ let fee = $t02773327890._3
800+ let activitiesAmount = $t02773327890._4
801+ let totalRes = $t02773327890._5
798802 if ((0 >= usdtLeft))
799803 then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
800804 else {
818822 then throw("Delivery feature is turned off!")
819823 else {
820824 let prologResult = prolog()
821- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
822- if ((size(i.payments) != 0))
823- then throw("sellResources doesn't require any payments")
824- else {
825- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
826- let resList = split(currentPack[bpIdxRes], "_")
827- let $t02911129232 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
828- let factoryActions = $t02911129232._1
829- let newRes = $t02911129232._2
830- let usdtReceived = $t02911129232._3
831- let totalRes = $t02911129232._4
832- let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
833- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
834- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
835- let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
836- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
837- then MIN_USDT_FEE_DELIVERY
838- else feePart
839- let activitiesAmount = (usdtReceived / 100)
840- if ((fee >= (usdtReceived - activitiesAmount)))
841- then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
825+ if ((prologResult == prologResult))
826+ then {
827+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
828+ if ((size(i.payments) != 0))
829+ then throw("sellResources doesn't require any payments")
842830 else {
843- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
844- $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
831+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
832+ let resList = split(currentPack[bpIdxRes], "_")
833+ let $t02912629247 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
834+ let factoryActions = $t02912629247._1
835+ let newRes = $t02912629247._2
836+ let usdtReceived = $t02912629247._3
837+ let totalRes = $t02912629247._4
838+ let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
839+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
840+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
841+ let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
842+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
843+ then MIN_USDT_FEE_DELIVERY
844+ else feePart
845+ let activitiesAmount = (usdtReceived / 100)
846+ if ((fee >= (usdtReceived - activitiesAmount)))
847+ then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
848+ else {
849+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
850+ $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
851+ }
845852 }
846853 }
854+ else throw("Strict value is not equal to itself.")
847855 }
848856
849857
853861 then throw("Delivery feature is turned off!")
854862 else {
855863 let prologResult = prolog()
856- if ((size(i.payments) != 0))
857- then throw("sellResources doesn't require any payments")
858- else {
859- let user = i.caller
860- let addr = toString(user)
861- let asset = value(assetInfo(fromBase58String(landAssetId)))
862- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
863- then throw((("NFT " + asset.name) + " is not staked"))
864- else {
865- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
866- if ((owner != addr))
867- then throw((LANDPREFIX + " is not yours"))
868- else {
869- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
870- let currentWh = split_4C(wh, ":")
871- let resList = split(currentWh[whIdxRes], "_")
872- let $t03125931380 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
873- let factoryActions = $t03125931380._1
874- let newRes = $t03125931380._2
875- let usdtReceived = $t03125931380._3
876- let totalRes = $t03125931380._4
877- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), currentWh[whIdxMat], currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
878- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
879- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalRes, MULT8)], nil))
880- let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
881- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
882- then MIN_USDT_FEE_DELIVERY
883- else feePart
884- let activitiesAmount = (usdtReceived / 100)
885- if ((fee >= (usdtReceived - activitiesAmount)))
886- then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
887- else {
888- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
889- $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(whSave, prologResult, statsResult))
890- }
891- }
892- }
893- }
864+ if ((prologResult == prologResult))
865+ then if ((size(i.payments) != 0))
866+ then throw("sellResources doesn't require any payments")
867+ else {
868+ let user = i.caller
869+ let addr = toString(user)
870+ let asset = value(assetInfo(fromBase58String(landAssetId)))
871+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
872+ then throw((("NFT " + asset.name) + " is not staked"))
873+ else {
874+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
875+ if ((owner != addr))
876+ then throw((LANDPREFIX + " is not yours"))
877+ else {
878+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
879+ let currentWh = split_4C(wh, ":")
880+ let resList = split(currentWh[whIdxRes], "_")
881+ let $t03127731398 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
882+ let factoryActions = $t03127731398._1
883+ let newRes = $t03127731398._2
884+ let usdtReceived = $t03127731398._3
885+ let totalRes = $t03127731398._4
886+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), currentWh[whIdxMat], currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
887+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
888+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalRes, MULT8)], nil))
889+ let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
890+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
891+ then MIN_USDT_FEE_DELIVERY
892+ else feePart
893+ let activitiesAmount = (usdtReceived / 100)
894+ if ((fee >= (usdtReceived - activitiesAmount)))
895+ then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
896+ else {
897+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
898+ $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(whSave, prologResult, statsResult))
899+ }
900+ }
901+ }
902+ }
903+ else throw("Strict value is not equal to itself.")
894904 }
895905
896906
898908 @Callable(i)
899909 func buyMaterials (amounts,maxPrices) = {
900910 let prologResult = prolog()
901- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
902- if ((size(i.payments) != 1))
903- then throw("exactly 1 payment must be attached")
904- else {
905- let pmt = i.payments[0]
906- let amt = pmt.amount
907- if (if (!(isDefined(pmt.assetId)))
908- then true
909- else (value(pmt.assetId) != usdtAssetId))
910- then throw("USDT payments only!")
911+ if ((prologResult == prologResult))
912+ then {
913+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
914+ if ((size(i.payments) != 1))
915+ then throw("exactly 1 payment must be attached")
911916 else {
912- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
913- if ((curLocation[locIdxType] != "F"))
914- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
917+ let pmt = i.payments[0]
918+ let amt = pmt.amount
919+ if (if (!(isDefined(pmt.assetId)))
920+ then true
921+ else (value(pmt.assetId) != usdtAssetId))
922+ then throw("USDT payments only!")
915923 else {
916- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
917- let matList = split(currentPack[bpIdxMat], "_")
918- let $t03324033362 = buyMaterialsCommon(matList, curLocation[locIdxId], amounts, maxPrices)
919- let factoryActions = $t03324033362._1
920- let newMat = $t03324033362._2
921- let usdtSpent = $t03324033362._3
922- let totalMat = $t03324033362._4
923- if ((usdtSpent > amt))
924- then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
924+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
925+ if ((curLocation[locIdxType] != "F"))
926+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
925927 else {
926- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
927- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
928- let rest = if (((amt - usdtSpent) > 0))
929- then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
930- else nil
931- let activitiesAmount = (usdtSpent / 100)
932- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
933- $Tuple2(((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
928+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
929+ let matList = split(currentPack[bpIdxMat], "_")
930+ let $t03326133383 = buyMaterialsCommon(matList, curLocation[locIdxId], amounts, maxPrices)
931+ let factoryActions = $t03326133383._1
932+ let newMat = $t03326133383._2
933+ let usdtSpent = $t03326133383._3
934+ let totalMat = $t03326133383._4
935+ if ((usdtSpent > amt))
936+ then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
937+ else {
938+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
939+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
940+ let rest = if (((amt - usdtSpent) > 0))
941+ then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
942+ else nil
943+ let activitiesAmount = (usdtSpent / 100)
944+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
945+ $Tuple2(((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
946+ }
934947 }
935948 }
936949 }
937950 }
951+ else throw("Strict value is not equal to itself.")
938952 }
939953
940954
944958 then throw("Delivery feature is turned off!")
945959 else {
946960 let prologResult = prolog()
947- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
948- if ((size(i.payments) != 1))
949- then throw("exactly 1 payment must be attached")
950- else {
951- let pmt = i.payments[0]
952- let amt = pmt.amount
953- if (if (!(isDefined(pmt.assetId)))
954- then true
955- else (value(pmt.assetId) != usdtAssetId))
956- then throw("USDT payments only!")
961+ if ((prologResult == prologResult))
962+ then {
963+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
964+ if ((size(i.payments) != 1))
965+ then throw("exactly 1 payment must be attached")
957966 else {
958- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
959- let matList = split(currentPack[bpIdxMat], "_")
960- let $t03488034997 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
961- let factoryActions = $t03488034997._1
962- let newMat = $t03488034997._2
963- let usdtSpent = $t03488034997._3
964- let totalMat = $t03488034997._4
965- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
966- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
967- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
968- let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
969- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
970- then MIN_USDT_FEE_DELIVERY
971- else feePart
972- let usdtSpentWithFee = (usdtSpent + fee)
973- if ((usdtSpentWithFee > amt))
974- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
967+ let pmt = i.payments[0]
968+ let amt = pmt.amount
969+ if (if (!(isDefined(pmt.assetId)))
970+ then true
971+ else (value(pmt.assetId) != usdtAssetId))
972+ then throw("USDT payments only!")
975973 else {
976- let rest = if (((amt - usdtSpentWithFee) > 0))
977- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
978- else nil
979- let activitiesAmount = (usdtSpent / 100)
980- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
981- $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
974+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
975+ let matList = split(currentPack[bpIdxMat], "_")
976+ let $t03490435021 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
977+ let factoryActions = $t03490435021._1
978+ let newMat = $t03490435021._2
979+ let usdtSpent = $t03490435021._3
980+ let totalMat = $t03490435021._4
981+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
982+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
983+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
984+ let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
985+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
986+ then MIN_USDT_FEE_DELIVERY
987+ else feePart
988+ let usdtSpentWithFee = (usdtSpent + fee)
989+ if ((usdtSpentWithFee > amt))
990+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
991+ else {
992+ let rest = if (((amt - usdtSpentWithFee) > 0))
993+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
994+ else nil
995+ let activitiesAmount = (usdtSpent / 100)
996+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
997+ $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
998+ }
982999 }
9831000 }
9841001 }
1002+ else throw("Strict value is not equal to itself.")
9851003 }
9861004
9871005
9911009 then throw("Delivery feature is turned off!")
9921010 else {
9931011 let prologResult = prolog()
994- if ((size(i.payments) != 1))
995- then throw("exactly 1 payment must be attached")
996- else {
997- let pmt = i.payments[0]
998- let amt = pmt.amount
999- if (if (!(isDefined(pmt.assetId)))
1000- then true
1001- else (value(pmt.assetId) != usdtAssetId))
1002- then throw("USDT payments only!")
1003- else {
1004- let user = i.caller
1005- let addr = toString(user)
1006- let asset = value(assetInfo(fromBase58String(landAssetId)))
1007- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1008- then throw((("NFT " + asset.name) + " is not staked"))
1009- else {
1010- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1011- if ((owner != addr))
1012- then throw((LANDPREFIX + " is not yours"))
1013- else {
1014- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1015- let currentWh = split_4C(wh, ":")
1016- let matList = split(currentWh[whIdxMat], "_")
1017- let $t03727537392 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
1018- let factoryActions = $t03727537392._1
1019- let newMat = $t03727537392._2
1020- let usdtSpent = $t03727537392._3
1021- let totalMat = $t03727537392._4
1022- let whStr = makeString_2C([currentWh[whIdxLevels], currentWh[whIdxRes], makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1023- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1024- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalMat, MULT8)], nil))
1025- let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
1026- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
1027- then MIN_USDT_FEE_DELIVERY
1028- else feePart
1029- let usdtSpentWithFee = (usdtSpent + fee)
1030- if ((usdtSpentWithFee > amt))
1031- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1032- else {
1033- let rest = if (((amt - usdtSpentWithFee) > 0))
1034- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1035- else nil
1036- let activitiesAmount = (usdtSpent / 100)
1037- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1038- $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1039- }
1040- }
1041- }
1042- }
1043- }
1012+ if ((prologResult == prologResult))
1013+ then if ((size(i.payments) != 1))
1014+ then throw("exactly 1 payment must be attached")
1015+ else {
1016+ let pmt = i.payments[0]
1017+ let amt = pmt.amount
1018+ if (if (!(isDefined(pmt.assetId)))
1019+ then true
1020+ else (value(pmt.assetId) != usdtAssetId))
1021+ then throw("USDT payments only!")
1022+ else {
1023+ let user = i.caller
1024+ let addr = toString(user)
1025+ let asset = value(assetInfo(fromBase58String(landAssetId)))
1026+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1027+ then throw((("NFT " + asset.name) + " is not staked"))
1028+ else {
1029+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1030+ if ((owner != addr))
1031+ then throw((LANDPREFIX + " is not yours"))
1032+ else {
1033+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1034+ let currentWh = split_4C(wh, ":")
1035+ let matList = split(currentWh[whIdxMat], "_")
1036+ let $t03730237419 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
1037+ let factoryActions = $t03730237419._1
1038+ let newMat = $t03730237419._2
1039+ let usdtSpent = $t03730237419._3
1040+ let totalMat = $t03730237419._4
1041+ let whStr = makeString_2C([currentWh[whIdxLevels], currentWh[whIdxRes], makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1042+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1043+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalMat, MULT8)], nil))
1044+ let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
1045+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
1046+ then MIN_USDT_FEE_DELIVERY
1047+ else feePart
1048+ let usdtSpentWithFee = (usdtSpent + fee)
1049+ if ((usdtSpentWithFee > amt))
1050+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1051+ else {
1052+ let rest = if (((amt - usdtSpentWithFee) > 0))
1053+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1054+ else nil
1055+ let activitiesAmount = (usdtSpent / 100)
1056+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1057+ $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1058+ }
1059+ }
1060+ }
1061+ }
1062+ }
1063+ else throw("Strict value is not equal to itself.")
10441064 }
10451065
10461066
10481068 @Callable(i)
10491069 func exchangeResources (amounts) = {
10501070 let prologResult = prolog()
1051- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1052- if ((size(i.payments) != 1))
1053- then throw("exactly 1 payment must be attached")
1054- else {
1055- let pmt = i.payments[0]
1056- let amt = pmt.amount
1057- if (if (!(isDefined(pmt.assetId)))
1058- then true
1059- else (value(pmt.assetId) != usdtAssetId))
1060- then throw("USDT payments only!")
1071+ if ((prologResult == prologResult))
1072+ then {
1073+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1074+ if ((size(i.payments) != 1))
1075+ then throw("exactly 1 payment must be attached")
10611076 else {
1062- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1063- if ((curLocation[locIdxType] != "F"))
1064- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
1077+ let pmt = i.payments[0]
1078+ let amt = pmt.amount
1079+ if (if (!(isDefined(pmt.assetId)))
1080+ then true
1081+ else (value(pmt.assetId) != usdtAssetId))
1082+ then throw("USDT payments only!")
10651083 else {
1066- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1067- let resList = split(currentPack[bpIdxRes], "_")
1068- let matList = split(currentPack[bpIdxMat], "_")
1069- let $t03950639612 = exchangeResourcesCommon(resList, matList, amounts)
1070- let newRes = $t03950639612._1
1071- let newMat = $t03950639612._2
1072- let usdtSpent = $t03950639612._3
1073- let totalAmountConverted = $t03950639612._4
1074- if ((usdtSpent > amt))
1075- then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
1084+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1085+ if ((curLocation[locIdxType] != "F"))
1086+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
10761087 else {
1077- let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1078- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1079- let rest = if (((amt - usdtSpent) > 0))
1080- then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
1081- else nil
1082- let activitiesAmount = (usdtSpent / 100)
1083- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1084- $Tuple2((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
1088+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1089+ let resList = split(currentPack[bpIdxRes], "_")
1090+ let matList = split(currentPack[bpIdxMat], "_")
1091+ let $t03953639642 = exchangeResourcesCommon(resList, matList, amounts)
1092+ let newRes = $t03953639642._1
1093+ let newMat = $t03953639642._2
1094+ let usdtSpent = $t03953639642._3
1095+ let totalAmountConverted = $t03953639642._4
1096+ if ((usdtSpent > amt))
1097+ then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
1098+ else {
1099+ let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1100+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1101+ let rest = if (((amt - usdtSpent) > 0))
1102+ then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
1103+ else nil
1104+ let activitiesAmount = (usdtSpent / 100)
1105+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1106+ $Tuple2((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
1107+ }
10851108 }
10861109 }
10871110 }
10881111 }
1112+ else throw("Strict value is not equal to itself.")
10891113 }
10901114
10911115
10951119 then throw("Delivery feature is turned off!")
10961120 else {
10971121 let prologResult = prolog()
1098- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1099- if ((size(i.payments) != 1))
1100- then throw("exactly 1 payment must be attached")
1101- else {
1102- let pmt = i.payments[0]
1103- let amt = pmt.amount
1104- if (if (!(isDefined(pmt.assetId)))
1105- then true
1106- else (value(pmt.assetId) != usdtAssetId))
1107- then throw("USDT payments only!")
1122+ if ((prologResult == prologResult))
1123+ then {
1124+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1125+ if ((size(i.payments) != 1))
1126+ then throw("exactly 1 payment must be attached")
11081127 else {
1109- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1110- let resList = split(currentPack[bpIdxRes], "_")
1111- let matList = split(currentPack[bpIdxMat], "_")
1112- let $t04112441230 = exchangeResourcesCommon(resList, matList, amounts)
1113- let newRes = $t04112441230._1
1114- let newMat = $t04112441230._2
1115- let usdtSpent = $t04112441230._3
1116- let totalAmountConverted = $t04112441230._4
1117- let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1118- let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1119- then MIN_USDT_FEE_DELIVERY15
1120- else feePart
1121- let usdtSpentWithFee = (usdtSpent + fee)
1122- if ((usdtSpentWithFee > amt))
1123- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1128+ let pmt = i.payments[0]
1129+ let amt = pmt.amount
1130+ if (if (!(isDefined(pmt.assetId)))
1131+ then true
1132+ else (value(pmt.assetId) != usdtAssetId))
1133+ then throw("USDT payments only!")
11241134 else {
1125- let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1126- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1127- let rest = if (((amt - usdtSpentWithFee) > 0))
1128- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1129- else nil
1130- let activitiesAmount = (usdtSpent / 100)
1131- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1132- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1133- $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
1135+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1136+ let resList = split(currentPack[bpIdxRes], "_")
1137+ let matList = split(currentPack[bpIdxMat], "_")
1138+ let $t04115741263 = exchangeResourcesCommon(resList, matList, amounts)
1139+ let newRes = $t04115741263._1
1140+ let newMat = $t04115741263._2
1141+ let usdtSpent = $t04115741263._3
1142+ let totalAmountConverted = $t04115741263._4
1143+ let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1144+ let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1145+ then MIN_USDT_FEE_DELIVERY15
1146+ else feePart
1147+ let usdtSpentWithFee = (usdtSpent + fee)
1148+ if ((usdtSpentWithFee > amt))
1149+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1150+ else {
1151+ let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1152+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1153+ let rest = if (((amt - usdtSpentWithFee) > 0))
1154+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1155+ else nil
1156+ let activitiesAmount = (usdtSpent / 100)
1157+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1158+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1159+ $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
1160+ }
11341161 }
11351162 }
11361163 }
1164+ else throw("Strict value is not equal to itself.")
11371165 }
11381166
11391167
11431171 then throw("Delivery feature is turned off!")
11441172 else {
11451173 let prologResult = prolog()
1146- if ((size(i.payments) != 1))
1147- then throw("exactly 1 payment must be attached")
1148- else {
1149- let pmt = i.payments[0]
1150- let amt = pmt.amount
1151- if (if (!(isDefined(pmt.assetId)))
1152- then true
1153- else (value(pmt.assetId) != usdtAssetId))
1154- then throw("USDT payments only!")
1155- else {
1156- let user = i.caller
1157- let addr = toString(user)
1158- let asset = value(assetInfo(fromBase58String(landAssetId)))
1159- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1160- then throw((("NFT " + asset.name) + " is not staked"))
1161- else {
1162- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1163- if ((owner != addr))
1164- then throw((LANDPREFIX + " is not yours"))
1165- else {
1166- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1167- let currentWh = split_4C(wh, ":")
1168- let resList = split(currentWh[whIdxRes], "_")
1169- let matList = split(currentWh[whIdxMat], "_")
1170- let $t04353043636 = exchangeResourcesCommon(resList, matList, amounts)
1171- let newRes = $t04353043636._1
1172- let newMat = $t04353043636._2
1173- let usdtSpent = $t04353043636._3
1174- let totalAmountConverted = $t04353043636._4
1175- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1176- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1177- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1178- let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1179- let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1180- then MIN_USDT_FEE_DELIVERY15
1181- else feePart
1182- let usdtSpentWithFee = (usdtSpent + fee)
1183- if ((usdtSpentWithFee > amt))
1184- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1185- else {
1186- let rest = if (((amt - usdtSpentWithFee) > 0))
1187- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1188- else nil
1189- let activitiesAmount = (usdtSpent / 100)
1190- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1191- $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1192- }
1193- }
1194- }
1195- }
1196- }
1174+ if ((prologResult == prologResult))
1175+ then if ((size(i.payments) != 1))
1176+ then throw("exactly 1 payment must be attached")
1177+ else {
1178+ let pmt = i.payments[0]
1179+ let amt = pmt.amount
1180+ if (if (!(isDefined(pmt.assetId)))
1181+ then true
1182+ else (value(pmt.assetId) != usdtAssetId))
1183+ then throw("USDT payments only!")
1184+ else {
1185+ let user = i.caller
1186+ let addr = toString(user)
1187+ let asset = value(assetInfo(fromBase58String(landAssetId)))
1188+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1189+ then throw((("NFT " + asset.name) + " is not staked"))
1190+ else {
1191+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1192+ if ((owner != addr))
1193+ then throw((LANDPREFIX + " is not yours"))
1194+ else {
1195+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1196+ let currentWh = split_4C(wh, ":")
1197+ let resList = split(currentWh[whIdxRes], "_")
1198+ let matList = split(currentWh[whIdxMat], "_")
1199+ let $t04356643672 = exchangeResourcesCommon(resList, matList, amounts)
1200+ let newRes = $t04356643672._1
1201+ let newMat = $t04356643672._2
1202+ let usdtSpent = $t04356643672._3
1203+ let totalAmountConverted = $t04356643672._4
1204+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1205+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1206+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1207+ let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1208+ let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1209+ then MIN_USDT_FEE_DELIVERY15
1210+ else feePart
1211+ let usdtSpentWithFee = (usdtSpent + fee)
1212+ if ((usdtSpentWithFee > amt))
1213+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1214+ else {
1215+ let rest = if (((amt - usdtSpentWithFee) > 0))
1216+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1217+ else nil
1218+ let activitiesAmount = (usdtSpent / 100)
1219+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1220+ $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1221+ }
1222+ }
1223+ }
1224+ }
1225+ }
1226+ else throw("Strict value is not equal to itself.")
11971227 }
11981228
11991229
12011231 @Callable(i)
12021232 func craftGoods (productIdx,quantity) = {
12031233 let prologResult = prolog()
1204- if ((size(i.payments) != 1))
1205- then throw("exactly 1 payment must be attached")
1206- else {
1207- let pmt = i.payments[0]
1208- let amt = pmt.amount
1209- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
1210- if ((pmtAssetId != usdtAssetId))
1211- then throw("USDT payments only!")
1212- else if ((amt != MULT6))
1213- then throw("exactly 1 USDT must be attached as payment")
1214- else if ((0 >= quantity))
1215- then throw("Quantity should be positive")
1216- else {
1217- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1218- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1219- if ((curLocation[locIdxType] != "M"))
1220- then throw(("Duck location type should be Manufactory, but is " + curLocation[locIdxType]))
1221- else {
1222- let cont = curLocation[locIdxContinent]
1223- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1224- let matList = split(currentPack[bpIdxMat], "_")
1225- if (if ((0 > productIdx))
1226- then true
1227- else (productIdx >= size(productionMatrix)))
1228- then throw(("Unknown product idx=" + toString(productIdx)))
1229- else {
1230- let recipe = split(productionMatrix[productIdx], "_")
1231- if ((size(recipe) != RECIPESIZE))
1232- then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx]))
1233- else {
1234- let productContIdx = parseIntValue(recipe[rIdxContinent])
1235- if ((continents[productContIdx] != cont))
1236- then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont))
1237- else {
1238- let prodList = if ((currentPack[bpIdxProd] == ""))
1239- then nil
1240- else split_4C(currentPack[bpIdxProd], "_")
1241- func filler (acc,ignoredItem) = {
1242- let n = acc._2
1243- let xs = if ((size(prodList) > n))
1244- then prodList[n]
1245- else "0"
1246- let x = parseIntValue(xs)
1247- let amount = (quantity * PRODUCTPKGSIZE)
1248- let y = if ((n == productIdx))
1249- then toString((x + amount))
1250- else xs
1251- $Tuple2((acc._1 :+ y), (n + 1))
1252- }
1234+ if ((prologResult == prologResult))
1235+ then if ((size(i.payments) != 1))
1236+ then throw("exactly 1 payment must be attached")
1237+ else {
1238+ let pmt = i.payments[0]
1239+ let amt = pmt.amount
1240+ let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
1241+ if ((pmtAssetId != usdtAssetId))
1242+ then throw("USDT payments only!")
1243+ else if ((amt != MULT6))
1244+ then throw("exactly 1 USDT must be attached as payment")
1245+ else if ((0 >= quantity))
1246+ then throw("Quantity should be positive")
1247+ else {
1248+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1249+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1250+ if ((curLocation[locIdxType] != "M"))
1251+ then throw(("Duck location type should be Manufactory, but is " + curLocation[locIdxType]))
1252+ else {
1253+ let cont = curLocation[locIdxContinent]
1254+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1255+ let matList = split(currentPack[bpIdxMat], "_")
1256+ if (if ((0 > productIdx))
1257+ then true
1258+ else (productIdx >= size(productionMatrix)))
1259+ then throw(("Unknown product idx=" + toString(productIdx)))
1260+ else {
1261+ let recipe = split(productionMatrix[productIdx], "_")
1262+ if ((size(recipe) != RECIPESIZE))
1263+ then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx]))
1264+ else {
1265+ let productContIdx = parseIntValue(recipe[rIdxContinent])
1266+ if ((continents[productContIdx] != cont))
1267+ then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont))
1268+ else {
1269+ let prodList = if ((currentPack[bpIdxProd] == ""))
1270+ then nil
1271+ else split_4C(currentPack[bpIdxProd], "_")
1272+ func filler (acc,ignoredItem) = {
1273+ let n = acc._2
1274+ let xs = if ((size(prodList) > n))
1275+ then prodList[n]
1276+ else "0"
1277+ let x = parseIntValue(xs)
1278+ let amount = (quantity * PRODUCTPKGSIZE)
1279+ let y = if ((n == productIdx))
1280+ then toString((x + amount))
1281+ else xs
1282+ $Tuple2((acc._1 :+ y), (n + 1))
1283+ }
12531284
1254- let bpProd = ( let $l = productionMatrix
1255- let $s = size($l)
1256- let $acc0 = $Tuple2(nil, 0)
1257- func $f0_1 ($a,$i) = if (($i >= $s))
1258- then $a
1259- else filler($a, $l[$i])
1260-
1261- func $f0_2 ($a,$i) = if (($i >= $s))
1262- then $a
1263- else throw("List size exceeds 50")
1264-
1265- $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
1266- func producer (acc,j) = {
1267- let needMat = (((parseIntValue(recipe[j]) * MULT5) * quantity) * parseIntValue(recipe[rIdxCoeff]))
1268- let haveMat = parseIntValue(matList[j])
1269- if ((needMat > haveMat))
1270- then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity)))
1271- else if ((needMat > 0))
1272- then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat))
1273- else $Tuple2((acc._1 :+ matList[j]), acc._2)
1274- }
1275-
1276- let merged = {
1277- let $l = ITER6
1285+ let bpProd = ( let $l = productionMatrix
12781286 let $s = size($l)
12791287 let $acc0 = $Tuple2(nil, 0)
1280- func $f1_1 ($a,$i) = if (($i >= $s))
1288+ func $f0_1 ($a,$i) = if (($i >= $s))
12811289 then $a
1282- else producer($a, $l[$i])
1290+ else filler($a, $l[$i])
12831291
1284- func $f1_2 ($a,$i) = if (($i >= $s))
1292+ func $f0_2 ($a,$i) = if (($i >= $s))
12851293 then $a
1286- else throw("List size exceeds 6")
1294+ else throw("List size exceeds 50")
12871295
1288- $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
1296+ $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
1297+ func producer (acc,j) = {
1298+ let needMat = (((parseIntValue(recipe[j]) * MULT5) * quantity) * parseIntValue(recipe[rIdxCoeff]))
1299+ let haveMat = parseIntValue(matList[j])
1300+ if ((needMat > haveMat))
1301+ then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity)))
1302+ else if ((needMat > 0))
1303+ then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat))
1304+ else $Tuple2((acc._1 :+ matList[j]), acc._2)
1305+ }
1306+
1307+ let merged = {
1308+ let $l = ITER6
1309+ let $s = size($l)
1310+ let $acc0 = $Tuple2(nil, 0)
1311+ func $f1_1 ($a,$i) = if (($i >= $s))
1312+ then $a
1313+ else producer($a, $l[$i])
1314+
1315+ func $f1_2 ($a,$i) = if (($i >= $s))
1316+ then $a
1317+ else throw("List size exceeds 6")
1318+
1319+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
1320+ }
1321+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._1, "_"), makeString_2C(bpProd, "_")], ":")
1322+ let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1323+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpCraft, merged._2, MULT8)], nil))
1324+ $Tuple2(nil, $Tuple3(result, prologResult, statsResult))
12891325 }
1290- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._1, "_"), makeString_2C(bpProd, "_")], ":")
1291- let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1292- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpCraft, merged._2, MULT8)], nil))
1293- $Tuple2(nil, $Tuple3(result, prologResult, statsResult))
1294- }
1295- }
1296- }
1297- }
1298- }
1299- }
1326+ }
1327+ }
1328+ }
1329+ }
1330+ }
1331+ else throw("Strict value is not equal to itself.")
13001332 }
13011333
13021334
13681400 @Callable(i)
13691401 func acceptWarehouseOrder (bpOrderStr,shopLandAssetId,duckAssetId) = {
13701402 let prologResult = prolog()
1371- let caller = i.originCaller
1372- let callerAddr = toString(caller)
1373- let stakedDuckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1374- let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(stakedDuckAssetId)), DEFAULTLOCATION)
1375- let loc = split(value(curLocation), "_")
1376- if ((loc[locIdxType] != "L"))
1377- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
1378- else if ((stakedDuckAssetId != duckAssetId))
1379- then throw(((("Your staked duck is " + stakedDuckAssetId) + ", but passed ") + duckAssetId))
1380- else {
1381- let bpKey = keyBackpackByDuck(duckAssetId)
1382- let currentPack = getBackpack(bpKey)
1383- let bpResList = split(currentPack[bpIdxRes], "_")
1384- let bpMatList = split(currentPack[bpIdxMat], "_")
1385- let bpProdList = if ((currentPack[bpIdxProd] == ""))
1386- then nil
1387- else split_4C(currentPack[bpIdxProd], "_")
1388- let $t05314853388 = acceptShopOrderCommon(shopLandAssetId, callerAddr, bpOrderStr, bpResList, bpMatList, bpProdList)
1389- let shopAction = $t05314853388._1
1390- let newUserRes = $t05314853388._2
1391- let newUserMat = $t05314853388._3
1392- let newUserProd = $t05314853388._4
1393- let usdWh2BpSaldo = $t05314853388._5
1394- let usdBp2WhSaldo = $t05314853388._6
1395- let xpAmount = $t05314853388._7
1396- let shopLandOwner = $t05314853388._8
1397- let shopWhSave = $t05314853388._9
1398- let accStatsResult = $t05314853388._10
1399- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, 0)]
1400- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, 0)
1401- let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1402- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1403- let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1404- $Tuple2((actions1 ++ actions2), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1405- }
1403+ if ((prologResult == prologResult))
1404+ then {
1405+ let caller = i.originCaller
1406+ let callerAddr = toString(caller)
1407+ let stakedDuckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1408+ let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(stakedDuckAssetId)), DEFAULTLOCATION)
1409+ let loc = split(value(curLocation), "_")
1410+ if ((loc[locIdxType] != "L"))
1411+ then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
1412+ else if ((stakedDuckAssetId != duckAssetId))
1413+ then throw(((("Your staked duck is " + stakedDuckAssetId) + ", but passed ") + duckAssetId))
1414+ else {
1415+ let bpKey = keyBackpackByDuck(duckAssetId)
1416+ let currentPack = getBackpack(bpKey)
1417+ let bpResList = split(currentPack[bpIdxRes], "_")
1418+ let bpMatList = split(currentPack[bpIdxMat], "_")
1419+ let bpProdList = if ((currentPack[bpIdxProd] == ""))
1420+ then nil
1421+ else split_4C(currentPack[bpIdxProd], "_")
1422+ let $t05319053430 = acceptShopOrderCommon(shopLandAssetId, callerAddr, bpOrderStr, bpResList, bpMatList, bpProdList)
1423+ let shopAction = $t05319053430._1
1424+ let newUserRes = $t05319053430._2
1425+ let newUserMat = $t05319053430._3
1426+ let newUserProd = $t05319053430._4
1427+ let usdWh2BpSaldo = $t05319053430._5
1428+ let usdBp2WhSaldo = $t05319053430._6
1429+ let xpAmount = $t05319053430._7
1430+ let shopLandOwner = $t05319053430._8
1431+ let shopWhSave = $t05319053430._9
1432+ let accStatsResult = $t05319053430._10
1433+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, 0)]
1434+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, 0)
1435+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1436+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1437+ let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1438+ $Tuple2((actions1 ++ actions2), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1439+ }
1440+ }
1441+ else throw("Strict value is not equal to itself.")
14061442 }
14071443
14081444
14121448 then throw("Delivery feature is turned off!")
14131449 else {
14141450 let prologResult = prolog()
1415- let caller = i.originCaller
1416- let callerAddr = toString(caller)
1417- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1418- let bpKey = keyBackpackByDuck(duckAssetId)
1419- let currentPack = getBackpack(bpKey)
1420- let bpResList = split(currentPack[bpIdxRes], "_")
1421- let bpMatList = split(currentPack[bpIdxMat], "_")
1422- let bpProdList = if ((currentPack[bpIdxProd] == ""))
1423- then nil
1424- else split_4C(currentPack[bpIdxProd], "_")
1425- let $t05482755065 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, bpResList, bpMatList, bpProdList)
1426- let shopAction = $t05482755065._1
1427- let newUserRes = $t05482755065._2
1428- let newUserMat = $t05482755065._3
1429- let newUserProd = $t05482755065._4
1430- let usdWh2BpSaldo = $t05482755065._5
1431- let usdBp2WhSaldo = $t05482755065._6
1432- let xpAmount = $t05482755065._7
1433- let shopLandOwner = $t05482755065._8
1434- let shopWhSave = $t05482755065._9
1435- let accStatsResult = $t05482755065._10
1436- let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1437- let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1438- then MIN_USDT_FEE_DELIVERY
1439- else deliveryFeePart
1440- let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1441- let receivedFee = (deliveryFee - spentFee)
1442- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1443- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1444- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1445- let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1446- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1447- let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1448- $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1451+ if ((prologResult == prologResult))
1452+ then {
1453+ let caller = i.originCaller
1454+ let callerAddr = toString(caller)
1455+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1456+ let bpKey = keyBackpackByDuck(duckAssetId)
1457+ let currentPack = getBackpack(bpKey)
1458+ let bpResList = split(currentPack[bpIdxRes], "_")
1459+ let bpMatList = split(currentPack[bpIdxMat], "_")
1460+ let bpProdList = if ((currentPack[bpIdxProd] == ""))
1461+ then nil
1462+ else split_4C(currentPack[bpIdxProd], "_")
1463+ let $t05487255110 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, bpResList, bpMatList, bpProdList)
1464+ let shopAction = $t05487255110._1
1465+ let newUserRes = $t05487255110._2
1466+ let newUserMat = $t05487255110._3
1467+ let newUserProd = $t05487255110._4
1468+ let usdWh2BpSaldo = $t05487255110._5
1469+ let usdBp2WhSaldo = $t05487255110._6
1470+ let xpAmount = $t05487255110._7
1471+ let shopLandOwner = $t05487255110._8
1472+ let shopWhSave = $t05487255110._9
1473+ let accStatsResult = $t05487255110._10
1474+ let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1475+ let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1476+ then MIN_USDT_FEE_DELIVERY
1477+ else deliveryFeePart
1478+ let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1479+ let receivedFee = (deliveryFee - spentFee)
1480+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1481+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1482+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1483+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1484+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1485+ let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1486+ $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1487+ }
1488+ else throw("Strict value is not equal to itself.")
14491489 }
14501490
14511491
14551495 then throw("Delivery feature is turned off!")
14561496 else {
14571497 let prologResult = prolog()
1458- let caller = i.originCaller
1459- let callerAddr = toString(caller)
1460- let asset = value(assetInfo(fromBase58String(myLandAssetId)))
1461- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(myLandAssetId)))))
1462- then throw((("NFT " + asset.name) + " is not staked"))
1463- else {
1464- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(myLandAssetId)), (("NFT " + asset.name) + " is orphaned"))
1465- if ((owner != callerAddr))
1466- then throw((LANDPREFIX + " is not yours"))
1498+ if ((prologResult == prologResult))
1499+ then {
1500+ let caller = i.originCaller
1501+ let callerAddr = toString(caller)
1502+ let asset = value(assetInfo(fromBase58String(myLandAssetId)))
1503+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(myLandAssetId)))))
1504+ then throw((("NFT " + asset.name) + " is not staked"))
14671505 else {
1468- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [myLandAssetId], nil))
1469- let currentWh = split_4C(wh, ":")
1470- let resList = split(currentWh[whIdxRes], "_")
1471- let matList = split(currentWh[whIdxMat], "_")
1472- let prodList = if ((currentWh[whIdxProd] == ""))
1473- then nil
1474- else split(currentWh[whIdxProd], "_")
1475- let $t05730457536 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, resList, matList, prodList)
1476- let shopAction = $t05730457536._1
1477- let newUserRes = $t05730457536._2
1478- let newUserMat = $t05730457536._3
1479- let newUserProd = $t05730457536._4
1480- let usdWh2BpSaldo = $t05730457536._5
1481- let usdBp2WhSaldo = $t05730457536._6
1482- let xpAmount = $t05730457536._7
1483- let shopLandOwner = $t05730457536._8
1484- let shopWhSave = $t05730457536._9
1485- let accStatsResult = $t05730457536._10
1486- let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1487- let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1488- then MIN_USDT_FEE_DELIVERY
1489- else deliveryFeePart
1490- let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1491- let receivedFee = (deliveryFee - spentFee)
1492- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1493- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1494- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1495- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString(newUserProd, "_"), currentWh[whIdxLOFT]], ":")
1496- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, myLandAssetId], nil))
1497- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [callerAddr, fraction(xpShop, xpAmount, MULT8)], nil))
1498- $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, whSave, statsResult, accStatsResult))
1506+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(myLandAssetId)), (("NFT " + asset.name) + " is orphaned"))
1507+ if ((owner != callerAddr))
1508+ then throw((LANDPREFIX + " is not yours"))
1509+ else {
1510+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [myLandAssetId], nil))
1511+ let currentWh = split_4C(wh, ":")
1512+ let resList = split(currentWh[whIdxRes], "_")
1513+ let matList = split(currentWh[whIdxMat], "_")
1514+ let prodList = if ((currentWh[whIdxProd] == ""))
1515+ then nil
1516+ else split(currentWh[whIdxProd], "_")
1517+ let $t05735257584 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, resList, matList, prodList)
1518+ let shopAction = $t05735257584._1
1519+ let newUserRes = $t05735257584._2
1520+ let newUserMat = $t05735257584._3
1521+ let newUserProd = $t05735257584._4
1522+ let usdWh2BpSaldo = $t05735257584._5
1523+ let usdBp2WhSaldo = $t05735257584._6
1524+ let xpAmount = $t05735257584._7
1525+ let shopLandOwner = $t05735257584._8
1526+ let shopWhSave = $t05735257584._9
1527+ let accStatsResult = $t05735257584._10
1528+ let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1529+ let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1530+ then MIN_USDT_FEE_DELIVERY
1531+ else deliveryFeePart
1532+ let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1533+ let receivedFee = (deliveryFee - spentFee)
1534+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1535+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1536+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1537+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString(newUserProd, "_"), currentWh[whIdxLOFT]], ":")
1538+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, myLandAssetId], nil))
1539+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [callerAddr, fraction(xpShop, xpAmount, MULT8)], nil))
1540+ $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, whSave, statsResult, accStatsResult))
1541+ }
14991542 }
15001543 }
1544+ else throw("Strict value is not equal to itself.")
15011545 }
15021546
15031547
15051549 @Callable(i)
15061550 func sellProductsToES (amounts) = {
15071551 let prologResult = prolog()
1508- if ((size(i.payments) != 0))
1509- then throw("No payments needed")
1510- else {
1511- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1512- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1513- if ((curLocation[locIdxType] != "A"))
1514- then throw(("Duck location type should be Airport, but is " + curLocation[locIdxType]))
1515- else {
1516- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1517- let prodList = if ((currentPack[bpIdxProd] == ""))
1518- then nil
1519- else split_4C(currentPack[bpIdxProd], "_")
1520- let esKey = keyEsWarehouse()
1521- let existStr = getString(esKey)
1522- let existAmounts = if (isDefined(existStr))
1523- then split_4C(value(existStr), "_")
1524- else nil
1525- func moveProd (acc,recipeStr) = {
1526- let j = acc._1
1527- let quantity = if ((size(amounts) > j))
1528- then amounts[j]
1529- else 0
1530- if ((0 > quantity))
1531- then throw("Quantity cannot be negative")
1532- else {
1533- let recipe = split(recipeStr, "_")
1534- if ((size(recipe) != RECIPESIZE))
1535- then throw(("Fatal: unknown recipe: " + recipeStr))
1536- else {
1537- let maxAmount = (ESMAXPACKAGES * PRODUCTPKGSIZE)
1538- let existAmount = if ((size(existAmounts) > j))
1539- then parseIntValue(existAmounts[j])
1540- else 0
1541- let canBuy = (maxAmount - existAmount)
1542- if ((quantity > canBuy))
1543- then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j]))
1544- else {
1545- let totalMat = getRecipeMaterials(recipe)
1546- let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (MULT8 * PRODUCTPKGSIZE))
1547- let bpProdAmount = if ((size(prodList) > j))
1548- then parseIntValue(prodList[j])
1549- else 0
1550- if ((quantity > bpProdAmount))
1551- then throw(((("You have only " + toString(bpProdAmount)) + " of ") + prodTypes[j]))
1552- else $Tuple5((j + 1), (acc._2 + (unitPrice * quantity)), (acc._3 :+ toString((bpProdAmount - quantity))), (acc._4 :+ toString((existAmount + quantity))), (acc._5 + (totalMat * quantity)))
1553- }
1554- }
1555- }
1552+ if ((prologResult == prologResult))
1553+ then if ((size(i.payments) != 0))
1554+ then throw("No payments needed")
1555+ else {
1556+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1557+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1558+ if ((curLocation[locIdxType] != "A"))
1559+ then throw(("Duck location type should be Airport, but is " + curLocation[locIdxType]))
1560+ else {
1561+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1562+ let prodList = if ((currentPack[bpIdxProd] == ""))
1563+ then nil
1564+ else split_4C(currentPack[bpIdxProd], "_")
1565+ let esKey = keyEsWarehouse()
1566+ let existStr = getString(esKey)
1567+ let existAmounts = if (isDefined(existStr))
1568+ then split_4C(value(existStr), "_")
1569+ else nil
1570+ func moveProd (acc,recipeStr) = {
1571+ let j = acc._1
1572+ let quantity = if ((size(amounts) > j))
1573+ then amounts[j]
1574+ else 0
1575+ if ((0 > quantity))
1576+ then throw("Quantity cannot be negative")
1577+ else {
1578+ let recipe = split(recipeStr, "_")
1579+ if ((size(recipe) != RECIPESIZE))
1580+ then throw(("Fatal: unknown recipe: " + recipeStr))
1581+ else {
1582+ let maxAmount = (ESMAXPACKAGES * PRODUCTPKGSIZE)
1583+ let existAmount = if ((size(existAmounts) > j))
1584+ then parseIntValue(existAmounts[j])
1585+ else 0
1586+ let canBuy = (maxAmount - existAmount)
1587+ if ((quantity > canBuy))
1588+ then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j]))
1589+ else {
1590+ let totalMat = getRecipeMaterials(recipe)
1591+ let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (MULT8 * PRODUCTPKGSIZE))
1592+ let bpProdAmount = if ((size(prodList) > j))
1593+ then parseIntValue(prodList[j])
1594+ else 0
1595+ if ((quantity > bpProdAmount))
1596+ then throw(((("You have only " + toString(bpProdAmount)) + " of ") + prodTypes[j]))
1597+ else $Tuple5((j + 1), (acc._2 + (unitPrice * quantity)), (acc._3 :+ toString((bpProdAmount - quantity))), (acc._4 :+ toString((existAmount + quantity))), (acc._5 + (totalMat * quantity)))
1598+ }
1599+ }
1600+ }
1601+ }
1602+
1603+ let merged = {
1604+ let $l = productionMatrix
1605+ let $s = size($l)
1606+ let $acc0 = $Tuple5(0, 0, nil, nil, 0)
1607+ func $f0_1 ($a,$i) = if (($i >= $s))
1608+ then $a
1609+ else moveProd($a, $l[$i])
1610+
1611+ func $f0_2 ($a,$i) = if (($i >= $s))
1612+ then $a
1613+ else throw("List size exceeds 50")
1614+
1615+ $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)
1616+ }
1617+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], currentPack[bpIdxRes], currentPack[bpIdxMat], makeString_2C(merged._3, "_")], ":")
1618+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1619+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpSellToEs, merged._5, (MULT8 * 10))], nil))
1620+ $Tuple2([StringEntry(esKey, makeString_2C(merged._4, "_")), ScriptTransfer(i.caller, merged._2, usdtAssetId)], $Tuple3(bpSave, prologResult, statsResult))
15561621 }
1557-
1558- let merged = {
1559- let $l = productionMatrix
1560- let $s = size($l)
1561- let $acc0 = $Tuple5(0, 0, nil, nil, 0)
1562- func $f0_1 ($a,$i) = if (($i >= $s))
1563- then $a
1564- else moveProd($a, $l[$i])
1565-
1566- func $f0_2 ($a,$i) = if (($i >= $s))
1567- then $a
1568- else throw("List size exceeds 50")
1569-
1570- $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)
1571- }
1572- let newBpStr = makeString_2C([currentPack[bpIdxLevel], currentPack[bpIdxRes], currentPack[bpIdxMat], makeString_2C(merged._3, "_")], ":")
1573- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1574- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpSellToEs, merged._5, (MULT8 * 10))], nil))
1575- $Tuple2([StringEntry(esKey, makeString_2C(merged._4, "_")), ScriptTransfer(i.caller, merged._2, usdtAssetId)], $Tuple3(bpSave, prologResult, statsResult))
1576- }
1577- }
1622+ }
1623+ else throw("Strict value is not equal to itself.")
15781624 }
15791625
15801626
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let xpTrade = 10000
55
66 let xpCraft = 10000
77
88 let xpSellToEs = 10000
99
1010 let xpShop = 10000
1111
1212 let LANDPREFIX = "LAND"
1313
1414 let NUMRES = 6
1515
1616 let DEFAULTLOCATION = "Africa_F_Africa"
1717
1818 let RESOURCEPRICEMIN = 39637
1919
2020 let ESMAXPACKAGES = 10
2121
2222 let ESBUYCOEF = 4
2323
2424 let MIN_USDT_FEE_DELIVERY = 50000
2525
2626 let MIN_USDT_FEE_DELIVERY15 = 75000
2727
2828 let USDT2ACRES_MULTIPLIER = 10
2929
3030 let resTypes = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"]
3131
3232 let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"]
3333
3434 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", "Mine L1", "Mine L2", "Mine L3", "Trap L1", "Trap L2", "Trap L3"]
3535
3636 let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"]
3737
3838 let COEFF2MAT = 10000000
3939
4040 let productionMatrix = ["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_011", "8_8_8_8_8_60_26_2_4_0,0,0,0,0,0,0_011", "8_8_8_8_8_60_39_2_8_0,0,0,0,0,0,0_011", "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_10_0,0,0,0,0,0,0_201", "18_18_10_18_18_18_22_4_20_0,0,0,0,0,0,0_201", "18_18_10_18_18_18_33_4_30_0,0,0,0,0,0,0_201", "4_13_22_4_35_22_23_0_50,1,0_0,0,0,0,0,0,0_", "4_13_22_4_35_22_46_0_50,1,1_0,2,5,0,0,0,0_", "4_13_22_4_35_22_69_0_50,2,1_0,5,10,0,0,0,0_", "5_25_40_5_10_15_20_1_30,1,1_0,0,0,0,0,0,0_", "5_25_40_5_10_15_40_1_30,1,2_2,1,3,0,0,0,0_", "5_25_40_5_10_15_60_1_30,1,3_5,2,8,0,0,0,0_"]
4141
4242 let rIdxCoeff = 6
4343
4444 let rIdxContinent = 7
4545
4646 let RECIPESIZE = 11
4747
4848 let PRODUCTPKGSIZE = 10
4949
5050 let whIdxLevels = 0
5151
5252 let whIdxRes = 1
5353
5454 let whIdxMat = 2
5555
5656 let whIdxProd = 3
5757
5858 let whIdxLOFT = 4
5959
6060 let volLocked = 0
6161
6262 let volTotal = 3
6363
6464 let bpIdxLevel = 0
6565
6666 let bpIdxRes = 1
6767
6868 let bpIdxMat = 2
6969
7070 let bpIdxProd = 3
7171
7272 let locIdxContinent = 0
7373
7474 let locIdxType = 1
7575
7676 let locIdxId = 2
7777
7878 func keyLandAssetIdToOwner (assetId) = ("no_" + assetId)
7979
8080
8181 func keyStakedTimeByAssetId (assetId) = ("st_" + assetId)
8282
8383
8484 func keyAddressRefBy (addr) = ("accRefBy_" + addr)
8585
8686
8787 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
8888
8989
9090 func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId)
9191
9292
9393 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
9494
9595
9696 func keyOrderByLand (landAssetId) = ("landOrder_" + landAssetId)
9797
9898
9999 func keyEsWarehouse () = "emergencyWarehouseProducts"
100100
101101
102102 let deliveryFundKey = "deliveryFund"
103103
104104 let deliveryLockedKey = "deliveryLocked"
105105
106106 func getRecipeMaterials (recipe) = (parseIntValue(recipe[rIdxCoeff]) * COEFF2MAT)
107107
108108
109109 let KS_ALLOW_DELIVERY = true
110110
111111 let chain = take(drop(this.bytes, 1), 1)
112112
113113 let usdtAssetId = match chain {
114114 case _ =>
115115 if ((base58'2W' == $match0))
116116 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
117117 else if ((base58'2T' == $match0))
118118 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
119119 else throw("Unknown chain")
120120 }
121121
122122 let defaultRestAddressStr = match chain {
123123 case _ =>
124124 if ((base58'2W' == $match0))
125125 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
126126 else if ((base58'2T' == $match0))
127127 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
128128 else throw("Unknown chain")
129129 }
130130
131131 let SEP = "__"
132132
133133 let MULT5 = 100000
134134
135135 let MULT6 = 1000000
136136
137137 let MULT8 = 100000000
138138
139139 let MULT10 = 10000000000
140140
141141 let MINSHOPPAYMENT = 100000
142142
143143 let ITER6 = [0, 1, 2, 3, 4, 5]
144144
145145 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
146146
147147
148148 let IdxCfgStakingDapp = 1
149149
150150 let IdxCfgInvestFundDapp = 6
151151
152152 let IdxCfgAcresDapp = 8
153153
154154 func keyRestCfg () = "%s__restConfig"
155155
156156
157157 func keyRestAddress () = "%s__restAddr"
158158
159159
160160 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
161161
162162
163163 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
164164
165165
166166 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
167167
168168 let restCfg = readRestCfgOrFail(restContract)
169169
170170 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
171171
172172 let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp)
173173
174174 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
175175
176176 func asString (v) = match v {
177177 case s: String =>
178178 s
179179 case _ =>
180180 throw("fail to cast into String")
181181 }
182182
183183
184184 func asInt (v) = match v {
185185 case n: Int =>
186186 n
187187 case _ =>
188188 throw("fail to cast into Int")
189189 }
190190
191191
192192 func keyBlocked () = "contractsBlocked"
193193
194194
195195 func fixedPoint (val,decimals) = {
196196 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
197197 let lowPart = toString((val % tenPow))
198198 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
199199 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
200200 }
201201
202202
203203 let FACTORYMAXWAREHOUSE = 10000000000
204204
205205 let SELLMULTIPLIER = 200
206206
207207 let BUYMULTIPLIER = 300
208208
209209 let AUCTIONFEE = 10000
210210
211211 let DELIVERY_FEE = 10000
212212
213213 let DELIVERY_FEE15 = 15000
214214
215215 func keyFactoryWarehouseByIdAndType (factoryId,resType) = ((("factoryWhByContinentAndRes_" + factoryId) + "_") + toString(resType))
216216
217217
218218 let ordIdxRes = 0
219219
220220 let ordIdxMat = 1
221221
222222 let ordIdxProd = 2
223223
224224 func getOrder (ordKey) = {
225225 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:"), ":")
226226 [if ((size(split(p[ordIdxRes], "_")) == NUMRES))
227227 then p[ordIdxRes]
228228 else "0@0_0@0_0@0_0@0_0@0_0@0", if ((size(split(p[ordIdxMat], "_")) == NUMRES))
229229 then p[ordIdxMat]
230230 else "0@0_0@0_0@0_0@0_0@0_0@0", p[ordIdxProd]]
231231 }
232232
233233
234234 func toVolume (amount,pkgSize,isProduct) = if (isProduct)
235235 then {
236236 let pkgs = if ((amount >= 0))
237237 then (((amount + pkgSize) - 1) / pkgSize)
238238 else -((((-(amount) + pkgSize) - 1) / pkgSize))
239239 (pkgs * MULT8)
240240 }
241241 else amount
242242
243243
244244 func sellInternal (locId,resType,amount,minPrice) = {
245245 let whKey = keyFactoryWarehouseByIdAndType(locId, resType)
246246 let w0 = valueOrElse(getInteger(whKey), 0)
247247 let r0 = if ((w0 > FACTORYMAXWAREHOUSE))
248248 then 0
249249 else if (((w0 + amount) > FACTORYMAXWAREHOUSE))
250250 then (FACTORYMAXWAREHOUSE - w0)
251251 else amount
252252 let usdtReceived = (fraction(r0, ((SELLMULTIPLIER * RESOURCEPRICEMIN) - fraction(((100 * w0) + (50 * r0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction((amount - r0), RESOURCEPRICEMIN, MULT8))
253253 let min99 = (minPrice - (minPrice / 100))
254254 if (((min99 * amount) > (usdtReceived * MULT8)))
255255 then throw((((((((((("Actual price = " + toString(usdtReceived)) + " / ") + toString(amount)) + " < minPrice = ") + toString(minPrice)) + ", (") + locId) + ", ") + resTypes[resType]) + ")"))
256256 else $Tuple2(IntegerEntry(whKey, (w0 + amount)), usdtReceived)
257257 }
258258
259259
260260 func buyInternal (locId,matType,amount,maxPrice) = {
261261 let whKey = keyFactoryWarehouseByIdAndType(locId, matType)
262262 let w0 = valueOrElse(getInteger(whKey), 0)
263263 let m1 = if ((w0 > FACTORYMAXWAREHOUSE))
264264 then min([amount, (w0 - FACTORYMAXWAREHOUSE)])
265265 else 0
266266 let m0 = min([w0, (amount - m1)])
267267 let m = (m0 + m1)
268268 let w0min = min([w0, FACTORYMAXWAREHOUSE])
269269 let usdtSpent = (fraction(m0, ((BUYMULTIPLIER * RESOURCEPRICEMIN) - fraction(((100 * w0min) - (50 * m0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction(m1, (2 * RESOURCEPRICEMIN), MULT8))
270270 let max101 = (maxPrice + (maxPrice / 100))
271271 if (((usdtSpent * MULT8) > (max101 * m)))
272272 then throw((((((((((("Actual price = " + toString(usdtSpent)) + " / ") + toString(m)) + " > maxPrice = ") + toString(maxPrice)) + ", (") + locId) + ", ") + matTypes[matType]) + ")"))
273273 else $Tuple3(IntegerEntry(whKey, (w0 - m)), usdtSpent, m)
274274 }
275275
276276
277277 func getBackpack (bpKey) = {
278278 let p = split_4C(valueOrElse(getString(stakingContract, bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
279279 [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES))
280280 then p[bpIdxRes]
281281 else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES))
282282 then p[bpIdxMat]
283283 else "0_0_0_0_0_0", p[bpIdxProd]]
284284 }
285285
286286
287287 func checkBlocked () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false))
288288 then throw("Contracts are under maintenance")
289289 else unit
290290
291291
292-func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil))
292+func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
293293
294294
295295 func setCommon (acc,ignoredIterator) = {
296296 let j = acc._1
297297 let item = if ((size(acc._10) > j))
298298 then acc._10[j]
299299 else "0@0"
300300 let isProd = acc._8
301301 let itemParts = split(item, "@")
302302 if ((size(itemParts) != 2))
303303 then throw("Incorrect order format, should be amount@price")
304304 else {
305305 let newOrdAm = parseIntValue(itemParts[0])
306306 let newOrdPr = parseIntValue(itemParts[1])
307307 let newOrdUsd = if (isProd)
308308 then (newOrdAm * newOrdPr)
309309 else fraction(newOrdAm, newOrdPr, MULT8)
310310 let newOrdVol = toVolume(newOrdAm, PRODUCTPKGSIZE, isProd)
311311 let whInit = if ((size(acc._6) > j))
312312 then parseIntValue(acc._6[j])
313313 else 0
314314 let curOrdParts = split(if ((size(acc._7) > j))
315315 then acc._7[j]
316316 else "0@0", "@")
317317 let curOrdAm = parseIntValue(curOrdParts[0])
318318 let curOrdPr = parseIntValue(curOrdParts[1])
319319 if (if ((0 > curOrdPr))
320320 then true
321321 else (0 > newOrdPr))
322322 then throw("Price can't be negative")
323323 else {
324324 let curOrdUsd = if (isProd)
325325 then (curOrdAm * curOrdPr)
326326 else fraction(curOrdAm, curOrdPr, MULT8)
327327 if ((newOrdAm == 0))
328328 then if ((curOrdAm > 0))
329329 then $Tuple10((j + 1), (acc._2 :+ toString(whInit)), acc._3, acc._4, (acc._5 - curOrdUsd), acc._6, acc._7, isProd, (acc._9 + toVolume(whInit, PRODUCTPKGSIZE, isProd)), acc._10)
330330 else $Tuple10((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)), acc._10)
331331 else if ((newOrdAm > 0))
332332 then if ((0 > curOrdAm))
333333 then $Tuple10((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), acc._10)
334334 else $Tuple10((j + 1), (acc._2 :+ toString(whInit)), (acc._3 + newOrdVol), acc._4, ((acc._5 + newOrdUsd) - curOrdUsd), acc._6, acc._7, isProd, toVolume(whInit, PRODUCTPKGSIZE, isProd), acc._10)
335335 else if ((0 > curOrdAm))
336336 then {
337337 let amDiff = (curOrdAm - newOrdAm)
338338 if ((0 > (whInit - amDiff)))
339339 then throw((((("Attempt to take " + toString(amDiff)) + " from warehouse, but only ") + toString(whInit)) + " available"))
340340 else $Tuple10((j + 1), (acc._2 :+ toString((whInit - amDiff))), acc._3, (acc._4 - newOrdVol), acc._5, acc._6, acc._7, isProd, toVolume((whInit - amDiff), PRODUCTPKGSIZE, isProd), acc._10)
341341 }
342342 else if ((0 > (whInit + newOrdAm)))
343343 then throw((((("Attempt to take " + toString(-(newOrdAm))) + " from warehouse, but only ") + toString(whInit)) + " available"))
344344 else $Tuple10((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), acc._10)
345345 }
346346 }
347347 }
348348
349349
350350 func setInternal (currentWh,currentOrd,newOrd) = {
351351 let currWhRes = split(currentWh[whIdxRes], "_")
352352 let currWhMat = split(currentWh[whIdxMat], "_")
353353 let currWhProd = if ((currentWh[whIdxProd] == ""))
354354 then nil
355355 else split_4C(currentWh[whIdxProd], "_")
356356 let currentOrdRes = split(currentOrd[ordIdxRes], "_")
357357 let currentOrdMat = split(currentOrd[ordIdxMat], "_")
358358 let currentOrdProd = if ((currentOrd[ordIdxProd] == ""))
359359 then nil
360360 else split_4C(currentOrd[ordIdxProd], "_")
361361 if ((size(newOrd) != 3))
362362 then throw("newOrderStr should contain exactly 2 ':' separators")
363363 else {
364364 let resParts = split(newOrd[0], "_")
365365 let matParts = split(newOrd[1], "_")
366366 let prodParts = if ((newOrd[2] == ""))
367367 then nil
368368 else split_4C(newOrd[2], "_")
369369 if ((size(resParts) != NUMRES))
370370 then throw("All 6 resources should be passed")
371371 else if ((size(matParts) != NUMRES))
372372 then throw("All 6 materials should be passed")
373373 else {
374374 let r = {
375375 let $l = resTypes
376376 let $s = size($l)
377377 let $acc0 = $Tuple10(0, nil, 0, 0, 0, currWhRes, currentOrdRes, false, 0, resParts)
378378 func $f0_1 ($a,$i) = if (($i >= $s))
379379 then $a
380380 else setCommon($a, $l[$i])
381381
382382 func $f0_2 ($a,$i) = if (($i >= $s))
383383 then $a
384384 else throw("List size exceeds 6")
385385
386386 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
387387 }
388388 let m = {
389389 let $l = matTypes
390390 let $s = size($l)
391391 let $acc0 = $Tuple10(0, nil, r._3, r._4, r._5, currWhMat, currentOrdMat, false, r._9, matParts)
392392 func $f1_1 ($a,$i) = if (($i >= $s))
393393 then $a
394394 else setCommon($a, $l[$i])
395395
396396 func $f1_2 ($a,$i) = if (($i >= $s))
397397 then $a
398398 else throw("List size exceeds 6")
399399
400400 $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
401401 }
402402 let p = {
403403 let $l = prodTypes
404404 let $s = size($l)
405405 let $acc0 = $Tuple10(0, nil, m._3, m._4, m._5, currWhProd, currentOrdProd, true, m._9, prodParts)
406406 func $f2_1 ($a,$i) = if (($i >= $s))
407407 then $a
408408 else setCommon($a, $l[$i])
409409
410410 func $f2_2 ($a,$i) = if (($i >= $s))
411411 then $a
412412 else throw("List size exceeds 50")
413413
414414 $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)
415415 }
416416 $Tuple7(r._2, m._2, p._2, p._3, p._4, p._5, p._9)
417417 }
418418 }
419419 }
420420
421421
422422 func acceptCommon (acc,bpOrdItem) = {
423423 let j = acc._7
424424 let isProd = acc._12
425425 let bpOrdParts = split(bpOrdItem, "@")
426426 if ((size(bpOrdParts) != 2))
427427 then throw("Incorrect order format, should be amount@price")
428428 else {
429429 let bpOrdAm = parseIntValue(bpOrdParts[0])
430430 let bpOrdPr = parseIntValue(bpOrdParts[1])
431431 if ((0 > bpOrdPr))
432432 then throw("Price can't be negative")
433433 else {
434434 let bpOrdUsd = if (isProd)
435435 then (bpOrdAm * bpOrdPr)
436436 else fraction(bpOrdAm, bpOrdPr, MULT8)
437437 let bpInit = if ((size(acc._8) > j))
438438 then parseIntValue(acc._8[j])
439439 else 0
440440 let whInit = if ((size(acc._9) > j))
441441 then parseIntValue(acc._9[j])
442442 else 0
443443 let whOrdInit = if ((size(acc._10) > j))
444444 then acc._10[j]
445445 else "0@0"
446446 let whOrdParts = split(whOrdInit, "@")
447447 let whOrdAm = parseIntValue(whOrdParts[0])
448448 let whOrdPr = parseIntValue(whOrdParts[1])
449449 if (if ((bpOrdAm != 0))
450450 then (bpOrdPr != whOrdPr)
451451 else false)
452452 then throw(((((("Prices of " + acc._11[j]) + " don't match! WH price=") + toString(whOrdPr)) + ", your price=") + toString(bpOrdPr)))
453453 else {
454454 let whOrdUsd = if (isProd)
455455 then (whOrdAm * whOrdPr)
456456 else fraction(whOrdAm, whOrdPr, MULT8)
457457 let deltaVol = toVolume(bpOrdAm, PRODUCTPKGSIZE, isProd)
458458 if ((bpOrdAm == 0))
459459 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)
460460 else if ((bpOrdAm > 0))
461461 then if ((0 > whOrdAm))
462462 then if ((bpOrdAm > -(whOrdAm)))
463463 then throw(((((("Attempt to buy " + toString(bpOrdAm)) + " of ") + acc._11[j]) + ", but warehouse only sells ") + toString(-(whOrdAm))))
464464 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)
465465 then (bpOrdAm * MULT8)
466466 else bpOrdAm)))
467467 else throw((("Attempt to buy " + acc._11[j]) + " while warehouse doesn't sell it"))
468468 else if ((whOrdAm > 0))
469469 then if ((-(bpOrdAm) > whOrdAm))
470470 then throw(((((("Attempt to sell " + toString(-(bpOrdAm))) + " of ") + acc._11[j]) + ", but warehouse only buys ") + toString(whOrdAm)))
471471 else if ((-(bpOrdAm) > bpInit))
472472 then throw(((((("Attempt to sell " + toString(-(bpOrdAm))) + ", but you only have ") + toString(bpInit)) + " of ") + acc._11[j]))
473473 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)
474474 then (bpOrdAm * MULT8)
475475 else bpOrdAm)))
476476 else throw((("Attempt to sell " + acc._11[j]) + " while warehouse doesn't buy it"))
477477 }
478478 }
479479 }
480480 }
481481
482482
483483 func sellResourcesCommon (resList,factoryLocId,amounts,minPrices) = {
484484 func adder (acc,j) = if ((amounts[j] > parseIntValue(resList[j])))
485485 then throw(((((("You have " + resList[j]) + " of ") + resTypes[j]) + ", but tried to sell ") + toString(amounts[j])))
486486 else if ((0 > amounts[j]))
487487 then throw(((("You tried to sell negative amount of " + resTypes[j]) + ": ") + toString(amounts[j])))
488488 else if ((amounts[j] > 0))
489489 then {
490490 let b = sellInternal(factoryLocId, j, amounts[j], minPrices[j])
491491 $Tuple4((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(resList[j]) - amounts[j]))), (acc._3 + b._2), (acc._4 + amounts[j]))
492492 }
493493 else $Tuple4(acc._1, (acc._2 :+ resList[j]), acc._3, acc._4)
494494
495495 let $l = ITER6
496496 let $s = size($l)
497497 let $acc0 = $Tuple4(nil, nil, 0, 0)
498498 func $f0_1 ($a,$i) = if (($i >= $s))
499499 then $a
500500 else adder($a, $l[$i])
501501
502502 func $f0_2 ($a,$i) = if (($i >= $s))
503503 then $a
504504 else throw("List size exceeds 6")
505505
506506 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
507507 }
508508
509509
510510 func buyMaterialsCommon (matList,factoryLocId,amounts,maxPrices) = {
511511 func mUpdater (acc,j) = if ((0 > amounts[j]))
512512 then throw(((("You tried to buy negative amount of " + matTypes[j]) + ": ") + toString(amounts[j])))
513513 else if ((amounts[j] > 0))
514514 then {
515515 let b = buyInternal(factoryLocId, j, amounts[j], maxPrices[j])
516516 $Tuple4((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(matList[j]) + b._3))), (acc._3 + b._2), (acc._4 + amounts[j]))
517517 }
518518 else $Tuple4(acc._1, (acc._2 :+ matList[j]), acc._3, acc._4)
519519
520520 let $l = ITER6
521521 let $s = size($l)
522522 let $acc0 = $Tuple4(nil, nil, 0, 0)
523523 func $f0_1 ($a,$i) = if (($i >= $s))
524524 then $a
525525 else mUpdater($a, $l[$i])
526526
527527 func $f0_2 ($a,$i) = if (($i >= $s))
528528 then $a
529529 else throw("List size exceeds 6")
530530
531531 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
532532 }
533533
534534
535535 func exchangeResourcesCommon (resList,matList,amounts) = {
536536 func exchanger (acc,j) = {
537537 let amj = amounts[j]
538538 if ((amj > parseIntValue(resList[j])))
539539 then throw(((((("You have " + resList[j]) + " of ") + resTypes[j]) + ", but tried to exchange ") + toString(amj)))
540540 else if ((0 > amj))
541541 then throw(((("You tried to exchange negative amount of " + resTypes[j]) + ": ") + toString(amj)))
542542 else if ((amj > 0))
543543 then $Tuple4((acc._1 :+ toString((parseIntValue(resList[j]) - amj))), (acc._2 :+ toString((parseIntValue(matList[j]) + amj))), (acc._3 + fraction(amj, RESOURCEPRICEMIN, MULT8)), (acc._4 + amj))
544544 else $Tuple4((acc._1 :+ resList[j]), (acc._2 :+ matList[j]), acc._3, acc._4)
545545 }
546546
547547 let $l = ITER6
548548 let $s = size($l)
549549 let $acc0 = $Tuple4(nil, nil, 0, 0)
550550 func $f0_1 ($a,$i) = if (($i >= $s))
551551 then $a
552552 else exchanger($a, $l[$i])
553553
554554 func $f0_2 ($a,$i) = if (($i >= $s))
555555 then $a
556556 else throw("List size exceeds 6")
557557
558558 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
559559 }
560560
561561
562562 func shop2userActions (usdWh2BpSaldo,callerAddr,receivedFee) = if ((usdWh2BpSaldo > 0))
563563 then {
564564 let usdWh2BpFee = fraction(usdWh2BpSaldo, AUCTIONFEE, MULT6)
565565 if ((receivedFee >= (usdWh2BpSaldo - (3 * usdWh2BpFee))))
566566 then throw(("This trade does not cover delivery cost of " + fixedPoint(receivedFee, 6)))
567567 else {
568568 let refByKey = keyAddressRefBy(callerAddr)
569569 let refBy = getString(stakingContract, refByKey)
570570 let caller = addressFromStringValue(callerAddr)
571571 (((if (isDefined(refBy))
572572 then [ScriptTransfer(addressFromStringValue(value(refBy)), usdWh2BpFee, usdtAssetId)]
573573 else nil) :+ ScriptTransfer(caller, ((usdWh2BpSaldo - (3 * usdWh2BpFee)) - receivedFee), usdtAssetId)) :+ ScriptTransfer(restContract, usdWh2BpFee, usdtAssetId))
574574 }
575575 }
576576 else nil
577577
578578
579579 func user2shopActions (usdBp2WhSaldo,pmts,shopLandOwner,spentFee) = if ((usdBp2WhSaldo > 0))
580580 then if ((size(pmts) != 1))
581581 then throw("exactly 1 payment must be attached")
582582 else {
583583 let pmt = pmts[0]
584584 let amt = pmt.amount
585585 if (if (!(isDefined(pmt.assetId)))
586586 then true
587587 else (value(pmt.assetId) != usdtAssetId))
588588 then throw("USDT payments only!")
589589 else {
590590 let usdtSpentWithFee = (usdBp2WhSaldo + spentFee)
591591 if ((amt != usdtSpentWithFee))
592592 then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdBp2WhSaldo, 6)) + "+") + fixedPoint(spentFee, 6)) + "(delivery fee)"))
593593 else if ((MINSHOPPAYMENT > usdBp2WhSaldo))
594594 then throw(("Min shop trade is " + fixedPoint(MINSHOPPAYMENT, 6)))
595595 else {
596596 let usdBp2WhFee = fraction(usdBp2WhSaldo, AUCTIONFEE, MULT6)
597597 let refByKey = keyAddressRefBy(shopLandOwner)
598598 let refBy = getString(stakingContract, refByKey)
599599 (((if (isDefined(refBy))
600600 then [ScriptTransfer(addressFromStringValue(value(refBy)), usdBp2WhFee, usdtAssetId)]
601601 else nil) :+ ScriptTransfer(addressFromStringValue(shopLandOwner), (usdBp2WhSaldo - (3 * usdBp2WhFee)), usdtAssetId)) :+ ScriptTransfer(restContract, usdBp2WhFee, usdtAssetId))
602602 }
603603 }
604604 }
605605 else if ((size(pmts) != 0))
606606 then throw("No payments needed")
607607 else nil
608608
609609
610610 func acceptShopOrderCommon (shopLandAssetId,callerAddr,bpOrderStr,bpResList,bpMatList,bpProdList) = {
611611 let landAsset = value(assetInfo(fromBase58String(shopLandAssetId)))
612612 if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(shopLandAssetId)))))
613613 then throw((("NFT " + landAsset.name) + " is not staked"))
614614 else {
615615 let shopLandOwner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(shopLandAssetId)), (("NFT " + landAsset.name) + " is orphaned"))
616616 if ((shopLandOwner == callerAddr))
617617 then throw("You cannot trade with yourself")
618618 else {
619619 let bpOrderParts = split_4C(bpOrderStr, ":")
620620 if ((size(bpOrderParts) != 3))
621621 then throw("bpOrderStr should contain exactly 2 ':' separators")
622622 else {
623623 let bpOrdRes = split(bpOrderParts[0], "_")
624624 let bpOrdMat = split(bpOrderParts[1], "_")
625625 let bpOrdProd = if ((bpOrderParts[2] == ""))
626626 then nil
627627 else split_4C(bpOrderParts[2], "_")
628628 if ((size(bpOrdRes) != NUMRES))
629629 then throw("All 6 resources should be passed")
630630 else if ((size(bpOrdMat) != NUMRES))
631631 then throw("All 6 materials should be passed")
632632 else {
633633 let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [shopLandAssetId], nil))
634634 let currentWh = split_4C(wh, ":")
635635 let currWhRes = split(currentWh[whIdxRes], "_")
636636 let currWhMat = split(currentWh[whIdxMat], "_")
637637 let currWhProd = if ((currentWh[whIdxProd] == ""))
638638 then nil
639639 else split_4C(currentWh[whIdxProd], "_")
640640 let currWhLockedVol = parseIntValue(split(currentWh[whIdxLOFT], "_")[volLocked])
641641 let ordKey = keyOrderByLand(shopLandAssetId)
642642 let whOrd = getOrder(ordKey)
643643 let whOrdRes = split(whOrd[ordIdxRes], "_")
644644 let whOrdMat = split(whOrd[ordIdxMat], "_")
645645 let whOrdProd = if ((whOrd[ordIdxProd] == ""))
646646 then nil
647647 else split_4C(whOrd[ordIdxProd], "_")
648648 let r = {
649649 let $l = bpOrdRes
650650 let $s = size($l)
651651 let $acc0 = $Tuple13(nil, nil, nil, 0, 0, 0, 0, bpResList, currWhRes, whOrdRes, resTypes, false, 0)
652652 func $f0_1 ($a,$i) = if (($i >= $s))
653653 then $a
654654 else acceptCommon($a, $l[$i])
655655
656656 func $f0_2 ($a,$i) = if (($i >= $s))
657657 then $a
658658 else throw("List size exceeds 6")
659659
660660 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
661661 }
662662 let m = {
663663 let $l = bpOrdMat
664664 let $s = size($l)
665665 let $acc0 = $Tuple13(nil, nil, nil, r._4, r._5, r._6, 0, bpMatList, currWhMat, whOrdMat, matTypes, false, r._13)
666666 func $f1_1 ($a,$i) = if (($i >= $s))
667667 then $a
668668 else acceptCommon($a, $l[$i])
669669
670670 func $f1_2 ($a,$i) = if (($i >= $s))
671671 then $a
672672 else throw("List size exceeds 6")
673673
674674 $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
675675 }
676676 let p = if ((size(bpOrdProd) != 0))
677677 then {
678678 let $l = bpOrdProd
679679 let $s = size($l)
680680 let $acc0 = $Tuple13(nil, nil, nil, m._4, m._5, m._6, 0, bpProdList, currWhProd, whOrdProd, prodTypes, true, m._13)
681681 func $f2_1 ($a,$i) = if (($i >= $s))
682682 then $a
683683 else acceptCommon($a, $l[$i])
684684
685685 func $f2_2 ($a,$i) = if (($i >= $s))
686686 then $a
687687 else throw("List size exceeds 50")
688688
689689 $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)
690690 }
691691 else $Tuple13(currWhProd, whOrdProd, bpProdList, m._4, m._5, m._6, 0, bpProdList, currWhProd, whOrdProd, prodTypes, true, m._13)
692692 let volSaldo = p._4
693693 let newLockedVol = if ((0 > (currWhLockedVol - volSaldo)))
694694 then 0
695695 else (currWhLockedVol - volSaldo)
696696 let whStr = makeString_2C([currentWh[whIdxLevels], makeString(r._1, "_"), makeString(m._1, "_"), makeString_2C(p._1, "_"), toString(newLockedVol)], ":")
697697 let newWhOrdStr = makeString_2C([makeString(r._2, "_"), makeString(m._2, "_"), makeString_2C(p._2, "_")], ":")
698698 let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, shopLandAssetId], nil))
699699 let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [shopLandOwner, fraction(xpShop, p._13, MULT8)], nil))
700700 $Tuple10(StringEntry(ordKey, newWhOrdStr), r._3, m._3, p._3, p._5, p._6, p._13, shopLandOwner, whSave, accStatsResult)
701701 }
702702 }
703703 }
704704 }
705705 }
706706
707707
708708 func sellResourcesWorldInternal (amount) = {
709709 let oneRes = (amount / 30)
710710 let oneFactoryAmounts = [oneRes, oneRes, oneRes, oneRes, oneRes, oneRes]
711711 let s = toString(oneRes)
712712 let resList = [s, s, s, s, s, s]
713713 let minPrices = [0, 0, 0, 0, 0, 0]
714714 func oneFactory (acc,continent) = {
715715 let x = sellResourcesCommon(resList, continent, oneFactoryAmounts, minPrices)
716716 $Tuple3((acc._1 ++ x._1), (acc._2 + x._3), (acc._3 + x._4))
717717 }
718718
719- let $t02526125351 = {
719+ let $t02527025360 = {
720720 let $l = continents
721721 let $s = size($l)
722722 let $acc0 = $Tuple3(nil, 0, 0)
723723 func $f0_1 ($a,$i) = if (($i >= $s))
724724 then $a
725725 else oneFactory($a, $l[$i])
726726
727727 func $f0_2 ($a,$i) = if (($i >= $s))
728728 then $a
729729 else throw("List size exceeds 5")
730730
731731 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
732732 }
733- let factoryActions = $t02526125351._1
734- let usdtReceived = $t02526125351._2
735- let totalRes = $t02526125351._3
733+ let factoryActions = $t02527025360._1
734+ let usdtReceived = $t02527025360._2
735+ let totalRes = $t02527025360._3
736736 let fee = fraction(usdtReceived, DELIVERY_FEE, MULT6)
737737 let activitiesAmount = (usdtReceived / 100)
738738 let usdtLeft = ((usdtReceived - activitiesAmount) - fee)
739739 $Tuple5(factoryActions, usdtLeft, fee, activitiesAmount, totalRes)
740740 }
741741
742742
743743 @Callable(i)
744744 func recalcLockedVolumeREADONLY (landAssetId,wh) = {
745745 let currentOrd = getOrder(keyOrderByLand(landAssetId))
746746 let z = setInternal(wh, currentOrd, currentOrd)
747747 $Tuple2(nil, (z._4 + z._5))
748748 }
749749
750750
751751
752752 @Callable(i)
753753 func constructorV1 (restAddr) = if ((i.caller != this))
754754 then throw("Permission denied")
755755 else [StringEntry(keyRestAddress(), restAddr)]
756756
757757
758758
759759 @Callable(i)
760760 func sellResources (amounts,minPrices) = {
761761 let prologResult = prolog()
762- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
763- if ((size(i.payments) != 0))
764- then throw("sellResources doesn't require any payments")
765- else {
766- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
767- if ((curLocation[locIdxType] != "F"))
768- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
762+ if ((prologResult == prologResult))
763+ then {
764+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
765+ if ((size(i.payments) != 0))
766+ then throw("sellResources doesn't require any payments")
769767 else {
770- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
771- let resList = split(currentPack[bpIdxRes], "_")
772- let $t02680326929 = sellResourcesCommon(resList, curLocation[locIdxId], amounts, minPrices)
773- let factoryActions = $t02680326929._1
774- let newRes = $t02680326929._2
775- let usdtReceived = $t02680326929._3
776- let totalRes = $t02680326929._4
777- let activitiesAmount = (usdtReceived / 100)
778- let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
779- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
780- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
781- $Tuple2(((factoryActions :+ ScriptTransfer(i.caller, (usdtReceived - activitiesAmount), usdtAssetId)) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
768+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
769+ if ((curLocation[locIdxType] != "F"))
770+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
771+ else {
772+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
773+ let resList = split(currentPack[bpIdxRes], "_")
774+ let $t02681526941 = sellResourcesCommon(resList, curLocation[locIdxId], amounts, minPrices)
775+ let factoryActions = $t02681526941._1
776+ let newRes = $t02681526941._2
777+ let usdtReceived = $t02681526941._3
778+ let totalRes = $t02681526941._4
779+ let activitiesAmount = (usdtReceived / 100)
780+ let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
781+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
782+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
783+ $Tuple2(((factoryActions :+ ScriptTransfer(i.caller, (usdtReceived - activitiesAmount), usdtAssetId)) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
784+ }
782785 }
783786 }
787+ else throw("Strict value is not equal to itself.")
784788 }
785789
786790
787791
788792 @Callable(i)
789793 func sellResourcesWorld (addr,amount) = if ((i.caller != acresContract))
790794 then throw("Permission denied")
791795 else {
792- let $t02772127878 = sellResourcesWorldInternal(amount)
793- let factoryActions = $t02772127878._1
794- let usdtLeft = $t02772127878._2
795- let fee = $t02772127878._3
796- let activitiesAmount = $t02772127878._4
797- let totalRes = $t02772127878._5
796+ let $t02773327890 = sellResourcesWorldInternal(amount)
797+ let factoryActions = $t02773327890._1
798+ let usdtLeft = $t02773327890._2
799+ let fee = $t02773327890._3
800+ let activitiesAmount = $t02773327890._4
801+ let totalRes = $t02773327890._5
798802 if ((0 >= usdtLeft))
799803 then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
800804 else {
801805 let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalRes, MULT8)], nil))
802806 $Tuple2((((factoryActions :+ IntegerEntry(deliveryFundKey, (valueOrElse(getInteger(deliveryFundKey), 0) + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ ScriptTransfer(investFundContract, usdtLeft, usdtAssetId)), $Tuple2(usdtLeft, statsResult))
803807 }
804808 }
805809
806810
807811
808812 @Callable(i)
809813 func sellResourcesWorldREADONLY (amount) = {
810814 let usdtLeft = sellResourcesWorldInternal(amount)._2
811815 $Tuple2(nil, usdtLeft)
812816 }
813817
814818
815819
816820 @Callable(i)
817821 func sellResourcesDuckDelivery (amounts,minPrices,factoryContinent) = if (!(KS_ALLOW_DELIVERY))
818822 then throw("Delivery feature is turned off!")
819823 else {
820824 let prologResult = prolog()
821- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
822- if ((size(i.payments) != 0))
823- then throw("sellResources doesn't require any payments")
824- else {
825- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
826- let resList = split(currentPack[bpIdxRes], "_")
827- let $t02911129232 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
828- let factoryActions = $t02911129232._1
829- let newRes = $t02911129232._2
830- let usdtReceived = $t02911129232._3
831- let totalRes = $t02911129232._4
832- let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
833- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
834- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
835- let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
836- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
837- then MIN_USDT_FEE_DELIVERY
838- else feePart
839- let activitiesAmount = (usdtReceived / 100)
840- if ((fee >= (usdtReceived - activitiesAmount)))
841- then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
825+ if ((prologResult == prologResult))
826+ then {
827+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
828+ if ((size(i.payments) != 0))
829+ then throw("sellResources doesn't require any payments")
842830 else {
843- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
844- $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
831+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
832+ let resList = split(currentPack[bpIdxRes], "_")
833+ let $t02912629247 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
834+ let factoryActions = $t02912629247._1
835+ let newRes = $t02912629247._2
836+ let usdtReceived = $t02912629247._3
837+ let totalRes = $t02912629247._4
838+ let newPack = makeString_2C([currentPack[bpIdxLevel], makeString(newRes, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
839+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
840+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalRes, MULT8)], nil))
841+ let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
842+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
843+ then MIN_USDT_FEE_DELIVERY
844+ else feePart
845+ let activitiesAmount = (usdtReceived / 100)
846+ if ((fee >= (usdtReceived - activitiesAmount)))
847+ then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
848+ else {
849+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
850+ $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
851+ }
845852 }
846853 }
854+ else throw("Strict value is not equal to itself.")
847855 }
848856
849857
850858
851859 @Callable(i)
852860 func sellResourcesLandDelivery (amounts,minPrices,landAssetId,factoryContinent) = if (!(KS_ALLOW_DELIVERY))
853861 then throw("Delivery feature is turned off!")
854862 else {
855863 let prologResult = prolog()
856- if ((size(i.payments) != 0))
857- then throw("sellResources doesn't require any payments")
858- else {
859- let user = i.caller
860- let addr = toString(user)
861- let asset = value(assetInfo(fromBase58String(landAssetId)))
862- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
863- then throw((("NFT " + asset.name) + " is not staked"))
864- else {
865- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
866- if ((owner != addr))
867- then throw((LANDPREFIX + " is not yours"))
868- else {
869- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
870- let currentWh = split_4C(wh, ":")
871- let resList = split(currentWh[whIdxRes], "_")
872- let $t03125931380 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
873- let factoryActions = $t03125931380._1
874- let newRes = $t03125931380._2
875- let usdtReceived = $t03125931380._3
876- let totalRes = $t03125931380._4
877- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), currentWh[whIdxMat], currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
878- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
879- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalRes, MULT8)], nil))
880- let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
881- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
882- then MIN_USDT_FEE_DELIVERY
883- else feePart
884- let activitiesAmount = (usdtReceived / 100)
885- if ((fee >= (usdtReceived - activitiesAmount)))
886- then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
887- else {
888- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
889- $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(whSave, prologResult, statsResult))
890- }
891- }
892- }
893- }
864+ if ((prologResult == prologResult))
865+ then if ((size(i.payments) != 0))
866+ then throw("sellResources doesn't require any payments")
867+ else {
868+ let user = i.caller
869+ let addr = toString(user)
870+ let asset = value(assetInfo(fromBase58String(landAssetId)))
871+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
872+ then throw((("NFT " + asset.name) + " is not staked"))
873+ else {
874+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
875+ if ((owner != addr))
876+ then throw((LANDPREFIX + " is not yours"))
877+ else {
878+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
879+ let currentWh = split_4C(wh, ":")
880+ let resList = split(currentWh[whIdxRes], "_")
881+ let $t03127731398 = sellResourcesCommon(resList, factoryContinent, amounts, minPrices)
882+ let factoryActions = $t03127731398._1
883+ let newRes = $t03127731398._2
884+ let usdtReceived = $t03127731398._3
885+ let totalRes = $t03127731398._4
886+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), currentWh[whIdxMat], currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
887+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
888+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalRes, MULT8)], nil))
889+ let feePart = fraction(usdtReceived, DELIVERY_FEE, MULT6)
890+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
891+ then MIN_USDT_FEE_DELIVERY
892+ else feePart
893+ let activitiesAmount = (usdtReceived / 100)
894+ if ((fee >= (usdtReceived - activitiesAmount)))
895+ then throw(("This trade does not cover delivery cost of " + fixedPoint(fee, 6)))
896+ else {
897+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
898+ $Tuple2((((factoryActions :+ ScriptTransfer(i.caller, ((usdtReceived - activitiesAmount) - fee), usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(whSave, prologResult, statsResult))
899+ }
900+ }
901+ }
902+ }
903+ else throw("Strict value is not equal to itself.")
894904 }
895905
896906
897907
898908 @Callable(i)
899909 func buyMaterials (amounts,maxPrices) = {
900910 let prologResult = prolog()
901- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
902- if ((size(i.payments) != 1))
903- then throw("exactly 1 payment must be attached")
904- else {
905- let pmt = i.payments[0]
906- let amt = pmt.amount
907- if (if (!(isDefined(pmt.assetId)))
908- then true
909- else (value(pmt.assetId) != usdtAssetId))
910- then throw("USDT payments only!")
911+ if ((prologResult == prologResult))
912+ then {
913+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
914+ if ((size(i.payments) != 1))
915+ then throw("exactly 1 payment must be attached")
911916 else {
912- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
913- if ((curLocation[locIdxType] != "F"))
914- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
917+ let pmt = i.payments[0]
918+ let amt = pmt.amount
919+ if (if (!(isDefined(pmt.assetId)))
920+ then true
921+ else (value(pmt.assetId) != usdtAssetId))
922+ then throw("USDT payments only!")
915923 else {
916- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
917- let matList = split(currentPack[bpIdxMat], "_")
918- let $t03324033362 = buyMaterialsCommon(matList, curLocation[locIdxId], amounts, maxPrices)
919- let factoryActions = $t03324033362._1
920- let newMat = $t03324033362._2
921- let usdtSpent = $t03324033362._3
922- let totalMat = $t03324033362._4
923- if ((usdtSpent > amt))
924- then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
924+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
925+ if ((curLocation[locIdxType] != "F"))
926+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
925927 else {
926- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
927- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
928- let rest = if (((amt - usdtSpent) > 0))
929- then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
930- else nil
931- let activitiesAmount = (usdtSpent / 100)
932- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
933- $Tuple2(((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
928+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
929+ let matList = split(currentPack[bpIdxMat], "_")
930+ let $t03326133383 = buyMaterialsCommon(matList, curLocation[locIdxId], amounts, maxPrices)
931+ let factoryActions = $t03326133383._1
932+ let newMat = $t03326133383._2
933+ let usdtSpent = $t03326133383._3
934+ let totalMat = $t03326133383._4
935+ if ((usdtSpent > amt))
936+ then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
937+ else {
938+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
939+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
940+ let rest = if (((amt - usdtSpent) > 0))
941+ then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
942+ else nil
943+ let activitiesAmount = (usdtSpent / 100)
944+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
945+ $Tuple2(((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
946+ }
934947 }
935948 }
936949 }
937950 }
951+ else throw("Strict value is not equal to itself.")
938952 }
939953
940954
941955
942956 @Callable(i)
943957 func buyMaterialsDuckDelivery (amounts,maxPrices,factoryContinent) = if (!(KS_ALLOW_DELIVERY))
944958 then throw("Delivery feature is turned off!")
945959 else {
946960 let prologResult = prolog()
947- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
948- if ((size(i.payments) != 1))
949- then throw("exactly 1 payment must be attached")
950- else {
951- let pmt = i.payments[0]
952- let amt = pmt.amount
953- if (if (!(isDefined(pmt.assetId)))
954- then true
955- else (value(pmt.assetId) != usdtAssetId))
956- then throw("USDT payments only!")
961+ if ((prologResult == prologResult))
962+ then {
963+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
964+ if ((size(i.payments) != 1))
965+ then throw("exactly 1 payment must be attached")
957966 else {
958- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
959- let matList = split(currentPack[bpIdxMat], "_")
960- let $t03488034997 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
961- let factoryActions = $t03488034997._1
962- let newMat = $t03488034997._2
963- let usdtSpent = $t03488034997._3
964- let totalMat = $t03488034997._4
965- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
966- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
967- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
968- let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
969- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
970- then MIN_USDT_FEE_DELIVERY
971- else feePart
972- let usdtSpentWithFee = (usdtSpent + fee)
973- if ((usdtSpentWithFee > amt))
974- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
967+ let pmt = i.payments[0]
968+ let amt = pmt.amount
969+ if (if (!(isDefined(pmt.assetId)))
970+ then true
971+ else (value(pmt.assetId) != usdtAssetId))
972+ then throw("USDT payments only!")
975973 else {
976- let rest = if (((amt - usdtSpentWithFee) > 0))
977- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
978- else nil
979- let activitiesAmount = (usdtSpent / 100)
980- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
981- $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
974+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
975+ let matList = split(currentPack[bpIdxMat], "_")
976+ let $t03490435021 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
977+ let factoryActions = $t03490435021._1
978+ let newMat = $t03490435021._2
979+ let usdtSpent = $t03490435021._3
980+ let totalMat = $t03490435021._4
981+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
982+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
983+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalMat, MULT8)], nil))
984+ let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
985+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
986+ then MIN_USDT_FEE_DELIVERY
987+ else feePart
988+ let usdtSpentWithFee = (usdtSpent + fee)
989+ if ((usdtSpentWithFee > amt))
990+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
991+ else {
992+ let rest = if (((amt - usdtSpentWithFee) > 0))
993+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
994+ else nil
995+ let activitiesAmount = (usdtSpent / 100)
996+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
997+ $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
998+ }
982999 }
9831000 }
9841001 }
1002+ else throw("Strict value is not equal to itself.")
9851003 }
9861004
9871005
9881006
9891007 @Callable(i)
9901008 func buyMaterialsLandDelivery (amounts,maxPrices,landAssetId,factoryContinent) = if (!(KS_ALLOW_DELIVERY))
9911009 then throw("Delivery feature is turned off!")
9921010 else {
9931011 let prologResult = prolog()
994- if ((size(i.payments) != 1))
995- then throw("exactly 1 payment must be attached")
996- else {
997- let pmt = i.payments[0]
998- let amt = pmt.amount
999- if (if (!(isDefined(pmt.assetId)))
1000- then true
1001- else (value(pmt.assetId) != usdtAssetId))
1002- then throw("USDT payments only!")
1003- else {
1004- let user = i.caller
1005- let addr = toString(user)
1006- let asset = value(assetInfo(fromBase58String(landAssetId)))
1007- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1008- then throw((("NFT " + asset.name) + " is not staked"))
1009- else {
1010- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1011- if ((owner != addr))
1012- then throw((LANDPREFIX + " is not yours"))
1013- else {
1014- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1015- let currentWh = split_4C(wh, ":")
1016- let matList = split(currentWh[whIdxMat], "_")
1017- let $t03727537392 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
1018- let factoryActions = $t03727537392._1
1019- let newMat = $t03727537392._2
1020- let usdtSpent = $t03727537392._3
1021- let totalMat = $t03727537392._4
1022- let whStr = makeString_2C([currentWh[whIdxLevels], currentWh[whIdxRes], makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1023- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1024- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalMat, MULT8)], nil))
1025- let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
1026- let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
1027- then MIN_USDT_FEE_DELIVERY
1028- else feePart
1029- let usdtSpentWithFee = (usdtSpent + fee)
1030- if ((usdtSpentWithFee > amt))
1031- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1032- else {
1033- let rest = if (((amt - usdtSpentWithFee) > 0))
1034- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1035- else nil
1036- let activitiesAmount = (usdtSpent / 100)
1037- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1038- $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1039- }
1040- }
1041- }
1042- }
1043- }
1012+ if ((prologResult == prologResult))
1013+ then if ((size(i.payments) != 1))
1014+ then throw("exactly 1 payment must be attached")
1015+ else {
1016+ let pmt = i.payments[0]
1017+ let amt = pmt.amount
1018+ if (if (!(isDefined(pmt.assetId)))
1019+ then true
1020+ else (value(pmt.assetId) != usdtAssetId))
1021+ then throw("USDT payments only!")
1022+ else {
1023+ let user = i.caller
1024+ let addr = toString(user)
1025+ let asset = value(assetInfo(fromBase58String(landAssetId)))
1026+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1027+ then throw((("NFT " + asset.name) + " is not staked"))
1028+ else {
1029+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1030+ if ((owner != addr))
1031+ then throw((LANDPREFIX + " is not yours"))
1032+ else {
1033+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1034+ let currentWh = split_4C(wh, ":")
1035+ let matList = split(currentWh[whIdxMat], "_")
1036+ let $t03730237419 = buyMaterialsCommon(matList, factoryContinent, amounts, maxPrices)
1037+ let factoryActions = $t03730237419._1
1038+ let newMat = $t03730237419._2
1039+ let usdtSpent = $t03730237419._3
1040+ let totalMat = $t03730237419._4
1041+ let whStr = makeString_2C([currentWh[whIdxLevels], currentWh[whIdxRes], makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1042+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1043+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalMat, MULT8)], nil))
1044+ let feePart = fraction(usdtSpent, DELIVERY_FEE, MULT6)
1045+ let fee = if ((MIN_USDT_FEE_DELIVERY > feePart))
1046+ then MIN_USDT_FEE_DELIVERY
1047+ else feePart
1048+ let usdtSpentWithFee = (usdtSpent + fee)
1049+ if ((usdtSpentWithFee > amt))
1050+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1051+ else {
1052+ let rest = if (((amt - usdtSpentWithFee) > 0))
1053+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1054+ else nil
1055+ let activitiesAmount = (usdtSpent / 100)
1056+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1057+ $Tuple2((((factoryActions ++ rest) :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1058+ }
1059+ }
1060+ }
1061+ }
1062+ }
1063+ else throw("Strict value is not equal to itself.")
10441064 }
10451065
10461066
10471067
10481068 @Callable(i)
10491069 func exchangeResources (amounts) = {
10501070 let prologResult = prolog()
1051- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1052- if ((size(i.payments) != 1))
1053- then throw("exactly 1 payment must be attached")
1054- else {
1055- let pmt = i.payments[0]
1056- let amt = pmt.amount
1057- if (if (!(isDefined(pmt.assetId)))
1058- then true
1059- else (value(pmt.assetId) != usdtAssetId))
1060- then throw("USDT payments only!")
1071+ if ((prologResult == prologResult))
1072+ then {
1073+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1074+ if ((size(i.payments) != 1))
1075+ then throw("exactly 1 payment must be attached")
10611076 else {
1062- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1063- if ((curLocation[locIdxType] != "F"))
1064- then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
1077+ let pmt = i.payments[0]
1078+ let amt = pmt.amount
1079+ if (if (!(isDefined(pmt.assetId)))
1080+ then true
1081+ else (value(pmt.assetId) != usdtAssetId))
1082+ then throw("USDT payments only!")
10651083 else {
1066- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1067- let resList = split(currentPack[bpIdxRes], "_")
1068- let matList = split(currentPack[bpIdxMat], "_")
1069- let $t03950639612 = exchangeResourcesCommon(resList, matList, amounts)
1070- let newRes = $t03950639612._1
1071- let newMat = $t03950639612._2
1072- let usdtSpent = $t03950639612._3
1073- let totalAmountConverted = $t03950639612._4
1074- if ((usdtSpent > amt))
1075- then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
1084+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1085+ if ((curLocation[locIdxType] != "F"))
1086+ then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType]))
10761087 else {
1077- let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1078- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1079- let rest = if (((amt - usdtSpent) > 0))
1080- then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
1081- else nil
1082- let activitiesAmount = (usdtSpent / 100)
1083- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1084- $Tuple2((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
1088+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1089+ let resList = split(currentPack[bpIdxRes], "_")
1090+ let matList = split(currentPack[bpIdxMat], "_")
1091+ let $t03953639642 = exchangeResourcesCommon(resList, matList, amounts)
1092+ let newRes = $t03953639642._1
1093+ let newMat = $t03953639642._2
1094+ let usdtSpent = $t03953639642._3
1095+ let totalAmountConverted = $t03953639642._4
1096+ if ((usdtSpent > amt))
1097+ then throw(((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)))
1098+ else {
1099+ let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1100+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1101+ let rest = if (((amt - usdtSpent) > 0))
1102+ then [ScriptTransfer(i.caller, (amt - usdtSpent), usdtAssetId)]
1103+ else nil
1104+ let activitiesAmount = (usdtSpent / 100)
1105+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1106+ $Tuple2((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)), $Tuple3(backpackResult, prologResult, statsResult))
1107+ }
10851108 }
10861109 }
10871110 }
10881111 }
1112+ else throw("Strict value is not equal to itself.")
10891113 }
10901114
10911115
10921116
10931117 @Callable(i)
10941118 func exchangeResourcesDuckDelivery (amounts) = if (!(KS_ALLOW_DELIVERY))
10951119 then throw("Delivery feature is turned off!")
10961120 else {
10971121 let prologResult = prolog()
1098- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1099- if ((size(i.payments) != 1))
1100- then throw("exactly 1 payment must be attached")
1101- else {
1102- let pmt = i.payments[0]
1103- let amt = pmt.amount
1104- if (if (!(isDefined(pmt.assetId)))
1105- then true
1106- else (value(pmt.assetId) != usdtAssetId))
1107- then throw("USDT payments only!")
1122+ if ((prologResult == prologResult))
1123+ then {
1124+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1125+ if ((size(i.payments) != 1))
1126+ then throw("exactly 1 payment must be attached")
11081127 else {
1109- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1110- let resList = split(currentPack[bpIdxRes], "_")
1111- let matList = split(currentPack[bpIdxMat], "_")
1112- let $t04112441230 = exchangeResourcesCommon(resList, matList, amounts)
1113- let newRes = $t04112441230._1
1114- let newMat = $t04112441230._2
1115- let usdtSpent = $t04112441230._3
1116- let totalAmountConverted = $t04112441230._4
1117- let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1118- let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1119- then MIN_USDT_FEE_DELIVERY15
1120- else feePart
1121- let usdtSpentWithFee = (usdtSpent + fee)
1122- if ((usdtSpentWithFee > amt))
1123- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1128+ let pmt = i.payments[0]
1129+ let amt = pmt.amount
1130+ if (if (!(isDefined(pmt.assetId)))
1131+ then true
1132+ else (value(pmt.assetId) != usdtAssetId))
1133+ then throw("USDT payments only!")
11241134 else {
1125- let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1126- let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1127- let rest = if (((amt - usdtSpentWithFee) > 0))
1128- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1129- else nil
1130- let activitiesAmount = (usdtSpent / 100)
1131- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1132- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1133- $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
1135+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1136+ let resList = split(currentPack[bpIdxRes], "_")
1137+ let matList = split(currentPack[bpIdxMat], "_")
1138+ let $t04115741263 = exchangeResourcesCommon(resList, matList, amounts)
1139+ let newRes = $t04115741263._1
1140+ let newMat = $t04115741263._2
1141+ let usdtSpent = $t04115741263._3
1142+ let totalAmountConverted = $t04115741263._4
1143+ let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1144+ let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1145+ then MIN_USDT_FEE_DELIVERY15
1146+ else feePart
1147+ let usdtSpentWithFee = (usdtSpent + fee)
1148+ if ((usdtSpentWithFee > amt))
1149+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1150+ else {
1151+ let newPack = makeString([currentPack[bpIdxLevel], makeString(newRes, "_"), makeString(newMat, "_"), currentPack[bpIdxProd]], ":")
1152+ let backpackResult = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1153+ let rest = if (((amt - usdtSpentWithFee) > 0))
1154+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1155+ else nil
1156+ let activitiesAmount = (usdtSpent / 100)
1157+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1158+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1159+ $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(backpackResult, prologResult, statsResult))
1160+ }
11341161 }
11351162 }
11361163 }
1164+ else throw("Strict value is not equal to itself.")
11371165 }
11381166
11391167
11401168
11411169 @Callable(i)
11421170 func exchangeResourcesLandDelivery (amounts,landAssetId) = if (!(KS_ALLOW_DELIVERY))
11431171 then throw("Delivery feature is turned off!")
11441172 else {
11451173 let prologResult = prolog()
1146- if ((size(i.payments) != 1))
1147- then throw("exactly 1 payment must be attached")
1148- else {
1149- let pmt = i.payments[0]
1150- let amt = pmt.amount
1151- if (if (!(isDefined(pmt.assetId)))
1152- then true
1153- else (value(pmt.assetId) != usdtAssetId))
1154- then throw("USDT payments only!")
1155- else {
1156- let user = i.caller
1157- let addr = toString(user)
1158- let asset = value(assetInfo(fromBase58String(landAssetId)))
1159- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1160- then throw((("NFT " + asset.name) + " is not staked"))
1161- else {
1162- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1163- if ((owner != addr))
1164- then throw((LANDPREFIX + " is not yours"))
1165- else {
1166- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1167- let currentWh = split_4C(wh, ":")
1168- let resList = split(currentWh[whIdxRes], "_")
1169- let matList = split(currentWh[whIdxMat], "_")
1170- let $t04353043636 = exchangeResourcesCommon(resList, matList, amounts)
1171- let newRes = $t04353043636._1
1172- let newMat = $t04353043636._2
1173- let usdtSpent = $t04353043636._3
1174- let totalAmountConverted = $t04353043636._4
1175- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1176- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1177- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1178- let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1179- let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1180- then MIN_USDT_FEE_DELIVERY15
1181- else feePart
1182- let usdtSpentWithFee = (usdtSpent + fee)
1183- if ((usdtSpentWithFee > amt))
1184- then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1185- else {
1186- let rest = if (((amt - usdtSpentWithFee) > 0))
1187- then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1188- else nil
1189- let activitiesAmount = (usdtSpent / 100)
1190- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1191- $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1192- }
1193- }
1194- }
1195- }
1196- }
1174+ if ((prologResult == prologResult))
1175+ then if ((size(i.payments) != 1))
1176+ then throw("exactly 1 payment must be attached")
1177+ else {
1178+ let pmt = i.payments[0]
1179+ let amt = pmt.amount
1180+ if (if (!(isDefined(pmt.assetId)))
1181+ then true
1182+ else (value(pmt.assetId) != usdtAssetId))
1183+ then throw("USDT payments only!")
1184+ else {
1185+ let user = i.caller
1186+ let addr = toString(user)
1187+ let asset = value(assetInfo(fromBase58String(landAssetId)))
1188+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
1189+ then throw((("NFT " + asset.name) + " is not staked"))
1190+ else {
1191+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
1192+ if ((owner != addr))
1193+ then throw((LANDPREFIX + " is not yours"))
1194+ else {
1195+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
1196+ let currentWh = split_4C(wh, ":")
1197+ let resList = split(currentWh[whIdxRes], "_")
1198+ let matList = split(currentWh[whIdxMat], "_")
1199+ let $t04356643672 = exchangeResourcesCommon(resList, matList, amounts)
1200+ let newRes = $t04356643672._1
1201+ let newMat = $t04356643672._2
1202+ let usdtSpent = $t04356643672._3
1203+ let totalAmountConverted = $t04356643672._4
1204+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newRes, "_"), makeString(newMat, "_"), currentWh[whIdxProd], currentWh[whIdxLOFT]], ":")
1205+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
1206+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, fraction(xpTrade, totalAmountConverted, MULT8)], nil))
1207+ let feePart = fraction(usdtSpent, DELIVERY_FEE15, MULT6)
1208+ let fee = if ((MIN_USDT_FEE_DELIVERY15 > feePart))
1209+ then MIN_USDT_FEE_DELIVERY15
1210+ else feePart
1211+ let usdtSpentWithFee = (usdtSpent + fee)
1212+ if ((usdtSpentWithFee > amt))
1213+ then throw((((((("Insufficient payment! Attached=" + fixedPoint(amt, 6)) + ", required=") + fixedPoint(usdtSpent, 6)) + "+") + fixedPoint(fee, 6)) + "(delivery fee)"))
1214+ else {
1215+ let rest = if (((amt - usdtSpentWithFee) > 0))
1216+ then [ScriptTransfer(i.caller, (amt - usdtSpentWithFee), usdtAssetId)]
1217+ else nil
1218+ let activitiesAmount = (usdtSpent / 100)
1219+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1220+ $Tuple2(((rest :+ ScriptTransfer(restContract, activitiesAmount, usdtAssetId)) :+ IntegerEntry(deliveryFundKey, (fundTotal + fee))), $Tuple3(whSave, prologResult, statsResult))
1221+ }
1222+ }
1223+ }
1224+ }
1225+ }
1226+ else throw("Strict value is not equal to itself.")
11971227 }
11981228
11991229
12001230
12011231 @Callable(i)
12021232 func craftGoods (productIdx,quantity) = {
12031233 let prologResult = prolog()
1204- if ((size(i.payments) != 1))
1205- then throw("exactly 1 payment must be attached")
1206- else {
1207- let pmt = i.payments[0]
1208- let amt = pmt.amount
1209- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
1210- if ((pmtAssetId != usdtAssetId))
1211- then throw("USDT payments only!")
1212- else if ((amt != MULT6))
1213- then throw("exactly 1 USDT must be attached as payment")
1214- else if ((0 >= quantity))
1215- then throw("Quantity should be positive")
1216- else {
1217- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1218- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1219- if ((curLocation[locIdxType] != "M"))
1220- then throw(("Duck location type should be Manufactory, but is " + curLocation[locIdxType]))
1221- else {
1222- let cont = curLocation[locIdxContinent]
1223- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1224- let matList = split(currentPack[bpIdxMat], "_")
1225- if (if ((0 > productIdx))
1226- then true
1227- else (productIdx >= size(productionMatrix)))
1228- then throw(("Unknown product idx=" + toString(productIdx)))
1229- else {
1230- let recipe = split(productionMatrix[productIdx], "_")
1231- if ((size(recipe) != RECIPESIZE))
1232- then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx]))
1233- else {
1234- let productContIdx = parseIntValue(recipe[rIdxContinent])
1235- if ((continents[productContIdx] != cont))
1236- then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont))
1237- else {
1238- let prodList = if ((currentPack[bpIdxProd] == ""))
1239- then nil
1240- else split_4C(currentPack[bpIdxProd], "_")
1241- func filler (acc,ignoredItem) = {
1242- let n = acc._2
1243- let xs = if ((size(prodList) > n))
1244- then prodList[n]
1245- else "0"
1246- let x = parseIntValue(xs)
1247- let amount = (quantity * PRODUCTPKGSIZE)
1248- let y = if ((n == productIdx))
1249- then toString((x + amount))
1250- else xs
1251- $Tuple2((acc._1 :+ y), (n + 1))
1252- }
1234+ if ((prologResult == prologResult))
1235+ then if ((size(i.payments) != 1))
1236+ then throw("exactly 1 payment must be attached")
1237+ else {
1238+ let pmt = i.payments[0]
1239+ let amt = pmt.amount
1240+ let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
1241+ if ((pmtAssetId != usdtAssetId))
1242+ then throw("USDT payments only!")
1243+ else if ((amt != MULT6))
1244+ then throw("exactly 1 USDT must be attached as payment")
1245+ else if ((0 >= quantity))
1246+ then throw("Quantity should be positive")
1247+ else {
1248+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1249+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1250+ if ((curLocation[locIdxType] != "M"))
1251+ then throw(("Duck location type should be Manufactory, but is " + curLocation[locIdxType]))
1252+ else {
1253+ let cont = curLocation[locIdxContinent]
1254+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1255+ let matList = split(currentPack[bpIdxMat], "_")
1256+ if (if ((0 > productIdx))
1257+ then true
1258+ else (productIdx >= size(productionMatrix)))
1259+ then throw(("Unknown product idx=" + toString(productIdx)))
1260+ else {
1261+ let recipe = split(productionMatrix[productIdx], "_")
1262+ if ((size(recipe) != RECIPESIZE))
1263+ then throw(("Fatal: unknown recipe: " + productionMatrix[productIdx]))
1264+ else {
1265+ let productContIdx = parseIntValue(recipe[rIdxContinent])
1266+ if ((continents[productContIdx] != cont))
1267+ then throw(((("This product is available in " + continents[productContIdx]) + ", but you are in ") + cont))
1268+ else {
1269+ let prodList = if ((currentPack[bpIdxProd] == ""))
1270+ then nil
1271+ else split_4C(currentPack[bpIdxProd], "_")
1272+ func filler (acc,ignoredItem) = {
1273+ let n = acc._2
1274+ let xs = if ((size(prodList) > n))
1275+ then prodList[n]
1276+ else "0"
1277+ let x = parseIntValue(xs)
1278+ let amount = (quantity * PRODUCTPKGSIZE)
1279+ let y = if ((n == productIdx))
1280+ then toString((x + amount))
1281+ else xs
1282+ $Tuple2((acc._1 :+ y), (n + 1))
1283+ }
12531284
1254- let bpProd = ( let $l = productionMatrix
1255- let $s = size($l)
1256- let $acc0 = $Tuple2(nil, 0)
1257- func $f0_1 ($a,$i) = if (($i >= $s))
1258- then $a
1259- else filler($a, $l[$i])
1260-
1261- func $f0_2 ($a,$i) = if (($i >= $s))
1262- then $a
1263- else throw("List size exceeds 50")
1264-
1265- $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
1266- func producer (acc,j) = {
1267- let needMat = (((parseIntValue(recipe[j]) * MULT5) * quantity) * parseIntValue(recipe[rIdxCoeff]))
1268- let haveMat = parseIntValue(matList[j])
1269- if ((needMat > haveMat))
1270- then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity)))
1271- else if ((needMat > 0))
1272- then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat))
1273- else $Tuple2((acc._1 :+ matList[j]), acc._2)
1274- }
1275-
1276- let merged = {
1277- let $l = ITER6
1285+ let bpProd = ( let $l = productionMatrix
12781286 let $s = size($l)
12791287 let $acc0 = $Tuple2(nil, 0)
1280- func $f1_1 ($a,$i) = if (($i >= $s))
1288+ func $f0_1 ($a,$i) = if (($i >= $s))
12811289 then $a
1282- else producer($a, $l[$i])
1290+ else filler($a, $l[$i])
12831291
1284- func $f1_2 ($a,$i) = if (($i >= $s))
1292+ func $f0_2 ($a,$i) = if (($i >= $s))
12851293 then $a
1286- else throw("List size exceeds 6")
1294+ else throw("List size exceeds 50")
12871295
1288- $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
1296+ $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
1297+ func producer (acc,j) = {
1298+ let needMat = (((parseIntValue(recipe[j]) * MULT5) * quantity) * parseIntValue(recipe[rIdxCoeff]))
1299+ let haveMat = parseIntValue(matList[j])
1300+ if ((needMat > haveMat))
1301+ then throw(((((((("You have " + fixedPoint(haveMat, 8)) + " of ") + matTypes[j]) + ", but recipe requires ") + fixedPoint(needMat, 8)) + " for quantity ") + toString(quantity)))
1302+ else if ((needMat > 0))
1303+ then $Tuple2((acc._1 :+ toString((haveMat - needMat))), (acc._2 + needMat))
1304+ else $Tuple2((acc._1 :+ matList[j]), acc._2)
1305+ }
1306+
1307+ let merged = {
1308+ let $l = ITER6
1309+ let $s = size($l)
1310+ let $acc0 = $Tuple2(nil, 0)
1311+ func $f1_1 ($a,$i) = if (($i >= $s))
1312+ then $a
1313+ else producer($a, $l[$i])
1314+
1315+ func $f1_2 ($a,$i) = if (($i >= $s))
1316+ then $a
1317+ else throw("List size exceeds 6")
1318+
1319+ $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6)
1320+ }
1321+ let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._1, "_"), makeString_2C(bpProd, "_")], ":")
1322+ let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1323+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpCraft, merged._2, MULT8)], nil))
1324+ $Tuple2(nil, $Tuple3(result, prologResult, statsResult))
12891325 }
1290- let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._1, "_"), makeString_2C(bpProd, "_")], ":")
1291- let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil))
1292- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpCraft, merged._2, MULT8)], nil))
1293- $Tuple2(nil, $Tuple3(result, prologResult, statsResult))
1294- }
1295- }
1296- }
1297- }
1298- }
1299- }
1326+ }
1327+ }
1328+ }
1329+ }
1330+ }
1331+ else throw("Strict value is not equal to itself.")
13001332 }
13011333
13021334
13031335
13041336 @Callable(i)
13051337 func setWarehouseOrder (newOrderStr,landAssetId) = {
13061338 let user = i.originCaller
13071339 let addr = toString(user)
13081340 let result = if ((user != restContract))
13091341 then checkBlocked()
13101342 else false
13111343 let asset = value(assetInfo(fromBase58String(landAssetId)))
13121344 if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(landAssetId)))))
13131345 then throw((("NFT " + asset.name) + " is not staked"))
13141346 else {
13151347 let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
13161348 if (if ((user != restContract))
13171349 then (owner != addr)
13181350 else false)
13191351 then throw((LANDPREFIX + " is not yours"))
13201352 else {
13211353 let newOrder = split_4C(newOrderStr, ":")
13221354 let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [landAssetId], nil))
13231355 let currentWh = split_4C(wh, ":")
13241356 let loft = split(currentWh[whIdxLOFT], "_")
13251357 let whTotal = parseIntValue(loft[volTotal])
13261358 let ordKey = keyOrderByLand(landAssetId)
13271359 let currentOrd = getOrder(ordKey)
13281360 let z = setInternal(currentWh, currentOrd, newOrder)
13291361 let buyVolSaldo = z._4
13301362 let sellVolSaldo = z._5
13311363 let whOccupied = z._7
13321364 let whLocked = (buyVolSaldo + sellVolSaldo)
13331365 let whFree = ((whTotal - whOccupied) - whLocked)
13341366 if ((0 > whFree))
13351367 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"))
13361368 else {
13371369 let whStr = makeString_2C([currentWh[whIdxLevels], makeString(z._1, "_"), makeString(z._2, "_"), makeString_2C(z._3, "_"), toString(whLocked)], ":")
13381370 let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, landAssetId], nil))
13391371 let usdSaldo = z._6
13401372 let actions = if ((usdSaldo > 0))
13411373 then if ((size(i.payments) != 1))
13421374 then throw("exactly 1 payment must be attached")
13431375 else {
13441376 let pmt = i.payments[0]
13451377 let amt = pmt.amount
13461378 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
13471379 if ((pmtAssetId != usdtAssetId))
13481380 then throw("USDT payments only!")
13491381 else if ((amt != usdSaldo))
13501382 then throw(("Payment needed is " + toString(usdSaldo)))
13511383 else [StringEntry(ordKey, newOrderStr)]
13521384 }
13531385 else if ((usdSaldo == 0))
13541386 then if ((size(i.payments) != 0))
13551387 then throw("No payments needed")
13561388 else [StringEntry(ordKey, newOrderStr)]
13571389 else if ((size(i.payments) != 0))
13581390 then throw("No payments needed")
13591391 else [ScriptTransfer(addressFromStringValue(owner), -(usdSaldo), usdtAssetId), StringEntry(ordKey, newOrderStr)]
13601392 $Tuple2(actions, $Tuple2(result, whSave))
13611393 }
13621394 }
13631395 }
13641396 }
13651397
13661398
13671399
13681400 @Callable(i)
13691401 func acceptWarehouseOrder (bpOrderStr,shopLandAssetId,duckAssetId) = {
13701402 let prologResult = prolog()
1371- let caller = i.originCaller
1372- let callerAddr = toString(caller)
1373- let stakedDuckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1374- let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(stakedDuckAssetId)), DEFAULTLOCATION)
1375- let loc = split(value(curLocation), "_")
1376- if ((loc[locIdxType] != "L"))
1377- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
1378- else if ((stakedDuckAssetId != duckAssetId))
1379- then throw(((("Your staked duck is " + stakedDuckAssetId) + ", but passed ") + duckAssetId))
1380- else {
1381- let bpKey = keyBackpackByDuck(duckAssetId)
1382- let currentPack = getBackpack(bpKey)
1383- let bpResList = split(currentPack[bpIdxRes], "_")
1384- let bpMatList = split(currentPack[bpIdxMat], "_")
1385- let bpProdList = if ((currentPack[bpIdxProd] == ""))
1386- then nil
1387- else split_4C(currentPack[bpIdxProd], "_")
1388- let $t05314853388 = acceptShopOrderCommon(shopLandAssetId, callerAddr, bpOrderStr, bpResList, bpMatList, bpProdList)
1389- let shopAction = $t05314853388._1
1390- let newUserRes = $t05314853388._2
1391- let newUserMat = $t05314853388._3
1392- let newUserProd = $t05314853388._4
1393- let usdWh2BpSaldo = $t05314853388._5
1394- let usdBp2WhSaldo = $t05314853388._6
1395- let xpAmount = $t05314853388._7
1396- let shopLandOwner = $t05314853388._8
1397- let shopWhSave = $t05314853388._9
1398- let accStatsResult = $t05314853388._10
1399- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, 0)]
1400- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, 0)
1401- let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1402- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1403- let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1404- $Tuple2((actions1 ++ actions2), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1405- }
1403+ if ((prologResult == prologResult))
1404+ then {
1405+ let caller = i.originCaller
1406+ let callerAddr = toString(caller)
1407+ let stakedDuckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1408+ let curLocation = valueOrElse(getString(stakingContract, keyDuckLocation(stakedDuckAssetId)), DEFAULTLOCATION)
1409+ let loc = split(value(curLocation), "_")
1410+ if ((loc[locIdxType] != "L"))
1411+ then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
1412+ else if ((stakedDuckAssetId != duckAssetId))
1413+ then throw(((("Your staked duck is " + stakedDuckAssetId) + ", but passed ") + duckAssetId))
1414+ else {
1415+ let bpKey = keyBackpackByDuck(duckAssetId)
1416+ let currentPack = getBackpack(bpKey)
1417+ let bpResList = split(currentPack[bpIdxRes], "_")
1418+ let bpMatList = split(currentPack[bpIdxMat], "_")
1419+ let bpProdList = if ((currentPack[bpIdxProd] == ""))
1420+ then nil
1421+ else split_4C(currentPack[bpIdxProd], "_")
1422+ let $t05319053430 = acceptShopOrderCommon(shopLandAssetId, callerAddr, bpOrderStr, bpResList, bpMatList, bpProdList)
1423+ let shopAction = $t05319053430._1
1424+ let newUserRes = $t05319053430._2
1425+ let newUserMat = $t05319053430._3
1426+ let newUserProd = $t05319053430._4
1427+ let usdWh2BpSaldo = $t05319053430._5
1428+ let usdBp2WhSaldo = $t05319053430._6
1429+ let xpAmount = $t05319053430._7
1430+ let shopLandOwner = $t05319053430._8
1431+ let shopWhSave = $t05319053430._9
1432+ let accStatsResult = $t05319053430._10
1433+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, 0)]
1434+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, 0)
1435+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1436+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1437+ let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1438+ $Tuple2((actions1 ++ actions2), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1439+ }
1440+ }
1441+ else throw("Strict value is not equal to itself.")
14061442 }
14071443
14081444
14091445
14101446 @Callable(i)
14111447 func acceptShopOrderDuckDelivery (orderStr,shopLandAssetId) = if (!(KS_ALLOW_DELIVERY))
14121448 then throw("Delivery feature is turned off!")
14131449 else {
14141450 let prologResult = prolog()
1415- let caller = i.originCaller
1416- let callerAddr = toString(caller)
1417- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1418- let bpKey = keyBackpackByDuck(duckAssetId)
1419- let currentPack = getBackpack(bpKey)
1420- let bpResList = split(currentPack[bpIdxRes], "_")
1421- let bpMatList = split(currentPack[bpIdxMat], "_")
1422- let bpProdList = if ((currentPack[bpIdxProd] == ""))
1423- then nil
1424- else split_4C(currentPack[bpIdxProd], "_")
1425- let $t05482755065 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, bpResList, bpMatList, bpProdList)
1426- let shopAction = $t05482755065._1
1427- let newUserRes = $t05482755065._2
1428- let newUserMat = $t05482755065._3
1429- let newUserProd = $t05482755065._4
1430- let usdWh2BpSaldo = $t05482755065._5
1431- let usdBp2WhSaldo = $t05482755065._6
1432- let xpAmount = $t05482755065._7
1433- let shopLandOwner = $t05482755065._8
1434- let shopWhSave = $t05482755065._9
1435- let accStatsResult = $t05482755065._10
1436- let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1437- let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1438- then MIN_USDT_FEE_DELIVERY
1439- else deliveryFeePart
1440- let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1441- let receivedFee = (deliveryFee - spentFee)
1442- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1443- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1444- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1445- let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1446- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1447- let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1448- $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1451+ if ((prologResult == prologResult))
1452+ then {
1453+ let caller = i.originCaller
1454+ let callerAddr = toString(caller)
1455+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(callerAddr)), "You don't have a duck staked")
1456+ let bpKey = keyBackpackByDuck(duckAssetId)
1457+ let currentPack = getBackpack(bpKey)
1458+ let bpResList = split(currentPack[bpIdxRes], "_")
1459+ let bpMatList = split(currentPack[bpIdxMat], "_")
1460+ let bpProdList = if ((currentPack[bpIdxProd] == ""))
1461+ then nil
1462+ else split_4C(currentPack[bpIdxProd], "_")
1463+ let $t05487255110 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, bpResList, bpMatList, bpProdList)
1464+ let shopAction = $t05487255110._1
1465+ let newUserRes = $t05487255110._2
1466+ let newUserMat = $t05487255110._3
1467+ let newUserProd = $t05487255110._4
1468+ let usdWh2BpSaldo = $t05487255110._5
1469+ let usdBp2WhSaldo = $t05487255110._6
1470+ let xpAmount = $t05487255110._7
1471+ let shopLandOwner = $t05487255110._8
1472+ let shopWhSave = $t05487255110._9
1473+ let accStatsResult = $t05487255110._10
1474+ let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1475+ let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1476+ then MIN_USDT_FEE_DELIVERY
1477+ else deliveryFeePart
1478+ let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1479+ let receivedFee = (deliveryFee - spentFee)
1480+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1481+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1482+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1483+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString_2C(newUserProd, "_")], ":")
1484+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1485+ let duckStatsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpShop, xpAmount, MULT8)], nil))
1486+ $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, bpSave, duckStatsResult, accStatsResult))
1487+ }
1488+ else throw("Strict value is not equal to itself.")
14491489 }
14501490
14511491
14521492
14531493 @Callable(i)
14541494 func acceptShopOrderLandDelivery (orderStr,shopLandAssetId,myLandAssetId) = if (!(KS_ALLOW_DELIVERY))
14551495 then throw("Delivery feature is turned off!")
14561496 else {
14571497 let prologResult = prolog()
1458- let caller = i.originCaller
1459- let callerAddr = toString(caller)
1460- let asset = value(assetInfo(fromBase58String(myLandAssetId)))
1461- if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(myLandAssetId)))))
1462- then throw((("NFT " + asset.name) + " is not staked"))
1463- else {
1464- let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(myLandAssetId)), (("NFT " + asset.name) + " is orphaned"))
1465- if ((owner != callerAddr))
1466- then throw((LANDPREFIX + " is not yours"))
1498+ if ((prologResult == prologResult))
1499+ then {
1500+ let caller = i.originCaller
1501+ let callerAddr = toString(caller)
1502+ let asset = value(assetInfo(fromBase58String(myLandAssetId)))
1503+ if (!(isDefined(getInteger(stakingContract, keyStakedTimeByAssetId(myLandAssetId)))))
1504+ then throw((("NFT " + asset.name) + " is not staked"))
14671505 else {
1468- let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [myLandAssetId], nil))
1469- let currentWh = split_4C(wh, ":")
1470- let resList = split(currentWh[whIdxRes], "_")
1471- let matList = split(currentWh[whIdxMat], "_")
1472- let prodList = if ((currentWh[whIdxProd] == ""))
1473- then nil
1474- else split(currentWh[whIdxProd], "_")
1475- let $t05730457536 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, resList, matList, prodList)
1476- let shopAction = $t05730457536._1
1477- let newUserRes = $t05730457536._2
1478- let newUserMat = $t05730457536._3
1479- let newUserProd = $t05730457536._4
1480- let usdWh2BpSaldo = $t05730457536._5
1481- let usdBp2WhSaldo = $t05730457536._6
1482- let xpAmount = $t05730457536._7
1483- let shopLandOwner = $t05730457536._8
1484- let shopWhSave = $t05730457536._9
1485- let accStatsResult = $t05730457536._10
1486- let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1487- let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1488- then MIN_USDT_FEE_DELIVERY
1489- else deliveryFeePart
1490- let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1491- let receivedFee = (deliveryFee - spentFee)
1492- let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1493- let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1494- let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1495- let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString(newUserProd, "_"), currentWh[whIdxLOFT]], ":")
1496- let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, myLandAssetId], nil))
1497- let statsResult = asInt(invoke(stakingContract, "updateAccStats", [callerAddr, fraction(xpShop, xpAmount, MULT8)], nil))
1498- $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, whSave, statsResult, accStatsResult))
1506+ let owner = valueOrErrorMessage(getString(stakingContract, keyLandAssetIdToOwner(myLandAssetId)), (("NFT " + asset.name) + " is orphaned"))
1507+ if ((owner != callerAddr))
1508+ then throw((LANDPREFIX + " is not yours"))
1509+ else {
1510+ let wh = asString(invoke(stakingContract, "getWarehouseREADONLY", [myLandAssetId], nil))
1511+ let currentWh = split_4C(wh, ":")
1512+ let resList = split(currentWh[whIdxRes], "_")
1513+ let matList = split(currentWh[whIdxMat], "_")
1514+ let prodList = if ((currentWh[whIdxProd] == ""))
1515+ then nil
1516+ else split(currentWh[whIdxProd], "_")
1517+ let $t05735257584 = acceptShopOrderCommon(shopLandAssetId, callerAddr, orderStr, resList, matList, prodList)
1518+ let shopAction = $t05735257584._1
1519+ let newUserRes = $t05735257584._2
1520+ let newUserMat = $t05735257584._3
1521+ let newUserProd = $t05735257584._4
1522+ let usdWh2BpSaldo = $t05735257584._5
1523+ let usdBp2WhSaldo = $t05735257584._6
1524+ let xpAmount = $t05735257584._7
1525+ let shopLandOwner = $t05735257584._8
1526+ let shopWhSave = $t05735257584._9
1527+ let accStatsResult = $t05735257584._10
1528+ let deliveryFeePart = fraction((usdBp2WhSaldo + usdWh2BpSaldo), DELIVERY_FEE, MULT6)
1529+ let deliveryFee = if ((MIN_USDT_FEE_DELIVERY > deliveryFeePart))
1530+ then MIN_USDT_FEE_DELIVERY
1531+ else deliveryFeePart
1532+ let spentFee = fraction(deliveryFee, usdBp2WhSaldo, (usdBp2WhSaldo + usdWh2BpSaldo))
1533+ let receivedFee = (deliveryFee - spentFee)
1534+ let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
1535+ let actions1 = [shopAction, shop2userActions(usdWh2BpSaldo, callerAddr, receivedFee)]
1536+ let actions2 = user2shopActions(usdBp2WhSaldo, i.payments, shopLandOwner, spentFee)
1537+ let whStr = makeString_2C([currentWh[whIdxLevels], makeString(newUserRes, "_"), makeString(newUserMat, "_"), makeString(newUserProd, "_"), currentWh[whIdxLOFT]], ":")
1538+ let whSave = asString(invoke(stakingContract, "saveWarehouse", [whStr, myLandAssetId], nil))
1539+ let statsResult = asInt(invoke(stakingContract, "updateAccStats", [callerAddr, fraction(xpShop, xpAmount, MULT8)], nil))
1540+ $Tuple2(((actions1 ++ actions2) :+ IntegerEntry(deliveryFundKey, (fundTotal + deliveryFee))), $Tuple5(prologResult, shopWhSave, whSave, statsResult, accStatsResult))
1541+ }
14991542 }
15001543 }
1544+ else throw("Strict value is not equal to itself.")
15011545 }
15021546
15031547
15041548
15051549 @Callable(i)
15061550 func sellProductsToES (amounts) = {
15071551 let prologResult = prolog()
1508- if ((size(i.payments) != 0))
1509- then throw("No payments needed")
1510- else {
1511- let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1512- let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1513- if ((curLocation[locIdxType] != "A"))
1514- then throw(("Duck location type should be Airport, but is " + curLocation[locIdxType]))
1515- else {
1516- let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1517- let prodList = if ((currentPack[bpIdxProd] == ""))
1518- then nil
1519- else split_4C(currentPack[bpIdxProd], "_")
1520- let esKey = keyEsWarehouse()
1521- let existStr = getString(esKey)
1522- let existAmounts = if (isDefined(existStr))
1523- then split_4C(value(existStr), "_")
1524- else nil
1525- func moveProd (acc,recipeStr) = {
1526- let j = acc._1
1527- let quantity = if ((size(amounts) > j))
1528- then amounts[j]
1529- else 0
1530- if ((0 > quantity))
1531- then throw("Quantity cannot be negative")
1532- else {
1533- let recipe = split(recipeStr, "_")
1534- if ((size(recipe) != RECIPESIZE))
1535- then throw(("Fatal: unknown recipe: " + recipeStr))
1536- else {
1537- let maxAmount = (ESMAXPACKAGES * PRODUCTPKGSIZE)
1538- let existAmount = if ((size(existAmounts) > j))
1539- then parseIntValue(existAmounts[j])
1540- else 0
1541- let canBuy = (maxAmount - existAmount)
1542- if ((quantity > canBuy))
1543- then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j]))
1544- else {
1545- let totalMat = getRecipeMaterials(recipe)
1546- let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (MULT8 * PRODUCTPKGSIZE))
1547- let bpProdAmount = if ((size(prodList) > j))
1548- then parseIntValue(prodList[j])
1549- else 0
1550- if ((quantity > bpProdAmount))
1551- then throw(((("You have only " + toString(bpProdAmount)) + " of ") + prodTypes[j]))
1552- else $Tuple5((j + 1), (acc._2 + (unitPrice * quantity)), (acc._3 :+ toString((bpProdAmount - quantity))), (acc._4 :+ toString((existAmount + quantity))), (acc._5 + (totalMat * quantity)))
1553- }
1554- }
1555- }
1552+ if ((prologResult == prologResult))
1553+ then if ((size(i.payments) != 0))
1554+ then throw("No payments needed")
1555+ else {
1556+ let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
1557+ let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_")
1558+ if ((curLocation[locIdxType] != "A"))
1559+ then throw(("Duck location type should be Airport, but is " + curLocation[locIdxType]))
1560+ else {
1561+ let currentPack = getBackpack(keyBackpackByDuck(duckAssetId))
1562+ let prodList = if ((currentPack[bpIdxProd] == ""))
1563+ then nil
1564+ else split_4C(currentPack[bpIdxProd], "_")
1565+ let esKey = keyEsWarehouse()
1566+ let existStr = getString(esKey)
1567+ let existAmounts = if (isDefined(existStr))
1568+ then split_4C(value(existStr), "_")
1569+ else nil
1570+ func moveProd (acc,recipeStr) = {
1571+ let j = acc._1
1572+ let quantity = if ((size(amounts) > j))
1573+ then amounts[j]
1574+ else 0
1575+ if ((0 > quantity))
1576+ then throw("Quantity cannot be negative")
1577+ else {
1578+ let recipe = split(recipeStr, "_")
1579+ if ((size(recipe) != RECIPESIZE))
1580+ then throw(("Fatal: unknown recipe: " + recipeStr))
1581+ else {
1582+ let maxAmount = (ESMAXPACKAGES * PRODUCTPKGSIZE)
1583+ let existAmount = if ((size(existAmounts) > j))
1584+ then parseIntValue(existAmounts[j])
1585+ else 0
1586+ let canBuy = (maxAmount - existAmount)
1587+ if ((quantity > canBuy))
1588+ then throw(((("Warehouse can buy only " + toString(canBuy)) + " of ") + prodTypes[j]))
1589+ else {
1590+ let totalMat = getRecipeMaterials(recipe)
1591+ let unitPrice = fraction((totalMat * ESBUYCOEF), RESOURCEPRICEMIN, (MULT8 * PRODUCTPKGSIZE))
1592+ let bpProdAmount = if ((size(prodList) > j))
1593+ then parseIntValue(prodList[j])
1594+ else 0
1595+ if ((quantity > bpProdAmount))
1596+ then throw(((("You have only " + toString(bpProdAmount)) + " of ") + prodTypes[j]))
1597+ else $Tuple5((j + 1), (acc._2 + (unitPrice * quantity)), (acc._3 :+ toString((bpProdAmount - quantity))), (acc._4 :+ toString((existAmount + quantity))), (acc._5 + (totalMat * quantity)))
1598+ }
1599+ }
1600+ }
1601+ }
1602+
1603+ let merged = {
1604+ let $l = productionMatrix
1605+ let $s = size($l)
1606+ let $acc0 = $Tuple5(0, 0, nil, nil, 0)
1607+ func $f0_1 ($a,$i) = if (($i >= $s))
1608+ then $a
1609+ else moveProd($a, $l[$i])
1610+
1611+ func $f0_2 ($a,$i) = if (($i >= $s))
1612+ then $a
1613+ else throw("List size exceeds 50")
1614+
1615+ $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)
1616+ }
1617+ let newBpStr = makeString_2C([currentPack[bpIdxLevel], currentPack[bpIdxRes], currentPack[bpIdxMat], makeString_2C(merged._3, "_")], ":")
1618+ let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1619+ let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpSellToEs, merged._5, (MULT8 * 10))], nil))
1620+ $Tuple2([StringEntry(esKey, makeString_2C(merged._4, "_")), ScriptTransfer(i.caller, merged._2, usdtAssetId)], $Tuple3(bpSave, prologResult, statsResult))
15561621 }
1557-
1558- let merged = {
1559- let $l = productionMatrix
1560- let $s = size($l)
1561- let $acc0 = $Tuple5(0, 0, nil, nil, 0)
1562- func $f0_1 ($a,$i) = if (($i >= $s))
1563- then $a
1564- else moveProd($a, $l[$i])
1565-
1566- func $f0_2 ($a,$i) = if (($i >= $s))
1567- then $a
1568- else throw("List size exceeds 50")
1569-
1570- $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)
1571- }
1572- let newBpStr = makeString_2C([currentPack[bpIdxLevel], currentPack[bpIdxRes], currentPack[bpIdxMat], makeString_2C(merged._3, "_")], ":")
1573- let bpSave = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newBpStr], nil))
1574- let statsResult = asInt(invoke(stakingContract, "updateDuckStats", [duckAssetId, fraction(xpSellToEs, merged._5, (MULT8 * 10))], nil))
1575- $Tuple2([StringEntry(esKey, makeString_2C(merged._4, "_")), ScriptTransfer(i.caller, merged._2, usdtAssetId)], $Tuple3(bpSave, prologResult, statsResult))
1576- }
1577- }
1622+ }
1623+ else throw("Strict value is not equal to itself.")
15781624 }
15791625
15801626
15811627
15821628 @Callable(i)
15831629 func updateEsStorage (newStorage) = if ((i.caller != stakingContract))
15841630 then throw("Permission denied")
15851631 else $Tuple2([StringEntry(keyEsWarehouse(), newStorage)], newStorage)
15861632
15871633
15881634
15891635 @Callable(i)
15901636 func updateDeliveryLocked (newAmount) = if ((i.caller != stakingContract))
15911637 then throw("Permission denied")
15921638 else $Tuple2([IntegerEntry(deliveryLockedKey, newAmount)], newAmount)
15931639
15941640
15951641
15961642 @Callable(i)
15971643 func sendDeliveryReward (addr) = if ((i.caller != stakingContract))
15981644 then throw("Permission denied")
15991645 else {
16001646 let fundTotal = valueOrElse(getInteger(deliveryFundKey), 0)
16011647 let lockedTotal = valueOrElse(getInteger(deliveryLockedKey), 0)
16021648 let acresAmount = (MIN_USDT_FEE_DELIVERY * USDT2ACRES_MULTIPLIER)
16031649 let acresResult = invoke(acresContract, "sendAcres", [addr, acresAmount], nil)
16041650 $Tuple2([IntegerEntry(deliveryFundKey, (fundTotal - MIN_USDT_FEE_DELIVERY)), IntegerEntry(deliveryLockedKey, (lockedTotal - MIN_USDT_FEE_DELIVERY))], acresResult)
16051651 }
16061652
16071653

github/deemru/w8io/169f3d6 
231.20 ms