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+4CO89YKZWpwdGN8kvabNgdYoDI3gkAAgECDVVua25vd24gY2hhaW4ADWluY3ViYXRvckFkZHIEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDAJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNQRWt0VnV4MlJoY2hTTjYzRHNEbzRiNG16NFFxektTZUR2AwkAAAICAVQFByRtYXRjaDAFBHRoaXMJAAIBAg1Vbmtub3duIGNoYWluAAticmVlZGVyQWRkcgQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAkBEUBleHRyTmF0aXZlKDEwNjIpAQIj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Wx1ZQEJAJEDAggFAWkIcGF5bWVudHMAAAMJAQIhPQIIBQNwbXQHYXNzZXRJZAULdXNkbkFzc2V0SWQJAAIBAhpBbGxvd2VkIFVTRE4gcGF5bWVudCBvbmx5IQkBDXVwSW5mcmFDb21tb24DBwgFAWkGY2FsbGVyCAUDcG10BmFtb3VudAFpARBhY3RpdmF0ZUFydGlmYWN0AQdhcnROYW1lAwkBAiE9AgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIwQXJ0aWZhY3QgYWN0aXZhdGlvbiBkb2Vzbid0IHJlcXVpcmUgYW55IHBheW1lbnRzBAZyZXN1bHQEByRtYXRjaDAFB2FydE5hbWUDCQAAAgIHUFJFU0FMRQUHJG1hdGNoMAkBEmFjdGl2YXRlUHJlc2FsZUFydAEJAKUIAQgFAWkGY2FsbGVyCQACAQIQVW5rbm93biBhcnRpZmFjdAUGcmVzdWx0AA3u1ac=", "height": 2393274, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3DsgrbRAncKXuvTep9mgjJa5z9TvSmVoeUkZBPKj5fKN Next: CAKs3kgsQ12fqrxwYjQd7LqqT65S5TtXMtm8Wq5bCs3N Diff:
Old | New | Differences | |
---|---|---|---|
92 | 92 | then 1000000000 | |
93 | 93 | else if (("T" == $match0)) | |
94 | 94 | 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 | |
104 | 95 | else throw("Unknown chain") | |
105 | 96 | } | |
106 | 97 | ||
461 | 452 | let presaleBonus = if (valueOrElse(getBoolean(keypresaleArtActivatedByAssetId(landAssetId)), false)) | |
462 | 453 | then 3 | |
463 | 454 | else 0 | |
464 | - | (DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) | |
455 | + | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, presaleBonus, 20)) | |
465 | 456 | } | |
466 | 457 | ||
467 | 458 | ||
468 | - | func | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | if (( | |
473 | - | then throw((( | |
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")) | |
474 | 465 | 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 | + | } | |
478 | 477 | } | |
479 | 478 | } | |
480 | 479 | ||
481 | 480 | ||
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) = { | |
483 | 516 | 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) | |
485 | 520 | let curLevel = valueOrElse(getInteger(infraKey), 0) | |
486 | 521 | if ((curLevel >= 3)) | |
487 | 522 | then throw("Currently max infrastructure level = 3") | |
488 | 523 | else { | |
489 | 524 | 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))) | |
493 | 530 | 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) | |
517 | 537 | } | |
518 | 538 | } | |
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)] | |
519 | 550 | } | |
520 | 551 | ||
521 | 552 | ||
548 | 579 | let d = split(asset.description, "_") | |
549 | 580 | let terrainCounts = countTerrains(d[recTerrains]) | |
550 | 581 | let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1) | |
551 | - | let presaleActive = if ((500 >= landNumInt)) | |
552 | - | then (lastBlock.timestamp > PresaleArtifactActivationTime) | |
553 | - | else false | |
554 | 582 | [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(landAssetId), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)] | |
555 | 583 | } | |
556 | 584 | } | |
560 | 588 | ||
561 | 589 | ||
562 | 590 | @Callable(i) | |
563 | - | func unstakeLand ( | |
591 | + | func unstakeLand (landAssetIdStr) = if ((size(i.payments) != 0)) | |
564 | 592 | then throw("unstake doesn't require any payments") | |
565 | 593 | 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, ":"))] | |
602 | 601 | } | |
603 | 602 | ||
604 | 603 | ||
677 | 676 | ||
678 | 677 | ||
679 | 678 | @Callable(i) | |
680 | - | func claimRes (amount, | |
679 | + | func claimRes (amount,landAssetIdStr) = if ((size(i.payments) != 0)) | |
681 | 680 | then throw("claimRes doesn't require any payments") | |
682 | 681 | else { | |
683 | 682 | 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]) | |
728 | 685 | } | |
729 | 686 | ||
730 | 687 | ||
837 | 794 | ||
838 | 795 | ||
839 | 796 | @Callable(i) | |
840 | - | func upgradeInfra ( | |
797 | + | func upgradeInfra (landAssetIdIgnored) = if ((size(i.payments) != 0)) | |
841 | 798 | then throw("Infrastructure upgrade doesn't require any payments") | |
842 | - | else upInfraCommon(true, i.caller, | |
799 | + | else upInfraCommon(true, i.caller, 0) | |
843 | 800 | ||
844 | 801 | ||
845 | 802 | ||
846 | 803 | @Callable(i) | |
847 | - | func upgradeInfraUsdn ( | |
804 | + | func upgradeInfraUsdn (landAssetIdIgnored) = if ((size(i.payments) != 1)) | |
848 | 805 | then throw("Exactly one payment required") | |
849 | 806 | else { | |
850 | 807 | let pmt = value(i.payments[0]) | |
851 | 808 | if ((pmt.assetId != usdnAssetId)) | |
852 | 809 | 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 | |
862 | 826 | } | |
863 | 827 | ||
864 | 828 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let chain = toUtf8String(take(drop(this.bytes, 1), 1)) | |
5 | 5 | ||
6 | 6 | let usdnAssetId = match chain { | |
7 | 7 | case _ => | |
8 | 8 | if (("W" == $match0)) | |
9 | 9 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
10 | 10 | else if (("T" == $match0)) | |
11 | 11 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
12 | 12 | else throw("Unknown chain") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | let incubatorAddr = match chain { | |
16 | 16 | case _ => | |
17 | 17 | if (("W" == $match0)) | |
18 | 18 | then addressFromStringValue("3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv") | |
19 | 19 | else if (("T" == $match0)) | |
20 | 20 | then this | |
21 | 21 | else throw("Unknown chain") | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | let breederAddr = match chain { | |
25 | 25 | case _ => | |
26 | 26 | if (("W" == $match0)) | |
27 | 27 | then addressFromStringValue("3PDVuU45H7Eh5dmtNbnRNRStGwULA7NY6Hb") | |
28 | 28 | else if (("T" == $match0)) | |
29 | 29 | then this | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | let economyAddr = match chain { | |
34 | 34 | case _ => | |
35 | 35 | if (("W" == $match0)) | |
36 | 36 | then addressFromStringValue("3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D") | |
37 | 37 | else if (("T" == $match0)) | |
38 | 38 | then addressFromStringValue("3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep") | |
39 | 39 | else throw("Unknown chain") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | let pub = base58'6LfPuKJjLgekmncBhMg2LZyMTNVzZBccXR28ySXm9uXD' | |
43 | 43 | ||
44 | 44 | let HEALCOST = 10000 | |
45 | 45 | ||
46 | 46 | let LANDPREFIX = "LAND" | |
47 | 47 | ||
48 | 48 | let DUCKPREFIX = "DUCK" | |
49 | 49 | ||
50 | 50 | let DEFAULTLOCATION = "Africa_F_Africa" | |
51 | 51 | ||
52 | 52 | let NUMRES = 6 | |
53 | 53 | ||
54 | 54 | let DAILYRESBYPIECE = 3456000 | |
55 | 55 | ||
56 | 56 | let DAYMILLIS = 86400000 | |
57 | 57 | ||
58 | 58 | let FIVEMINUTESMILLIS = 300000 | |
59 | 59 | ||
60 | 60 | let RESOURCEPRICEMIN = 158549 | |
61 | 61 | ||
62 | 62 | let InfraUpgradeCostS = match chain { | |
63 | 63 | case _ => | |
64 | 64 | if (("W" == $match0)) | |
65 | 65 | then 18921595217 | |
66 | 66 | else if (("T" == $match0)) | |
67 | 67 | then 189215952 | |
68 | 68 | else throw("Unknown chain") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | let InfraUpgradeCostSUsdn = match chain { | |
72 | 72 | case _ => | |
73 | 73 | if (("W" == $match0)) | |
74 | 74 | then 120000000 | |
75 | 75 | else if (("T" == $match0)) | |
76 | 76 | then 1200000 | |
77 | 77 | else throw("Unknown chain") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | let EXPMATERIALS = match chain { | |
81 | 81 | case _ => | |
82 | 82 | if (("W" == $match0)) | |
83 | 83 | then 157679960139 | |
84 | 84 | else if (("T" == $match0)) | |
85 | 85 | then 1576799601 | |
86 | 86 | else throw("Unknown chain") | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | let EXPUSDN = match chain { | |
90 | 90 | case _ => | |
91 | 91 | if (("W" == $match0)) | |
92 | 92 | then 1000000000 | |
93 | 93 | else if (("T" == $match0)) | |
94 | 94 | 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 | |
104 | 95 | else throw("Unknown chain") | |
105 | 96 | } | |
106 | 97 | ||
107 | 98 | let MULT6 = 1000000 | |
108 | 99 | ||
109 | 100 | let FIVEX = toBigInt(5) | |
110 | 101 | ||
111 | 102 | let TWENTYX = toBigInt(20) | |
112 | 103 | ||
113 | 104 | let TWENTY2X = toBigInt((20 * 20)) | |
114 | 105 | ||
115 | 106 | let TWENTY3X = toBigInt(((20 * 20) * 20)) | |
116 | 107 | ||
117 | 108 | let TWENTY4X = toBigInt((((20 * 20) * 20) * 20)) | |
118 | 109 | ||
119 | 110 | let TWENTY5X = toBigInt(((((20 * 20) * 20) * 20) * 20)) | |
120 | 111 | ||
121 | 112 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
122 | 113 | ||
123 | 114 | let continents = ["Asia", "Europe", "Americas", "Oceania", "Africa"] | |
124 | 115 | ||
125 | 116 | func keyNextFreeLandNum () = "nextLandNum" | |
126 | 117 | ||
127 | 118 | ||
128 | 119 | func keyLandToAssetId (landNum) = ("landToAsset_" + landNum) | |
129 | 120 | ||
130 | 121 | ||
131 | 122 | func keyNftName (landNum,landSize) = ((LANDPREFIX + landNum) + landSize) | |
132 | 123 | ||
133 | 124 | ||
134 | 125 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
135 | 126 | ||
136 | 127 | ||
137 | 128 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
138 | 129 | ||
139 | 130 | ||
140 | 131 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
141 | 132 | ||
142 | 133 | ||
143 | 134 | func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId) | |
144 | 135 | ||
145 | 136 | ||
146 | 137 | func keyInfraLevelByAssetIdAndOwner (assetId,ownerAddr) = ((("infraLevelByAssetIdAndOwner_" + assetId) + "_") + ownerAddr) | |
147 | 138 | ||
148 | 139 | ||
149 | 140 | func keypresaleArtActivatedByAssetId (assetId) = ("presaleArtActivated_" + assetId) | |
150 | 141 | ||
151 | 142 | ||
152 | 143 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
153 | 144 | ||
154 | 145 | ||
155 | 146 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
156 | 147 | ||
157 | 148 | ||
158 | 149 | func keyLandNumToOwner (landNum) = ("landOwner_" + landNum) | |
159 | 150 | ||
160 | 151 | ||
161 | 152 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
162 | 153 | ||
163 | 154 | ||
164 | 155 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
165 | 156 | ||
166 | 157 | ||
167 | 158 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
168 | 159 | ||
169 | 160 | ||
170 | 161 | func keyResProportions () = "resTypesProportions" | |
171 | 162 | ||
172 | 163 | ||
173 | 164 | let recLandNum = 0 | |
174 | 165 | ||
175 | 166 | let recLandSize = 1 | |
176 | 167 | ||
177 | 168 | let recTerrains = 2 | |
178 | 169 | ||
179 | 170 | let recContinent = 3 | |
180 | 171 | ||
181 | 172 | let locIdxContinent = 0 | |
182 | 173 | ||
183 | 174 | let locIdxType = 1 | |
184 | 175 | ||
185 | 176 | let locIdxId = 2 | |
186 | 177 | ||
187 | 178 | let bpIdxLevel = 0 | |
188 | 179 | ||
189 | 180 | let bpIdxRes = 1 | |
190 | 181 | ||
191 | 182 | let bpIdxMat = 2 | |
192 | 183 | ||
193 | 184 | let bpIdxProd = 3 | |
194 | 185 | ||
195 | 186 | func asString (v) = match v { | |
196 | 187 | case s: String => | |
197 | 188 | s | |
198 | 189 | case _ => | |
199 | 190 | throw("fail to cast into String") | |
200 | 191 | } | |
201 | 192 | ||
202 | 193 | ||
203 | 194 | func getNeededMaterials (total) = { | |
204 | 195 | let props = split(value(getString(keyResProportions())), "_") | |
205 | 196 | if ((size(props) != NUMRES)) | |
206 | 197 | then throw("Wrong proportions data") | |
207 | 198 | else { | |
208 | 199 | let r = [parseIntValue(props[0]), parseIntValue(props[1]), parseIntValue(props[2]), parseIntValue(props[3]), parseIntValue(props[4]), parseIntValue(props[5])] | |
209 | 200 | let sum = (((((r[0] + r[1]) + r[2]) + r[3]) + r[4]) + r[5]) | |
210 | 201 | if ((0 >= sum)) | |
211 | 202 | then throw("No lands staked") | |
212 | 203 | else { | |
213 | 204 | let norm6 = fraction(total, MULT6, sum) | |
214 | 205 | func normalizer (acc,elem) = (acc :+ fraction(elem, norm6, MULT6)) | |
215 | 206 | ||
216 | 207 | let $l = r | |
217 | 208 | let $s = size($l) | |
218 | 209 | let $acc0 = nil | |
219 | 210 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
220 | 211 | then $a | |
221 | 212 | else normalizer($a, $l[$i]) | |
222 | 213 | ||
223 | 214 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
224 | 215 | then $a | |
225 | 216 | else throw("List size exceeds 6") | |
226 | 217 | ||
227 | 218 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
228 | 219 | } | |
229 | 220 | } | |
230 | 221 | } | |
231 | 222 | ||
232 | 223 | ||
233 | 224 | func subtractMaterials (shouldUseMat,has,totalNeed) = { | |
234 | 225 | let need = getNeededMaterials(totalNeed) | |
235 | 226 | func subtractor (acc,idx) = { | |
236 | 227 | let result = (parseIntValue(has[idx]) - need[idx]) | |
237 | 228 | if ((0 > result)) | |
238 | 229 | then throw(((((("Not enough material idx=" + toString(idx)) + ", you have ") + has[idx]) + ", but need ") + toString(need[idx]))) | |
239 | 230 | else (acc :+ toString(result)) | |
240 | 231 | } | |
241 | 232 | ||
242 | 233 | if (shouldUseMat) | |
243 | 234 | then { | |
244 | 235 | let $l = [0, 1, 2, 3, 4, 5] | |
245 | 236 | let $s = size($l) | |
246 | 237 | let $acc0 = nil | |
247 | 238 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
248 | 239 | then $a | |
249 | 240 | else subtractor($a, $l[$i]) | |
250 | 241 | ||
251 | 242 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
252 | 243 | then $a | |
253 | 244 | else throw("List size exceeds 6") | |
254 | 245 | ||
255 | 246 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
256 | 247 | } | |
257 | 248 | else has | |
258 | 249 | } | |
259 | 250 | ||
260 | 251 | ||
261 | 252 | func updateProportions (terrainCounts,landSizeIndex,sign) = { | |
262 | 253 | let props = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
263 | 254 | if ((size(props) != NUMRES)) | |
264 | 255 | then throw("Wrong proportions data") | |
265 | 256 | else { | |
266 | 257 | func updater (acc,i) = { | |
267 | 258 | let result = (parseIntValue(props[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
268 | 259 | if ((0 > result)) | |
269 | 260 | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
270 | 261 | else (acc :+ toString(result)) | |
271 | 262 | } | |
272 | 263 | ||
273 | 264 | let r = { | |
274 | 265 | let $l = [0, 1, 2, 3, 4, 5] | |
275 | 266 | let $s = size($l) | |
276 | 267 | let $acc0 = nil | |
277 | 268 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
278 | 269 | then $a | |
279 | 270 | else updater($a, $l[$i]) | |
280 | 271 | ||
281 | 272 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
282 | 273 | then $a | |
283 | 274 | else throw("List size exceeds 6") | |
284 | 275 | ||
285 | 276 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
286 | 277 | } | |
287 | 278 | makeString(r, "_") | |
288 | 279 | } | |
289 | 280 | } | |
290 | 281 | ||
291 | 282 | ||
292 | 283 | 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)] | |
293 | 284 | ||
294 | 285 | ||
295 | 286 | func numPiecesBySize (landSize) = match landSize { | |
296 | 287 | case _ => | |
297 | 288 | if (("S" == $match0)) | |
298 | 289 | then 25 | |
299 | 290 | else if (("M" == $match0)) | |
300 | 291 | then 100 | |
301 | 292 | else if (("L" == $match0)) | |
302 | 293 | then 225 | |
303 | 294 | else if (("XL" == $match0)) | |
304 | 295 | then 400 | |
305 | 296 | else if (("XXL" == $match0)) | |
306 | 297 | then 625 | |
307 | 298 | else throw("Unknown land size") | |
308 | 299 | } | |
309 | 300 | ||
310 | 301 | ||
311 | 302 | func subOneInList (aList,idx,amount) = { | |
312 | 303 | func subber (acc,i) = (acc :+ (if ((i == idx)) | |
313 | 304 | then toString((parseIntValue(aList[i]) - amount)) | |
314 | 305 | else aList[i])) | |
315 | 306 | ||
316 | 307 | let r = { | |
317 | 308 | let $l = [0, 1, 2, 3, 4, 5] | |
318 | 309 | let $s = size($l) | |
319 | 310 | let $acc0 = nil | |
320 | 311 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
321 | 312 | then $a | |
322 | 313 | else subber($a, $l[$i]) | |
323 | 314 | ||
324 | 315 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
325 | 316 | then $a | |
326 | 317 | else throw("List size exceeds 6") | |
327 | 318 | ||
328 | 319 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
329 | 320 | } | |
330 | 321 | makeString(r, "_") | |
331 | 322 | } | |
332 | 323 | ||
333 | 324 | ||
334 | 325 | func addRes (currentRes,terrainCounts,deltaTime,landSizeIndex,dailyByPieceWithBonuses) = { | |
335 | 326 | func adder (acc,i) = { | |
336 | 327 | let resOfType = ((fraction(deltaTime, dailyByPieceWithBonuses, DAYMILLIS) * terrainCounts[i]) * landSizeIndex) | |
337 | 328 | (acc :+ toString((parseIntValue(currentRes[i]) + resOfType))) | |
338 | 329 | } | |
339 | 330 | ||
340 | 331 | let r = { | |
341 | 332 | let $l = [0, 1, 2, 3, 4, 5] | |
342 | 333 | let $s = size($l) | |
343 | 334 | let $acc0 = nil | |
344 | 335 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
345 | 336 | then $a | |
346 | 337 | else adder($a, $l[$i]) | |
347 | 338 | ||
348 | 339 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
349 | 340 | then $a | |
350 | 341 | else throw("List size exceeds 6") | |
351 | 342 | ||
352 | 343 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
353 | 344 | } | |
354 | 345 | makeString(r, "_") | |
355 | 346 | } | |
356 | 347 | ||
357 | 348 | ||
358 | 349 | func abs (x) = if ((x >= toBigInt(0))) | |
359 | 350 | then x | |
360 | 351 | else -(x) | |
361 | 352 | ||
362 | 353 | ||
363 | 354 | 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]] | |
364 | 355 | ||
365 | 356 | func genChar (n,freqs) = { | |
366 | 357 | let rem = toInt((n % TWENTYX)) | |
367 | 358 | let letter = if ((freqs[0] > rem)) | |
368 | 359 | then "A" | |
369 | 360 | else if ((freqs[1] > rem)) | |
370 | 361 | then "B" | |
371 | 362 | else if ((freqs[2] > rem)) | |
372 | 363 | then "C" | |
373 | 364 | else if ((freqs[3] > rem)) | |
374 | 365 | then "D" | |
375 | 366 | else if ((freqs[4] > rem)) | |
376 | 367 | then "E" | |
377 | 368 | else "F" | |
378 | 369 | letter | |
379 | 370 | } | |
380 | 371 | ||
381 | 372 | ||
382 | 373 | func getBackpack (bpKey) = { | |
383 | 374 | let p = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
384 | 375 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
385 | 376 | then p[bpIdxRes] | |
386 | 377 | else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES)) | |
387 | 378 | then p[bpIdxMat] | |
388 | 379 | else "0_0_0_0_0_0", p[bpIdxProd]] | |
389 | 380 | } | |
390 | 381 | ||
391 | 382 | ||
392 | 383 | func expeditionCommon (shouldUseMat,caller,txId,message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
393 | 384 | then throw("signature does not match") | |
394 | 385 | else { | |
395 | 386 | let parts = split(toUtf8String(message), ";") | |
396 | 387 | let hp = split(split(parts[0], "|")[0], "_") | |
397 | 388 | let curHP = parseIntValue(hp[0]) | |
398 | 389 | let newHP = parseIntValue(hp[1]) | |
399 | 390 | let locAndTime = split(parts[1], ":") | |
400 | 391 | let targetLocation = split(locAndTime[0], "_") | |
401 | 392 | if ((targetLocation[1] != "E")) | |
402 | 393 | then throw("expedition target location type should be E") | |
403 | 394 | else { | |
404 | 395 | let time = parseIntValue(locAndTime[1]) | |
405 | 396 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
406 | 397 | then true | |
407 | 398 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
408 | 399 | then throw("signature outdated") | |
409 | 400 | else { | |
410 | 401 | let userAddr = toString(caller) | |
411 | 402 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(userAddr)), "You don't have a duck staked") | |
412 | 403 | let keyHealth = keyDuckHealth(duckAssetId) | |
413 | 404 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
414 | 405 | if ((oldFromState != curHP)) | |
415 | 406 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
416 | 407 | else if ((0 >= curHP)) | |
417 | 408 | then throw("You can't fly with zero health") | |
418 | 409 | else if ((0 >= newHP)) | |
419 | 410 | then $Tuple2(((if (!(shouldUseMat)) | |
420 | 411 | then [ScriptTransfer(caller, EXPUSDN, usdnAssetId)] | |
421 | 412 | else nil) :+ IntegerEntry(keyHealth, 0)), "") | |
422 | 413 | else { | |
423 | 414 | let bpKey = keyBackpackByDuck(duckAssetId) | |
424 | 415 | let currentPack = getBackpack(bpKey) | |
425 | 416 | let mList = split(currentPack[bpIdxMat], "_") | |
426 | 417 | let newMat = makeString(subtractMaterials(shouldUseMat, mList, EXPMATERIALS), "_") | |
427 | 418 | let bigNum = abs(toBigInt(txId)) | |
428 | 419 | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
429 | 420 | let landNum = toString(freeNum) | |
430 | 421 | let continentIdx = toInt((bigNum % FIVEX)) | |
431 | 422 | let f = freq[continentIdx] | |
432 | 423 | 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)) | |
433 | 424 | ||
434 | 425 | let t = { | |
435 | 426 | let $l = [1, 2, 3, 4, 5] | |
436 | 427 | let $s = size($l) | |
437 | 428 | let $acc0 = $Tuple2("", (bigNum / FIVEX)) | |
438 | 429 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
439 | 430 | then $a | |
440 | 431 | else terrainGenerator($a, $l[$i]) | |
441 | 432 | ||
442 | 433 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
443 | 434 | then $a | |
444 | 435 | else throw("List size exceeds 5") | |
445 | 436 | ||
446 | 437 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
447 | 438 | } | |
448 | 439 | let continent = continents[continentIdx] | |
449 | 440 | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", t._1, continent], "_"), 1, 0, false) | |
450 | 441 | let assetId = calculateAssetId(issue) | |
451 | 442 | let id = toBase58String(assetId) | |
452 | 443 | $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) | |
453 | 444 | } | |
454 | 445 | } | |
455 | 446 | } | |
456 | 447 | } | |
457 | 448 | ||
458 | 449 | ||
459 | 450 | func applyBonuses (landAssetId) = { | |
460 | 451 | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
461 | 452 | let presaleBonus = if (valueOrElse(getBoolean(keypresaleArtActivatedByAssetId(landAssetId)), false)) | |
462 | 453 | then 3 | |
463 | 454 | else 0 | |
464 | - | (DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) | |
455 | + | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, presaleBonus, 20)) | |
465 | 456 | } | |
466 | 457 | ||
467 | 458 | ||
468 | - | func | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | if (( | |
473 | - | then throw((( | |
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")) | |
474 | 465 | 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 | + | } | |
478 | 477 | } | |
479 | 478 | } | |
480 | 479 | ||
481 | 480 | ||
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) = { | |
483 | 516 | 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) | |
485 | 520 | let curLevel = valueOrElse(getInteger(infraKey), 0) | |
486 | 521 | if ((curLevel >= 3)) | |
487 | 522 | then throw("Currently max infrastructure level = 3") | |
488 | 523 | else { | |
489 | 524 | 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))) | |
493 | 530 | 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) | |
517 | 537 | } | |
518 | 538 | } | |
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)] | |
519 | 550 | } | |
520 | 551 | ||
521 | 552 | ||
522 | 553 | @Callable(i) | |
523 | 554 | func stakeLand () = { | |
524 | 555 | let pmt = value(i.payments[0]) | |
525 | 556 | let assetId = value(pmt.assetId) | |
526 | 557 | let address = toString(i.caller) | |
527 | 558 | if ((pmt.amount != 1)) | |
528 | 559 | then throw((("NFT " + LANDPREFIX) + " token should be attached as payment")) | |
529 | 560 | else { | |
530 | 561 | let asset = value(assetInfo(assetId)) | |
531 | 562 | if ((asset.issuer != this)) | |
532 | 563 | then throw("Unknown issuer of token") | |
533 | 564 | else if (!(contains(asset.name, LANDPREFIX))) | |
534 | 565 | then throw((("Only NFT " + LANDPREFIX) + " tokens are accepted")) | |
535 | 566 | else { | |
536 | 567 | let landNumSize = drop(asset.name, 4) | |
537 | 568 | let landNum = if (contains(landNumSize, "XXL")) | |
538 | 569 | then dropRight(landNumSize, 3) | |
539 | 570 | else if (contains(landNumSize, "XL")) | |
540 | 571 | then dropRight(landNumSize, 2) | |
541 | 572 | else dropRight(landNumSize, 1) | |
542 | 573 | let landNumInt = valueOrErrorMessage(parseInt(landNum), ("Cannot parse land number from " + asset.name)) | |
543 | 574 | let landAssetId = toBase58String(assetId) | |
544 | 575 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
545 | 576 | if (isDefined(getInteger(timeKey))) | |
546 | 577 | then throw((("NFT " + asset.name) + " is already staked")) | |
547 | 578 | else { | |
548 | 579 | let d = split(asset.description, "_") | |
549 | 580 | let terrainCounts = countTerrains(d[recTerrains]) | |
550 | 581 | let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1) | |
551 | - | let presaleActive = if ((500 >= landNumInt)) | |
552 | - | then (lastBlock.timestamp > PresaleArtifactActivationTime) | |
553 | - | else false | |
554 | 582 | [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(landAssetId), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)] | |
555 | 583 | } | |
556 | 584 | } | |
557 | 585 | } | |
558 | 586 | } | |
559 | 587 | ||
560 | 588 | ||
561 | 589 | ||
562 | 590 | @Callable(i) | |
563 | - | func unstakeLand ( | |
591 | + | func unstakeLand (landAssetIdStr) = if ((size(i.payments) != 0)) | |
564 | 592 | then throw("unstake doesn't require any payments") | |
565 | 593 | 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, ":"))] | |
602 | 601 | } | |
603 | 602 | ||
604 | 603 | ||
605 | 604 | ||
606 | 605 | @Callable(i) | |
607 | 606 | func stakeDuck () = { | |
608 | 607 | let pmt = value(i.payments[0]) | |
609 | 608 | let assetId = value(pmt.assetId) | |
610 | 609 | let address = toString(i.caller) | |
611 | 610 | if ((pmt.amount != 1)) | |
612 | 611 | then throw((("NFT " + DUCKPREFIX) + " token should be attached as payment")) | |
613 | 612 | else { | |
614 | 613 | let asset = value(assetInfo(assetId)) | |
615 | 614 | if (if ((asset.issuer != incubatorAddr)) | |
616 | 615 | then (asset.issuer != breederAddr) | |
617 | 616 | else false) | |
618 | 617 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
619 | 618 | else if (!(contains(asset.name, DUCKPREFIX))) | |
620 | 619 | then throw((("Only NFT " + DUCKPREFIX) + " tokens are accepted")) | |
621 | 620 | else { | |
622 | 621 | let assetIdStr = toBase58String(assetId) | |
623 | 622 | let timeKey = keyStakedTimeByAssetId(assetIdStr) | |
624 | 623 | if (isDefined(getInteger(timeKey))) | |
625 | 624 | then throw((("NFT " + asset.name) + " is already staked")) | |
626 | 625 | else if (isDefined(getString(keyStakedDuckByOwner(address)))) | |
627 | 626 | then throw(("You already staked one duck: " + asset.name)) | |
628 | 627 | else { | |
629 | 628 | let locKey = keyDuckLocation(assetIdStr) | |
630 | 629 | let location = getString(locKey) | |
631 | 630 | let keyHealth = keyDuckHealth(assetIdStr) | |
632 | 631 | let health = getInteger(keyHealth) | |
633 | 632 | let bpKey = keyBackpackByDuck(assetIdStr) | |
634 | 633 | let backpack = getString(bpKey) | |
635 | 634 | ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location)) | |
636 | 635 | then nil | |
637 | 636 | else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health)) | |
638 | 637 | then nil | |
639 | 638 | else ([IntegerEntry(keyHealth, 100)] ++ (if (isDefined(backpack)) | |
640 | 639 | then nil | |
641 | 640 | else [StringEntry(bpKey, "0:0_0_0_0_0_0:0_0_0_0_0_0:")])))))) | |
642 | 641 | } | |
643 | 642 | } | |
644 | 643 | } | |
645 | 644 | } | |
646 | 645 | ||
647 | 646 | ||
648 | 647 | ||
649 | 648 | @Callable(i) | |
650 | 649 | func unstakeDuck (assetIdStr) = if ((size(i.payments) != 0)) | |
651 | 650 | then throw("unstake doesn't require any payments") | |
652 | 651 | else { | |
653 | 652 | let assetId = fromBase58String(assetIdStr) | |
654 | 653 | let address = toString(i.caller) | |
655 | 654 | let asset = value(assetInfo(assetId)) | |
656 | 655 | if (if ((asset.issuer != incubatorAddr)) | |
657 | 656 | then (asset.issuer != breederAddr) | |
658 | 657 | else false) | |
659 | 658 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
660 | 659 | else if (!(contains(asset.name, DUCKPREFIX))) | |
661 | 660 | then throw((("Only NFT " + DUCKPREFIX) + " tokens can be unstaked")) | |
662 | 661 | else { | |
663 | 662 | let timeKey = keyStakedTimeByAssetId(toBase58String(assetId)) | |
664 | 663 | if (!(isDefined(timeKey))) | |
665 | 664 | then throw((("NFT " + asset.name) + " is not staked")) | |
666 | 665 | else if (!(isDefined(keyStakedDuckByOwner(address)))) | |
667 | 666 | then throw((("The duck " + asset.name) + " is not staked")) | |
668 | 667 | else { | |
669 | 668 | let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned")) | |
670 | 669 | if ((owner != address)) | |
671 | 670 | then throw("Staked NFT is not yours") | |
672 | 671 | else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyDuckIdToOwner(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))] | |
673 | 672 | } | |
674 | 673 | } | |
675 | 674 | } | |
676 | 675 | ||
677 | 676 | ||
678 | 677 | ||
679 | 678 | @Callable(i) | |
680 | - | func claimRes (amount, | |
679 | + | func claimRes (amount,landAssetIdStr) = if ((size(i.payments) != 0)) | |
681 | 680 | then throw("claimRes doesn't require any payments") | |
682 | 681 | else { | |
683 | 682 | 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]) | |
728 | 685 | } | |
729 | 686 | ||
730 | 687 | ||
731 | 688 | ||
732 | 689 | @Callable(i) | |
733 | 690 | func flight (message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
734 | 691 | then throw("signature does not match") | |
735 | 692 | else if ((size(i.payments) != 0)) | |
736 | 693 | then throw("flight doesn't require any payments") | |
737 | 694 | else { | |
738 | 695 | let parts = split(toUtf8String(message), ";") | |
739 | 696 | let hp = split(split(parts[0], "|")[0], "_") | |
740 | 697 | let curHP = parseIntValue(hp[0]) | |
741 | 698 | let newHP = parseIntValue(hp[1]) | |
742 | 699 | let newLocAndTime = split(parts[1], ":") | |
743 | 700 | let newLocation = newLocAndTime[0] | |
744 | 701 | let time = parseIntValue(newLocAndTime[1]) | |
745 | 702 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
746 | 703 | then true | |
747 | 704 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
748 | 705 | then throw("signature outdated") | |
749 | 706 | else { | |
750 | 707 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
751 | 708 | let keyHealth = keyDuckHealth(duckAssetId) | |
752 | 709 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
753 | 710 | if ((oldFromState != curHP)) | |
754 | 711 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
755 | 712 | else if ((0 >= curHP)) | |
756 | 713 | then throw("You can't fly with zero health") | |
757 | 714 | else { | |
758 | 715 | let locKey = keyDuckLocation(duckAssetId) | |
759 | 716 | let curLocation = valueOrElse(getString(locKey), DEFAULTLOCATION) | |
760 | 717 | if ((newLocation == curLocation)) | |
761 | 718 | then throw("You can't fly to the same location") | |
762 | 719 | else $Tuple2([StringEntry(locKey, if ((newHP > 0)) | |
763 | 720 | then newLocation | |
764 | 721 | else curLocation), IntegerEntry(keyHealth, newHP)], unit) | |
765 | 722 | } | |
766 | 723 | } | |
767 | 724 | } | |
768 | 725 | ||
769 | 726 | ||
770 | 727 | ||
771 | 728 | @Callable(i) | |
772 | 729 | func setHealth (health,duckAssetId) = if (if ((0 > health)) | |
773 | 730 | then true | |
774 | 731 | else (health > 100)) | |
775 | 732 | then throw("HP should be within 0..100") | |
776 | 733 | else [IntegerEntry(keyDuckHealth(duckAssetId), health)] | |
777 | 734 | ||
778 | 735 | ||
779 | 736 | ||
780 | 737 | @Callable(i) | |
781 | 738 | func heal (matType,amount) = if (if ((0 > matType)) | |
782 | 739 | then true | |
783 | 740 | else (matType >= NUMRES)) | |
784 | 741 | then throw(("Unknown material: " + toString(matType))) | |
785 | 742 | else if ((0 >= amount)) | |
786 | 743 | then throw(("Amount should be positive! " + toString(amount))) | |
787 | 744 | else { | |
788 | 745 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
789 | 746 | let keyHealth = keyDuckHealth(duckAssetId) | |
790 | 747 | let oldHealth = valueOrElse(getInteger(keyHealth), 100) | |
791 | 748 | if ((oldHealth >= 100)) | |
792 | 749 | then throw("HP should be < 100 to heal") | |
793 | 750 | else { | |
794 | 751 | let bpKey = keyBackpackByDuck(duckAssetId) | |
795 | 752 | let currentPack = getBackpack(bpKey) | |
796 | 753 | let mList = split(currentPack[bpIdxMat], "_") | |
797 | 754 | let currentAmount = parseIntValue(mList[matType]) | |
798 | 755 | let deltaHealth = min([(amount / HEALCOST), (100 - oldHealth)]) | |
799 | 756 | let spendAmount = (deltaHealth * HEALCOST) | |
800 | 757 | if ((spendAmount > currentAmount)) | |
801 | 758 | then throw(((((("You need " + toString(spendAmount)) + " of ") + matTypes[matType]) + " to heal, but you backpack contains ") + toString(currentAmount))) | |
802 | 759 | else { | |
803 | 760 | let newMat = subOneInList(mList, matType, spendAmount) | |
804 | 761 | [IntegerEntry(keyHealth, (oldHealth + deltaHealth)), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] | |
805 | 762 | } | |
806 | 763 | } | |
807 | 764 | } | |
808 | 765 | ||
809 | 766 | ||
810 | 767 | ||
811 | 768 | @Callable(i) | |
812 | 769 | func updateBackpack (duckAssetId,newPack) = if ((i.caller != economyAddr)) | |
813 | 770 | then throw("permission denied") | |
814 | 771 | else $Tuple2([StringEntry(keyBackpackByDuck(duckAssetId), newPack)], newPack) | |
815 | 772 | ||
816 | 773 | ||
817 | 774 | ||
818 | 775 | @Callable(i) | |
819 | 776 | func expeditionBuy (message,sig) = if ((size(i.payments) != 1)) | |
820 | 777 | then throw("Exactly one payment required") | |
821 | 778 | else { | |
822 | 779 | let pmt = value(i.payments[0]) | |
823 | 780 | if ((pmt.assetId != usdnAssetId)) | |
824 | 781 | then throw("Allowed USDN payment only!") | |
825 | 782 | else if ((pmt.amount != EXPUSDN)) | |
826 | 783 | then throw(("Payment attached should be " + toString(EXPUSDN))) | |
827 | 784 | else expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
828 | 785 | } | |
829 | 786 | ||
830 | 787 | ||
831 | 788 | ||
832 | 789 | @Callable(i) | |
833 | 790 | func expedition (message,sig) = if ((size(i.payments) != 0)) | |
834 | 791 | then throw("expedition doesn't require any payments") | |
835 | 792 | else expeditionCommon(true, i.caller, i.transactionId, message, sig) | |
836 | 793 | ||
837 | 794 | ||
838 | 795 | ||
839 | 796 | @Callable(i) | |
840 | - | func upgradeInfra ( | |
797 | + | func upgradeInfra (landAssetIdIgnored) = if ((size(i.payments) != 0)) | |
841 | 798 | then throw("Infrastructure upgrade doesn't require any payments") | |
842 | - | else upInfraCommon(true, i.caller, | |
799 | + | else upInfraCommon(true, i.caller, 0) | |
843 | 800 | ||
844 | 801 | ||
845 | 802 | ||
846 | 803 | @Callable(i) | |
847 | - | func upgradeInfraUsdn ( | |
804 | + | func upgradeInfraUsdn (landAssetIdIgnored) = if ((size(i.payments) != 1)) | |
848 | 805 | then throw("Exactly one payment required") | |
849 | 806 | else { | |
850 | 807 | let pmt = value(i.payments[0]) | |
851 | 808 | if ((pmt.assetId != usdnAssetId)) | |
852 | 809 | 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 | |
862 | 826 | } | |
863 | 827 | ||
864 | 828 |
github/deemru/w8io/026f985 96.11 ms ◑