tx · BMPLrL7JaYrzdyMqEQaof9Z2476EU7k8anQRKiWia9m7 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm: -0.03100000 Waves 2023.01.14 18:30 [2404806] smart account 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm > SELF 0.00000000 Waves
{ "type": 13, "id": "BMPLrL7JaYrzdyMqEQaof9Z2476EU7k8anQRKiWia9m7", "fee": 3100000, "feeAssetId": null, "timestamp": 1673710228941, "version": 2, "chainId": 84, "sender": "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm", "senderPublicKey": "EVooykMNV691Venwp1dHUTBd7KWequzUcda57Wd3LQEX", "proofs": [ "4EqpJQDTMftV7615w7kKj97qY8GAiaYMNhrkxj4MVUvafTgRUm7AZBDhW9HC8oauioVxzzm6bR2h1cRBAPN1CQzG" ], "script": "base64:BgJTCAISABIDCgEIEgASAwoBCBIECgIBCBIECgICAhIECgIBCBIECgIBARIECgIICBIECgICAhIECgICAhIDCgEIEgMKAQgSAwoBCBIDCgEYEgMKARhWAAVjaGFpbgkAsAkBCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2RuQXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAEgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEDCQAAAgIBVAUHJG1hdGNoMAEg93bq9/eDymXbbhPuAjvPWCmVqcHRjfJL2mzYHWKAyN4JAAIBAg1Vbmtub3duIGNoYWluAA1pbmN1YmF0b3JBZGRyBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzUEVrdFZ1eDJSaGNoU042M0RzRG80YjRtejRRcXpLU2VEdgMJAAACAgFUBQckbWF0Y2gwBQR0aGlzCQACAQINVW5rbm93biBjaGFpbgALYnJlZWRlckFkZHIEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDAJ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MBCAUBaQhwYXltZW50cwABCQACAQIcRXhhY3RseSBvbmUgcGF5bWVudCByZXF1aXJlZAQDcG10CQEFdmFsdWUBCQCRAwIIBQFpCHBheW1lbnRzAAADCQECIT0CCAUDcG10B2Fzc2V0SWQFC3VzZG5Bc3NldElkCQACAQIaQWxsb3dlZCBVU0ROIHBheW1lbnQgb25seSEEBnJlc3VsdAkBC21lcmdlQ29tbW9uBQcJAKUIAQgFAWkGY2FsbGVyCAUDcG10BmFtb3VudAUMbGFuZEFzc2V0SWRzCAUBaQ10cmFuc2FjdGlvbklkCQCUCgIJAM0IAggFBnJlc3VsdAJfMQkBDlNjcmlwdFRyYW5zZmVyAwULZWNvbm9teUFkZHIIBQNwbXQGYW1vdW50BQt1c2RuQXNzZXRJZAgFBnJlc3VsdAJfMgDRLwz4", "height": 2404806, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GHnDLx9fbaZCDDUUZzSTzCGjWtWvrC3bi3Dnq8Zj8HgV Next: ESx94b7ZFJufZ3G1VNP6MNoB8gTVpkJoQ42tTVDbWA37 Diff:
Old | New | Differences | |
---|---|---|---|
113 | 113 | ||
114 | 114 | let continents = ["Asia", "Europe", "Americas", "Oceania", "Africa"] | |
115 | 115 | ||
116 | + | let ARTPRESALE = "PRESALE" | |
117 | + | ||
116 | 118 | func keyNextFreeLandNum () = "nextLandNum" | |
117 | 119 | ||
118 | 120 | ||
141 | 143 | ||
142 | 144 | ||
143 | 145 | func keyPresaleArtActivatedByAssetIdAndOwner (assetId,ownerAddr) = ((("presaleArtActivatedByAssetIdAndOwner_" + assetId) + "_") + ownerAddr) | |
146 | + | ||
147 | + | ||
148 | + | func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_") | |
149 | + | ||
150 | + | ||
151 | + | func keyLandArtStatusByTypeAssetIdAndOwner (type,assetId,ownerAddr) = makeString(["landArtStatusByTypeAssetIdAndOwner", type, assetId, ownerAddr], "_") | |
144 | 152 | ||
145 | 153 | ||
146 | 154 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
252 | 260 | } | |
253 | 261 | ||
254 | 262 | ||
263 | + | func updateProportionsInternal (propList,terrainCounts,landSizeIndex,sign) = if ((size(propList) != NUMRES)) | |
264 | + | then throw("Wrong proportions data") | |
265 | + | else { | |
266 | + | func updater (acc,i) = { | |
267 | + | let result = (parseIntValue(propList[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
268 | + | if ((0 > result)) | |
269 | + | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
270 | + | else (acc :+ toString(result)) | |
271 | + | } | |
272 | + | ||
273 | + | let r = { | |
274 | + | let $l = [0, 1, 2, 3, 4, 5] | |
275 | + | let $s = size($l) | |
276 | + | let $acc0 = nil | |
277 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
278 | + | then $a | |
279 | + | else updater($a, $l[$i]) | |
280 | + | ||
281 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
282 | + | then $a | |
283 | + | else throw("List size exceeds 6") | |
284 | + | ||
285 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
286 | + | } | |
287 | + | makeString(r, "_") | |
288 | + | } | |
289 | + | ||
290 | + | ||
255 | 291 | func updateProportions (terrainCounts,landSizeIndex,sign) = { | |
256 | - | let props = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
257 | - | if ((size(props) != NUMRES)) | |
258 | - | then throw("Wrong proportions data") | |
259 | - | else { | |
260 | - | func updater (acc,i) = { | |
261 | - | let result = (parseIntValue(props[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
262 | - | if ((0 > result)) | |
263 | - | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
264 | - | else (acc :+ toString(result)) | |
265 | - | } | |
266 | - | ||
267 | - | let r = { | |
268 | - | let $l = [0, 1, 2, 3, 4, 5] | |
269 | - | let $s = size($l) | |
270 | - | let $acc0 = nil | |
271 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
272 | - | then $a | |
273 | - | else updater($a, $l[$i]) | |
274 | - | ||
275 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
276 | - | then $a | |
277 | - | else throw("List size exceeds 6") | |
278 | - | ||
279 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
280 | - | } | |
281 | - | makeString(r, "_") | |
282 | - | } | |
292 | + | let propList = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
293 | + | updateProportionsInternal(propList, terrainCounts, landSizeIndex, sign) | |
283 | 294 | } | |
284 | 295 | ||
285 | 296 | ||
373 | 384 | } | |
374 | 385 | ||
375 | 386 | ||
387 | + | func genTerrains (seed,continentIdx) = { | |
388 | + | let f = freq[continentIdx] | |
389 | + | 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)) | |
390 | + | ||
391 | + | let t = { | |
392 | + | let $l = [1, 2, 3, 4, 5] | |
393 | + | let $s = size($l) | |
394 | + | let $acc0 = $Tuple2("", (seed / FIVEX)) | |
395 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
396 | + | then $a | |
397 | + | else terrainGenerator($a, $l[$i]) | |
398 | + | ||
399 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
400 | + | then $a | |
401 | + | else throw("List size exceeds 5") | |
402 | + | ||
403 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
404 | + | } | |
405 | + | t._1 | |
406 | + | } | |
407 | + | ||
408 | + | ||
376 | 409 | func getBackpack (bpKey) = { | |
377 | 410 | let p = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
378 | 411 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
422 | 455 | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
423 | 456 | let landNum = toString(freeNum) | |
424 | 457 | let continentIdx = toInt((bigNum % FIVEX)) | |
425 | - | let f = freq[continentIdx] | |
426 | - | 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)) | |
427 | - | ||
428 | - | let t = { | |
429 | - | let $l = [1, 2, 3, 4, 5] | |
430 | - | let $s = size($l) | |
431 | - | let $acc0 = $Tuple2("", (bigNum / FIVEX)) | |
432 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
433 | - | then $a | |
434 | - | else terrainGenerator($a, $l[$i]) | |
435 | - | ||
436 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
437 | - | then $a | |
438 | - | else throw("List size exceeds 5") | |
439 | - | ||
440 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
441 | - | } | |
458 | + | let terrains = genTerrains(bigNum, continentIdx) | |
442 | 459 | let continent = continents[continentIdx] | |
443 | - | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", | |
460 | + | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", terrains, continent], "_"), 1, 0, false) | |
444 | 461 | let assetId = calculateAssetId(issue) | |
445 | 462 | let id = toBase58String(assetId) | |
446 | 463 | $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) | |
450 | 467 | } | |
451 | 468 | ||
452 | 469 | ||
453 | - | func applyBonuses (landAssetId) = { | |
470 | + | func applyBonuses (landAssetId,pieces) = { | |
454 | 471 | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
455 | - | let | |
456 | - | then | |
457 | - | else 0 | |
458 | - | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, | |
472 | + | let artPieces = valueOrElse(getInteger(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(keyPresaleArtActivatedByAssetId(landAssetId)), false)) | |
473 | + | then pieces | |
474 | + | else 0) | |
475 | + | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, (artPieces * 3), (pieces * 20))) | |
459 | 476 | } | |
460 | 477 | ||
461 | 478 | ||
490 | 507 | then throw(((("Saved timestamp is in future, saved = " + toString(c._4)) + ", current = ") + toString(lastBlock.timestamp))) | |
491 | 508 | else { | |
492 | 509 | let pieces = numPiecesBySize(landSize) | |
493 | - | let dailyProductionByPiece = applyBonuses(c._2) | |
510 | + | let dailyProductionByPiece = applyBonuses(c._2, pieces) | |
494 | 511 | let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS) | |
495 | 512 | if ((amount > availRes)) | |
496 | 513 | then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount))) | |
510 | 527 | func claimAll (addr,landAssetId,pieces) = { | |
511 | 528 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
512 | 529 | let savedTime = value(getInteger(timeKey)) | |
513 | - | let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId), DAYMILLIS) * pieces) | |
530 | + | let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId, pieces), DAYMILLIS) * pieces) | |
514 | 531 | claimResInternal(addr, availRes) | |
515 | 532 | } | |
516 | 533 | ||
544 | 561 | ||
545 | 562 | func activatePresaleArt (addr) = { | |
546 | 563 | let c = checkClaimConditions(addr) | |
547 | - | let activationKey = keyPresaleArtActivatedByAssetId(c._2) | |
564 | + | let landAssetId = c._2 | |
565 | + | let activationKey = keyPresaleArtActivatedByAssetId(landAssetId) | |
548 | 566 | if (valueOrElse(getBoolean(activationKey), false)) | |
549 | 567 | then throw("Presale artifact is already activated") | |
550 | 568 | else if ((parseIntValue(c._3[recLandNum]) > 500)) | |
551 | - | then throw((((LANDPREFIX + " ") + | |
569 | + | then throw((((LANDPREFIX + " ") + landAssetId) + " is not eligible for presale artifact")) | |
552 | 570 | else { | |
553 | 571 | let pieces = numPiecesBySize(c._3[recLandSize]) | |
554 | - | let claimResult = claimAll(addr, | |
555 | - | (((claimResult._1 :+ BooleanEntry( | |
572 | + | let claimResult = claimAll(addr, landAssetId, pieces) | |
573 | + | (((((claimResult._1 :+ BooleanEntry(activationKey, true)) :+ BooleanEntry(keyPresaleArtActivatedByAssetIdAndOwner(landAssetId, addr), true)) :+ IntegerEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId), pieces)) :+ IntegerEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, landAssetId, addr), pieces)) :+ StringEntry(claimResult._2, makeString(claimResult._3, ":"))) | |
556 | 574 | } | |
575 | + | } | |
576 | + | ||
577 | + | ||
578 | + | func mergeInternal (newLandSize,newLevel,formula,addr,landAssetIds,txId,needMat) = { | |
579 | + | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked") | |
580 | + | func checkMerge (acc,landAssetId) = { | |
581 | + | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
582 | + | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
583 | + | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
584 | + | let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned")) | |
585 | + | if ((owner != addr)) | |
586 | + | then throw((LANDPREFIX + " is not yours")) | |
587 | + | else { | |
588 | + | let d = split(asset.description, "_") | |
589 | + | let continent = d[recContinent] | |
590 | + | if (if ((acc._3 != "")) | |
591 | + | then (acc._3 != continent) | |
592 | + | else false) | |
593 | + | then throw("Lands should be on the same continent to merge") | |
594 | + | else { | |
595 | + | let landSize = d[recLandSize] | |
596 | + | let sizesIn = acc._1 | |
597 | + | let i = valueOrErrorMessage(indexOf(sizesIn, landSize), "You haven't passed all the lands needed") | |
598 | + | let sizesOut = (take(sizesIn, i) + drop(sizesIn, (i + 1))) | |
599 | + | let pieces = numPiecesBySize(landSize) | |
600 | + | let arts = (acc._2 + valueOrElse(getInteger(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(keyPresaleArtActivatedByAssetId(landAssetId)), false)) | |
601 | + | then pieces | |
602 | + | else 0)) | |
603 | + | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
604 | + | let reqLevel = match landSize { | |
605 | + | case _ => | |
606 | + | if (("S" == $match0)) | |
607 | + | then 3 | |
608 | + | else if (("M" == $match0)) | |
609 | + | then 4 | |
610 | + | else if (("L" == $match0)) | |
611 | + | then 5 | |
612 | + | else if (("XL" == $match0)) | |
613 | + | then 6 | |
614 | + | else throw("Only S, M, L, XL can merge") | |
615 | + | } | |
616 | + | if ((infraLevel != reqLevel)) | |
617 | + | then throw("All lands should be maxed to merge") | |
618 | + | else { | |
619 | + | let landNum = d[recLandNum] | |
620 | + | let terrainCounts = countTerrains(d[recTerrains]) | |
621 | + | let deltaTime = (lastBlock.timestamp - savedTime) | |
622 | + | if ((0 > deltaTime)) | |
623 | + | then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
624 | + | else { | |
625 | + | let dailyProductionByPiece = applyBonuses(landAssetId, pieces) | |
626 | + | let bpRes = addRes(split(acc._4, "_"), terrainCounts, deltaTime, (pieces / 25), dailyProductionByPiece) | |
627 | + | let props = updateProportionsInternal(split(acc._6, "_"), terrainCounts, (pieces / 25), -1) | |
628 | + | $Tuple6(sizesOut, arts, continent, bpRes, (((((((((((((acc._5 :+ DeleteEntry(keyStakedTimeByAssetId(landAssetId))) :+ DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, addr))) :+ DeleteEntry(keyLandToAssetId(landNum))) :+ DeleteEntry(keyNftName(landNum, landSize))) :+ DeleteEntry(keyLandAssetIdToOwner(landAssetId))) :+ DeleteEntry(keyInfraLevelByAssetId(landAssetId))) :+ DeleteEntry(keyInfraLevelByAssetIdAndOwner(landAssetId, addr))) :+ DeleteEntry(keyPresaleArtActivatedByAssetId(landAssetId))) :+ DeleteEntry(keyPresaleArtActivatedByAssetIdAndOwner(landAssetId, addr))) :+ DeleteEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId))) :+ DeleteEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, landAssetId, addr))) :+ DeleteEntry(keyLandNumToOwner(landNum))) :+ Burn(fromBase58String(landAssetId), 1)), props) | |
629 | + | } | |
630 | + | } | |
631 | + | } | |
632 | + | } | |
633 | + | } | |
634 | + | ||
635 | + | let bpKey = keyBackpackByDuck(duckAssetId) | |
636 | + | let currentPack = getBackpack(bpKey) | |
637 | + | let propStr = valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0") | |
638 | + | let r = { | |
639 | + | let $l = landAssetIds | |
640 | + | let $s = size($l) | |
641 | + | let $acc0 = $Tuple6(formula, 0, "", currentPack[bpIdxRes], nil, propStr) | |
642 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
643 | + | then $a | |
644 | + | else checkMerge($a, $l[$i]) | |
645 | + | ||
646 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
647 | + | then $a | |
648 | + | else throw("List size exceeds 4") | |
649 | + | ||
650 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4) | |
651 | + | } | |
652 | + | let continentIdx = valueOrErrorMessage(indexOf(continents, r._3), ("Unknown continent: " + r._3)) | |
653 | + | let terrains = genTerrains(abs(toBigInt(txId)), continentIdx) | |
654 | + | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
655 | + | let newLandNum = toString(freeNum) | |
656 | + | let issue = Issue(keyNftName(newLandNum, newLandSize), makeString([newLandNum, newLandSize, terrains, r._3], "_"), 1, 0, false) | |
657 | + | let assetId = calculateAssetId(issue) | |
658 | + | let newLandAssetId = toBase58String(assetId) | |
659 | + | let newMat = makeString(subtractMaterials((needMat > 0), split(currentPack[bpIdxMat], "_"), needMat), "_") | |
660 | + | $Tuple2(((((((((((((r._5 :+ IntegerEntry(keyNextFreeLandNum(), (freeNum + 1))) :+ issue) :+ StringEntry(keyLandToAssetId(newLandNum), newLandAssetId)) :+ StringEntry(keyLandAssetIdToOwner(newLandAssetId), addr)) :+ StringEntry(keyLandNumToOwner(newLandNum), addr)) :+ IntegerEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, newLandAssetId), r._2)) :+ IntegerEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, newLandAssetId, addr), r._2)) :+ IntegerEntry(keyInfraLevelByAssetId(newLandAssetId), newLevel)) :+ IntegerEntry(keyInfraLevelByAssetIdAndOwner(newLandAssetId, addr), newLevel)) :+ StringEntry(bpKey, makeString([currentPack[bpIdxLevel], r._4, newMat, currentPack[bpIdxProd]], ":"))) :+ StringEntry(keyResProportions(), r._6)) :+ ScriptTransfer(addressFromStringValue(addr), 1, assetId)), newLandAssetId) | |
661 | + | } | |
662 | + | ||
663 | + | ||
664 | + | func s2m (addr,landAssetIds,txId) = mergeInternal("M", 3, "SSSS", addr, landAssetIds, txId, 0) | |
665 | + | ||
666 | + | ||
667 | + | func m2l (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
668 | + | let cost = (InfraUpgradeCostSUsdn * 4) | |
669 | + | if (if (!(shouldUseMat)) | |
670 | + | then (paymentAmount != cost) | |
671 | + | else false) | |
672 | + | then throw(("Payment attached should be " + toString(cost))) | |
673 | + | else mergeInternal("L", 4, "SMM", addr, landAssetIds, txId, (InfraUpgradeCostS * 4)) | |
674 | + | } | |
675 | + | ||
676 | + | ||
677 | + | func l2xl (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
678 | + | let cost = (InfraUpgradeCostSUsdn * 47) | |
679 | + | if (if (!(shouldUseMat)) | |
680 | + | then (paymentAmount != cost) | |
681 | + | else false) | |
682 | + | then throw(("Payment attached should be " + toString(cost))) | |
683 | + | else mergeInternal("XL", 5, "SSSML", addr, landAssetIds, txId, (InfraUpgradeCostS * 47)) | |
684 | + | } | |
685 | + | ||
686 | + | ||
687 | + | func xl2xxl (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
688 | + | let cost = (InfraUpgradeCostSUsdn * 54) | |
689 | + | if (if (!(shouldUseMat)) | |
690 | + | then (paymentAmount != cost) | |
691 | + | else false) | |
692 | + | then throw(("Payment attached should be " + toString(cost))) | |
693 | + | else mergeInternal("XXL", 6, "LXL", addr, landAssetIds, txId, (InfraUpgradeCostS * 54)) | |
694 | + | } | |
695 | + | ||
696 | + | ||
697 | + | func mergeCommon (shouldUseMat,addr,paymentAmount,landAssetIds,txId) = { | |
698 | + | let mergeResult = match size(landAssetIds) { | |
699 | + | case _ => | |
700 | + | if ((4 == $match0)) | |
701 | + | then s2m(addr, landAssetIds, txId) | |
702 | + | else if ((3 == $match0)) | |
703 | + | then m2l(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
704 | + | else if ((5 == $match0)) | |
705 | + | then l2xl(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
706 | + | else if ((2 == $match0)) | |
707 | + | then xl2xxl(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
708 | + | else throw("Unknown merge") | |
709 | + | } | |
710 | + | mergeResult | |
557 | 711 | } | |
558 | 712 | ||
559 | 713 | ||
788 | 942 | then throw("Allowed USDN payment only!") | |
789 | 943 | else if ((pmt.amount != EXPUSDN)) | |
790 | 944 | then throw(("Payment attached should be " + toString(EXPUSDN))) | |
791 | - | else expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
945 | + | else { | |
946 | + | let result = expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
947 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
948 | + | } | |
792 | 949 | } | |
793 | 950 | ||
794 | 951 | ||
814 | 971 | let pmt = value(i.payments[0]) | |
815 | 972 | if ((pmt.assetId != usdnAssetId)) | |
816 | 973 | then throw("Allowed USDN payment only!") | |
817 | - | else upInfraCommon(false, i.caller, pmt.amount) | |
974 | + | else { | |
975 | + | let result = upInfraCommon(false, i.caller, pmt.amount) | |
976 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
977 | + | } | |
818 | 978 | } | |
819 | 979 | ||
820 | 980 | ||
833 | 993 | } | |
834 | 994 | ||
835 | 995 | ||
996 | + | ||
997 | + | @Callable(i) | |
998 | + | func mergeLands (landAssetIds) = if ((size(i.payments) != 0)) | |
999 | + | then throw("Lands merging doesn't require any payments") | |
1000 | + | else mergeCommon(true, toString(i.caller), 0, landAssetIds, i.transactionId) | |
1001 | + | ||
1002 | + | ||
1003 | + | ||
1004 | + | @Callable(i) | |
1005 | + | func mergeLandsUsdn (landAssetIds) = if ((size(i.payments) != 1)) | |
1006 | + | then throw("Exactly one payment required") | |
1007 | + | else { | |
1008 | + | let pmt = value(i.payments[0]) | |
1009 | + | if ((pmt.assetId != usdnAssetId)) | |
1010 | + | then throw("Allowed USDN payment only!") | |
1011 | + | else { | |
1012 | + | let result = mergeCommon(false, toString(i.caller), pmt.amount, landAssetIds, i.transactionId) | |
1013 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
1014 | + | } | |
1015 | + | } | |
1016 | + | ||
1017 | + |
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 | 95 | else throw("Unknown chain") | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | let MULT6 = 1000000 | |
99 | 99 | ||
100 | 100 | let FIVEX = toBigInt(5) | |
101 | 101 | ||
102 | 102 | let TWENTYX = toBigInt(20) | |
103 | 103 | ||
104 | 104 | let TWENTY2X = toBigInt((20 * 20)) | |
105 | 105 | ||
106 | 106 | let TWENTY3X = toBigInt(((20 * 20) * 20)) | |
107 | 107 | ||
108 | 108 | let TWENTY4X = toBigInt((((20 * 20) * 20) * 20)) | |
109 | 109 | ||
110 | 110 | let TWENTY5X = toBigInt(((((20 * 20) * 20) * 20) * 20)) | |
111 | 111 | ||
112 | 112 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
113 | 113 | ||
114 | 114 | let continents = ["Asia", "Europe", "Americas", "Oceania", "Africa"] | |
115 | 115 | ||
116 | + | let ARTPRESALE = "PRESALE" | |
117 | + | ||
116 | 118 | func keyNextFreeLandNum () = "nextLandNum" | |
117 | 119 | ||
118 | 120 | ||
119 | 121 | func keyLandToAssetId (landNum) = ("landToAsset_" + landNum) | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | func keyNftName (landNum,landSize) = ((LANDPREFIX + landNum) + landSize) | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
129 | 131 | ||
130 | 132 | ||
131 | 133 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
132 | 134 | ||
133 | 135 | ||
134 | 136 | func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId) | |
135 | 137 | ||
136 | 138 | ||
137 | 139 | func keyInfraLevelByAssetIdAndOwner (assetId,ownerAddr) = ((("infraLevelByAssetIdAndOwner_" + assetId) + "_") + ownerAddr) | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func keyPresaleArtActivatedByAssetId (assetId) = ("presaleArtActivated_" + assetId) | |
141 | 143 | ||
142 | 144 | ||
143 | 145 | func keyPresaleArtActivatedByAssetIdAndOwner (assetId,ownerAddr) = ((("presaleArtActivatedByAssetIdAndOwner_" + assetId) + "_") + ownerAddr) | |
146 | + | ||
147 | + | ||
148 | + | func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_") | |
149 | + | ||
150 | + | ||
151 | + | func keyLandArtStatusByTypeAssetIdAndOwner (type,assetId,ownerAddr) = makeString(["landArtStatusByTypeAssetIdAndOwner", type, assetId, ownerAddr], "_") | |
144 | 152 | ||
145 | 153 | ||
146 | 154 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
147 | 155 | ||
148 | 156 | ||
149 | 157 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
150 | 158 | ||
151 | 159 | ||
152 | 160 | func keyLandNumToOwner (landNum) = ("landOwner_" + landNum) | |
153 | 161 | ||
154 | 162 | ||
155 | 163 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
156 | 164 | ||
157 | 165 | ||
158 | 166 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
159 | 167 | ||
160 | 168 | ||
161 | 169 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
162 | 170 | ||
163 | 171 | ||
164 | 172 | func keyResProportions () = "resTypesProportions" | |
165 | 173 | ||
166 | 174 | ||
167 | 175 | let recLandNum = 0 | |
168 | 176 | ||
169 | 177 | let recLandSize = 1 | |
170 | 178 | ||
171 | 179 | let recTerrains = 2 | |
172 | 180 | ||
173 | 181 | let recContinent = 3 | |
174 | 182 | ||
175 | 183 | let locIdxContinent = 0 | |
176 | 184 | ||
177 | 185 | let locIdxType = 1 | |
178 | 186 | ||
179 | 187 | let locIdxId = 2 | |
180 | 188 | ||
181 | 189 | let bpIdxLevel = 0 | |
182 | 190 | ||
183 | 191 | let bpIdxRes = 1 | |
184 | 192 | ||
185 | 193 | let bpIdxMat = 2 | |
186 | 194 | ||
187 | 195 | let bpIdxProd = 3 | |
188 | 196 | ||
189 | 197 | func asString (v) = match v { | |
190 | 198 | case s: String => | |
191 | 199 | s | |
192 | 200 | case _ => | |
193 | 201 | throw("fail to cast into String") | |
194 | 202 | } | |
195 | 203 | ||
196 | 204 | ||
197 | 205 | func getNeededMaterials (total) = { | |
198 | 206 | let props = split(value(getString(keyResProportions())), "_") | |
199 | 207 | if ((size(props) != NUMRES)) | |
200 | 208 | then throw("Wrong proportions data") | |
201 | 209 | else { | |
202 | 210 | let r = [parseIntValue(props[0]), parseIntValue(props[1]), parseIntValue(props[2]), parseIntValue(props[3]), parseIntValue(props[4]), parseIntValue(props[5])] | |
203 | 211 | let sum = (((((r[0] + r[1]) + r[2]) + r[3]) + r[4]) + r[5]) | |
204 | 212 | if ((0 >= sum)) | |
205 | 213 | then throw("No lands staked") | |
206 | 214 | else { | |
207 | 215 | let norm6 = fraction(total, MULT6, sum) | |
208 | 216 | func normalizer (acc,elem) = (acc :+ fraction(elem, norm6, MULT6)) | |
209 | 217 | ||
210 | 218 | let $l = r | |
211 | 219 | let $s = size($l) | |
212 | 220 | let $acc0 = nil | |
213 | 221 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
214 | 222 | then $a | |
215 | 223 | else normalizer($a, $l[$i]) | |
216 | 224 | ||
217 | 225 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
218 | 226 | then $a | |
219 | 227 | else throw("List size exceeds 6") | |
220 | 228 | ||
221 | 229 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
222 | 230 | } | |
223 | 231 | } | |
224 | 232 | } | |
225 | 233 | ||
226 | 234 | ||
227 | 235 | func subtractMaterials (shouldUseMat,has,totalNeed) = { | |
228 | 236 | let need = getNeededMaterials(totalNeed) | |
229 | 237 | func subtractor (acc,idx) = { | |
230 | 238 | let result = (parseIntValue(has[idx]) - need[idx]) | |
231 | 239 | if ((0 > result)) | |
232 | 240 | then throw(((((("Not enough material idx=" + toString(idx)) + ", you have ") + has[idx]) + ", but need ") + toString(need[idx]))) | |
233 | 241 | else (acc :+ toString(result)) | |
234 | 242 | } | |
235 | 243 | ||
236 | 244 | if (shouldUseMat) | |
237 | 245 | then { | |
238 | 246 | let $l = [0, 1, 2, 3, 4, 5] | |
239 | 247 | let $s = size($l) | |
240 | 248 | let $acc0 = nil | |
241 | 249 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
242 | 250 | then $a | |
243 | 251 | else subtractor($a, $l[$i]) | |
244 | 252 | ||
245 | 253 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
246 | 254 | then $a | |
247 | 255 | else throw("List size exceeds 6") | |
248 | 256 | ||
249 | 257 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
250 | 258 | } | |
251 | 259 | else has | |
252 | 260 | } | |
253 | 261 | ||
254 | 262 | ||
263 | + | func updateProportionsInternal (propList,terrainCounts,landSizeIndex,sign) = if ((size(propList) != NUMRES)) | |
264 | + | then throw("Wrong proportions data") | |
265 | + | else { | |
266 | + | func updater (acc,i) = { | |
267 | + | let result = (parseIntValue(propList[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
268 | + | if ((0 > result)) | |
269 | + | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
270 | + | else (acc :+ toString(result)) | |
271 | + | } | |
272 | + | ||
273 | + | let r = { | |
274 | + | let $l = [0, 1, 2, 3, 4, 5] | |
275 | + | let $s = size($l) | |
276 | + | let $acc0 = nil | |
277 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
278 | + | then $a | |
279 | + | else updater($a, $l[$i]) | |
280 | + | ||
281 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
282 | + | then $a | |
283 | + | else throw("List size exceeds 6") | |
284 | + | ||
285 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
286 | + | } | |
287 | + | makeString(r, "_") | |
288 | + | } | |
289 | + | ||
290 | + | ||
255 | 291 | func updateProportions (terrainCounts,landSizeIndex,sign) = { | |
256 | - | let props = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
257 | - | if ((size(props) != NUMRES)) | |
258 | - | then throw("Wrong proportions data") | |
259 | - | else { | |
260 | - | func updater (acc,i) = { | |
261 | - | let result = (parseIntValue(props[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
262 | - | if ((0 > result)) | |
263 | - | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
264 | - | else (acc :+ toString(result)) | |
265 | - | } | |
266 | - | ||
267 | - | let r = { | |
268 | - | let $l = [0, 1, 2, 3, 4, 5] | |
269 | - | let $s = size($l) | |
270 | - | let $acc0 = nil | |
271 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
272 | - | then $a | |
273 | - | else updater($a, $l[$i]) | |
274 | - | ||
275 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
276 | - | then $a | |
277 | - | else throw("List size exceeds 6") | |
278 | - | ||
279 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
280 | - | } | |
281 | - | makeString(r, "_") | |
282 | - | } | |
292 | + | let propList = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
293 | + | updateProportionsInternal(propList, terrainCounts, landSizeIndex, sign) | |
283 | 294 | } | |
284 | 295 | ||
285 | 296 | ||
286 | 297 | 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)] | |
287 | 298 | ||
288 | 299 | ||
289 | 300 | func numPiecesBySize (landSize) = match landSize { | |
290 | 301 | case _ => | |
291 | 302 | if (("S" == $match0)) | |
292 | 303 | then 25 | |
293 | 304 | else if (("M" == $match0)) | |
294 | 305 | then 100 | |
295 | 306 | else if (("L" == $match0)) | |
296 | 307 | then 225 | |
297 | 308 | else if (("XL" == $match0)) | |
298 | 309 | then 400 | |
299 | 310 | else if (("XXL" == $match0)) | |
300 | 311 | then 625 | |
301 | 312 | else throw("Unknown land size") | |
302 | 313 | } | |
303 | 314 | ||
304 | 315 | ||
305 | 316 | func subOneInList (aList,idx,amount) = { | |
306 | 317 | func subber (acc,i) = (acc :+ (if ((i == idx)) | |
307 | 318 | then toString((parseIntValue(aList[i]) - amount)) | |
308 | 319 | else aList[i])) | |
309 | 320 | ||
310 | 321 | let r = { | |
311 | 322 | let $l = [0, 1, 2, 3, 4, 5] | |
312 | 323 | let $s = size($l) | |
313 | 324 | let $acc0 = nil | |
314 | 325 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
315 | 326 | then $a | |
316 | 327 | else subber($a, $l[$i]) | |
317 | 328 | ||
318 | 329 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
319 | 330 | then $a | |
320 | 331 | else throw("List size exceeds 6") | |
321 | 332 | ||
322 | 333 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
323 | 334 | } | |
324 | 335 | makeString(r, "_") | |
325 | 336 | } | |
326 | 337 | ||
327 | 338 | ||
328 | 339 | func addRes (currentRes,terrainCounts,deltaTime,landSizeIndex,dailyByPieceWithBonuses) = { | |
329 | 340 | func adder (acc,i) = { | |
330 | 341 | let resOfType = ((fraction(deltaTime, dailyByPieceWithBonuses, DAYMILLIS) * terrainCounts[i]) * landSizeIndex) | |
331 | 342 | (acc :+ toString((parseIntValue(currentRes[i]) + resOfType))) | |
332 | 343 | } | |
333 | 344 | ||
334 | 345 | let r = { | |
335 | 346 | let $l = [0, 1, 2, 3, 4, 5] | |
336 | 347 | let $s = size($l) | |
337 | 348 | let $acc0 = nil | |
338 | 349 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
339 | 350 | then $a | |
340 | 351 | else adder($a, $l[$i]) | |
341 | 352 | ||
342 | 353 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
343 | 354 | then $a | |
344 | 355 | else throw("List size exceeds 6") | |
345 | 356 | ||
346 | 357 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
347 | 358 | } | |
348 | 359 | makeString(r, "_") | |
349 | 360 | } | |
350 | 361 | ||
351 | 362 | ||
352 | 363 | func abs (x) = if ((x >= toBigInt(0))) | |
353 | 364 | then x | |
354 | 365 | else -(x) | |
355 | 366 | ||
356 | 367 | ||
357 | 368 | 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]] | |
358 | 369 | ||
359 | 370 | func genChar (n,freqs) = { | |
360 | 371 | let rem = toInt((n % TWENTYX)) | |
361 | 372 | let letter = if ((freqs[0] > rem)) | |
362 | 373 | then "A" | |
363 | 374 | else if ((freqs[1] > rem)) | |
364 | 375 | then "B" | |
365 | 376 | else if ((freqs[2] > rem)) | |
366 | 377 | then "C" | |
367 | 378 | else if ((freqs[3] > rem)) | |
368 | 379 | then "D" | |
369 | 380 | else if ((freqs[4] > rem)) | |
370 | 381 | then "E" | |
371 | 382 | else "F" | |
372 | 383 | letter | |
373 | 384 | } | |
374 | 385 | ||
375 | 386 | ||
387 | + | func genTerrains (seed,continentIdx) = { | |
388 | + | let f = freq[continentIdx] | |
389 | + | 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)) | |
390 | + | ||
391 | + | let t = { | |
392 | + | let $l = [1, 2, 3, 4, 5] | |
393 | + | let $s = size($l) | |
394 | + | let $acc0 = $Tuple2("", (seed / FIVEX)) | |
395 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
396 | + | then $a | |
397 | + | else terrainGenerator($a, $l[$i]) | |
398 | + | ||
399 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
400 | + | then $a | |
401 | + | else throw("List size exceeds 5") | |
402 | + | ||
403 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
404 | + | } | |
405 | + | t._1 | |
406 | + | } | |
407 | + | ||
408 | + | ||
376 | 409 | func getBackpack (bpKey) = { | |
377 | 410 | let p = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
378 | 411 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
379 | 412 | then p[bpIdxRes] | |
380 | 413 | else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES)) | |
381 | 414 | then p[bpIdxMat] | |
382 | 415 | else "0_0_0_0_0_0", p[bpIdxProd]] | |
383 | 416 | } | |
384 | 417 | ||
385 | 418 | ||
386 | 419 | func expeditionCommon (shouldUseMat,caller,txId,message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
387 | 420 | then throw("signature does not match") | |
388 | 421 | else { | |
389 | 422 | let parts = split(toUtf8String(message), ";") | |
390 | 423 | let hp = split(split(parts[0], "|")[0], "_") | |
391 | 424 | let curHP = parseIntValue(hp[0]) | |
392 | 425 | let newHP = parseIntValue(hp[1]) | |
393 | 426 | let locAndTime = split(parts[1], ":") | |
394 | 427 | let targetLocation = split(locAndTime[0], "_") | |
395 | 428 | if ((targetLocation[1] != "E")) | |
396 | 429 | then throw("expedition target location type should be E") | |
397 | 430 | else { | |
398 | 431 | let time = parseIntValue(locAndTime[1]) | |
399 | 432 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
400 | 433 | then true | |
401 | 434 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
402 | 435 | then throw("signature outdated") | |
403 | 436 | else { | |
404 | 437 | let userAddr = toString(caller) | |
405 | 438 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(userAddr)), "You don't have a duck staked") | |
406 | 439 | let keyHealth = keyDuckHealth(duckAssetId) | |
407 | 440 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
408 | 441 | if ((oldFromState != curHP)) | |
409 | 442 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
410 | 443 | else if ((0 >= curHP)) | |
411 | 444 | then throw("You can't fly with zero health") | |
412 | 445 | else if ((0 >= newHP)) | |
413 | 446 | then $Tuple2(((if (!(shouldUseMat)) | |
414 | 447 | then [ScriptTransfer(caller, EXPUSDN, usdnAssetId)] | |
415 | 448 | else nil) :+ IntegerEntry(keyHealth, 0)), "") | |
416 | 449 | else { | |
417 | 450 | let bpKey = keyBackpackByDuck(duckAssetId) | |
418 | 451 | let currentPack = getBackpack(bpKey) | |
419 | 452 | let mList = split(currentPack[bpIdxMat], "_") | |
420 | 453 | let newMat = makeString(subtractMaterials(shouldUseMat, mList, EXPMATERIALS), "_") | |
421 | 454 | let bigNum = abs(toBigInt(txId)) | |
422 | 455 | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
423 | 456 | let landNum = toString(freeNum) | |
424 | 457 | let continentIdx = toInt((bigNum % FIVEX)) | |
425 | - | let f = freq[continentIdx] | |
426 | - | 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)) | |
427 | - | ||
428 | - | let t = { | |
429 | - | let $l = [1, 2, 3, 4, 5] | |
430 | - | let $s = size($l) | |
431 | - | let $acc0 = $Tuple2("", (bigNum / FIVEX)) | |
432 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
433 | - | then $a | |
434 | - | else terrainGenerator($a, $l[$i]) | |
435 | - | ||
436 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
437 | - | then $a | |
438 | - | else throw("List size exceeds 5") | |
439 | - | ||
440 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
441 | - | } | |
458 | + | let terrains = genTerrains(bigNum, continentIdx) | |
442 | 459 | let continent = continents[continentIdx] | |
443 | - | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", | |
460 | + | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", terrains, continent], "_"), 1, 0, false) | |
444 | 461 | let assetId = calculateAssetId(issue) | |
445 | 462 | let id = toBase58String(assetId) | |
446 | 463 | $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) | |
447 | 464 | } | |
448 | 465 | } | |
449 | 466 | } | |
450 | 467 | } | |
451 | 468 | ||
452 | 469 | ||
453 | - | func applyBonuses (landAssetId) = { | |
470 | + | func applyBonuses (landAssetId,pieces) = { | |
454 | 471 | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
455 | - | let | |
456 | - | then | |
457 | - | else 0 | |
458 | - | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, | |
472 | + | let artPieces = valueOrElse(getInteger(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(keyPresaleArtActivatedByAssetId(landAssetId)), false)) | |
473 | + | then pieces | |
474 | + | else 0) | |
475 | + | ((DAILYRESBYPIECE + fraction(DAILYRESBYPIECE, infraLevel, 4)) + fraction(DAILYRESBYPIECE, (artPieces * 3), (pieces * 20))) | |
459 | 476 | } | |
460 | 477 | ||
461 | 478 | ||
462 | 479 | func checkClaimConditions (addr) = { | |
463 | 480 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked") | |
464 | 481 | let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION) | |
465 | 482 | let loc = split(value(curLocation), "_") | |
466 | 483 | if ((loc[locIdxType] != "L")) | |
467 | 484 | then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L")) | |
468 | 485 | else { | |
469 | 486 | let landAssetId = loc[locIdxId] | |
470 | 487 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
471 | 488 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
472 | 489 | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
473 | 490 | let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned")) | |
474 | 491 | if ((owner != addr)) | |
475 | 492 | then throw((LANDPREFIX + " is not yours")) | |
476 | 493 | else { | |
477 | 494 | let d = split(asset.description, "_") | |
478 | 495 | $Tuple4(duckAssetId, landAssetId, d, savedTime) | |
479 | 496 | } | |
480 | 497 | } | |
481 | 498 | } | |
482 | 499 | ||
483 | 500 | ||
484 | 501 | func claimResInternal (addr,amount) = { | |
485 | 502 | let c = checkClaimConditions(addr) | |
486 | 503 | let landSize = c._3[recLandSize] | |
487 | 504 | let terrainCounts = countTerrains(c._3[recTerrains]) | |
488 | 505 | let deltaTime = (lastBlock.timestamp - c._4) | |
489 | 506 | if ((0 > deltaTime)) | |
490 | 507 | then throw(((("Saved timestamp is in future, saved = " + toString(c._4)) + ", current = ") + toString(lastBlock.timestamp))) | |
491 | 508 | else { | |
492 | 509 | let pieces = numPiecesBySize(landSize) | |
493 | - | let dailyProductionByPiece = applyBonuses(c._2) | |
510 | + | let dailyProductionByPiece = applyBonuses(c._2, pieces) | |
494 | 511 | let availRes = fraction(deltaTime, (dailyProductionByPiece * pieces), DAYMILLIS) | |
495 | 512 | if ((amount > availRes)) | |
496 | 513 | then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount))) | |
497 | 514 | else { | |
498 | 515 | let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (dailyProductionByPiece * pieces)) | |
499 | 516 | let newTimestamp = (lastBlock.timestamp - newDeltaTime) | |
500 | 517 | let bpKey = keyBackpackByDuck(c._1) | |
501 | 518 | let currentPack = getBackpack(bpKey) | |
502 | 519 | let currentRes = split(currentPack[bpIdxRes], "_") | |
503 | 520 | let bpRes = addRes(currentRes, terrainCounts, (deltaTime - newDeltaTime), (pieces / 25), dailyProductionByPiece) | |
504 | 521 | $Tuple3([IntegerEntry(keyStakedTimeByAssetId(c._2), newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, c._2, addr), newTimestamp)], bpKey, [currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]]) | |
505 | 522 | } | |
506 | 523 | } | |
507 | 524 | } | |
508 | 525 | ||
509 | 526 | ||
510 | 527 | func claimAll (addr,landAssetId,pieces) = { | |
511 | 528 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
512 | 529 | let savedTime = value(getInteger(timeKey)) | |
513 | - | let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId), DAYMILLIS) * pieces) | |
530 | + | let availRes = (fraction((lastBlock.timestamp - savedTime), applyBonuses(landAssetId, pieces), DAYMILLIS) * pieces) | |
514 | 531 | claimResInternal(addr, availRes) | |
515 | 532 | } | |
516 | 533 | ||
517 | 534 | ||
518 | 535 | func upInfraCommon (shouldUseMat,caller,paymentAmount) = { | |
519 | 536 | let addr = toString(caller) | |
520 | 537 | let c = checkClaimConditions(addr) | |
521 | 538 | let pieces = numPiecesBySize(c._3[recLandSize]) | |
522 | 539 | let infraKey = keyInfraLevelByAssetId(c._2) | |
523 | 540 | let curLevel = valueOrElse(getInteger(infraKey), 0) | |
524 | 541 | if ((curLevel >= 3)) | |
525 | 542 | then throw("Currently max infrastructure level = 3") | |
526 | 543 | else { | |
527 | 544 | let newLevel = (curLevel + 1) | |
528 | 545 | let cost = fraction(InfraUpgradeCostSUsdn, (pieces * newLevel), 25) | |
529 | 546 | if (if (!(shouldUseMat)) | |
530 | 547 | then (paymentAmount != cost) | |
531 | 548 | else false) | |
532 | 549 | then throw(("Payment attached should be " + toString(cost))) | |
533 | 550 | else { | |
534 | 551 | let bpKey = keyBackpackByDuck(c._1) | |
535 | 552 | let currentPack = getBackpack(bpKey) | |
536 | 553 | let mList = split(currentPack[bpIdxMat], "_") | |
537 | 554 | let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_") | |
538 | 555 | let claimResult = claimAll(addr, c._2, pieces) | |
539 | 556 | $Tuple2(([IntegerEntry(infraKey, newLevel), IntegerEntry(keyInfraLevelByAssetIdAndOwner(c._2, addr), newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], claimResult._3[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] ++ claimResult._1), newLevel) | |
540 | 557 | } | |
541 | 558 | } | |
542 | 559 | } | |
543 | 560 | ||
544 | 561 | ||
545 | 562 | func activatePresaleArt (addr) = { | |
546 | 563 | let c = checkClaimConditions(addr) | |
547 | - | let activationKey = keyPresaleArtActivatedByAssetId(c._2) | |
564 | + | let landAssetId = c._2 | |
565 | + | let activationKey = keyPresaleArtActivatedByAssetId(landAssetId) | |
548 | 566 | if (valueOrElse(getBoolean(activationKey), false)) | |
549 | 567 | then throw("Presale artifact is already activated") | |
550 | 568 | else if ((parseIntValue(c._3[recLandNum]) > 500)) | |
551 | - | then throw((((LANDPREFIX + " ") + | |
569 | + | then throw((((LANDPREFIX + " ") + landAssetId) + " is not eligible for presale artifact")) | |
552 | 570 | else { | |
553 | 571 | let pieces = numPiecesBySize(c._3[recLandSize]) | |
554 | - | let claimResult = claimAll(addr, | |
555 | - | (((claimResult._1 :+ BooleanEntry( | |
572 | + | let claimResult = claimAll(addr, landAssetId, pieces) | |
573 | + | (((((claimResult._1 :+ BooleanEntry(activationKey, true)) :+ BooleanEntry(keyPresaleArtActivatedByAssetIdAndOwner(landAssetId, addr), true)) :+ IntegerEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId), pieces)) :+ IntegerEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, landAssetId, addr), pieces)) :+ StringEntry(claimResult._2, makeString(claimResult._3, ":"))) | |
556 | 574 | } | |
575 | + | } | |
576 | + | ||
577 | + | ||
578 | + | func mergeInternal (newLandSize,newLevel,formula,addr,landAssetIds,txId,needMat) = { | |
579 | + | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked") | |
580 | + | func checkMerge (acc,landAssetId) = { | |
581 | + | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
582 | + | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
583 | + | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
584 | + | let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned")) | |
585 | + | if ((owner != addr)) | |
586 | + | then throw((LANDPREFIX + " is not yours")) | |
587 | + | else { | |
588 | + | let d = split(asset.description, "_") | |
589 | + | let continent = d[recContinent] | |
590 | + | if (if ((acc._3 != "")) | |
591 | + | then (acc._3 != continent) | |
592 | + | else false) | |
593 | + | then throw("Lands should be on the same continent to merge") | |
594 | + | else { | |
595 | + | let landSize = d[recLandSize] | |
596 | + | let sizesIn = acc._1 | |
597 | + | let i = valueOrErrorMessage(indexOf(sizesIn, landSize), "You haven't passed all the lands needed") | |
598 | + | let sizesOut = (take(sizesIn, i) + drop(sizesIn, (i + 1))) | |
599 | + | let pieces = numPiecesBySize(landSize) | |
600 | + | let arts = (acc._2 + valueOrElse(getInteger(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId)), if (valueOrElse(getBoolean(keyPresaleArtActivatedByAssetId(landAssetId)), false)) | |
601 | + | then pieces | |
602 | + | else 0)) | |
603 | + | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
604 | + | let reqLevel = match landSize { | |
605 | + | case _ => | |
606 | + | if (("S" == $match0)) | |
607 | + | then 3 | |
608 | + | else if (("M" == $match0)) | |
609 | + | then 4 | |
610 | + | else if (("L" == $match0)) | |
611 | + | then 5 | |
612 | + | else if (("XL" == $match0)) | |
613 | + | then 6 | |
614 | + | else throw("Only S, M, L, XL can merge") | |
615 | + | } | |
616 | + | if ((infraLevel != reqLevel)) | |
617 | + | then throw("All lands should be maxed to merge") | |
618 | + | else { | |
619 | + | let landNum = d[recLandNum] | |
620 | + | let terrainCounts = countTerrains(d[recTerrains]) | |
621 | + | let deltaTime = (lastBlock.timestamp - savedTime) | |
622 | + | if ((0 > deltaTime)) | |
623 | + | then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
624 | + | else { | |
625 | + | let dailyProductionByPiece = applyBonuses(landAssetId, pieces) | |
626 | + | let bpRes = addRes(split(acc._4, "_"), terrainCounts, deltaTime, (pieces / 25), dailyProductionByPiece) | |
627 | + | let props = updateProportionsInternal(split(acc._6, "_"), terrainCounts, (pieces / 25), -1) | |
628 | + | $Tuple6(sizesOut, arts, continent, bpRes, (((((((((((((acc._5 :+ DeleteEntry(keyStakedTimeByAssetId(landAssetId))) :+ DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, addr))) :+ DeleteEntry(keyLandToAssetId(landNum))) :+ DeleteEntry(keyNftName(landNum, landSize))) :+ DeleteEntry(keyLandAssetIdToOwner(landAssetId))) :+ DeleteEntry(keyInfraLevelByAssetId(landAssetId))) :+ DeleteEntry(keyInfraLevelByAssetIdAndOwner(landAssetId, addr))) :+ DeleteEntry(keyPresaleArtActivatedByAssetId(landAssetId))) :+ DeleteEntry(keyPresaleArtActivatedByAssetIdAndOwner(landAssetId, addr))) :+ DeleteEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, landAssetId))) :+ DeleteEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, landAssetId, addr))) :+ DeleteEntry(keyLandNumToOwner(landNum))) :+ Burn(fromBase58String(landAssetId), 1)), props) | |
629 | + | } | |
630 | + | } | |
631 | + | } | |
632 | + | } | |
633 | + | } | |
634 | + | ||
635 | + | let bpKey = keyBackpackByDuck(duckAssetId) | |
636 | + | let currentPack = getBackpack(bpKey) | |
637 | + | let propStr = valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0") | |
638 | + | let r = { | |
639 | + | let $l = landAssetIds | |
640 | + | let $s = size($l) | |
641 | + | let $acc0 = $Tuple6(formula, 0, "", currentPack[bpIdxRes], nil, propStr) | |
642 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
643 | + | then $a | |
644 | + | else checkMerge($a, $l[$i]) | |
645 | + | ||
646 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
647 | + | then $a | |
648 | + | else throw("List size exceeds 4") | |
649 | + | ||
650 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4) | |
651 | + | } | |
652 | + | let continentIdx = valueOrErrorMessage(indexOf(continents, r._3), ("Unknown continent: " + r._3)) | |
653 | + | let terrains = genTerrains(abs(toBigInt(txId)), continentIdx) | |
654 | + | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
655 | + | let newLandNum = toString(freeNum) | |
656 | + | let issue = Issue(keyNftName(newLandNum, newLandSize), makeString([newLandNum, newLandSize, terrains, r._3], "_"), 1, 0, false) | |
657 | + | let assetId = calculateAssetId(issue) | |
658 | + | let newLandAssetId = toBase58String(assetId) | |
659 | + | let newMat = makeString(subtractMaterials((needMat > 0), split(currentPack[bpIdxMat], "_"), needMat), "_") | |
660 | + | $Tuple2(((((((((((((r._5 :+ IntegerEntry(keyNextFreeLandNum(), (freeNum + 1))) :+ issue) :+ StringEntry(keyLandToAssetId(newLandNum), newLandAssetId)) :+ StringEntry(keyLandAssetIdToOwner(newLandAssetId), addr)) :+ StringEntry(keyLandNumToOwner(newLandNum), addr)) :+ IntegerEntry(keyLandArtStatusByTypeAndAssetId(ARTPRESALE, newLandAssetId), r._2)) :+ IntegerEntry(keyLandArtStatusByTypeAssetIdAndOwner(ARTPRESALE, newLandAssetId, addr), r._2)) :+ IntegerEntry(keyInfraLevelByAssetId(newLandAssetId), newLevel)) :+ IntegerEntry(keyInfraLevelByAssetIdAndOwner(newLandAssetId, addr), newLevel)) :+ StringEntry(bpKey, makeString([currentPack[bpIdxLevel], r._4, newMat, currentPack[bpIdxProd]], ":"))) :+ StringEntry(keyResProportions(), r._6)) :+ ScriptTransfer(addressFromStringValue(addr), 1, assetId)), newLandAssetId) | |
661 | + | } | |
662 | + | ||
663 | + | ||
664 | + | func s2m (addr,landAssetIds,txId) = mergeInternal("M", 3, "SSSS", addr, landAssetIds, txId, 0) | |
665 | + | ||
666 | + | ||
667 | + | func m2l (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
668 | + | let cost = (InfraUpgradeCostSUsdn * 4) | |
669 | + | if (if (!(shouldUseMat)) | |
670 | + | then (paymentAmount != cost) | |
671 | + | else false) | |
672 | + | then throw(("Payment attached should be " + toString(cost))) | |
673 | + | else mergeInternal("L", 4, "SMM", addr, landAssetIds, txId, (InfraUpgradeCostS * 4)) | |
674 | + | } | |
675 | + | ||
676 | + | ||
677 | + | func l2xl (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
678 | + | let cost = (InfraUpgradeCostSUsdn * 47) | |
679 | + | if (if (!(shouldUseMat)) | |
680 | + | then (paymentAmount != cost) | |
681 | + | else false) | |
682 | + | then throw(("Payment attached should be " + toString(cost))) | |
683 | + | else mergeInternal("XL", 5, "SSSML", addr, landAssetIds, txId, (InfraUpgradeCostS * 47)) | |
684 | + | } | |
685 | + | ||
686 | + | ||
687 | + | func xl2xxl (addr,landAssetIds,txId,shouldUseMat,paymentAmount) = { | |
688 | + | let cost = (InfraUpgradeCostSUsdn * 54) | |
689 | + | if (if (!(shouldUseMat)) | |
690 | + | then (paymentAmount != cost) | |
691 | + | else false) | |
692 | + | then throw(("Payment attached should be " + toString(cost))) | |
693 | + | else mergeInternal("XXL", 6, "LXL", addr, landAssetIds, txId, (InfraUpgradeCostS * 54)) | |
694 | + | } | |
695 | + | ||
696 | + | ||
697 | + | func mergeCommon (shouldUseMat,addr,paymentAmount,landAssetIds,txId) = { | |
698 | + | let mergeResult = match size(landAssetIds) { | |
699 | + | case _ => | |
700 | + | if ((4 == $match0)) | |
701 | + | then s2m(addr, landAssetIds, txId) | |
702 | + | else if ((3 == $match0)) | |
703 | + | then m2l(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
704 | + | else if ((5 == $match0)) | |
705 | + | then l2xl(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
706 | + | else if ((2 == $match0)) | |
707 | + | then xl2xxl(addr, landAssetIds, txId, shouldUseMat, paymentAmount) | |
708 | + | else throw("Unknown merge") | |
709 | + | } | |
710 | + | mergeResult | |
557 | 711 | } | |
558 | 712 | ||
559 | 713 | ||
560 | 714 | @Callable(i) | |
561 | 715 | func stakeLand () = { | |
562 | 716 | let pmt = value(i.payments[0]) | |
563 | 717 | let assetId = value(pmt.assetId) | |
564 | 718 | let address = toString(i.caller) | |
565 | 719 | if ((pmt.amount != 1)) | |
566 | 720 | then throw((("NFT " + LANDPREFIX) + " token should be attached as payment")) | |
567 | 721 | else { | |
568 | 722 | let asset = value(assetInfo(assetId)) | |
569 | 723 | if ((asset.issuer != this)) | |
570 | 724 | then throw("Unknown issuer of token") | |
571 | 725 | else if (!(contains(asset.name, LANDPREFIX))) | |
572 | 726 | then throw((("Only NFT " + LANDPREFIX) + " tokens are accepted")) | |
573 | 727 | else { | |
574 | 728 | let landNumSize = drop(asset.name, 4) | |
575 | 729 | let landNum = if (contains(landNumSize, "XXL")) | |
576 | 730 | then dropRight(landNumSize, 3) | |
577 | 731 | else if (contains(landNumSize, "XL")) | |
578 | 732 | then dropRight(landNumSize, 2) | |
579 | 733 | else dropRight(landNumSize, 1) | |
580 | 734 | let landNumInt = valueOrErrorMessage(parseInt(landNum), ("Cannot parse land number from " + asset.name)) | |
581 | 735 | let landAssetId = toBase58String(assetId) | |
582 | 736 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
583 | 737 | if (isDefined(getInteger(timeKey))) | |
584 | 738 | then throw((("NFT " + asset.name) + " is already staked")) | |
585 | 739 | else { | |
586 | 740 | let d = split(asset.description, "_") | |
587 | 741 | let terrainCounts = countTerrains(d[recTerrains]) | |
588 | 742 | let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1) | |
589 | 743 | [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(landAssetId), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)] | |
590 | 744 | } | |
591 | 745 | } | |
592 | 746 | } | |
593 | 747 | } | |
594 | 748 | ||
595 | 749 | ||
596 | 750 | ||
597 | 751 | @Callable(i) | |
598 | 752 | func unstakeLand (landAssetIdStr) = if ((size(i.payments) != 0)) | |
599 | 753 | then throw("unstake doesn't require any payments") | |
600 | 754 | else { | |
601 | 755 | let addr = toString(i.caller) | |
602 | 756 | let c = checkClaimConditions(addr) | |
603 | 757 | let terrainCounts = countTerrains(c._3[recTerrains]) | |
604 | 758 | let pieces = numPiecesBySize(c._3[recLandSize]) | |
605 | 759 | let props = updateProportions(terrainCounts, (pieces / 25), -1) | |
606 | 760 | let claimResult = claimAll(addr, c._2, pieces) | |
607 | 761 | [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, ":"))] | |
608 | 762 | } | |
609 | 763 | ||
610 | 764 | ||
611 | 765 | ||
612 | 766 | @Callable(i) | |
613 | 767 | func stakeDuck () = { | |
614 | 768 | let pmt = value(i.payments[0]) | |
615 | 769 | let assetId = value(pmt.assetId) | |
616 | 770 | let address = toString(i.caller) | |
617 | 771 | if ((pmt.amount != 1)) | |
618 | 772 | then throw((("NFT " + DUCKPREFIX) + " token should be attached as payment")) | |
619 | 773 | else { | |
620 | 774 | let asset = value(assetInfo(assetId)) | |
621 | 775 | if (if ((asset.issuer != incubatorAddr)) | |
622 | 776 | then (asset.issuer != breederAddr) | |
623 | 777 | else false) | |
624 | 778 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
625 | 779 | else if (!(contains(asset.name, DUCKPREFIX))) | |
626 | 780 | then throw((("Only NFT " + DUCKPREFIX) + " tokens are accepted")) | |
627 | 781 | else { | |
628 | 782 | let assetIdStr = toBase58String(assetId) | |
629 | 783 | let timeKey = keyStakedTimeByAssetId(assetIdStr) | |
630 | 784 | if (isDefined(getInteger(timeKey))) | |
631 | 785 | then throw((("NFT " + asset.name) + " is already staked")) | |
632 | 786 | else if (isDefined(getString(keyStakedDuckByOwner(address)))) | |
633 | 787 | then throw(("You already staked one duck: " + asset.name)) | |
634 | 788 | else { | |
635 | 789 | let locKey = keyDuckLocation(assetIdStr) | |
636 | 790 | let location = getString(locKey) | |
637 | 791 | let keyHealth = keyDuckHealth(assetIdStr) | |
638 | 792 | let health = getInteger(keyHealth) | |
639 | 793 | let bpKey = keyBackpackByDuck(assetIdStr) | |
640 | 794 | let backpack = getString(bpKey) | |
641 | 795 | ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location)) | |
642 | 796 | then nil | |
643 | 797 | else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health)) | |
644 | 798 | then nil | |
645 | 799 | else ([IntegerEntry(keyHealth, 100)] ++ (if (isDefined(backpack)) | |
646 | 800 | then nil | |
647 | 801 | else [StringEntry(bpKey, "0:0_0_0_0_0_0:0_0_0_0_0_0:")])))))) | |
648 | 802 | } | |
649 | 803 | } | |
650 | 804 | } | |
651 | 805 | } | |
652 | 806 | ||
653 | 807 | ||
654 | 808 | ||
655 | 809 | @Callable(i) | |
656 | 810 | func unstakeDuck (assetIdStr) = if ((size(i.payments) != 0)) | |
657 | 811 | then throw("unstake doesn't require any payments") | |
658 | 812 | else { | |
659 | 813 | let assetId = fromBase58String(assetIdStr) | |
660 | 814 | let address = toString(i.caller) | |
661 | 815 | let asset = value(assetInfo(assetId)) | |
662 | 816 | if (if ((asset.issuer != incubatorAddr)) | |
663 | 817 | then (asset.issuer != breederAddr) | |
664 | 818 | else false) | |
665 | 819 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
666 | 820 | else if (!(contains(asset.name, DUCKPREFIX))) | |
667 | 821 | then throw((("Only NFT " + DUCKPREFIX) + " tokens can be unstaked")) | |
668 | 822 | else { | |
669 | 823 | let timeKey = keyStakedTimeByAssetId(toBase58String(assetId)) | |
670 | 824 | if (!(isDefined(timeKey))) | |
671 | 825 | then throw((("NFT " + asset.name) + " is not staked")) | |
672 | 826 | else if (!(isDefined(keyStakedDuckByOwner(address)))) | |
673 | 827 | then throw((("The duck " + asset.name) + " is not staked")) | |
674 | 828 | else { | |
675 | 829 | let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned")) | |
676 | 830 | if ((owner != address)) | |
677 | 831 | then throw("Staked NFT is not yours") | |
678 | 832 | else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyDuckIdToOwner(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))] | |
679 | 833 | } | |
680 | 834 | } | |
681 | 835 | } | |
682 | 836 | ||
683 | 837 | ||
684 | 838 | ||
685 | 839 | @Callable(i) | |
686 | 840 | func claimRes (amount,landAssetIdStr) = if ((size(i.payments) != 0)) | |
687 | 841 | then throw("claimRes doesn't require any payments") | |
688 | 842 | else { | |
689 | 843 | let addr = toString(i.originCaller) | |
690 | 844 | let result = claimResInternal(addr, amount) | |
691 | 845 | $Tuple2((result._1 :+ StringEntry(result._2, makeString(result._3, ":"))), result._3[bpIdxRes]) | |
692 | 846 | } | |
693 | 847 | ||
694 | 848 | ||
695 | 849 | ||
696 | 850 | @Callable(i) | |
697 | 851 | func flight (message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
698 | 852 | then throw("signature does not match") | |
699 | 853 | else if ((size(i.payments) != 0)) | |
700 | 854 | then throw("flight doesn't require any payments") | |
701 | 855 | else { | |
702 | 856 | let parts = split(toUtf8String(message), ";") | |
703 | 857 | let hp = split(split(parts[0], "|")[0], "_") | |
704 | 858 | let curHP = parseIntValue(hp[0]) | |
705 | 859 | let newHP = parseIntValue(hp[1]) | |
706 | 860 | let newLocAndTime = split(parts[1], ":") | |
707 | 861 | let newLocation = newLocAndTime[0] | |
708 | 862 | let time = parseIntValue(newLocAndTime[1]) | |
709 | 863 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
710 | 864 | then true | |
711 | 865 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
712 | 866 | then throw("signature outdated") | |
713 | 867 | else { | |
714 | 868 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
715 | 869 | let keyHealth = keyDuckHealth(duckAssetId) | |
716 | 870 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
717 | 871 | if ((oldFromState != curHP)) | |
718 | 872 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
719 | 873 | else if ((0 >= curHP)) | |
720 | 874 | then throw("You can't fly with zero health") | |
721 | 875 | else { | |
722 | 876 | let locKey = keyDuckLocation(duckAssetId) | |
723 | 877 | let curLocation = valueOrElse(getString(locKey), DEFAULTLOCATION) | |
724 | 878 | if ((newLocation == curLocation)) | |
725 | 879 | then throw("You can't fly to the same location") | |
726 | 880 | else $Tuple2([StringEntry(locKey, if ((newHP > 0)) | |
727 | 881 | then newLocation | |
728 | 882 | else curLocation), IntegerEntry(keyHealth, newHP)], unit) | |
729 | 883 | } | |
730 | 884 | } | |
731 | 885 | } | |
732 | 886 | ||
733 | 887 | ||
734 | 888 | ||
735 | 889 | @Callable(i) | |
736 | 890 | func setHealth (health,duckAssetId) = if (if ((0 > health)) | |
737 | 891 | then true | |
738 | 892 | else (health > 100)) | |
739 | 893 | then throw("HP should be within 0..100") | |
740 | 894 | else [IntegerEntry(keyDuckHealth(duckAssetId), health)] | |
741 | 895 | ||
742 | 896 | ||
743 | 897 | ||
744 | 898 | @Callable(i) | |
745 | 899 | func heal (matType,amount) = if (if ((0 > matType)) | |
746 | 900 | then true | |
747 | 901 | else (matType >= NUMRES)) | |
748 | 902 | then throw(("Unknown material: " + toString(matType))) | |
749 | 903 | else if ((0 >= amount)) | |
750 | 904 | then throw(("Amount should be positive! " + toString(amount))) | |
751 | 905 | else { | |
752 | 906 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
753 | 907 | let keyHealth = keyDuckHealth(duckAssetId) | |
754 | 908 | let oldHealth = valueOrElse(getInteger(keyHealth), 100) | |
755 | 909 | if ((oldHealth >= 100)) | |
756 | 910 | then throw("HP should be < 100 to heal") | |
757 | 911 | else { | |
758 | 912 | let bpKey = keyBackpackByDuck(duckAssetId) | |
759 | 913 | let currentPack = getBackpack(bpKey) | |
760 | 914 | let mList = split(currentPack[bpIdxMat], "_") | |
761 | 915 | let currentAmount = parseIntValue(mList[matType]) | |
762 | 916 | let deltaHealth = min([(amount / HEALCOST), (100 - oldHealth)]) | |
763 | 917 | let spendAmount = (deltaHealth * HEALCOST) | |
764 | 918 | if ((spendAmount > currentAmount)) | |
765 | 919 | then throw(((((("You need " + toString(spendAmount)) + " of ") + matTypes[matType]) + " to heal, but you backpack contains ") + toString(currentAmount))) | |
766 | 920 | else { | |
767 | 921 | let newMat = subOneInList(mList, matType, spendAmount) | |
768 | 922 | [IntegerEntry(keyHealth, (oldHealth + deltaHealth)), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] | |
769 | 923 | } | |
770 | 924 | } | |
771 | 925 | } | |
772 | 926 | ||
773 | 927 | ||
774 | 928 | ||
775 | 929 | @Callable(i) | |
776 | 930 | func updateBackpack (duckAssetId,newPack) = if ((i.caller != economyAddr)) | |
777 | 931 | then throw("permission denied") | |
778 | 932 | else $Tuple2([StringEntry(keyBackpackByDuck(duckAssetId), newPack)], newPack) | |
779 | 933 | ||
780 | 934 | ||
781 | 935 | ||
782 | 936 | @Callable(i) | |
783 | 937 | func expeditionBuy (message,sig) = if ((size(i.payments) != 1)) | |
784 | 938 | then throw("Exactly one payment required") | |
785 | 939 | else { | |
786 | 940 | let pmt = value(i.payments[0]) | |
787 | 941 | if ((pmt.assetId != usdnAssetId)) | |
788 | 942 | then throw("Allowed USDN payment only!") | |
789 | 943 | else if ((pmt.amount != EXPUSDN)) | |
790 | 944 | then throw(("Payment attached should be " + toString(EXPUSDN))) | |
791 | - | else expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
945 | + | else { | |
946 | + | let result = expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
947 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
948 | + | } | |
792 | 949 | } | |
793 | 950 | ||
794 | 951 | ||
795 | 952 | ||
796 | 953 | @Callable(i) | |
797 | 954 | func expedition (message,sig) = if ((size(i.payments) != 0)) | |
798 | 955 | then throw("expedition doesn't require any payments") | |
799 | 956 | else expeditionCommon(true, i.caller, i.transactionId, message, sig) | |
800 | 957 | ||
801 | 958 | ||
802 | 959 | ||
803 | 960 | @Callable(i) | |
804 | 961 | func upgradeInfra (landAssetIdIgnored) = if ((size(i.payments) != 0)) | |
805 | 962 | then throw("Infrastructure upgrade doesn't require any payments") | |
806 | 963 | else upInfraCommon(true, i.caller, 0) | |
807 | 964 | ||
808 | 965 | ||
809 | 966 | ||
810 | 967 | @Callable(i) | |
811 | 968 | func upgradeInfraUsdn (landAssetIdIgnored) = if ((size(i.payments) != 1)) | |
812 | 969 | then throw("Exactly one payment required") | |
813 | 970 | else { | |
814 | 971 | let pmt = value(i.payments[0]) | |
815 | 972 | if ((pmt.assetId != usdnAssetId)) | |
816 | 973 | then throw("Allowed USDN payment only!") | |
817 | - | else upInfraCommon(false, i.caller, pmt.amount) | |
974 | + | else { | |
975 | + | let result = upInfraCommon(false, i.caller, pmt.amount) | |
976 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
977 | + | } | |
818 | 978 | } | |
819 | 979 | ||
820 | 980 | ||
821 | 981 | ||
822 | 982 | @Callable(i) | |
823 | 983 | func activateArtifact (artName) = if ((size(i.payments) != 0)) | |
824 | 984 | then throw("Artifact activation doesn't require any payments") | |
825 | 985 | else { | |
826 | 986 | let result = match artName { | |
827 | 987 | case _ => | |
828 | 988 | if (("PRESALE" == $match0)) | |
829 | 989 | then activatePresaleArt(toString(i.caller)) | |
830 | 990 | else throw("Unknown artifact") | |
831 | 991 | } | |
832 | 992 | result | |
833 | 993 | } | |
834 | 994 | ||
835 | 995 | ||
996 | + | ||
997 | + | @Callable(i) | |
998 | + | func mergeLands (landAssetIds) = if ((size(i.payments) != 0)) | |
999 | + | then throw("Lands merging doesn't require any payments") | |
1000 | + | else mergeCommon(true, toString(i.caller), 0, landAssetIds, i.transactionId) | |
1001 | + | ||
1002 | + | ||
1003 | + | ||
1004 | + | @Callable(i) | |
1005 | + | func mergeLandsUsdn (landAssetIds) = if ((size(i.payments) != 1)) | |
1006 | + | then throw("Exactly one payment required") | |
1007 | + | else { | |
1008 | + | let pmt = value(i.payments[0]) | |
1009 | + | if ((pmt.assetId != usdnAssetId)) | |
1010 | + | then throw("Allowed USDN payment only!") | |
1011 | + | else { | |
1012 | + | let result = mergeCommon(false, toString(i.caller), pmt.amount, landAssetIds, i.transactionId) | |
1013 | + | $Tuple2((result._1 :+ ScriptTransfer(economyAddr, pmt.amount, usdnAssetId)), result._2) | |
1014 | + | } | |
1015 | + | } | |
1016 | + | ||
1017 | + |
github/deemru/w8io/026f985 150.77 ms ◑