tx · Co5a3aRFimWPciBA5gBEqF9P9fbhnNUF93MbCW77BodK

3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm:  -0.02300000 Waves

2023.01.06 18:24 [2393274] smart account 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm > SELF 0.00000000 Waves

{ "type": 13, "id": "Co5a3aRFimWPciBA5gBEqF9P9fbhnNUF93MbCW77BodK", "fee": 2300000, "feeAssetId": null, "timestamp": 1673018638357, "version": 2, "chainId": 84, "sender": "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm", "senderPublicKey": "EVooykMNV691Venwp1dHUTBd7KWequzUcda57Wd3LQEX", "proofs": [ "5zJYRkApPrKpzNkRmERnECtXYk7Mee7ZP1dsAchbveSZejszCFM2kDn5AUTa8z6cYjHkaWBX36Mn3aKtX74Cicxg" ], "script": "base64:BgJJCAISABIDCgEIEgASAwoBCBIECgIBCBIECgICAhIECgIBCBIECgIBARIECgIICBIECgICAhIECgICAhIDCgEIEgMKAQgSAwoBCEoABWNoYWluCQCwCQEJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZG5Bc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwASC2JinDBPXOU5GkDkt1JC9kjFGx+t+vVCm9SNIdKrKq0QMJAAACAgFUBQckbWF0Y2gwASD3dur394PKZdtuE+4CO89YKZWpwdGN8kvabNgdYoDI3gkAAgECDVVua25vd24gY2hhaW4ADWluY3ViYXRvckFkZHIEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDAJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNQRWt0VnV4MlJoY2hTTjYzRHNEbzRiNG16NFFxektTZUR2AwkAAAICAVQFByRtYXRjaDAFBHRoaXMJAAIBAg1Vbmtub3duIGNoYWluAAticmVlZGVyQWRkcgQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAkBEUBleHRyTmF0aXZlKDEwNjIpAQI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YWx1ZQEJAJEDAggFAWkIcGF5bWVudHMAAAMJAQIhPQIIBQNwbXQHYXNzZXRJZAULdXNkbkFzc2V0SWQJAAIBAhpBbGxvd2VkIFVTRE4gcGF5bWVudCBvbmx5IQkBDXVwSW5mcmFDb21tb24DBwgFAWkGY2FsbGVyCAUDcG10BmFtb3VudAFpARBhY3RpdmF0ZUFydGlmYWN0AQdhcnROYW1lAwkBAiE9AgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIwQXJ0aWZhY3QgYWN0aXZhdGlvbiBkb2Vzbid0IHJlcXVpcmUgYW55IHBheW1lbnRzBAZyZXN1bHQEByRtYXRjaDAFB2FydE5hbWUDCQAAAgIHUFJFU0FMRQUHJG1hdGNoMAkBEmFjdGl2YXRlUHJlc2FsZUFydAEJAKUIAQgFAWkGY2FsbGVyCQACAQIQVW5rbm93biBhcnRpZmFjdAUGcmVzdWx0AA3u1ac=", "height": 2393274, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3DsgrbRAncKXuvTep9mgjJa5z9TvSmVoeUkZBPKj5fKN Next: CAKs3kgsQ12fqrxwYjQd7LqqT65S5TtXMtm8Wq5bCs3N Diff:
OldNewDifferences
9292 then 1000000000
9393 else if (("T" == $match0))
9494 then 10000000
95- else throw("Unknown chain")
96-}
97-
98-let PresaleArtifactActivationTime = match chain {
99- case _ =>
100- if (("W" == $match0))
101- then 1673136000000
102- else if (("T" == $match0))
103- then 1672790400000
10495 else throw("Unknown chain")
10596 }
10697
461452 let presaleBonus = if (valueOrElse(getBoolean(keypresaleArtActivatedByAssetId(landAssetId)), false))
462453 then 3
463454 else 0
464- (DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4))
455+ ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, presaleBonus, 20))
465456 }
466457
467458
468-func claimAll (landAssetId,pieces) = {
469- let timeKey = keyStakedTimeByAssetId(landAssetId)
470- let savedTime = valueOrErrorMessage(getInteger(timeKey), (((LANDPREFIX + " ") + landAssetId) + " is not staked"))
471- let deltaTime = (lastBlock.timestamp - savedTime)
472- if ((0 > deltaTime))
473- then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp)))
459+func checkClaimConditions (addr) = {
460+ let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
461+ let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
462+ let loc = split(value(curLocation), "_")
463+ if ((loc[locIdxType] != "L"))
464+ then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
474465 else {
475- let dailyProductionByPiece = applyBonuses(landAssetId)
476- let availRes = (fraction(deltaTime, dailyProductionByPiece, DAYMILLIS) * pieces)
477- asString(invoke(this, "claimRes", [availRes, landAssetId], nil))
466+ let landAssetId = loc[locIdxId]
467+ let asset = value(assetInfo(fromBase58String(landAssetId)))
468+ let timeKey = keyStakedTimeByAssetId(landAssetId)
469+ let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked"))
470+ let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
471+ if ((owner != addr))
472+ then throw((LANDPREFIX + " is not yours"))
473+ else {
474+ let d = split(asset.description, "_")
475+ $Tuple4(duckAssetId, landAssetId, d, savedTime)
476+ }
478477 }
479478 }
480479
481480
482-func upInfraCommon (shouldUseMat,caller,landAssetId) = {
481+func claimResInternal (addr,amount) = {
482+ let c = checkClaimConditions(addr)
483+ let landSize = c._3[recLandSize]
484+ let terrainCounts = countTerrains(c._3[recTerrains])
485+ let deltaTime = (lastBlock.timestamp - c._4)
486+ if ((0 > deltaTime))
487+ then throw(((("Saved timestamp is in future, saved = " + toString(c._4)) + ", current = ") + toString(lastBlock.timestamp)))
488+ else {
489+ let pieces = numPiecesBySize(landSize)
490+ let dailyProductionByPiece = applyBonuses(c._2)
491+ let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS)
492+ if ((amount > availRes))
493+ then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount)))
494+ else {
495+ let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (dailyProductionByPiece * pieces))
496+ let newTimestamp = (lastBlock.timestamp - newDeltaTime)
497+ let bpKey = keyBackpackByDuck(c._1)
498+ let currentPack = getBackpack(bpKey)
499+ let currentRes = split(currentPack[bpIdxRes], "_")
500+ let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime), (pieces / 25), dailyProductionByPiece)
501+ $Tuple3([IntegerEntry(keyStakedTimeByAssetId(c._2), newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, c._2, addr), newTimestamp)], bpKey, [currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]])
502+ }
503+ }
504+ }
505+
506+
507+func claimAll (addr,landAssetId,pieces) = {
508+ let timeKey = keyStakedTimeByAssetId(landAssetId)
509+ let savedTime = value(getInteger(timeKey))
510+ let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId), DAYMILLIS) * pieces)
511+ claimResInternal(addr, availRes)
512+ }
513+
514+
515+func upInfraCommon (shouldUseMat,caller,paymentAmount) = {
483516 let addr = toString(caller)
484- let infraKey = keyInfraLevelByAssetId(landAssetId)
517+ let c = checkClaimConditions(addr)
518+ let pieces = numPiecesBySize(c._3[recLandSize])
519+ let infraKey = keyInfraLevelByAssetId(c._2)
485520 let curLevel = valueOrElse(getInteger(infraKey), 0)
486521 if ((curLevel >= 3))
487522 then throw("Currently max infrastructure level = 3")
488523 else {
489524 let newLevel = (curLevel + 1)
490- let asset = value(assetInfo(fromBase58String(landAssetId)))
491- if (!(contains(asset.name, LANDPREFIX)))
492- then throw((("NFT " + LANDPREFIX) + " token should be passed as param"))
525+ let cost = fraction(InfraUpgradeCostSUsdn, (pieces * newLevel), 25)
526+ if (if (!(shouldUseMat))
527+ then (paymentAmount != cost)
528+ else false)
529+ then throw(("Payment attached should be " + toString(cost)))
493530 else {
494- let owner = getStringValue(keyLandAssetIdToOwner(landAssetId))
495- if ((owner != addr))
496- then throw((LANDPREFIX + " is not yours"))
497- else {
498- let d = split(asset.description, "_")
499- let landSize = d[recLandSize]
500- let pieces = numPiecesBySize(landSize)
501- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
502- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
503- let loc = split(value(curLocation), "_")
504- if ((loc[locIdxType] != "L"))
505- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
506- else if ((loc[locIdxId] != landAssetId))
507- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
508- else {
509- let bpKey = keyBackpackByDuck(duckAssetId)
510- let currentPack = getBackpack(bpKey)
511- let mList = split(currentPack[bpIdxMat], "_")
512- let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_")
513- let newRes = claimAll(landAssetId, pieces)
514- $Tuple2([IntegerEntry(infraKey, newLevel), IntegerEntry(keyInfraLevelByAssetIdAndOwner(landAssetId, addr), newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], newRes, newMat, currentPack[bpIdxProd]], ":"))], newLevel)
515- }
516- }
531+ let bpKey = keyBackpackByDuck(c._1)
532+ let currentPack = getBackpack(bpKey)
533+ let mList = split(currentPack[bpIdxMat], "_")
534+ let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_")
535+ let claimResult = claimAll(addr, c._2, pieces)
536+ $Tuple2(([IntegerEntry(infraKey, newLevel), IntegerEntry(keyInfraLevelByAssetIdAndOwner(c._2, addr), newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], claimResult._3[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] ++ claimResult._1), newLevel)
517537 }
518538 }
539+ }
540+
541+
542+func activatePresaleArt (addr) = {
543+ let c = checkClaimConditions(addr)
544+ let activationKey = keypresaleArtActivatedByAssetId(c._2)
545+ if (valueOrElse(getBoolean(activationKey), false))
546+ then throw("Presale artifact is already activated")
547+ else if ((parseIntValue(c._3[recLandNum]) > 500))
548+ then throw((((LANDPREFIX + " ") + c._2) + " is not eligible for presale artifact"))
549+ else [BooleanEntry(keypresaleArtActivatedByAssetId(c._2), true)]
519550 }
520551
521552
548579 let d = split(asset.description, "_")
549580 let terrainCounts = countTerrains(d[recTerrains])
550581 let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1)
551- let presaleActive = if ((500 >= landNumInt))
552- then (lastBlock.timestamp > PresaleArtifactActivationTime)
553- else false
554582 [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(landAssetId), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)]
555583 }
556584 }
560588
561589
562590 @Callable(i)
563-func unstakeLand (landAssetId) = if ((size(i.payments) != 0))
591+func unstakeLand (landAssetIdStr) = if ((size(i.payments) != 0))
564592 then throw("unstake doesn't require any payments")
565593 else {
566- let assetId = fromBase58String(landAssetId)
567- let address = toString(i.caller)
568- let asset = value(assetInfo(assetId))
569- if ((asset.issuer != this))
570- then throw("Unknown issuer of token")
571- else if (!(contains(asset.name, LANDPREFIX)))
572- then throw((("Only NFT " + LANDPREFIX) + " tokens can be unstaked"))
573- else {
574- let timeKey = keyStakedTimeByAssetId(landAssetId)
575- if (!(isDefined(timeKey)))
576- then throw((("NFT " + asset.name) + " is not staked"))
577- else {
578- let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
579- if ((owner != address))
580- then throw((("Staked " + LANDPREFIX) + " is not yours"))
581- else {
582- let d = split(asset.description, "_")
583- let terrainCounts = countTerrains(d[recTerrains])
584- let pieces = numPiecesBySize(d[recLandSize])
585- let props = updateProportions(terrainCounts, (pieces / 25), -1)
586- let newRes = claimAll(landAssetId, pieces)
587- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(address)), (("You can't unstake " + LANDPREFIX) + " without a duck staked"))
588- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
589- let loc = split(value(curLocation), "_")
590- if ((loc[locIdxType] != "L"))
591- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
592- else if ((loc[locIdxId] != landAssetId))
593- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
594- else {
595- let bpKey = keyBackpackByDuck(duckAssetId)
596- let currentPack = getBackpack(bpKey)
597-[ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address)), StringEntry(keyResProportions(), props), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], newRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":"))]
598- }
599- }
600- }
601- }
594+ let addr = toString(i.caller)
595+ let c = checkClaimConditions(addr)
596+ let terrainCounts = countTerrains(c._3[recTerrains])
597+ let pieces = numPiecesBySize(c._3[recLandSize])
598+ let props = updateProportions(terrainCounts, (pieces / 25), -1)
599+ let claimResult = claimAll(addr, c._2, pieces)
600+[ScriptTransfer(i.caller, 1, fromBase58String(c._2)), DeleteEntry(keyStakedTimeByAssetId(c._2)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, c._2, addr)), StringEntry(keyResProportions(), props), StringEntry(claimResult._2, makeString(claimResult._3, ":"))]
602601 }
603602
604603
677676
678677
679678 @Callable(i)
680-func claimRes (amount,landAssetId) = if ((size(i.payments) != 0))
679+func claimRes (amount,landAssetIdStr) = if ((size(i.payments) != 0))
681680 then throw("claimRes doesn't require any payments")
682681 else {
683682 let addr = toString(i.originCaller)
684- let asset = value(assetInfo(fromBase58String(landAssetId)))
685- if (!(contains(asset.name, LANDPREFIX)))
686- then throw((("NFT " + LANDPREFIX) + " token should be passed as param"))
687- else {
688- let timeKey = keyStakedTimeByAssetId(landAssetId)
689- let owner = getStringValue(keyLandAssetIdToOwner(landAssetId))
690- if ((owner != addr))
691- then throw((LANDPREFIX + " is not yours"))
692- else {
693- let d = split(asset.description, "_")
694- let landSize = d[recLandSize]
695- let terrainCounts = countTerrains(d[recTerrains])
696- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
697- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
698- let loc = split(value(curLocation), "_")
699- if ((loc[locIdxType] != "L"))
700- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
701- else if ((loc[locIdxId] != landAssetId))
702- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
703- else {
704- let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked"))
705- let deltaTime = (lastBlock.timestamp - savedTime)
706- if ((0 > deltaTime))
707- then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp)))
708- else {
709- let pieces = numPiecesBySize(landSize)
710- let dailyProductionByPiece = applyBonuses(landAssetId)
711- let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS)
712- if ((amount > availRes))
713- then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount)))
714- else {
715- let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (dailyProductionByPiece * pieces))
716- let newTimestamp = (lastBlock.timestamp - newDeltaTime)
717- let bpKey = keyBackpackByDuck(duckAssetId)
718- let currentPack = getBackpack(bpKey)
719- let currentRes = split(currentPack[bpIdxRes], "_")
720- let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime), (pieces / 25), dailyProductionByPiece)
721- let newPack = makeString([currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
722- $Tuple2([StringEntry(bpKey, newPack), IntegerEntry(timeKey, newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, owner), newTimestamp)], bpRes)
723- }
724- }
725- }
726- }
727- }
683+ let result = claimResInternal(addr, amount)
684+ $Tuple2((result._1 :+ StringEntry(result._2, makeString(result._3, ":"))), result._3[bpIdxRes])
728685 }
729686
730687
837794
838795
839796 @Callable(i)
840-func upgradeInfra (landAssetId) = if ((size(i.payments) != 0))
797+func upgradeInfra (landAssetIdIgnored) = if ((size(i.payments) != 0))
841798 then throw("Infrastructure upgrade doesn't require any payments")
842- else upInfraCommon(true, i.caller, landAssetId)
799+ else upInfraCommon(true, i.caller, 0)
843800
844801
845802
846803 @Callable(i)
847-func upgradeInfraUsdn (landAssetId) = if ((size(i.payments) != 1))
804+func upgradeInfraUsdn (landAssetIdIgnored) = if ((size(i.payments) != 1))
848805 then throw("Exactly one payment required")
849806 else {
850807 let pmt = value(i.payments[0])
851808 if ((pmt.assetId != usdnAssetId))
852809 then throw("Allowed USDN payment only!")
853- else {
854- let newLevel = (valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) + 1)
855- let asset = value(assetInfo(fromBase58String(landAssetId)))
856- let d = split(asset.description, "_")
857- let cost = fraction(InfraUpgradeCostSUsdn, (numPiecesBySize(d[recLandSize]) * newLevel), 25)
858- if ((pmt.amount != cost))
859- then throw(("Payment attached should be " + toString(cost)))
860- else upInfraCommon(false, i.caller, landAssetId)
861- }
810+ else upInfraCommon(false, i.caller, pmt.amount)
811+ }
812+
813+
814+
815+@Callable(i)
816+func activateArtifact (artName) = if ((size(i.payments) != 0))
817+ then throw("Artifact activation doesn't require any payments")
818+ else {
819+ let result = match artName {
820+ case _ =>
821+ if (("PRESALE" == $match0))
822+ then activatePresaleArt(toString(i.caller))
823+ else throw("Unknown artifact")
824+ }
825+ result
862826 }
863827
864828
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chain = toUtf8String(take(drop(this.bytes, 1), 1))
55
66 let usdnAssetId = match chain {
77 case _ =>
88 if (("W" == $match0))
99 then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
1010 else if (("T" == $match0))
1111 then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ'
1212 else throw("Unknown chain")
1313 }
1414
1515 let incubatorAddr = match chain {
1616 case _ =>
1717 if (("W" == $match0))
1818 then addressFromStringValue("3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv")
1919 else if (("T" == $match0))
2020 then this
2121 else throw("Unknown chain")
2222 }
2323
2424 let breederAddr = match chain {
2525 case _ =>
2626 if (("W" == $match0))
2727 then addressFromStringValue("3PDVuU45H7Eh5dmtNbnRNRStGwULA7NY6Hb")
2828 else if (("T" == $match0))
2929 then this
3030 else throw("Unknown chain")
3131 }
3232
3333 let economyAddr = match chain {
3434 case _ =>
3535 if (("W" == $match0))
3636 then addressFromStringValue("3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D")
3737 else if (("T" == $match0))
3838 then addressFromStringValue("3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep")
3939 else throw("Unknown chain")
4040 }
4141
4242 let pub = base58'6LfPuKJjLgekmncBhMg2LZyMTNVzZBccXR28ySXm9uXD'
4343
4444 let HEALCOST = 10000
4545
4646 let LANDPREFIX = "LAND"
4747
4848 let DUCKPREFIX = "DUCK"
4949
5050 let DEFAULTLOCATION = "Africa_F_Africa"
5151
5252 let NUMRES = 6
5353
5454 let DAILYRESBYPIECE = 3456000
5555
5656 let DAYMILLIS = 86400000
5757
5858 let FIVEMINUTESMILLIS = 300000
5959
6060 let RESOURCEPRICEMIN = 158549
6161
6262 let InfraUpgradeCostS = match chain {
6363 case _ =>
6464 if (("W" == $match0))
6565 then 18921595217
6666 else if (("T" == $match0))
6767 then 189215952
6868 else throw("Unknown chain")
6969 }
7070
7171 let InfraUpgradeCostSUsdn = match chain {
7272 case _ =>
7373 if (("W" == $match0))
7474 then 120000000
7575 else if (("T" == $match0))
7676 then 1200000
7777 else throw("Unknown chain")
7878 }
7979
8080 let EXPMATERIALS = match chain {
8181 case _ =>
8282 if (("W" == $match0))
8383 then 157679960139
8484 else if (("T" == $match0))
8585 then 1576799601
8686 else throw("Unknown chain")
8787 }
8888
8989 let EXPUSDN = match chain {
9090 case _ =>
9191 if (("W" == $match0))
9292 then 1000000000
9393 else if (("T" == $match0))
9494 then 10000000
95- else throw("Unknown chain")
96-}
97-
98-let PresaleArtifactActivationTime = match chain {
99- case _ =>
100- if (("W" == $match0))
101- then 1673136000000
102- else if (("T" == $match0))
103- then 1672790400000
10495 else throw("Unknown chain")
10596 }
10697
10798 let MULT6 = 1000000
10899
109100 let FIVEX = toBigInt(5)
110101
111102 let TWENTYX = toBigInt(20)
112103
113104 let TWENTY2X = toBigInt((20 * 20))
114105
115106 let TWENTY3X = toBigInt(((20 * 20) * 20))
116107
117108 let TWENTY4X = toBigInt((((20 * 20) * 20) * 20))
118109
119110 let TWENTY5X = toBigInt(((((20 * 20) * 20) * 20) * 20))
120111
121112 let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"]
122113
123114 let continents = ["Asia", "Europe", "Americas", "Oceania", "Africa"]
124115
125116 func keyNextFreeLandNum () = "nextLandNum"
126117
127118
128119 func keyLandToAssetId (landNum) = ("landToAsset_" + landNum)
129120
130121
131122 func keyNftName (landNum,landSize) = ((LANDPREFIX + landNum) + landSize)
132123
133124
134125 func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId)
135126
136127
137128 func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId)
138129
139130
140131 func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId)
141132
142133
143134 func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId)
144135
145136
146137 func keyInfraLevelByAssetIdAndOwner (assetId,ownerAddr) = ((("infraLevelByAssetIdAndOwner_" + assetId) + "_") + ownerAddr)
147138
148139
149140 func keypresaleArtActivatedByAssetId (assetId) = ("presaleArtActivated_" + assetId)
150141
151142
152143 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
153144
154145
155146 func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr)
156147
157148
158149 func keyLandNumToOwner (landNum) = ("landOwner_" + landNum)
159150
160151
161152 func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId)
162153
163154
164155 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
165156
166157
167158 func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId)
168159
169160
170161 func keyResProportions () = "resTypesProportions"
171162
172163
173164 let recLandNum = 0
174165
175166 let recLandSize = 1
176167
177168 let recTerrains = 2
178169
179170 let recContinent = 3
180171
181172 let locIdxContinent = 0
182173
183174 let locIdxType = 1
184175
185176 let locIdxId = 2
186177
187178 let bpIdxLevel = 0
188179
189180 let bpIdxRes = 1
190181
191182 let bpIdxMat = 2
192183
193184 let bpIdxProd = 3
194185
195186 func asString (v) = match v {
196187 case s: String =>
197188 s
198189 case _ =>
199190 throw("fail to cast into String")
200191 }
201192
202193
203194 func getNeededMaterials (total) = {
204195 let props = split(value(getString(keyResProportions())), "_")
205196 if ((size(props) != NUMRES))
206197 then throw("Wrong proportions data")
207198 else {
208199 let r = [parseIntValue(props[0]), parseIntValue(props[1]), parseIntValue(props[2]), parseIntValue(props[3]), parseIntValue(props[4]), parseIntValue(props[5])]
209200 let sum = (((((r[0] + r[1]) + r[2]) + r[3]) + r[4]) + r[5])
210201 if ((0 >= sum))
211202 then throw("No lands staked")
212203 else {
213204 let norm6 = fraction(total, MULT6, sum)
214205 func normalizer (acc,elem) = (acc :+ fraction(elem, norm6, MULT6))
215206
216207 let $l = r
217208 let $s = size($l)
218209 let $acc0 = nil
219210 func $f0_1 ($a,$i) = if (($i >= $s))
220211 then $a
221212 else normalizer($a, $l[$i])
222213
223214 func $f0_2 ($a,$i) = if (($i >= $s))
224215 then $a
225216 else throw("List size exceeds 6")
226217
227218 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
228219 }
229220 }
230221 }
231222
232223
233224 func subtractMaterials (shouldUseMat,has,totalNeed) = {
234225 let need = getNeededMaterials(totalNeed)
235226 func subtractor (acc,idx) = {
236227 let result = (parseIntValue(has[idx]) - need[idx])
237228 if ((0 > result))
238229 then throw(((((("Not enough material idx=" + toString(idx)) + ", you have ") + has[idx]) + ", but need ") + toString(need[idx])))
239230 else (acc :+ toString(result))
240231 }
241232
242233 if (shouldUseMat)
243234 then {
244235 let $l = [0, 1, 2, 3, 4, 5]
245236 let $s = size($l)
246237 let $acc0 = nil
247238 func $f0_1 ($a,$i) = if (($i >= $s))
248239 then $a
249240 else subtractor($a, $l[$i])
250241
251242 func $f0_2 ($a,$i) = if (($i >= $s))
252243 then $a
253244 else throw("List size exceeds 6")
254245
255246 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
256247 }
257248 else has
258249 }
259250
260251
261252 func updateProportions (terrainCounts,landSizeIndex,sign) = {
262253 let props = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_")
263254 if ((size(props) != NUMRES))
264255 then throw("Wrong proportions data")
265256 else {
266257 func updater (acc,i) = {
267258 let result = (parseIntValue(props[i]) + ((sign * terrainCounts[i]) * landSizeIndex))
268259 if ((0 > result))
269260 then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex)))
270261 else (acc :+ toString(result))
271262 }
272263
273264 let r = {
274265 let $l = [0, 1, 2, 3, 4, 5]
275266 let $s = size($l)
276267 let $acc0 = nil
277268 func $f0_1 ($a,$i) = if (($i >= $s))
278269 then $a
279270 else updater($a, $l[$i])
280271
281272 func $f0_2 ($a,$i) = if (($i >= $s))
282273 then $a
283274 else throw("List size exceeds 6")
284275
285276 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
286277 }
287278 makeString(r, "_")
288279 }
289280 }
290281
291282
292283 func countTerrains (terrains) = [(size(split(terrains, "A")) - 1), (size(split(terrains, "B")) - 1), (size(split(terrains, "C")) - 1), (size(split(terrains, "D")) - 1), (size(split(terrains, "E")) - 1), (size(split(terrains, "F")) - 1)]
293284
294285
295286 func numPiecesBySize (landSize) = match landSize {
296287 case _ =>
297288 if (("S" == $match0))
298289 then 25
299290 else if (("M" == $match0))
300291 then 100
301292 else if (("L" == $match0))
302293 then 225
303294 else if (("XL" == $match0))
304295 then 400
305296 else if (("XXL" == $match0))
306297 then 625
307298 else throw("Unknown land size")
308299 }
309300
310301
311302 func subOneInList (aList,idx,amount) = {
312303 func subber (acc,i) = (acc :+ (if ((i == idx))
313304 then toString((parseIntValue(aList[i]) - amount))
314305 else aList[i]))
315306
316307 let r = {
317308 let $l = [0, 1, 2, 3, 4, 5]
318309 let $s = size($l)
319310 let $acc0 = nil
320311 func $f0_1 ($a,$i) = if (($i >= $s))
321312 then $a
322313 else subber($a, $l[$i])
323314
324315 func $f0_2 ($a,$i) = if (($i >= $s))
325316 then $a
326317 else throw("List size exceeds 6")
327318
328319 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
329320 }
330321 makeString(r, "_")
331322 }
332323
333324
334325 func addRes (currentRes,terrainCounts,deltaTime,landSizeIndex,dailyByPieceWithBonuses) = {
335326 func adder (acc,i) = {
336327 let resOfType = ((fraction(deltaTime, dailyByPieceWithBonuses, DAYMILLIS) * terrainCounts[i]) * landSizeIndex)
337328 (acc :+ toString((parseIntValue(currentRes[i]) + resOfType)))
338329 }
339330
340331 let r = {
341332 let $l = [0, 1, 2, 3, 4, 5]
342333 let $s = size($l)
343334 let $acc0 = nil
344335 func $f0_1 ($a,$i) = if (($i >= $s))
345336 then $a
346337 else adder($a, $l[$i])
347338
348339 func $f0_2 ($a,$i) = if (($i >= $s))
349340 then $a
350341 else throw("List size exceeds 6")
351342
352343 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
353344 }
354345 makeString(r, "_")
355346 }
356347
357348
358349 func abs (x) = if ((x >= toBigInt(0)))
359350 then x
360351 else -(x)
361352
362353
363354 let freq = [[1, 4, 9, 10, 15], [5, 8, 13, 14, 15], [6, 9, 14, 15, 16], [4, 7, 8, 13, 18], [1, 6, 7, 15, 19]]
364355
365356 func genChar (n,freqs) = {
366357 let rem = toInt((n % TWENTYX))
367358 let letter = if ((freqs[0] > rem))
368359 then "A"
369360 else if ((freqs[1] > rem))
370361 then "B"
371362 else if ((freqs[2] > rem))
372363 then "C"
373364 else if ((freqs[3] > rem))
374365 then "D"
375366 else if ((freqs[4] > rem))
376367 then "E"
377368 else "F"
378369 letter
379370 }
380371
381372
382373 func getBackpack (bpKey) = {
383374 let p = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":")
384375 [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES))
385376 then p[bpIdxRes]
386377 else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES))
387378 then p[bpIdxMat]
388379 else "0_0_0_0_0_0", p[bpIdxProd]]
389380 }
390381
391382
392383 func expeditionCommon (shouldUseMat,caller,txId,message,sig) = if (!(sigVerify_8Kb(message, sig, pub)))
393384 then throw("signature does not match")
394385 else {
395386 let parts = split(toUtf8String(message), ";")
396387 let hp = split(split(parts[0], "|")[0], "_")
397388 let curHP = parseIntValue(hp[0])
398389 let newHP = parseIntValue(hp[1])
399390 let locAndTime = split(parts[1], ":")
400391 let targetLocation = split(locAndTime[0], "_")
401392 if ((targetLocation[1] != "E"))
402393 then throw("expedition target location type should be E")
403394 else {
404395 let time = parseIntValue(locAndTime[1])
405396 if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS)))
406397 then true
407398 else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time))
408399 then throw("signature outdated")
409400 else {
410401 let userAddr = toString(caller)
411402 let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(userAddr)), "You don't have a duck staked")
412403 let keyHealth = keyDuckHealth(duckAssetId)
413404 let oldFromState = valueOrElse(getInteger(keyHealth), 100)
414405 if ((oldFromState != curHP))
415406 then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP)))
416407 else if ((0 >= curHP))
417408 then throw("You can't fly with zero health")
418409 else if ((0 >= newHP))
419410 then $Tuple2(((if (!(shouldUseMat))
420411 then [ScriptTransfer(caller, EXPUSDN, usdnAssetId)]
421412 else nil) :+ IntegerEntry(keyHealth, 0)), "")
422413 else {
423414 let bpKey = keyBackpackByDuck(duckAssetId)
424415 let currentPack = getBackpack(bpKey)
425416 let mList = split(currentPack[bpIdxMat], "_")
426417 let newMat = makeString(subtractMaterials(shouldUseMat, mList, EXPMATERIALS), "_")
427418 let bigNum = abs(toBigInt(txId))
428419 let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501)
429420 let landNum = toString(freeNum)
430421 let continentIdx = toInt((bigNum % FIVEX))
431422 let f = freq[continentIdx]
432423 func terrainGenerator (acc,elem) = $Tuple2((((((acc._1 + genChar(acc._2, f)) + genChar((acc._2 / TWENTYX), f)) + genChar((acc._2 / TWENTY2X), f)) + genChar((acc._2 / TWENTY3X), f)) + genChar((acc._2 / TWENTY4X), f)), (acc._2 / TWENTY5X))
433424
434425 let t = {
435426 let $l = [1, 2, 3, 4, 5]
436427 let $s = size($l)
437428 let $acc0 = $Tuple2("", (bigNum / FIVEX))
438429 func $f0_1 ($a,$i) = if (($i >= $s))
439430 then $a
440431 else terrainGenerator($a, $l[$i])
441432
442433 func $f0_2 ($a,$i) = if (($i >= $s))
443434 then $a
444435 else throw("List size exceeds 5")
445436
446437 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
447438 }
448439 let continent = continents[continentIdx]
449440 let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", t._1, continent], "_"), 1, 0, false)
450441 let assetId = calculateAssetId(issue)
451442 let id = toBase58String(assetId)
452443 $Tuple2([IntegerEntry(keyNextFreeLandNum(), (freeNum + 1)), issue, StringEntry(keyLandToAssetId(landNum), id), StringEntry(keyLandAssetIdToOwner(id), userAddr), StringEntry(keyLandNumToOwner(landNum), userAddr), IntegerEntry(keyInfraLevelByAssetId(id), 0), IntegerEntry(keyInfraLevelByAssetIdAndOwner(id, userAddr), 0), ScriptTransfer(caller, 1, assetId), StringEntry(keyDuckLocation(duckAssetId), makeString([continent, "L", id], "_")), IntegerEntry(keyHealth, newHP), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))], id)
453444 }
454445 }
455446 }
456447 }
457448
458449
459450 func applyBonuses (landAssetId) = {
460451 let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0)
461452 let presaleBonus = if (valueOrElse(getBoolean(keypresaleArtActivatedByAssetId(landAssetId)), false))
462453 then 3
463454 else 0
464- (DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4))
455+ ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, presaleBonus, 20))
465456 }
466457
467458
468-func claimAll (landAssetId,pieces) = {
469- let timeKey = keyStakedTimeByAssetId(landAssetId)
470- let savedTime = valueOrErrorMessage(getInteger(timeKey), (((LANDPREFIX + " ") + landAssetId) + " is not staked"))
471- let deltaTime = (lastBlock.timestamp - savedTime)
472- if ((0 > deltaTime))
473- then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp)))
459+func checkClaimConditions (addr) = {
460+ let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
461+ let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
462+ let loc = split(value(curLocation), "_")
463+ if ((loc[locIdxType] != "L"))
464+ then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
474465 else {
475- let dailyProductionByPiece = applyBonuses(landAssetId)
476- let availRes = (fraction(deltaTime, dailyProductionByPiece, DAYMILLIS) * pieces)
477- asString(invoke(this, "claimRes", [availRes, landAssetId], nil))
466+ let landAssetId = loc[locIdxId]
467+ let asset = value(assetInfo(fromBase58String(landAssetId)))
468+ let timeKey = keyStakedTimeByAssetId(landAssetId)
469+ let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked"))
470+ let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
471+ if ((owner != addr))
472+ then throw((LANDPREFIX + " is not yours"))
473+ else {
474+ let d = split(asset.description, "_")
475+ $Tuple4(duckAssetId, landAssetId, d, savedTime)
476+ }
478477 }
479478 }
480479
481480
482-func upInfraCommon (shouldUseMat,caller,landAssetId) = {
481+func claimResInternal (addr,amount) = {
482+ let c = checkClaimConditions(addr)
483+ let landSize = c._3[recLandSize]
484+ let terrainCounts = countTerrains(c._3[recTerrains])
485+ let deltaTime = (lastBlock.timestamp - c._4)
486+ if ((0 > deltaTime))
487+ then throw(((("Saved timestamp is in future, saved = " + toString(c._4)) + ", current = ") + toString(lastBlock.timestamp)))
488+ else {
489+ let pieces = numPiecesBySize(landSize)
490+ let dailyProductionByPiece = applyBonuses(c._2)
491+ let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS)
492+ if ((amount > availRes))
493+ then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount)))
494+ else {
495+ let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (dailyProductionByPiece * pieces))
496+ let newTimestamp = (lastBlock.timestamp - newDeltaTime)
497+ let bpKey = keyBackpackByDuck(c._1)
498+ let currentPack = getBackpack(bpKey)
499+ let currentRes = split(currentPack[bpIdxRes], "_")
500+ let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime), (pieces / 25), dailyProductionByPiece)
501+ $Tuple3([IntegerEntry(keyStakedTimeByAssetId(c._2), newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, c._2, addr), newTimestamp)], bpKey, [currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]])
502+ }
503+ }
504+ }
505+
506+
507+func claimAll (addr,landAssetId,pieces) = {
508+ let timeKey = keyStakedTimeByAssetId(landAssetId)
509+ let savedTime = value(getInteger(timeKey))
510+ let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId), DAYMILLIS) * pieces)
511+ claimResInternal(addr, availRes)
512+ }
513+
514+
515+func upInfraCommon (shouldUseMat,caller,paymentAmount) = {
483516 let addr = toString(caller)
484- let infraKey = keyInfraLevelByAssetId(landAssetId)
517+ let c = checkClaimConditions(addr)
518+ let pieces = numPiecesBySize(c._3[recLandSize])
519+ let infraKey = keyInfraLevelByAssetId(c._2)
485520 let curLevel = valueOrElse(getInteger(infraKey), 0)
486521 if ((curLevel >= 3))
487522 then throw("Currently max infrastructure level = 3")
488523 else {
489524 let newLevel = (curLevel + 1)
490- let asset = value(assetInfo(fromBase58String(landAssetId)))
491- if (!(contains(asset.name, LANDPREFIX)))
492- then throw((("NFT " + LANDPREFIX) + " token should be passed as param"))
525+ let cost = fraction(InfraUpgradeCostSUsdn, (pieces * newLevel), 25)
526+ if (if (!(shouldUseMat))
527+ then (paymentAmount != cost)
528+ else false)
529+ then throw(("Payment attached should be " + toString(cost)))
493530 else {
494- let owner = getStringValue(keyLandAssetIdToOwner(landAssetId))
495- if ((owner != addr))
496- then throw((LANDPREFIX + " is not yours"))
497- else {
498- let d = split(asset.description, "_")
499- let landSize = d[recLandSize]
500- let pieces = numPiecesBySize(landSize)
501- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
502- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
503- let loc = split(value(curLocation), "_")
504- if ((loc[locIdxType] != "L"))
505- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
506- else if ((loc[locIdxId] != landAssetId))
507- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
508- else {
509- let bpKey = keyBackpackByDuck(duckAssetId)
510- let currentPack = getBackpack(bpKey)
511- let mList = split(currentPack[bpIdxMat], "_")
512- let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_")
513- let newRes = claimAll(landAssetId, pieces)
514- $Tuple2([IntegerEntry(infraKey, newLevel), IntegerEntry(keyInfraLevelByAssetIdAndOwner(landAssetId, addr), newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], newRes, newMat, currentPack[bpIdxProd]], ":"))], newLevel)
515- }
516- }
531+ let bpKey = keyBackpackByDuck(c._1)
532+ let currentPack = getBackpack(bpKey)
533+ let mList = split(currentPack[bpIdxMat], "_")
534+ let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_")
535+ let claimResult = claimAll(addr, c._2, pieces)
536+ $Tuple2(([IntegerEntry(infraKey, newLevel), IntegerEntry(keyInfraLevelByAssetIdAndOwner(c._2, addr), newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], claimResult._3[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] ++ claimResult._1), newLevel)
517537 }
518538 }
539+ }
540+
541+
542+func activatePresaleArt (addr) = {
543+ let c = checkClaimConditions(addr)
544+ let activationKey = keypresaleArtActivatedByAssetId(c._2)
545+ if (valueOrElse(getBoolean(activationKey), false))
546+ then throw("Presale artifact is already activated")
547+ else if ((parseIntValue(c._3[recLandNum]) > 500))
548+ then throw((((LANDPREFIX + " ") + c._2) + " is not eligible for presale artifact"))
549+ else [BooleanEntry(keypresaleArtActivatedByAssetId(c._2), true)]
519550 }
520551
521552
522553 @Callable(i)
523554 func stakeLand () = {
524555 let pmt = value(i.payments[0])
525556 let assetId = value(pmt.assetId)
526557 let address = toString(i.caller)
527558 if ((pmt.amount != 1))
528559 then throw((("NFT " + LANDPREFIX) + " token should be attached as payment"))
529560 else {
530561 let asset = value(assetInfo(assetId))
531562 if ((asset.issuer != this))
532563 then throw("Unknown issuer of token")
533564 else if (!(contains(asset.name, LANDPREFIX)))
534565 then throw((("Only NFT " + LANDPREFIX) + " tokens are accepted"))
535566 else {
536567 let landNumSize = drop(asset.name, 4)
537568 let landNum = if (contains(landNumSize, "XXL"))
538569 then dropRight(landNumSize, 3)
539570 else if (contains(landNumSize, "XL"))
540571 then dropRight(landNumSize, 2)
541572 else dropRight(landNumSize, 1)
542573 let landNumInt = valueOrErrorMessage(parseInt(landNum), ("Cannot parse land number from " + asset.name))
543574 let landAssetId = toBase58String(assetId)
544575 let timeKey = keyStakedTimeByAssetId(landAssetId)
545576 if (isDefined(getInteger(timeKey)))
546577 then throw((("NFT " + asset.name) + " is already staked"))
547578 else {
548579 let d = split(asset.description, "_")
549580 let terrainCounts = countTerrains(d[recTerrains])
550581 let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1)
551- let presaleActive = if ((500 >= landNumInt))
552- then (lastBlock.timestamp > PresaleArtifactActivationTime)
553- else false
554582 [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(landAssetId), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)]
555583 }
556584 }
557585 }
558586 }
559587
560588
561589
562590 @Callable(i)
563-func unstakeLand (landAssetId) = if ((size(i.payments) != 0))
591+func unstakeLand (landAssetIdStr) = if ((size(i.payments) != 0))
564592 then throw("unstake doesn't require any payments")
565593 else {
566- let assetId = fromBase58String(landAssetId)
567- let address = toString(i.caller)
568- let asset = value(assetInfo(assetId))
569- if ((asset.issuer != this))
570- then throw("Unknown issuer of token")
571- else if (!(contains(asset.name, LANDPREFIX)))
572- then throw((("Only NFT " + LANDPREFIX) + " tokens can be unstaked"))
573- else {
574- let timeKey = keyStakedTimeByAssetId(landAssetId)
575- if (!(isDefined(timeKey)))
576- then throw((("NFT " + asset.name) + " is not staked"))
577- else {
578- let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned"))
579- if ((owner != address))
580- then throw((("Staked " + LANDPREFIX) + " is not yours"))
581- else {
582- let d = split(asset.description, "_")
583- let terrainCounts = countTerrains(d[recTerrains])
584- let pieces = numPiecesBySize(d[recLandSize])
585- let props = updateProportions(terrainCounts, (pieces / 25), -1)
586- let newRes = claimAll(landAssetId, pieces)
587- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(address)), (("You can't unstake " + LANDPREFIX) + " without a duck staked"))
588- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
589- let loc = split(value(curLocation), "_")
590- if ((loc[locIdxType] != "L"))
591- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
592- else if ((loc[locIdxId] != landAssetId))
593- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
594- else {
595- let bpKey = keyBackpackByDuck(duckAssetId)
596- let currentPack = getBackpack(bpKey)
597-[ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address)), StringEntry(keyResProportions(), props), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], newRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":"))]
598- }
599- }
600- }
601- }
594+ let addr = toString(i.caller)
595+ let c = checkClaimConditions(addr)
596+ let terrainCounts = countTerrains(c._3[recTerrains])
597+ let pieces = numPiecesBySize(c._3[recLandSize])
598+ let props = updateProportions(terrainCounts, (pieces / 25), -1)
599+ let claimResult = claimAll(addr, c._2, pieces)
600+[ScriptTransfer(i.caller, 1, fromBase58String(c._2)), DeleteEntry(keyStakedTimeByAssetId(c._2)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, c._2, addr)), StringEntry(keyResProportions(), props), StringEntry(claimResult._2, makeString(claimResult._3, ":"))]
602601 }
603602
604603
605604
606605 @Callable(i)
607606 func stakeDuck () = {
608607 let pmt = value(i.payments[0])
609608 let assetId = value(pmt.assetId)
610609 let address = toString(i.caller)
611610 if ((pmt.amount != 1))
612611 then throw((("NFT " + DUCKPREFIX) + " token should be attached as payment"))
613612 else {
614613 let asset = value(assetInfo(assetId))
615614 if (if ((asset.issuer != incubatorAddr))
616615 then (asset.issuer != breederAddr)
617616 else false)
618617 then throw((("Unknown issuer of " + DUCKPREFIX) + " token"))
619618 else if (!(contains(asset.name, DUCKPREFIX)))
620619 then throw((("Only NFT " + DUCKPREFIX) + " tokens are accepted"))
621620 else {
622621 let assetIdStr = toBase58String(assetId)
623622 let timeKey = keyStakedTimeByAssetId(assetIdStr)
624623 if (isDefined(getInteger(timeKey)))
625624 then throw((("NFT " + asset.name) + " is already staked"))
626625 else if (isDefined(getString(keyStakedDuckByOwner(address))))
627626 then throw(("You already staked one duck: " + asset.name))
628627 else {
629628 let locKey = keyDuckLocation(assetIdStr)
630629 let location = getString(locKey)
631630 let keyHealth = keyDuckHealth(assetIdStr)
632631 let health = getInteger(keyHealth)
633632 let bpKey = keyBackpackByDuck(assetIdStr)
634633 let backpack = getString(bpKey)
635634 ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location))
636635 then nil
637636 else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health))
638637 then nil
639638 else ([IntegerEntry(keyHealth, 100)] ++ (if (isDefined(backpack))
640639 then nil
641640 else [StringEntry(bpKey, "0:0_0_0_0_0_0:0_0_0_0_0_0:")]))))))
642641 }
643642 }
644643 }
645644 }
646645
647646
648647
649648 @Callable(i)
650649 func unstakeDuck (assetIdStr) = if ((size(i.payments) != 0))
651650 then throw("unstake doesn't require any payments")
652651 else {
653652 let assetId = fromBase58String(assetIdStr)
654653 let address = toString(i.caller)
655654 let asset = value(assetInfo(assetId))
656655 if (if ((asset.issuer != incubatorAddr))
657656 then (asset.issuer != breederAddr)
658657 else false)
659658 then throw((("Unknown issuer of " + DUCKPREFIX) + " token"))
660659 else if (!(contains(asset.name, DUCKPREFIX)))
661660 then throw((("Only NFT " + DUCKPREFIX) + " tokens can be unstaked"))
662661 else {
663662 let timeKey = keyStakedTimeByAssetId(toBase58String(assetId))
664663 if (!(isDefined(timeKey)))
665664 then throw((("NFT " + asset.name) + " is not staked"))
666665 else if (!(isDefined(keyStakedDuckByOwner(address))))
667666 then throw((("The duck " + asset.name) + " is not staked"))
668667 else {
669668 let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned"))
670669 if ((owner != address))
671670 then throw("Staked NFT is not yours")
672671 else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyDuckIdToOwner(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))]
673672 }
674673 }
675674 }
676675
677676
678677
679678 @Callable(i)
680-func claimRes (amount,landAssetId) = if ((size(i.payments) != 0))
679+func claimRes (amount,landAssetIdStr) = if ((size(i.payments) != 0))
681680 then throw("claimRes doesn't require any payments")
682681 else {
683682 let addr = toString(i.originCaller)
684- let asset = value(assetInfo(fromBase58String(landAssetId)))
685- if (!(contains(asset.name, LANDPREFIX)))
686- then throw((("NFT " + LANDPREFIX) + " token should be passed as param"))
687- else {
688- let timeKey = keyStakedTimeByAssetId(landAssetId)
689- let owner = getStringValue(keyLandAssetIdToOwner(landAssetId))
690- if ((owner != addr))
691- then throw((LANDPREFIX + " is not yours"))
692- else {
693- let d = split(asset.description, "_")
694- let landSize = d[recLandSize]
695- let terrainCounts = countTerrains(d[recTerrains])
696- let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked")
697- let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION)
698- let loc = split(value(curLocation), "_")
699- if ((loc[locIdxType] != "L"))
700- then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L"))
701- else if ((loc[locIdxId] != landAssetId))
702- then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId))
703- else {
704- let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked"))
705- let deltaTime = (lastBlock.timestamp - savedTime)
706- if ((0 > deltaTime))
707- then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp)))
708- else {
709- let pieces = numPiecesBySize(landSize)
710- let dailyProductionByPiece = applyBonuses(landAssetId)
711- let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS)
712- if ((amount > availRes))
713- then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount)))
714- else {
715- let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (dailyProductionByPiece * pieces))
716- let newTimestamp = (lastBlock.timestamp - newDeltaTime)
717- let bpKey = keyBackpackByDuck(duckAssetId)
718- let currentPack = getBackpack(bpKey)
719- let currentRes = split(currentPack[bpIdxRes], "_")
720- let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime), (pieces / 25), dailyProductionByPiece)
721- let newPack = makeString([currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":")
722- $Tuple2([StringEntry(bpKey, newPack), IntegerEntry(timeKey, newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, owner), newTimestamp)], bpRes)
723- }
724- }
725- }
726- }
727- }
683+ let result = claimResInternal(addr, amount)
684+ $Tuple2((result._1 :+ StringEntry(result._2, makeString(result._3, ":"))), result._3[bpIdxRes])
728685 }
729686
730687
731688
732689 @Callable(i)
733690 func flight (message,sig) = if (!(sigVerify_8Kb(message, sig, pub)))
734691 then throw("signature does not match")
735692 else if ((size(i.payments) != 0))
736693 then throw("flight doesn't require any payments")
737694 else {
738695 let parts = split(toUtf8String(message), ";")
739696 let hp = split(split(parts[0], "|")[0], "_")
740697 let curHP = parseIntValue(hp[0])
741698 let newHP = parseIntValue(hp[1])
742699 let newLocAndTime = split(parts[1], ":")
743700 let newLocation = newLocAndTime[0]
744701 let time = parseIntValue(newLocAndTime[1])
745702 if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS)))
746703 then true
747704 else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time))
748705 then throw("signature outdated")
749706 else {
750707 let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
751708 let keyHealth = keyDuckHealth(duckAssetId)
752709 let oldFromState = valueOrElse(getInteger(keyHealth), 100)
753710 if ((oldFromState != curHP))
754711 then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP)))
755712 else if ((0 >= curHP))
756713 then throw("You can't fly with zero health")
757714 else {
758715 let locKey = keyDuckLocation(duckAssetId)
759716 let curLocation = valueOrElse(getString(locKey), DEFAULTLOCATION)
760717 if ((newLocation == curLocation))
761718 then throw("You can't fly to the same location")
762719 else $Tuple2([StringEntry(locKey, if ((newHP > 0))
763720 then newLocation
764721 else curLocation), IntegerEntry(keyHealth, newHP)], unit)
765722 }
766723 }
767724 }
768725
769726
770727
771728 @Callable(i)
772729 func setHealth (health,duckAssetId) = if (if ((0 > health))
773730 then true
774731 else (health > 100))
775732 then throw("HP should be within 0..100")
776733 else [IntegerEntry(keyDuckHealth(duckAssetId), health)]
777734
778735
779736
780737 @Callable(i)
781738 func heal (matType,amount) = if (if ((0 > matType))
782739 then true
783740 else (matType >= NUMRES))
784741 then throw(("Unknown material: " + toString(matType)))
785742 else if ((0 >= amount))
786743 then throw(("Amount should be positive! " + toString(amount)))
787744 else {
788745 let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked")
789746 let keyHealth = keyDuckHealth(duckAssetId)
790747 let oldHealth = valueOrElse(getInteger(keyHealth), 100)
791748 if ((oldHealth >= 100))
792749 then throw("HP should be < 100 to heal")
793750 else {
794751 let bpKey = keyBackpackByDuck(duckAssetId)
795752 let currentPack = getBackpack(bpKey)
796753 let mList = split(currentPack[bpIdxMat], "_")
797754 let currentAmount = parseIntValue(mList[matType])
798755 let deltaHealth = min([(amount / HEALCOST), (100 - oldHealth)])
799756 let spendAmount = (deltaHealth * HEALCOST)
800757 if ((spendAmount > currentAmount))
801758 then throw(((((("You need " + toString(spendAmount)) + " of ") + matTypes[matType]) + " to heal, but you backpack contains ") + toString(currentAmount)))
802759 else {
803760 let newMat = subOneInList(mList, matType, spendAmount)
804761 [IntegerEntry(keyHealth, (oldHealth + deltaHealth)), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))]
805762 }
806763 }
807764 }
808765
809766
810767
811768 @Callable(i)
812769 func updateBackpack (duckAssetId,newPack) = if ((i.caller != economyAddr))
813770 then throw("permission denied")
814771 else $Tuple2([StringEntry(keyBackpackByDuck(duckAssetId), newPack)], newPack)
815772
816773
817774
818775 @Callable(i)
819776 func expeditionBuy (message,sig) = if ((size(i.payments) != 1))
820777 then throw("Exactly one payment required")
821778 else {
822779 let pmt = value(i.payments[0])
823780 if ((pmt.assetId != usdnAssetId))
824781 then throw("Allowed USDN payment only!")
825782 else if ((pmt.amount != EXPUSDN))
826783 then throw(("Payment attached should be " + toString(EXPUSDN)))
827784 else expeditionCommon(false, i.caller, i.transactionId, message, sig)
828785 }
829786
830787
831788
832789 @Callable(i)
833790 func expedition (message,sig) = if ((size(i.payments) != 0))
834791 then throw("expedition doesn't require any payments")
835792 else expeditionCommon(true, i.caller, i.transactionId, message, sig)
836793
837794
838795
839796 @Callable(i)
840-func upgradeInfra (landAssetId) = if ((size(i.payments) != 0))
797+func upgradeInfra (landAssetIdIgnored) = if ((size(i.payments) != 0))
841798 then throw("Infrastructure upgrade doesn't require any payments")
842- else upInfraCommon(true, i.caller, landAssetId)
799+ else upInfraCommon(true, i.caller, 0)
843800
844801
845802
846803 @Callable(i)
847-func upgradeInfraUsdn (landAssetId) = if ((size(i.payments) != 1))
804+func upgradeInfraUsdn (landAssetIdIgnored) = if ((size(i.payments) != 1))
848805 then throw("Exactly one payment required")
849806 else {
850807 let pmt = value(i.payments[0])
851808 if ((pmt.assetId != usdnAssetId))
852809 then throw("Allowed USDN payment only!")
853- else {
854- let newLevel = (valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) + 1)
855- let asset = value(assetInfo(fromBase58String(landAssetId)))
856- let d = split(asset.description, "_")
857- let cost = fraction(InfraUpgradeCostSUsdn, (numPiecesBySize(d[recLandSize]) * newLevel), 25)
858- if ((pmt.amount != cost))
859- then throw(("Payment attached should be " + toString(cost)))
860- else upInfraCommon(false, i.caller, landAssetId)
861- }
810+ else upInfraCommon(false, i.caller, pmt.amount)
811+ }
812+
813+
814+
815+@Callable(i)
816+func activateArtifact (artName) = if ((size(i.payments) != 0))
817+ then throw("Artifact activation doesn't require any payments")
818+ else {
819+ let result = match artName {
820+ case _ =>
821+ if (("PRESALE" == $match0))
822+ then activatePresaleArt(toString(i.caller))
823+ else throw("Unknown artifact")
824+ }
825+ result
862826 }
863827
864828

github/deemru/w8io/026f985 
96.11 ms