tx · 5xymvw3vMy4b4m88chQRYRMMTs3NDFw5365ta7q3YGqm 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.03600000 Waves 2024.12.13 02:41 [3412049] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "5xymvw3vMy4b4m88chQRYRMMTs3NDFw5365ta7q3YGqm", "fee": 3600000, "feeAssetId": null, "timestamp": 1734046934375, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "4ShdNCvYLybbHGzbo7Wr7iyfsToU8wkw7TedNJmKT75UzDiawSWV4Rz97dSoQ3gPcixme4XBFvUDrHepwsNqSuUG" ], "script": "base64:BgJLCAISABIECgIICBIDCgEEEgMKAQESABIAEgMKAQESABIECgIIARIAEgMKAQgSAwoBCBIECgIIARIDCgEIEgASAwoBCBIAEgASABIAkQEAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDcAgK3iBAAFTVVMVDgAgMLXLwAGTVVMVDE0AICA6YOx3hYACkRBWV9NSUxMSVMAgLiZKQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoAE09ORV9QRVJDRU5UX0RJVklTT1IAZAAMUkFORE9NX0RFTEFZAAIAFE5GVF9DSEVTVF9QUklDRV9VU0RUAMCWsQIABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABABdEQUlMWV9QUk9NT19TVEFSVF9CTE9DSwQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMACA75ECAwkAAAIBAVQFByRtYXRjaDAAwKbQAQkAAgECDVVua25vd24gY2hhaW4AFURBSUxZX1BST01PX0VORF9CTE9DSwQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMACg25MCAwkAAAIBAVQFByRtYX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yYXdzAl80AAAAwFtU2w==", "height": 3412049, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AqoH5B9A5TnViM8xwAc94XBfkNzzg56WzQP7NuABDaA5 Next: GF9ZrVqtxwtdcPSkGuZrsZqMwPgyMXE3CcAW8SQHdkx2 Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | ||
24 | 24 | let chain = take(drop(this.bytes, 1), 1) | |
25 | 25 | ||
26 | + | let DAILY_PROMO_START_BLOCK = match chain { | |
27 | + | case _ => | |
28 | + | if ((base58'2W' == $match0)) | |
29 | + | then 4487040 | |
30 | + | else if ((base58'2T' == $match0)) | |
31 | + | then 3412800 | |
32 | + | else throw("Unknown chain") | |
33 | + | } | |
34 | + | ||
35 | + | let DAILY_PROMO_END_BLOCK = match chain { | |
36 | + | case _ => | |
37 | + | if ((base58'2W' == $match0)) | |
38 | + | then 4517280 | |
39 | + | else if ((base58'2T' == $match0)) | |
40 | + | then 3443040 | |
41 | + | else throw("Unknown chain") | |
42 | + | } | |
43 | + | ||
44 | + | let DAY_BLOCKS = match chain { | |
45 | + | case _ => | |
46 | + | if ((base58'2W' == $match0)) | |
47 | + | then 1440 | |
48 | + | else if ((base58'2T' == $match0)) | |
49 | + | then 60 | |
50 | + | else throw("Unknown chain") | |
51 | + | } | |
52 | + | ||
26 | 53 | let WEEK_BLOCKS = match chain { | |
27 | 54 | case _ => | |
28 | 55 | if ((base58'2W' == $match0)) | |
29 | 56 | then 10080 | |
30 | 57 | else if ((base58'2T' == $match0)) | |
31 | 58 | then 180 | |
59 | + | else throw("Unknown chain") | |
60 | + | } | |
61 | + | ||
62 | + | let VRF_OFFSET = match chain { | |
63 | + | case _ => | |
64 | + | if ((base58'2W' == $match0)) | |
65 | + | then 0 | |
66 | + | else if ((base58'2T' == $match0)) | |
67 | + | then 1146000 | |
32 | 68 | else throw("Unknown chain") | |
33 | 69 | } | |
34 | 70 | ||
47 | 83 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
48 | 84 | else if ((base58'2T' == $match0)) | |
49 | 85 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
86 | + | else throw("Unknown chain") | |
87 | + | } | |
88 | + | ||
89 | + | let defaultRestAddressStr = match chain { | |
90 | + | case _ => | |
91 | + | if ((base58'2W' == $match0)) | |
92 | + | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
93 | + | else if ((base58'2T' == $match0)) | |
94 | + | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
50 | 95 | else throw("Unknown chain") | |
51 | 96 | } | |
52 | 97 | ||
85 | 130 | func keyRest2Address () = "%s__rest2Addr" | |
86 | 131 | ||
87 | 132 | ||
133 | + | func keyRestAddress () = "%s__restAddr" | |
134 | + | ||
135 | + | ||
136 | + | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
137 | + | ||
88 | 138 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
89 | 139 | ||
90 | 140 | ||
91 | 141 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
92 | 142 | ||
143 | + | ||
144 | + | let IdxCfgStakingDapp = 1 | |
145 | + | ||
146 | + | let restCfg = readRestCfgOrFail(restContract) | |
147 | + | ||
148 | + | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
93 | 149 | ||
94 | 150 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
95 | 151 | ||
141 | 197 | ||
142 | 198 | func keyStakedNFTsByOwner (ownerAddr) = ("stakedNFTsByOwner_" + ownerAddr) | |
143 | 199 | ||
200 | + | ||
201 | + | func keyUserPromoAcres (address) = ("promoAcres_" + address) | |
202 | + | ||
203 | + | ||
204 | + | func keyUserPromoTickets (address) = ("promoTickets_" + address) | |
205 | + | ||
206 | + | ||
207 | + | let keyTotalPromoTickets = "totalPromoTickets" | |
208 | + | ||
209 | + | let keyPromoMap = "promoMap" | |
144 | 210 | ||
145 | 211 | func asInt (v) = match v { | |
146 | 212 | case n: Int => | |
196 | 262 | let randomHash = sha256_16Kb((salt + entropy)) | |
197 | 263 | (toInt(randomHash) % maxValue) | |
198 | 264 | } | |
265 | + | ||
266 | + | ||
267 | + | func padL (val,len) = { | |
268 | + | let valS = toString(val) | |
269 | + | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
270 | + | (zeroes + valS) | |
271 | + | } | |
199 | 272 | ||
200 | 273 | ||
201 | 274 | let M6_ = 1000000 | |
528 | 601 | } | |
529 | 602 | ||
530 | 603 | ||
604 | + | let promoNumPrizes = 3 | |
605 | + | ||
606 | + | let promoAwardPerRound = [50000000, 25000000, 25000000] | |
607 | + | ||
608 | + | func stakeAcresFor (address,amt,shouldCleanPromo) = { | |
609 | + | let $t01122511301 = stakeUnstakeAcresInternal(amt, address, 0) | |
610 | + | let actions = $t01122511301._1 | |
611 | + | let wlgClaimedAmount = $t01122511301._2 | |
612 | + | let promoActions = if (if ((height >= DAILY_PROMO_START_BLOCK)) | |
613 | + | then (DAILY_PROMO_END_BLOCK > height) | |
614 | + | else false) | |
615 | + | then { | |
616 | + | let promoAcresKey = keyUserPromoAcres(address) | |
617 | + | let promoAcres = ((if (shouldCleanPromo) | |
618 | + | then 0 | |
619 | + | else valueOrElse(getInteger(promoAcresKey), 0)) + amt) | |
620 | + | let tickets = (promoAcres / MULT8) | |
621 | + | let ticketsKey = keyUserPromoTickets(address) | |
622 | + | let deltaTickets = (tickets - valueOrElse(getInteger(ticketsKey), 0)) | |
623 | + | let totalTickets = (valueOrElse(getInteger(keyTotalPromoTickets), 0) + deltaTickets) | |
624 | + | if (if (shouldCleanPromo) | |
625 | + | then true | |
626 | + | else (deltaTickets > 0)) | |
627 | + | then { | |
628 | + | let promoMap = valueOrElse(getString(keyPromoMap), "") | |
629 | + | let userRecord = ((address + ":") + padL(tickets, 3)) | |
630 | + | let newMap = if (contains(promoMap, address)) | |
631 | + | then { | |
632 | + | let mapParts = split_51C(promoMap, address) | |
633 | + | if ((mapParts[0] == "")) | |
634 | + | then { | |
635 | + | let r = drop(mapParts[1], 4) | |
636 | + | if ((r == "")) | |
637 | + | then if ((tickets == 0)) | |
638 | + | then "" | |
639 | + | else userRecord | |
640 | + | else if ((tickets == 0)) | |
641 | + | then drop(r, 1) | |
642 | + | else (userRecord + r) | |
643 | + | } | |
644 | + | else { | |
645 | + | let r = drop(mapParts[1], 4) | |
646 | + | if ((r == "")) | |
647 | + | then if ((tickets == 0)) | |
648 | + | then dropRight(mapParts[0], 1) | |
649 | + | else (mapParts[0] + userRecord) | |
650 | + | else if ((tickets == 0)) | |
651 | + | then (mapParts[0] + drop(r, 1)) | |
652 | + | else ((mapParts[0] + userRecord) + r) | |
653 | + | } | |
654 | + | } | |
655 | + | else if ((tickets == 0)) | |
656 | + | then promoMap | |
657 | + | else if ((promoMap == "")) | |
658 | + | then userRecord | |
659 | + | else ((promoMap + "_") + userRecord) | |
660 | + | [IntegerEntry(promoAcresKey, promoAcres), IntegerEntry(ticketsKey, tickets), IntegerEntry(keyTotalPromoTickets, totalTickets), StringEntry(keyPromoMap, newMap)] | |
661 | + | } | |
662 | + | else [IntegerEntry(promoAcresKey, promoAcres)] | |
663 | + | } | |
664 | + | else nil | |
665 | + | $Tuple2((actions ++ promoActions), wlgClaimedAmount) | |
666 | + | } | |
667 | + | ||
668 | + | ||
531 | 669 | @Callable(i) | |
532 | 670 | func saveLastTx () = if (!(containsElement([wlgContract, marketContract], i.caller))) | |
533 | 671 | then throw("Access denied") | |
555 | 693 | @Callable(i) | |
556 | 694 | func unstakeAcres (amount) = { | |
557 | 695 | let prologActions = prolog(i) | |
558 | - | if ((0 >= amount)) | |
559 | - | then throw("Amount should be positive") | |
560 | - | else { | |
561 | - | let address = toString(i.caller) | |
562 | - | if ((size(i.payments) != 0)) | |
563 | - | then throw("No payments required") | |
564 | - | else { | |
565 | - | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
566 | - | if ((arbReleaseTime > lastBlock.timestamp)) | |
567 | - | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
568 | - | else { | |
569 | - | let $t01234312423 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
570 | - | let actions = $t01234312423._1 | |
571 | - | let wlgClaimedAmount = $t01234312423._2 | |
572 | - | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
573 | - | } | |
574 | - | } | |
575 | - | } | |
696 | + | if (if ((height >= DAILY_PROMO_START_BLOCK)) | |
697 | + | then (DAILY_PROMO_END_BLOCK > height) | |
698 | + | else false) | |
699 | + | then throw("You can't unstake during Xmas promo period") | |
700 | + | else if ((0 >= amount)) | |
701 | + | then throw("Amount should be positive") | |
702 | + | else { | |
703 | + | let address = toString(i.caller) | |
704 | + | if ((size(i.payments) != 0)) | |
705 | + | then throw("No payments required") | |
706 | + | else { | |
707 | + | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
708 | + | if ((arbReleaseTime > lastBlock.timestamp)) | |
709 | + | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
710 | + | else { | |
711 | + | let $t01530415384 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
712 | + | let actions = $t01530415384._1 | |
713 | + | let wlgClaimedAmount = $t01530415384._2 | |
714 | + | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
715 | + | } | |
716 | + | } | |
717 | + | } | |
576 | 718 | } | |
577 | 719 | ||
578 | 720 | ||
591 | 733 | else (value(pmt.assetId) != acresAssetId)) | |
592 | 734 | then throw("ACRES payments only!") | |
593 | 735 | else { | |
594 | - | let $ | |
595 | - | let | |
596 | - | let wlgClaimedAmount = $ | |
597 | - | $Tuple2(( | |
736 | + | let $t01583515908 = stakeAcresFor(address, amt, false) | |
737 | + | let stakeActions = $t01583515908._1 | |
738 | + | let wlgClaimedAmount = $t01583515908._2 | |
739 | + | $Tuple2((stakeActions ++ prologActions), wlgClaimedAmount) | |
598 | 740 | } | |
599 | 741 | } | |
600 | 742 | } | |
657 | 799 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
658 | 800 | else { | |
659 | 801 | let addr = toString(i.caller) | |
660 | - | let $ | |
661 | - | let limitAction = $ | |
662 | - | let maxUsdt = $ | |
802 | + | let $t01777017818 = getSwapLimitAcres() | |
803 | + | let limitAction = $t01777017818._1 | |
804 | + | let maxUsdt = $t01777017818._2 | |
663 | 805 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
664 | 806 | if ((acresAmount > maxAcres)) | |
665 | 807 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
675 | 817 | ||
676 | 818 | @Callable(i) | |
677 | 819 | func sellAcresREADONLY (address,acresAmount) = { | |
678 | - | let $ | |
679 | - | let limitAction = $ | |
680 | - | let maxUsdt = $ | |
820 | + | let $t01831418362 = getSwapLimitAcres() | |
821 | + | let limitAction = $t01831418362._1 | |
822 | + | let maxUsdt = $t01831418362._2 | |
681 | 823 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
682 | 824 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
683 | 825 | } | |
738 | 880 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
739 | 881 | if ((req == req)) | |
740 | 882 | then { | |
741 | - | let $ | |
742 | - | let nftActions = $ | |
743 | - | let nftAssetId = $ | |
883 | + | let $t02087621014 = issueNftCustom(idxNameShovel, idxKeyP, idxCollDig, idxRarityP, 3, idxDescrShovel, idxBonusTypeFp, i.caller) | |
884 | + | let nftActions = $t02087621014._1 | |
885 | + | let nftAssetId = $t02087621014._2 | |
744 | 886 | $Tuple6(rr._1, rr._2, rr._3, rr._4, rr._5, nftActions) | |
745 | 887 | } | |
746 | 888 | else throw("Strict value is not equal to itself.") | |
811 | 953 | let userFpKey = keyFarmingPowerByUser(address) | |
812 | 954 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
813 | 955 | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(address)), 0) | |
814 | - | let $ | |
815 | - | let newBonusedFp = $ | |
816 | - | let ignored = $ | |
956 | + | let $t02328523372 = getFarmingPowerByAcresAndBonus(newAcresAmount, userBonus) | |
957 | + | let newBonusedFp = $t02328523372._1 | |
958 | + | let ignored = $t02328523372._2 | |
817 | 959 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
818 | 960 | let newTotalFp = ((oldTotalFp + newBonusedFp) - oldFp) | |
819 | 961 | $Tuple2(nil, [oldFp, newBonusedFp, oldTotalFp, newTotalFp]) | |
855 | 997 | let listAction = StringEntry(nftsKey, makeString_2C((nfts :+ assetIdStr), "_")) | |
856 | 998 | if ((asset.issuer == this)) | |
857 | 999 | then { | |
858 | - | let $ | |
859 | - | let actions = $ | |
860 | - | let wlgClaimedAmount = $ | |
1000 | + | let $t02478124971 = stakeNftInternal(addr, assetIdStr, (bonusByDescription(value(asset.description)) * 10000), keyUserWlNftNumber(addr), keyWlNftTotalStaked, MAX_WL_NFTS) | |
1001 | + | let actions = $t02478124971._1 | |
1002 | + | let wlgClaimedAmount = $t02478124971._2 | |
861 | 1003 | $Tuple2(((prologActions ++ actions) :+ listAction), wlgClaimedAmount) | |
862 | 1004 | } | |
863 | 1005 | else if ((isArkimalIssued(asset) == "")) | |
864 | 1006 | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
865 | 1007 | else { | |
866 | - | let $ | |
867 | - | let actions = $ | |
868 | - | let wlgClaimedAmount = $ | |
1008 | + | let $t02515225303 = stakeNftInternal(addr, assetIdStr, ARK_NFT_BONUS, keyUserArkNftNumber(addr), keyArkNftTotalStaked, MAX_ARK_NFTS) | |
1009 | + | let actions = $t02515225303._1 | |
1010 | + | let wlgClaimedAmount = $t02515225303._2 | |
869 | 1011 | $Tuple2(((prologActions ++ actions) :+ listAction), wlgClaimedAmount) | |
870 | 1012 | } | |
871 | 1013 | } | |
902 | 1044 | then { | |
903 | 1045 | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
904 | 1046 | let bonusVal = (bonusByDescription(value(asset.description)) * 10000) | |
905 | - | let $ | |
906 | - | let actions = $ | |
907 | - | let wlgClaimedAmount = $ | |
1047 | + | let $t02646826547 = stakeUnstakeAcresInternal(0, addr, -(bonusVal)) | |
1048 | + | let actions = $t02646826547._1 | |
1049 | + | let wlgClaimedAmount = $t02646826547._2 | |
908 | 1050 | $Tuple2(((((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber - 1))) :+ IntegerEntry(keyWlNftTotalStaked, max([0, (valueOrElse(getInteger(keyWlNftTotalStaked), 0) - 1)]))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) :+ ScriptTransfer(i.caller, 1, assetId)) ++ prologActions), wlgClaimedAmount) | |
909 | 1051 | } | |
910 | 1052 | else { | |
913 | 1055 | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
914 | 1056 | else { | |
915 | 1057 | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
916 | - | let $ | |
917 | - | let actions = $ | |
918 | - | let wlgClaimedAmount = $ | |
1058 | + | let $t02720727291 = stakeUnstakeAcresInternal(0, addr, -(ARK_NFT_BONUS)) | |
1059 | + | let actions = $t02720727291._1 | |
1060 | + | let wlgClaimedAmount = $t02720727291._2 | |
919 | 1061 | $Tuple2((((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) :+ ScriptTransfer(i.caller, 1, assetId)) ++ prologActions), wlgClaimedAmount) | |
920 | 1062 | } | |
921 | 1063 | } | |
957 | 1099 | } | |
958 | 1100 | } | |
959 | 1101 | ||
960 | - | let $ | |
1102 | + | let $t02868028896 = { | |
961 | 1103 | let $l = i.payments | |
962 | 1104 | let $s = size($l) | |
963 | 1105 | let $acc0 = $Tuple4(0, 0, nil, -1) | |
971 | 1113 | ||
972 | 1114 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
973 | 1115 | } | |
974 | - | let wlgFee = $ | |
975 | - | let totalBonus = $ | |
976 | - | let burnActions = $ | |
977 | - | let rarityIdx = $ | |
1116 | + | let wlgFee = $t02868028896._1 | |
1117 | + | let totalBonus = $t02868028896._2 | |
1118 | + | let burnActions = $t02868028896._3 | |
1119 | + | let rarityIdx = $t02868028896._4 | |
978 | 1120 | let newRarityIdx = if ((rarityIdx == idxRarityC)) | |
979 | 1121 | then if ((rarityThresholds[idxThresholdC] > totalBonus)) | |
980 | 1122 | then idxRarityC | |
1006 | 1148 | let changeActions = if ((change > 0)) | |
1007 | 1149 | then [ScriptTransfer(i.caller, change, wlgAssetId)] | |
1008 | 1150 | else nil | |
1009 | - | let $ | |
1010 | - | let issueNftActions = $ | |
1011 | - | let nftAssetId = $ | |
1151 | + | let $t03043330594 = issueNftCustom(idxNamePickaxe, newRarityIdx, idxCollDig, newRarityIdx, totalBonus, idxDescrPickaxe, idxBonusTypeFp, i.caller) | |
1152 | + | let issueNftActions = $t03043330594._1 | |
1153 | + | let nftAssetId = $t03043330594._2 | |
1012 | 1154 | let burned = size(burnActions) | |
1013 | 1155 | let burnCounterActions = if ((burned == 0)) | |
1014 | 1156 | then nil | |
1052 | 1194 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
1053 | 1195 | let salt = fromBase58String(split(valueOrElse(getString(keyCurWeekTxIdByUser(addr)), "42_DEFAULT"), "_")[1]) | |
1054 | 1196 | let rand = getRandomNumber(100, salt, entropy) | |
1055 | - | let $ | |
1197 | + | let $t03261332885 = if ((84 > rand)) | |
1056 | 1198 | then $Tuple2(1, idxRarityC) | |
1057 | 1199 | else if ((98 > rand)) | |
1058 | 1200 | then $Tuple2(5, idxRarityU) | |
1059 | 1201 | else $Tuple2(10, idxRarityL) | |
1060 | - | let bonus = $ | |
1061 | - | let rarityIdx = $ | |
1062 | - | let $ | |
1063 | - | let issueNftActions = $ | |
1064 | - | let nftAssetId = $ | |
1202 | + | let bonus = $t03261332885._1 | |
1203 | + | let rarityIdx = $t03261332885._2 | |
1204 | + | let $t03288833038 = issueNftCustom(idxNamePickaxe, rarityIdx, idxCollDig, rarityIdx, bonus, idxDescrPickaxe, idxBonusTypeFp, i.caller) | |
1205 | + | let issueNftActions = $t03288833038._1 | |
1206 | + | let nftAssetId = $t03288833038._2 | |
1065 | 1207 | $Tuple2(((((issueNftActions ++ prologActions) ++ changeActions) :+ ScriptTransfer(addressFromStringValue(getStringValue(wlgContract, teamAddrKey)), forTeam, wlgAssetId)) :+ DeleteEntry(finishKey)), $Tuple2(nftAssetId, wlgRemain)) | |
1066 | 1208 | } | |
1067 | 1209 | } | |
1085 | 1227 | } | |
1086 | 1228 | ||
1087 | 1229 | ||
1230 | + | ||
1231 | + | @Callable(i) | |
1232 | + | func drawDaylyPromo () = if ((i.caller != this)) | |
1233 | + | then throw("Permission denied") | |
1234 | + | else { | |
1235 | + | let today = (height % DAY_BLOCKS) | |
1236 | + | let maxValue = valueOrElse(getInteger(keyTotalPromoTickets), 0) | |
1237 | + | if ((maxValue == 0)) | |
1238 | + | then throw("No tickets to draw") | |
1239 | + | else { | |
1240 | + | let b = (today * DAY_BLOCKS) | |
1241 | + | let h = if ((b > VRF_OFFSET)) | |
1242 | + | then b | |
1243 | + | else (b + VRF_OFFSET) | |
1244 | + | let entropy = value(value(blockInfoByHeight(h)).vrf) | |
1245 | + | let promoMap = valueOrElse(getString(keyPromoMap), "") | |
1246 | + | if ((promoMap == "")) | |
1247 | + | then throw("No participants") | |
1248 | + | else { | |
1249 | + | let promoList = split_51C(promoMap, "_") | |
1250 | + | func singleDraw (ac,j) = if ((j >= promoNumPrizes)) | |
1251 | + | then ac | |
1252 | + | else { | |
1253 | + | let rand = getRandomNumber(ac._1, ac._2, entropy) | |
1254 | + | let promo4List = if ((ac._3 == "")) | |
1255 | + | then nil | |
1256 | + | else split_51C(ac._3, "_") | |
1257 | + | func countTickets (acc,el) = { | |
1258 | + | let parts = split(el, ":") | |
1259 | + | let addr = parts[0] | |
1260 | + | let tickets = parseIntValue(parts[1]) | |
1261 | + | let newTotal = (acc._1 + tickets) | |
1262 | + | if (if ((acc._3 == "")) | |
1263 | + | then (newTotal > rand) | |
1264 | + | else false) | |
1265 | + | then $Tuple3(newTotal, tickets, addr) | |
1266 | + | else $Tuple3(newTotal, acc._2, acc._3) | |
1267 | + | } | |
1268 | + | ||
1269 | + | let r = { | |
1270 | + | let $l = promo4List | |
1271 | + | let $s = size($l) | |
1272 | + | let $acc0 = $Tuple3(0, 0, "") | |
1273 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1274 | + | then $a | |
1275 | + | else countTickets($a, $l[$i]) | |
1276 | + | ||
1277 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1278 | + | then $a | |
1279 | + | else throw("List size exceeds 20") | |
1280 | + | ||
1281 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1282 | + | } | |
1283 | + | let winner = r._3 | |
1284 | + | if ((winner == "")) | |
1285 | + | then ac | |
1286 | + | else { | |
1287 | + | let mapParts = split_51C(ac._3, winner) | |
1288 | + | let newMap = if ((mapParts[0] == "")) | |
1289 | + | then drop(mapParts[1], 5) | |
1290 | + | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 4)) | |
1291 | + | let $t03563635787 = stakeAcresFor(winner, promoAwardPerRound[j], true) | |
1292 | + | let stakeActions = $t03563635787._1 | |
1293 | + | let ignoredWlgClaimedAmount = $t03563635787._2 | |
1294 | + | let newSalt = fromBase58String(valueOrElse(getString(stakingContract, keyCurWeekTxIdByUser(winner)), "DEFAULT")) | |
1295 | + | $Tuple4((ac._1 - r._2), newSalt, newMap, (ac._4 :+ stakeActions)) | |
1296 | + | } | |
1297 | + | } | |
1298 | + | ||
1299 | + | let draws = { | |
1300 | + | let $l = [0, 1, 2] | |
1301 | + | let $s = size($l) | |
1302 | + | let $acc0 = $Tuple4(maxValue, i.transactionId, promoMap, nil) | |
1303 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1304 | + | then $a | |
1305 | + | else singleDraw($a, $l[$i]) | |
1306 | + | ||
1307 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1308 | + | then $a | |
1309 | + | else throw("List size exceeds 3") | |
1310 | + | ||
1311 | + | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
1312 | + | } | |
1313 | + | $Tuple2(([StringEntry(keyPromoMap, draws._3), IntegerEntry(keyTotalPromoTickets, draws._1)] ++ draws._4), 0) | |
1314 | + | } | |
1315 | + | } | |
1316 | + | } | |
1317 | + | ||
1318 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULT7 = 10000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let MULT14 = 100000000000000 | |
13 | 13 | ||
14 | 14 | let DAY_MILLIS = 86400000 | |
15 | 15 | ||
16 | 16 | let USDT2ACRES_MULTIPLIER = 10 | |
17 | 17 | ||
18 | 18 | let ONE_PERCENT_DIVISOR = 100 | |
19 | 19 | ||
20 | 20 | let RANDOM_DELAY = 2 | |
21 | 21 | ||
22 | 22 | let NFT_CHEST_PRICE_USDT = 5000000 | |
23 | 23 | ||
24 | 24 | let chain = take(drop(this.bytes, 1), 1) | |
25 | 25 | ||
26 | + | let DAILY_PROMO_START_BLOCK = match chain { | |
27 | + | case _ => | |
28 | + | if ((base58'2W' == $match0)) | |
29 | + | then 4487040 | |
30 | + | else if ((base58'2T' == $match0)) | |
31 | + | then 3412800 | |
32 | + | else throw("Unknown chain") | |
33 | + | } | |
34 | + | ||
35 | + | let DAILY_PROMO_END_BLOCK = match chain { | |
36 | + | case _ => | |
37 | + | if ((base58'2W' == $match0)) | |
38 | + | then 4517280 | |
39 | + | else if ((base58'2T' == $match0)) | |
40 | + | then 3443040 | |
41 | + | else throw("Unknown chain") | |
42 | + | } | |
43 | + | ||
44 | + | let DAY_BLOCKS = match chain { | |
45 | + | case _ => | |
46 | + | if ((base58'2W' == $match0)) | |
47 | + | then 1440 | |
48 | + | else if ((base58'2T' == $match0)) | |
49 | + | then 60 | |
50 | + | else throw("Unknown chain") | |
51 | + | } | |
52 | + | ||
26 | 53 | let WEEK_BLOCKS = match chain { | |
27 | 54 | case _ => | |
28 | 55 | if ((base58'2W' == $match0)) | |
29 | 56 | then 10080 | |
30 | 57 | else if ((base58'2T' == $match0)) | |
31 | 58 | then 180 | |
59 | + | else throw("Unknown chain") | |
60 | + | } | |
61 | + | ||
62 | + | let VRF_OFFSET = match chain { | |
63 | + | case _ => | |
64 | + | if ((base58'2W' == $match0)) | |
65 | + | then 0 | |
66 | + | else if ((base58'2T' == $match0)) | |
67 | + | then 1146000 | |
32 | 68 | else throw("Unknown chain") | |
33 | 69 | } | |
34 | 70 | ||
35 | 71 | let usdtAssetId = match chain { | |
36 | 72 | case _ => | |
37 | 73 | if ((base58'2W' == $match0)) | |
38 | 74 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
39 | 75 | else if ((base58'2T' == $match0)) | |
40 | 76 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
41 | 77 | else throw("Unknown chain") | |
42 | 78 | } | |
43 | 79 | ||
44 | 80 | let defaultRest2AddressStr = match chain { | |
45 | 81 | case _ => | |
46 | 82 | if ((base58'2W' == $match0)) | |
47 | 83 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
48 | 84 | else if ((base58'2T' == $match0)) | |
49 | 85 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
86 | + | else throw("Unknown chain") | |
87 | + | } | |
88 | + | ||
89 | + | let defaultRestAddressStr = match chain { | |
90 | + | case _ => | |
91 | + | if ((base58'2W' == $match0)) | |
92 | + | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
93 | + | else if ((base58'2T' == $match0)) | |
94 | + | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
50 | 95 | else throw("Unknown chain") | |
51 | 96 | } | |
52 | 97 | ||
53 | 98 | let arbitrageDelay = match chain { | |
54 | 99 | case _ => | |
55 | 100 | if ((base58'2W' == $match0)) | |
56 | 101 | then DAY_MILLIS | |
57 | 102 | else if ((base58'2T' == $match0)) | |
58 | 103 | then 60000 | |
59 | 104 | else throw("Unknown chain") | |
60 | 105 | } | |
61 | 106 | ||
62 | 107 | let oldStakingContractStr = match chain { | |
63 | 108 | case _ => | |
64 | 109 | if ((base58'2W' == $match0)) | |
65 | 110 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
66 | 111 | else if ((base58'2T' == $match0)) | |
67 | 112 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
68 | 113 | else throw("Unknown chain") | |
69 | 114 | } | |
70 | 115 | ||
71 | 116 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
72 | 117 | ||
73 | 118 | ||
74 | 119 | let IdxCfgAcres2Dapp = 1 | |
75 | 120 | ||
76 | 121 | let IdxCfgWlgDapp = 2 | |
77 | 122 | ||
78 | 123 | let IdxCfgInvestFundDapp = 5 | |
79 | 124 | ||
80 | 125 | let IdxCfgMarketDapp = 6 | |
81 | 126 | ||
82 | 127 | func keyRestCfg () = "%s__restConfig" | |
83 | 128 | ||
84 | 129 | ||
85 | 130 | func keyRest2Address () = "%s__rest2Addr" | |
86 | 131 | ||
87 | 132 | ||
133 | + | func keyRestAddress () = "%s__restAddr" | |
134 | + | ||
135 | + | ||
136 | + | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
137 | + | ||
88 | 138 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
89 | 139 | ||
90 | 140 | ||
91 | 141 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
92 | 142 | ||
143 | + | ||
144 | + | let IdxCfgStakingDapp = 1 | |
145 | + | ||
146 | + | let restCfg = readRestCfgOrFail(restContract) | |
147 | + | ||
148 | + | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
93 | 149 | ||
94 | 150 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
95 | 151 | ||
96 | 152 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
97 | 153 | ||
98 | 154 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
99 | 155 | ||
100 | 156 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
101 | 157 | ||
102 | 158 | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
103 | 159 | ||
104 | 160 | let marketContract = getContractAddressOrFail(rest2Cfg, IdxCfgMarketDapp) | |
105 | 161 | ||
106 | 162 | let oldAcresContractKey = "oldAcresContract" | |
107 | 163 | ||
108 | 164 | func keyBlocked () = "contractsBlocked" | |
109 | 165 | ||
110 | 166 | ||
111 | 167 | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
112 | 168 | ||
113 | 169 | ||
114 | 170 | func keyCurWeekTxIdByUser (addr) = ("curWeekTxIdByUser_" + addr) | |
115 | 171 | ||
116 | 172 | ||
117 | 173 | func keyCommit (address) = ("finishBlockFor_" + address) | |
118 | 174 | ||
119 | 175 | ||
120 | 176 | let wlgAssetIdKey = "wlg_assetId" | |
121 | 177 | ||
122 | 178 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
123 | 179 | ||
124 | 180 | let acresIssuedAmountKey = "acresIssuedAmount" | |
125 | 181 | ||
126 | 182 | let acresAssetIdKey = "acresAssetId" | |
127 | 183 | ||
128 | 184 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
129 | 185 | ||
130 | 186 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
131 | 187 | ||
132 | 188 | ||
133 | 189 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
134 | 190 | ||
135 | 191 | ||
136 | 192 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
137 | 193 | ||
138 | 194 | ||
139 | 195 | func keyStakedTimeByAssetIdAndOwner (assetId,addr) = ((("st_" + assetId) + "_") + addr) | |
140 | 196 | ||
141 | 197 | ||
142 | 198 | func keyStakedNFTsByOwner (ownerAddr) = ("stakedNFTsByOwner_" + ownerAddr) | |
143 | 199 | ||
200 | + | ||
201 | + | func keyUserPromoAcres (address) = ("promoAcres_" + address) | |
202 | + | ||
203 | + | ||
204 | + | func keyUserPromoTickets (address) = ("promoTickets_" + address) | |
205 | + | ||
206 | + | ||
207 | + | let keyTotalPromoTickets = "totalPromoTickets" | |
208 | + | ||
209 | + | let keyPromoMap = "promoMap" | |
144 | 210 | ||
145 | 211 | func asInt (v) = match v { | |
146 | 212 | case n: Int => | |
147 | 213 | n | |
148 | 214 | case _ => | |
149 | 215 | throw("fail to cast into Int") | |
150 | 216 | } | |
151 | 217 | ||
152 | 218 | ||
153 | 219 | func asTuple5Ints (val) = match val { | |
154 | 220 | case t: (Int, Int, Int, Int, Int) => | |
155 | 221 | t | |
156 | 222 | case _ => | |
157 | 223 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
158 | 224 | } | |
159 | 225 | ||
160 | 226 | ||
161 | 227 | func asTuple4Ints (val) = match val { | |
162 | 228 | case t: (Int, Int, Int, Int) => | |
163 | 229 | t | |
164 | 230 | case _ => | |
165 | 231 | throw("fail to cast into (Int, Int, Int, Int)") | |
166 | 232 | } | |
167 | 233 | ||
168 | 234 | ||
169 | 235 | func asTuple3Ints (val) = match val { | |
170 | 236 | case t: (Int, Int, Int) => | |
171 | 237 | t | |
172 | 238 | case _ => | |
173 | 239 | throw("fail to cast into (Int, Int, Int)") | |
174 | 240 | } | |
175 | 241 | ||
176 | 242 | ||
177 | 243 | func asTuple2Ints (val) = match val { | |
178 | 244 | case t: (Int, Int) => | |
179 | 245 | t | |
180 | 246 | case _ => | |
181 | 247 | throw("fail to cast into (Int, Int)") | |
182 | 248 | } | |
183 | 249 | ||
184 | 250 | ||
185 | 251 | func fixedPoint (val,decimals) = { | |
186 | 252 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
187 | 253 | let lowPart = toString((val % tenPow)) | |
188 | 254 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
189 | 255 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
190 | 256 | } | |
191 | 257 | ||
192 | 258 | ||
193 | 259 | func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue)) | |
194 | 260 | then throw("maxValue should be > 0") | |
195 | 261 | else { | |
196 | 262 | let randomHash = sha256_16Kb((salt + entropy)) | |
197 | 263 | (toInt(randomHash) % maxValue) | |
198 | 264 | } | |
265 | + | ||
266 | + | ||
267 | + | func padL (val,len) = { | |
268 | + | let valS = toString(val) | |
269 | + | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
270 | + | (zeroes + valS) | |
271 | + | } | |
199 | 272 | ||
200 | 273 | ||
201 | 274 | let M6_ = 1000000 | |
202 | 275 | ||
203 | 276 | let M8_ = 100000000 | |
204 | 277 | ||
205 | 278 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
206 | 279 | ||
207 | 280 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
208 | 281 | ||
209 | 282 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
210 | 283 | ||
211 | 284 | ||
212 | 285 | func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr) | |
213 | 286 | ||
214 | 287 | ||
215 | 288 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
216 | 289 | ||
217 | 290 | let totalFarmingPowerKey = "totalFarmingPower" | |
218 | 291 | ||
219 | 292 | let MAX_WL_NFTS = 3 | |
220 | 293 | ||
221 | 294 | let MAX_ARK_NFTS = 1 | |
222 | 295 | ||
223 | 296 | let ARK_NFT_BONUS = 5000 | |
224 | 297 | ||
225 | 298 | let MAX_NFTS_STAKED_BY_USER = 4 | |
226 | 299 | ||
227 | 300 | let keyNftTotalIssued = "nftTotalIssued" | |
228 | 301 | ||
229 | 302 | let keyNftTotalBurned = "nftTotalBurned" | |
230 | 303 | ||
231 | 304 | let keyWlNftTotalStaked = "WlNftTotalStaked" | |
232 | 305 | ||
233 | 306 | let keyArkNftTotalStaked = "ArkNftTotalStaked" | |
234 | 307 | ||
235 | 308 | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
236 | 309 | ||
237 | 310 | ||
238 | 311 | func keyUserWlNftNumber (addr) = ("userWlNftNumber_" + addr) | |
239 | 312 | ||
240 | 313 | ||
241 | 314 | func keyUserArkNftNumber (addr) = ("userArkNftNumber_" + addr) | |
242 | 315 | ||
243 | 316 | ||
244 | 317 | func keyUserFullBonus (addr) = ("userFullBonus_" + addr) | |
245 | 318 | ||
246 | 319 | ||
247 | 320 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
248 | 321 | ||
249 | 322 | func getLevelByAcres (acres) = { | |
250 | 323 | let acr = ((acres + 99999999) / M8_) | |
251 | 324 | func checker (acc,item) = if ((item >= acr)) | |
252 | 325 | then acc | |
253 | 326 | else (acc + 1) | |
254 | 327 | ||
255 | 328 | let $l = levelAcres | |
256 | 329 | let $s = size($l) | |
257 | 330 | let $acc0 = 0 | |
258 | 331 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
259 | 332 | then $a | |
260 | 333 | else checker($a, $l[$i]) | |
261 | 334 | ||
262 | 335 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
263 | 336 | then $a | |
264 | 337 | else throw("List size exceeds 10") | |
265 | 338 | ||
266 | 339 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
267 | 340 | } | |
268 | 341 | ||
269 | 342 | ||
270 | 343 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
271 | 344 | ||
272 | 345 | ||
273 | 346 | func getFarmingPowerByAcresAndBonus (acres,bonus6) = { | |
274 | 347 | let notBonused = getFarmingPowerByAcres(acres) | |
275 | 348 | $Tuple2(fraction(notBonused, (M6_ + bonus6), M6_), notBonused) | |
276 | 349 | } | |
277 | 350 | ||
278 | 351 | ||
279 | 352 | let teamAddrKey = "teamAddr" | |
280 | 353 | ||
281 | 354 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
282 | 355 | ||
283 | 356 | ||
284 | 357 | let OLD_STAKING_DEADL = 1733346000000 | |
285 | 358 | ||
286 | 359 | let MAX_LANDS_TO_CONVERT = 14 | |
287 | 360 | ||
288 | 361 | let keyLastAcresSellTime = "lastAcresSellTime" | |
289 | 362 | ||
290 | 363 | let keyLastLimitLeft = "lastLimitLeft" | |
291 | 364 | ||
292 | 365 | let names = ["Gold shovel", "Pickaxe"] | |
293 | 366 | ||
294 | 367 | let descriptions = ["Reward for early birds", "Increases FarmPower"] | |
295 | 368 | ||
296 | 369 | let idxDescrShovel = 0 | |
297 | 370 | ||
298 | 371 | let idxDescrPickaxe = 1 | |
299 | 372 | ||
300 | 373 | let rarityThresholds = [5, 10, 20] | |
301 | 374 | ||
302 | 375 | let idxThresholdC = 0 | |
303 | 376 | ||
304 | 377 | let idxThresholdU = 1 | |
305 | 378 | ||
306 | 379 | let idxThresholdL = 2 | |
307 | 380 | ||
308 | 381 | let namez = ["SHOVEL", "PICKAXE"] | |
309 | 382 | ||
310 | 383 | let idxNameShovel = 0 | |
311 | 384 | ||
312 | 385 | let idxNamePickaxe = 1 | |
313 | 386 | ||
314 | 387 | let contentKeyz = ["contentPickaxeC", "contentPickaxeU", "contentPickaxeL", "contentPickaxeE", "contentShovelP"] | |
315 | 388 | ||
316 | 389 | let idxKeyC = 0 | |
317 | 390 | ||
318 | 391 | let idxKeyP = 4 | |
319 | 392 | ||
320 | 393 | let rarityNames = ["Common", "Uncommon", "Legendary", "Epic", "Promo"] | |
321 | 394 | ||
322 | 395 | let idxRarityC = 0 | |
323 | 396 | ||
324 | 397 | let idxRarityU = 1 | |
325 | 398 | ||
326 | 399 | let idxRarityL = 2 | |
327 | 400 | ||
328 | 401 | let idxRarityE = 3 | |
329 | 402 | ||
330 | 403 | let idxRarityP = 4 | |
331 | 404 | ||
332 | 405 | let collectionz = ["Digging tools"] | |
333 | 406 | ||
334 | 407 | let idxCollDig = 0 | |
335 | 408 | ||
336 | 409 | let bonusTypez = ["FarmPower"] | |
337 | 410 | ||
338 | 411 | let idxBonusTypeFp = 0 | |
339 | 412 | ||
340 | 413 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
341 | 414 | then valueOrElse(getBoolean(keyBlocked()), false) | |
342 | 415 | else false) | |
343 | 416 | then throw("Contracts are under maintenance") | |
344 | 417 | else { | |
345 | 418 | let addr = toString(i.originCaller) | |
346 | 419 | let week = (height / WEEK_BLOCKS) | |
347 | 420 | let lastWeekKey = keyLastWeekTxIdByUser(addr) | |
348 | 421 | let lastWeekTxIdByUser = getString(lastWeekKey) | |
349 | 422 | let txId = toBase58String(i.transactionId) | |
350 | 423 | let wtx = ((toString(week) + "_") + txId) | |
351 | 424 | let curWeekKey = keyCurWeekTxIdByUser(addr) | |
352 | 425 | if (isDefined(lastWeekTxIdByUser)) | |
353 | 426 | then { | |
354 | 427 | let lastWeekTx = split(value(lastWeekTxIdByUser), "_") | |
355 | 428 | if ((lastWeekTx[0] == toString(week))) | |
356 | 429 | then [StringEntry(lastWeekKey, wtx), StringEntry(curWeekKey, wtx)] | |
357 | 430 | else if ((lastWeekTx[0] == toString((week - 1)))) | |
358 | 431 | then [StringEntry(curWeekKey, wtx)] | |
359 | 432 | else { | |
360 | 433 | let curWeekTxIdByUser = getStringValue(curWeekKey) | |
361 | 434 | let curWeekTx = split(curWeekTxIdByUser, "_") | |
362 | 435 | if ((curWeekTx[0] == toString(week))) | |
363 | 436 | then [StringEntry(curWeekKey, wtx)] | |
364 | 437 | else [StringEntry(lastWeekKey, curWeekTxIdByUser), StringEntry(curWeekKey, wtx)] | |
365 | 438 | } | |
366 | 439 | } | |
367 | 440 | else [StringEntry(lastWeekKey, wtx), StringEntry(curWeekKey, wtx)] | |
368 | 441 | } | |
369 | 442 | ||
370 | 443 | ||
371 | 444 | func createNftDescrCustom (contKey,nftSerial,collection,name,descr,rarity,bonus,bonusType) = (((((((((((((((((((((((("{\"url\": \"https://waveslands.com\", " + "\"contentKey\": \"") + contKey) + "\", ") + "\"number\": ") + toString(nftSerial)) + ", ") + "\"collection\": \"") + collection) + "\", ") + "\"name\": \"") + name) + "\", ") + "\"description\": \"") + descr) + "\", ") + "\"rare\": \"") + rarity) + "\", ") + "\"bonus\": ") + toString(bonus)) + ", ") + "\"bonusType\": \"") + bonusType) + "\"}") | |
372 | 445 | ||
373 | 446 | ||
374 | 447 | func issueNftCustom (nameIdx,contKeyIdx,collIdx,rarityIdx,bonusPerc,descrIdx,bonusTypeIdx,addr) = { | |
375 | 448 | let nftSerial = valueOrElse(getInteger(keyNftTotalIssued), 0) | |
376 | 449 | let rarity = rarityNames[rarityIdx] | |
377 | 450 | let name = (((namez[nameIdx] + "-") + take(rarity, 1)) + toString(bonusPerc)) | |
378 | 451 | let issue = Issue(name, createNftDescrCustom(contentKeyz[contKeyIdx], nftSerial, collectionz[collIdx], names[nameIdx], descriptions[descrIdx], rarityNames[rarityIdx], bonusPerc, bonusTypez[bonusTypeIdx]), 1, 0, false) | |
379 | 452 | let nftAssetId = calculateAssetId(issue) | |
380 | 453 | $Tuple2([issue, IntegerEntry(keyNftTotalIssued, (nftSerial + 1)), IntegerEntry(keyNftNumberByAssetId(toBase58String(nftAssetId)), nftSerial), ScriptTransfer(addr, 1, nftAssetId)], nftAssetId) | |
381 | 454 | } | |
382 | 455 | ||
383 | 456 | ||
384 | 457 | func bonusByDescription (descr) = if (!(contains(descr, "\"bonusType\": \"FarmPower\""))) | |
385 | 458 | then throw(("NFT is not supported: " + descr)) | |
386 | 459 | else { | |
387 | 460 | let bonusStr = split_4C(split_4C(descr, "\"bonus\":")[1], ",")[0] | |
388 | 461 | parseIntValue(drop(bonusStr, (valueOrElse(lastIndexOf(bonusStr, " "), -1) + 1))) | |
389 | 462 | } | |
390 | 463 | ||
391 | 464 | ||
392 | 465 | func rarityIdxByDescriprion (descr) = if (!(contains(descr, "\"rare\""))) | |
393 | 466 | then throw(("NFT is not supported: " + descr)) | |
394 | 467 | else { | |
395 | 468 | let rarityStr = split_4C(split_4C(split_4C(descr, "\"rare\"")[1], ",")[0], "\"")[1] | |
396 | 469 | value(indexOf(rarityNames, rarityStr)) | |
397 | 470 | } | |
398 | 471 | ||
399 | 472 | ||
400 | 473 | func stakeUnstakeAcresInternal (amt,address,bonusDelta) = if (if ((amt == 0)) | |
401 | 474 | then (bonusDelta == 0) | |
402 | 475 | else false) | |
403 | 476 | then throw("Nothing to do") | |
404 | 477 | else { | |
405 | 478 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
406 | 479 | if ((wlgResult == wlgResult)) | |
407 | 480 | then { | |
408 | 481 | let now = lastBlock.timestamp | |
409 | 482 | let timeKey = keyAcresStakedTimeByUser(address) | |
410 | 483 | let amountKey = keyAcresStakedAmtByUser(address) | |
411 | 484 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
412 | 485 | if (if ((0 > amt)) | |
413 | 486 | then (0 > (oldAcresAmount + amt)) | |
414 | 487 | else false) | |
415 | 488 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
416 | 489 | else { | |
417 | 490 | let newAcresAmount = (oldAcresAmount + amt) | |
418 | 491 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
419 | 492 | let userFpKey = keyFarmingPowerByUser(address) | |
420 | 493 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
421 | 494 | let bonusKey = keyUserFullBonus(address) | |
422 | 495 | let oldBonus = valueOrElse(getInteger(acres2Contract, bonusKey), 0) | |
423 | 496 | if (if ((0 > bonusDelta)) | |
424 | 497 | then (0 > (oldBonus + bonusDelta)) | |
425 | 498 | else false) | |
426 | 499 | then throw((((("You have only " + fixedPoint(oldBonus, 4)) + "% bonus, and tried to unstake ") + fixedPoint(-(bonusDelta), 4)) + "%")) | |
427 | 500 | else { | |
428 | 501 | let $t062996398 = getFarmingPowerByAcresAndBonus(newAcresAmount, (oldBonus + bonusDelta)) | |
429 | 502 | let newBonusedFp = $t062996398._1 | |
430 | 503 | let ignored = $t062996398._2 | |
431 | 504 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
432 | 505 | let acresActions = if ((amt == 0)) | |
433 | 506 | then nil | |
434 | 507 | else [IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))] | |
435 | 508 | let bonusActions = if ((bonusDelta == 0)) | |
436 | 509 | then nil | |
437 | 510 | else [IntegerEntry(bonusKey, (oldBonus + bonusDelta))] | |
438 | 511 | $Tuple2(((((acresActions ++ bonusActions) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(userFpKey, newBonusedFp)) :+ IntegerEntry(totalFarmingPowerKey, ((oldTotalFp + newBonusedFp) - oldFp))), wlgResult) | |
439 | 512 | } | |
440 | 513 | } | |
441 | 514 | } | |
442 | 515 | else throw("Strict value is not equal to itself.") | |
443 | 516 | } | |
444 | 517 | ||
445 | 518 | ||
446 | 519 | func getWlgPrice (usdtBalanceCorrection) = { | |
447 | 520 | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
448 | 521 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
449 | 522 | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
450 | 523 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
451 | 524 | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
452 | 525 | fraction(totalFundsUsd, MULT8, issuedAmount) | |
453 | 526 | } | |
454 | 527 | ||
455 | 528 | ||
456 | 529 | func getSwapLimitAcres () = { | |
457 | 530 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
458 | 531 | let acres2Usd = assetBalance(this, usdtAssetId) | |
459 | 532 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
460 | 533 | let defaultLimit = (((acres2Usd + wlgUsd) + investFundTotal) / ONE_PERCENT_DIVISOR) | |
461 | 534 | let lastLimitLeft = valueOrElse(getInteger(keyLastLimitLeft), defaultLimit) | |
462 | 535 | let lastTime = valueOrElse(getInteger(keyLastAcresSellTime), 0) | |
463 | 536 | let now = lastBlock.timestamp | |
464 | 537 | let currentLimit = (lastLimitLeft + fraction(defaultLimit, (now - lastTime), DAY_MILLIS)) | |
465 | 538 | let limitLeftUsdt = min([currentLimit, defaultLimit]) | |
466 | 539 | $Tuple2(IntegerEntry(keyLastAcresSellTime, now), limitLeftUsdt) | |
467 | 540 | } | |
468 | 541 | ||
469 | 542 | ||
470 | 543 | let arkOracle = addressFromStringValue("3PJgZ6AK1WVCpdCmEZpesHmaKvrQDdXG5og") | |
471 | 544 | ||
472 | 545 | let incubator = valueOrElse(getString(arkOracle, "static_incubatorAddress"), "") | |
473 | 546 | ||
474 | 547 | let breeder = valueOrElse(getString(arkOracle, "static_breederAddress"), "") | |
475 | 548 | ||
476 | 549 | let turtleIncubator = valueOrElse(getString(arkOracle, "static_turtleIncubatorAddress"), "") | |
477 | 550 | ||
478 | 551 | let turtleBreeder = valueOrElse(getString(arkOracle, "static_turtleBreederAddress"), "") | |
479 | 552 | ||
480 | 553 | let canineIncubator = valueOrElse(getString(arkOracle, "static_canineIncubatorAddress"), "") | |
481 | 554 | ||
482 | 555 | let canineBreeder = valueOrElse(getString(arkOracle, "static_canineBreederAddress"), "") | |
483 | 556 | ||
484 | 557 | let felineIncubator = valueOrElse(getString(arkOracle, "static_felineIncubatorAddress"), "") | |
485 | 558 | ||
486 | 559 | let felineBreeder = valueOrElse(getString(arkOracle, "static_felineBreederAddress"), "") | |
487 | 560 | ||
488 | 561 | let mutantBreeder = valueOrElse(getString(arkOracle, "static_mutantIncubatorAddress"), "") | |
489 | 562 | ||
490 | 563 | func isArkimalIssued (nfo) = { | |
491 | 564 | let issuer = toString(nfo.issuer) | |
492 | 565 | if (if (if (if (if (if (if (if (if (if ((chain == base58'2T')) | |
493 | 566 | then (issuer == oldStakingContractStr) | |
494 | 567 | else false) | |
495 | 568 | then true | |
496 | 569 | else (issuer == incubator)) | |
497 | 570 | then true | |
498 | 571 | else (issuer == breeder)) | |
499 | 572 | then true | |
500 | 573 | else (issuer == turtleIncubator)) | |
501 | 574 | then true | |
502 | 575 | else (issuer == turtleBreeder)) | |
503 | 576 | then true | |
504 | 577 | else (issuer == canineIncubator)) | |
505 | 578 | then true | |
506 | 579 | else (issuer == canineBreeder)) | |
507 | 580 | then true | |
508 | 581 | else (issuer == felineIncubator)) | |
509 | 582 | then true | |
510 | 583 | else (issuer == felineBreeder)) | |
511 | 584 | then nfo.name | |
512 | 585 | else if ((issuer == mutantBreeder)) | |
513 | 586 | then nfo.description | |
514 | 587 | else "" | |
515 | 588 | } | |
516 | 589 | ||
517 | 590 | ||
518 | 591 | func stakeNftInternal (addr,assetIdStr,bonus6,userNumKey,totalNumKey,limit) = { | |
519 | 592 | let nftNumber = valueOrElse(getInteger(userNumKey), 0) | |
520 | 593 | if ((nftNumber >= limit)) | |
521 | 594 | then throw((("You can stake max " + toString(limit)) + " of such NFTs")) | |
522 | 595 | else { | |
523 | 596 | let $t01067710753 = stakeUnstakeAcresInternal(0, addr, bonus6) | |
524 | 597 | let actions = $t01067710753._1 | |
525 | 598 | let wlgClaimedAmount = $t01067710753._2 | |
526 | 599 | $Tuple2((((actions :+ IntegerEntry(userNumKey, (nftNumber + 1))) :+ IntegerEntry(totalNumKey, (valueOrElse(getInteger(totalNumKey), 0) + 1))) :+ IntegerEntry(keyStakedTimeByAssetIdAndOwner(assetIdStr, addr), lastBlock.timestamp)), wlgClaimedAmount) | |
527 | 600 | } | |
528 | 601 | } | |
529 | 602 | ||
530 | 603 | ||
604 | + | let promoNumPrizes = 3 | |
605 | + | ||
606 | + | let promoAwardPerRound = [50000000, 25000000, 25000000] | |
607 | + | ||
608 | + | func stakeAcresFor (address,amt,shouldCleanPromo) = { | |
609 | + | let $t01122511301 = stakeUnstakeAcresInternal(amt, address, 0) | |
610 | + | let actions = $t01122511301._1 | |
611 | + | let wlgClaimedAmount = $t01122511301._2 | |
612 | + | let promoActions = if (if ((height >= DAILY_PROMO_START_BLOCK)) | |
613 | + | then (DAILY_PROMO_END_BLOCK > height) | |
614 | + | else false) | |
615 | + | then { | |
616 | + | let promoAcresKey = keyUserPromoAcres(address) | |
617 | + | let promoAcres = ((if (shouldCleanPromo) | |
618 | + | then 0 | |
619 | + | else valueOrElse(getInteger(promoAcresKey), 0)) + amt) | |
620 | + | let tickets = (promoAcres / MULT8) | |
621 | + | let ticketsKey = keyUserPromoTickets(address) | |
622 | + | let deltaTickets = (tickets - valueOrElse(getInteger(ticketsKey), 0)) | |
623 | + | let totalTickets = (valueOrElse(getInteger(keyTotalPromoTickets), 0) + deltaTickets) | |
624 | + | if (if (shouldCleanPromo) | |
625 | + | then true | |
626 | + | else (deltaTickets > 0)) | |
627 | + | then { | |
628 | + | let promoMap = valueOrElse(getString(keyPromoMap), "") | |
629 | + | let userRecord = ((address + ":") + padL(tickets, 3)) | |
630 | + | let newMap = if (contains(promoMap, address)) | |
631 | + | then { | |
632 | + | let mapParts = split_51C(promoMap, address) | |
633 | + | if ((mapParts[0] == "")) | |
634 | + | then { | |
635 | + | let r = drop(mapParts[1], 4) | |
636 | + | if ((r == "")) | |
637 | + | then if ((tickets == 0)) | |
638 | + | then "" | |
639 | + | else userRecord | |
640 | + | else if ((tickets == 0)) | |
641 | + | then drop(r, 1) | |
642 | + | else (userRecord + r) | |
643 | + | } | |
644 | + | else { | |
645 | + | let r = drop(mapParts[1], 4) | |
646 | + | if ((r == "")) | |
647 | + | then if ((tickets == 0)) | |
648 | + | then dropRight(mapParts[0], 1) | |
649 | + | else (mapParts[0] + userRecord) | |
650 | + | else if ((tickets == 0)) | |
651 | + | then (mapParts[0] + drop(r, 1)) | |
652 | + | else ((mapParts[0] + userRecord) + r) | |
653 | + | } | |
654 | + | } | |
655 | + | else if ((tickets == 0)) | |
656 | + | then promoMap | |
657 | + | else if ((promoMap == "")) | |
658 | + | then userRecord | |
659 | + | else ((promoMap + "_") + userRecord) | |
660 | + | [IntegerEntry(promoAcresKey, promoAcres), IntegerEntry(ticketsKey, tickets), IntegerEntry(keyTotalPromoTickets, totalTickets), StringEntry(keyPromoMap, newMap)] | |
661 | + | } | |
662 | + | else [IntegerEntry(promoAcresKey, promoAcres)] | |
663 | + | } | |
664 | + | else nil | |
665 | + | $Tuple2((actions ++ promoActions), wlgClaimedAmount) | |
666 | + | } | |
667 | + | ||
668 | + | ||
531 | 669 | @Callable(i) | |
532 | 670 | func saveLastTx () = if (!(containsElement([wlgContract, marketContract], i.caller))) | |
533 | 671 | then throw("Access denied") | |
534 | 672 | else $Tuple2(prolog(i), 42) | |
535 | 673 | ||
536 | 674 | ||
537 | 675 | ||
538 | 676 | @Callable(i) | |
539 | 677 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
540 | 678 | then throw("Permission denied") | |
541 | 679 | else { | |
542 | 680 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
543 | 681 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
544 | 682 | } | |
545 | 683 | ||
546 | 684 | ||
547 | 685 | ||
548 | 686 | @Callable(i) | |
549 | 687 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
550 | 688 | then throw("permission denied") | |
551 | 689 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
552 | 690 | ||
553 | 691 | ||
554 | 692 | ||
555 | 693 | @Callable(i) | |
556 | 694 | func unstakeAcres (amount) = { | |
557 | 695 | let prologActions = prolog(i) | |
558 | - | if ((0 >= amount)) | |
559 | - | then throw("Amount should be positive") | |
560 | - | else { | |
561 | - | let address = toString(i.caller) | |
562 | - | if ((size(i.payments) != 0)) | |
563 | - | then throw("No payments required") | |
564 | - | else { | |
565 | - | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
566 | - | if ((arbReleaseTime > lastBlock.timestamp)) | |
567 | - | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
568 | - | else { | |
569 | - | let $t01234312423 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
570 | - | let actions = $t01234312423._1 | |
571 | - | let wlgClaimedAmount = $t01234312423._2 | |
572 | - | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
573 | - | } | |
574 | - | } | |
575 | - | } | |
696 | + | if (if ((height >= DAILY_PROMO_START_BLOCK)) | |
697 | + | then (DAILY_PROMO_END_BLOCK > height) | |
698 | + | else false) | |
699 | + | then throw("You can't unstake during Xmas promo period") | |
700 | + | else if ((0 >= amount)) | |
701 | + | then throw("Amount should be positive") | |
702 | + | else { | |
703 | + | let address = toString(i.caller) | |
704 | + | if ((size(i.payments) != 0)) | |
705 | + | then throw("No payments required") | |
706 | + | else { | |
707 | + | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
708 | + | if ((arbReleaseTime > lastBlock.timestamp)) | |
709 | + | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
710 | + | else { | |
711 | + | let $t01530415384 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
712 | + | let actions = $t01530415384._1 | |
713 | + | let wlgClaimedAmount = $t01530415384._2 | |
714 | + | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
715 | + | } | |
716 | + | } | |
717 | + | } | |
576 | 718 | } | |
577 | 719 | ||
578 | 720 | ||
579 | 721 | ||
580 | 722 | @Callable(i) | |
581 | 723 | func stakeAcres () = { | |
582 | 724 | let prologActions = prolog(i) | |
583 | 725 | let address = toString(i.caller) | |
584 | 726 | if ((size(i.payments) != 1)) | |
585 | 727 | then throw("exactly 1 payment must be attached") | |
586 | 728 | else { | |
587 | 729 | let pmt = i.payments[0] | |
588 | 730 | let amt = pmt.amount | |
589 | 731 | if (if (!(isDefined(pmt.assetId))) | |
590 | 732 | then true | |
591 | 733 | else (value(pmt.assetId) != acresAssetId)) | |
592 | 734 | then throw("ACRES payments only!") | |
593 | 735 | else { | |
594 | - | let $ | |
595 | - | let | |
596 | - | let wlgClaimedAmount = $ | |
597 | - | $Tuple2(( | |
736 | + | let $t01583515908 = stakeAcresFor(address, amt, false) | |
737 | + | let stakeActions = $t01583515908._1 | |
738 | + | let wlgClaimedAmount = $t01583515908._2 | |
739 | + | $Tuple2((stakeActions ++ prologActions), wlgClaimedAmount) | |
598 | 740 | } | |
599 | 741 | } | |
600 | 742 | } | |
601 | 743 | ||
602 | 744 | ||
603 | 745 | ||
604 | 746 | @Callable(i) | |
605 | 747 | func buyAcres () = { | |
606 | 748 | let prologActions = prolog(i) | |
607 | 749 | if ((size(i.payments) != 1)) | |
608 | 750 | then throw("exactly 1 payment must be attached") | |
609 | 751 | else { | |
610 | 752 | let pmt = i.payments[0] | |
611 | 753 | let usdtAmount = pmt.amount | |
612 | 754 | if (if (!(isDefined(pmt.assetId))) | |
613 | 755 | then true | |
614 | 756 | else (value(pmt.assetId) != usdtAssetId)) | |
615 | 757 | then throw("USDT payments only!") | |
616 | 758 | else if ((MULT6 > usdtAmount)) | |
617 | 759 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
618 | 760 | else { | |
619 | 761 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
620 | 762 | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
621 | 763 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
622 | 764 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
623 | 765 | if ((req == req)) | |
624 | 766 | then { | |
625 | 767 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
626 | 768 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
627 | 769 | } | |
628 | 770 | else throw("Strict value is not equal to itself.") | |
629 | 771 | } | |
630 | 772 | } | |
631 | 773 | } | |
632 | 774 | ||
633 | 775 | ||
634 | 776 | ||
635 | 777 | @Callable(i) | |
636 | 778 | func buyAcresREADONLY (usdtAmount) = { | |
637 | 779 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
638 | 780 | let wlgToBurn = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
639 | 781 | $Tuple2(nil, [acresAmount, MULT6, acresAmount, wlgToBurn]) | |
640 | 782 | } | |
641 | 783 | ||
642 | 784 | ||
643 | 785 | ||
644 | 786 | @Callable(i) | |
645 | 787 | func sellAcres () = { | |
646 | 788 | let prologActions = prolog(i) | |
647 | 789 | if ((size(i.payments) != 1)) | |
648 | 790 | then throw("exactly 1 payment must be attached") | |
649 | 791 | else { | |
650 | 792 | let pmt = i.payments[0] | |
651 | 793 | let acresAmount = pmt.amount | |
652 | 794 | if (if (!(isDefined(pmt.assetId))) | |
653 | 795 | then true | |
654 | 796 | else (value(pmt.assetId) != acresAssetId)) | |
655 | 797 | then throw("ACRES payments only!") | |
656 | 798 | else if ((MULT7 > acresAmount)) | |
657 | 799 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
658 | 800 | else { | |
659 | 801 | let addr = toString(i.caller) | |
660 | - | let $ | |
661 | - | let limitAction = $ | |
662 | - | let maxUsdt = $ | |
802 | + | let $t01777017818 = getSwapLimitAcres() | |
803 | + | let limitAction = $t01777017818._1 | |
804 | + | let maxUsdt = $t01777017818._2 | |
663 | 805 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
664 | 806 | if ((acresAmount > maxAcres)) | |
665 | 807 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
666 | 808 | else { | |
667 | 809 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
668 | 810 | $Tuple2(([limitAction, IntegerEntry(keyLastLimitLeft, (maxUsdt - usdtAmount)), ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
669 | 811 | } | |
670 | 812 | } | |
671 | 813 | } | |
672 | 814 | } | |
673 | 815 | ||
674 | 816 | ||
675 | 817 | ||
676 | 818 | @Callable(i) | |
677 | 819 | func sellAcresREADONLY (address,acresAmount) = { | |
678 | - | let $ | |
679 | - | let limitAction = $ | |
680 | - | let maxUsdt = $ | |
820 | + | let $t01831418362 = getSwapLimitAcres() | |
821 | + | let limitAction = $t01831418362._1 | |
822 | + | let maxUsdt = $t01831418362._2 | |
681 | 823 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
682 | 824 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
683 | 825 | } | |
684 | 826 | ||
685 | 827 | ||
686 | 828 | ||
687 | 829 | @Callable(i) | |
688 | 830 | func convertOldStakes () = { | |
689 | 831 | let prologActions = prolog(i) | |
690 | 832 | if ((OLD_STAKING_DEADL > lastBlock.timestamp)) | |
691 | 833 | then throw(("Disabled until " + toString((OLD_STAKING_DEADL / 1000)))) | |
692 | 834 | else { | |
693 | 835 | let address = toString(i.caller) | |
694 | 836 | if ((size(i.payments) != 0)) | |
695 | 837 | then throw("No payments required") | |
696 | 838 | else { | |
697 | 839 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
698 | 840 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
699 | 841 | let gotAcres0 = if ((amount > 0)) | |
700 | 842 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
701 | 843 | else $Tuple2(0, 0) | |
702 | 844 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
703 | 845 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
704 | 846 | let landsResult = if (isDefined(landsStr)) | |
705 | 847 | then { | |
706 | 848 | let lands = split_51C(value(landsStr), "_") | |
707 | 849 | if ((size(lands) > MAX_LANDS_TO_CONVERT)) | |
708 | 850 | then throw((("You have more than " + toString(MAX_LANDS_TO_CONVERT)) + " lands staked, please contact support, we'll process your case manually")) | |
709 | 851 | else { | |
710 | 852 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
711 | 853 | then throw("landAssetId is required") | |
712 | 854 | else { | |
713 | 855 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
714 | 856 | if ((r == r)) | |
715 | 857 | then $Tuple5((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4), (acc._5 + r._5)) | |
716 | 858 | else throw("Strict value is not equal to itself.") | |
717 | 859 | } | |
718 | 860 | ||
719 | 861 | let rr = { | |
720 | 862 | let $l = lands | |
721 | 863 | let $s = size($l) | |
722 | 864 | let $acc0 = $Tuple5(0, 0, 0, 0, 0) | |
723 | 865 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
724 | 866 | then $a | |
725 | 867 | else oneLand($a, $l[$i]) | |
726 | 868 | ||
727 | 869 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
728 | 870 | then $a | |
729 | 871 | else throw("List size exceeds 14") | |
730 | 872 | ||
731 | 873 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14) | |
732 | 874 | } | |
733 | 875 | if ((rr == rr)) | |
734 | 876 | then { | |
735 | 877 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
736 | 878 | if ((finalize == finalize)) | |
737 | 879 | then { | |
738 | 880 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
739 | 881 | if ((req == req)) | |
740 | 882 | then { | |
741 | - | let $ | |
742 | - | let nftActions = $ | |
743 | - | let nftAssetId = $ | |
883 | + | let $t02087621014 = issueNftCustom(idxNameShovel, idxKeyP, idxCollDig, idxRarityP, 3, idxDescrShovel, idxBonusTypeFp, i.caller) | |
884 | + | let nftActions = $t02087621014._1 | |
885 | + | let nftAssetId = $t02087621014._2 | |
744 | 886 | $Tuple6(rr._1, rr._2, rr._3, rr._4, rr._5, nftActions) | |
745 | 887 | } | |
746 | 888 | else throw("Strict value is not equal to itself.") | |
747 | 889 | } | |
748 | 890 | else throw("Strict value is not equal to itself.") | |
749 | 891 | } | |
750 | 892 | else throw("Strict value is not equal to itself.") | |
751 | 893 | } | |
752 | 894 | } | |
753 | 895 | else $Tuple6(0, 0, 0, 0, 0, nil) | |
754 | 896 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
755 | 897 | let duckResult = if ((duckAssetId != "")) | |
756 | 898 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
757 | 899 | else $Tuple3(0, 0, 0) | |
758 | 900 | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address, 0) | |
759 | 901 | $Tuple2(((landsResult._6 ++ x._1) ++ prologActions), $Tuple3(gotAcres0._2, landsResult._5, x._2)) | |
760 | 902 | } | |
761 | 903 | } | |
762 | 904 | } | |
763 | 905 | ||
764 | 906 | ||
765 | 907 | ||
766 | 908 | @Callable(i) | |
767 | 909 | func unstakeLandsREADONLY (address) = { | |
768 | 910 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
769 | 911 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
770 | 912 | let landsResult = if (isDefined(landsStr)) | |
771 | 913 | then { | |
772 | 914 | let lands = split_51C(value(landsStr), "_") | |
773 | 915 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
774 | 916 | then throw("landAssetId is required") | |
775 | 917 | else { | |
776 | 918 | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
777 | 919 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
778 | 920 | } | |
779 | 921 | ||
780 | 922 | let $l = lands | |
781 | 923 | let $s = size($l) | |
782 | 924 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
783 | 925 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
784 | 926 | then $a | |
785 | 927 | else oneLand($a, $l[$i]) | |
786 | 928 | ||
787 | 929 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
788 | 930 | then $a | |
789 | 931 | else throw("List size exceeds 100") | |
790 | 932 | ||
791 | 933 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
792 | 934 | } | |
793 | 935 | else $Tuple4(0, 0, 0, 0) | |
794 | 936 | $Tuple2(nil, landsResult) | |
795 | 937 | } | |
796 | 938 | ||
797 | 939 | ||
798 | 940 | ||
799 | 941 | @Callable(i) | |
800 | 942 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
801 | 943 | then throw("Permission denied") | |
802 | 944 | else stakeUnstakeAcresInternal(i.payments[0].amount, addr, 0) | |
803 | 945 | ||
804 | 946 | ||
805 | 947 | ||
806 | 948 | @Callable(i) | |
807 | 949 | func simulateStakeAcresREADONLY (address,addedAmount) = { | |
808 | 950 | let amountKey = keyAcresStakedAmtByUser(address) | |
809 | 951 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + addedAmount) | |
810 | 952 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
811 | 953 | let userFpKey = keyFarmingPowerByUser(address) | |
812 | 954 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
813 | 955 | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(address)), 0) | |
814 | - | let $ | |
815 | - | let newBonusedFp = $ | |
816 | - | let ignored = $ | |
956 | + | let $t02328523372 = getFarmingPowerByAcresAndBonus(newAcresAmount, userBonus) | |
957 | + | let newBonusedFp = $t02328523372._1 | |
958 | + | let ignored = $t02328523372._2 | |
817 | 959 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
818 | 960 | let newTotalFp = ((oldTotalFp + newBonusedFp) - oldFp) | |
819 | 961 | $Tuple2(nil, [oldFp, newBonusedFp, oldTotalFp, newTotalFp]) | |
820 | 962 | } | |
821 | 963 | ||
822 | 964 | ||
823 | 965 | ||
824 | 966 | @Callable(i) | |
825 | 967 | func issuePickC1 (forAddress) = if ((i.caller != wlgContract)) | |
826 | 968 | then throw("Permission denied") | |
827 | 969 | else issueNftCustom(idxNamePickaxe, idxKeyC, idxCollDig, idxRarityC, 1, idxDescrPickaxe, idxBonusTypeFp, addressFromStringValue(forAddress)) | |
828 | 970 | ||
829 | 971 | ||
830 | 972 | ||
831 | 973 | @Callable(i) | |
832 | 974 | func stakeNFT () = { | |
833 | 975 | let prologActions = prolog(i) | |
834 | 976 | if ((size(i.payments) != 1)) | |
835 | 977 | then throw("Exactly one payment required") | |
836 | 978 | else { | |
837 | 979 | let pmt = value(i.payments[0]) | |
838 | 980 | if ((pmt.amount != 1)) | |
839 | 981 | then throw("NFT token should be attached as payment") | |
840 | 982 | else { | |
841 | 983 | let assetId = value(pmt.assetId) | |
842 | 984 | let asset = value(assetInfo(assetId)) | |
843 | 985 | let assetIdStr = toBase58String(assetId) | |
844 | 986 | let addr = toString(i.caller) | |
845 | 987 | let nftsKey = keyStakedNFTsByOwner(addr) | |
846 | 988 | let nftsStr = getString(nftsKey) | |
847 | 989 | let nfts = if (isDefined(nftsStr)) | |
848 | 990 | then split_4C(value(nftsStr), "_") | |
849 | 991 | else nil | |
850 | 992 | if (containsElement(nfts, assetIdStr)) | |
851 | 993 | then throw(("Your staked NFTs already contain " + assetIdStr)) | |
852 | 994 | else if ((size(nfts) >= MAX_NFTS_STAKED_BY_USER)) | |
853 | 995 | then throw((("Your already staked max (" + toString(MAX_NFTS_STAKED_BY_USER)) + ") NFTs")) | |
854 | 996 | else { | |
855 | 997 | let listAction = StringEntry(nftsKey, makeString_2C((nfts :+ assetIdStr), "_")) | |
856 | 998 | if ((asset.issuer == this)) | |
857 | 999 | then { | |
858 | - | let $ | |
859 | - | let actions = $ | |
860 | - | let wlgClaimedAmount = $ | |
1000 | + | let $t02478124971 = stakeNftInternal(addr, assetIdStr, (bonusByDescription(value(asset.description)) * 10000), keyUserWlNftNumber(addr), keyWlNftTotalStaked, MAX_WL_NFTS) | |
1001 | + | let actions = $t02478124971._1 | |
1002 | + | let wlgClaimedAmount = $t02478124971._2 | |
861 | 1003 | $Tuple2(((prologActions ++ actions) :+ listAction), wlgClaimedAmount) | |
862 | 1004 | } | |
863 | 1005 | else if ((isArkimalIssued(asset) == "")) | |
864 | 1006 | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
865 | 1007 | else { | |
866 | - | let $ | |
867 | - | let actions = $ | |
868 | - | let wlgClaimedAmount = $ | |
1008 | + | let $t02515225303 = stakeNftInternal(addr, assetIdStr, ARK_NFT_BONUS, keyUserArkNftNumber(addr), keyArkNftTotalStaked, MAX_ARK_NFTS) | |
1009 | + | let actions = $t02515225303._1 | |
1010 | + | let wlgClaimedAmount = $t02515225303._2 | |
869 | 1011 | $Tuple2(((prologActions ++ actions) :+ listAction), wlgClaimedAmount) | |
870 | 1012 | } | |
871 | 1013 | } | |
872 | 1014 | } | |
873 | 1015 | } | |
874 | 1016 | } | |
875 | 1017 | ||
876 | 1018 | ||
877 | 1019 | ||
878 | 1020 | @Callable(i) | |
879 | 1021 | func unstakeNFT (assetIdStr) = { | |
880 | 1022 | let prologActions = prolog(i) | |
881 | 1023 | if ((size(i.payments) != 0)) | |
882 | 1024 | then throw("No payments required") | |
883 | 1025 | else { | |
884 | 1026 | let assetId = fromBase58String(assetIdStr) | |
885 | 1027 | let addr = toString(i.caller) | |
886 | 1028 | let asset = value(assetInfo(assetId)) | |
887 | 1029 | let timeKey = keyStakedTimeByAssetIdAndOwner(assetIdStr, addr) | |
888 | 1030 | if (!(isDefined(getInteger(timeKey)))) | |
889 | 1031 | then throw((("NFT " + asset.name) + " is not staked by you")) | |
890 | 1032 | else { | |
891 | 1033 | let nftsKey = keyStakedNFTsByOwner(addr) | |
892 | 1034 | let nfts = split_4C(valueOrElse(getString(nftsKey), ""), "_") | |
893 | 1035 | let idx = indexOf(nfts, assetIdStr) | |
894 | 1036 | if (!(isDefined(idx))) | |
895 | 1037 | then throw(("Your staked NFTs don't contain " + assetIdStr)) | |
896 | 1038 | else { | |
897 | 1039 | let listAction = if ((size(nfts) > 1)) | |
898 | 1040 | then StringEntry(nftsKey, makeString_2C(removeByIndex(nfts, value(idx)), "_")) | |
899 | 1041 | else DeleteEntry(nftsKey) | |
900 | 1042 | let isWL = (asset.issuer == this) | |
901 | 1043 | if (isWL) | |
902 | 1044 | then { | |
903 | 1045 | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
904 | 1046 | let bonusVal = (bonusByDescription(value(asset.description)) * 10000) | |
905 | - | let $ | |
906 | - | let actions = $ | |
907 | - | let wlgClaimedAmount = $ | |
1047 | + | let $t02646826547 = stakeUnstakeAcresInternal(0, addr, -(bonusVal)) | |
1048 | + | let actions = $t02646826547._1 | |
1049 | + | let wlgClaimedAmount = $t02646826547._2 | |
908 | 1050 | $Tuple2(((((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber - 1))) :+ IntegerEntry(keyWlNftTotalStaked, max([0, (valueOrElse(getInteger(keyWlNftTotalStaked), 0) - 1)]))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) :+ ScriptTransfer(i.caller, 1, assetId)) ++ prologActions), wlgClaimedAmount) | |
909 | 1051 | } | |
910 | 1052 | else { | |
911 | 1053 | let arkimalName = isArkimalIssued(asset) | |
912 | 1054 | if ((arkimalName == "")) | |
913 | 1055 | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
914 | 1056 | else { | |
915 | 1057 | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
916 | - | let $ | |
917 | - | let actions = $ | |
918 | - | let wlgClaimedAmount = $ | |
1058 | + | let $t02720727291 = stakeUnstakeAcresInternal(0, addr, -(ARK_NFT_BONUS)) | |
1059 | + | let actions = $t02720727291._1 | |
1060 | + | let wlgClaimedAmount = $t02720727291._2 | |
919 | 1061 | $Tuple2((((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) :+ ScriptTransfer(i.caller, 1, assetId)) ++ prologActions), wlgClaimedAmount) | |
920 | 1062 | } | |
921 | 1063 | } | |
922 | 1064 | } | |
923 | 1065 | } | |
924 | 1066 | } | |
925 | 1067 | } | |
926 | 1068 | ||
927 | 1069 | ||
928 | 1070 | ||
929 | 1071 | @Callable(i) | |
930 | 1072 | func exchangeNFTs () = { | |
931 | 1073 | let prologActions = prolog(i) | |
932 | 1074 | if ((3 > size(i.payments))) | |
933 | 1075 | then throw("Min one WLGOLD and 2 NFT payments allowed") | |
934 | 1076 | else if ((size(i.payments) > 10)) | |
935 | 1077 | then throw("Max one WLGOLD and 9 NFT payments allowed") | |
936 | 1078 | else { | |
937 | 1079 | let addr = toString(i.caller) | |
938 | 1080 | func addUp (acc,pmt) = { | |
939 | 1081 | let assetId = valueOrErrorMessage(pmt.assetId, "WAVES payments not allowed") | |
940 | 1082 | if ((assetId == wlgAssetId)) | |
941 | 1083 | then $Tuple4((acc._1 + pmt.amount), acc._2, acc._3, acc._4) | |
942 | 1084 | else { | |
943 | 1085 | let asset = value(assetInfo(assetId)) | |
944 | 1086 | if ((asset.issuer != this)) | |
945 | 1087 | then throw("Only WL-issued NFTs allowed") | |
946 | 1088 | else { | |
947 | 1089 | let rarityIx = rarityIdxByDescriprion(value(asset.description)) | |
948 | 1090 | if (if ((acc._4 > 0)) | |
949 | 1091 | then (rarityIx != acc._4) | |
950 | 1092 | else false) | |
951 | 1093 | then throw("You can exchange only NFTs of the same rarity") | |
952 | 1094 | else { | |
953 | 1095 | let bonusPerc = bonusByDescription(value(asset.description)) | |
954 | 1096 | $Tuple4(acc._1, (acc._2 + bonusPerc), (acc._3 :+ Burn(assetId, 1)), rarityIx) | |
955 | 1097 | } | |
956 | 1098 | } | |
957 | 1099 | } | |
958 | 1100 | } | |
959 | 1101 | ||
960 | - | let $ | |
1102 | + | let $t02868028896 = { | |
961 | 1103 | let $l = i.payments | |
962 | 1104 | let $s = size($l) | |
963 | 1105 | let $acc0 = $Tuple4(0, 0, nil, -1) | |
964 | 1106 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
965 | 1107 | then $a | |
966 | 1108 | else addUp($a, $l[$i]) | |
967 | 1109 | ||
968 | 1110 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
969 | 1111 | then $a | |
970 | 1112 | else throw("List size exceeds 10") | |
971 | 1113 | ||
972 | 1114 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
973 | 1115 | } | |
974 | - | let wlgFee = $ | |
975 | - | let totalBonus = $ | |
976 | - | let burnActions = $ | |
977 | - | let rarityIdx = $ | |
1116 | + | let wlgFee = $t02868028896._1 | |
1117 | + | let totalBonus = $t02868028896._2 | |
1118 | + | let burnActions = $t02868028896._3 | |
1119 | + | let rarityIdx = $t02868028896._4 | |
978 | 1120 | let newRarityIdx = if ((rarityIdx == idxRarityC)) | |
979 | 1121 | then if ((rarityThresholds[idxThresholdC] > totalBonus)) | |
980 | 1122 | then idxRarityC | |
981 | 1123 | else if ((rarityThresholds[idxThresholdU] > totalBonus)) | |
982 | 1124 | then idxRarityU | |
983 | 1125 | else throw((("You can advance only one level of rarity, max total bonus " + toString(rarityThresholds[idxThresholdU])) + "%")) | |
984 | 1126 | else if ((rarityIdx == idxRarityU)) | |
985 | 1127 | then if ((rarityThresholds[idxThresholdU] > totalBonus)) | |
986 | 1128 | then idxRarityU | |
987 | 1129 | else if ((rarityThresholds[idxThresholdL] > totalBonus)) | |
988 | 1130 | then idxRarityL | |
989 | 1131 | else throw((("You can advance only one level of rarity, max total bonus " + toString(rarityThresholds[idxThresholdL])) + "%")) | |
990 | 1132 | else if ((rarityIdx == idxRarityL)) | |
991 | 1133 | then if ((rarityThresholds[idxThresholdL] > totalBonus)) | |
992 | 1134 | then idxRarityL | |
993 | 1135 | else idxRarityE | |
994 | 1136 | else if ((rarityIdx == idxRarityE)) | |
995 | 1137 | then idxRarityE | |
996 | 1138 | else if ((rarityIdx == idxRarityP)) | |
997 | 1139 | then throw("You can't exchange NFTs of this rarity") | |
998 | 1140 | else throw("Unknown rarity") | |
999 | 1141 | let minWlgFee = fraction(totalBonus, MULT14, getWlgPrice(0)) | |
1000 | 1142 | let change = (wlgFee - minWlgFee) | |
1001 | 1143 | let forTeam = (minWlgFee / 2) | |
1002 | 1144 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [(minWlgFee - forTeam)], nil)) | |
1003 | 1145 | if ((0 > change)) | |
1004 | 1146 | then throw((("You need to attach " + fixedPoint(minWlgFee, 8)) + " WLGOLD as fee")) | |
1005 | 1147 | else { | |
1006 | 1148 | let changeActions = if ((change > 0)) | |
1007 | 1149 | then [ScriptTransfer(i.caller, change, wlgAssetId)] | |
1008 | 1150 | else nil | |
1009 | - | let $ | |
1010 | - | let issueNftActions = $ | |
1011 | - | let nftAssetId = $ | |
1151 | + | let $t03043330594 = issueNftCustom(idxNamePickaxe, newRarityIdx, idxCollDig, newRarityIdx, totalBonus, idxDescrPickaxe, idxBonusTypeFp, i.caller) | |
1152 | + | let issueNftActions = $t03043330594._1 | |
1153 | + | let nftAssetId = $t03043330594._2 | |
1012 | 1154 | let burned = size(burnActions) | |
1013 | 1155 | let burnCounterActions = if ((burned == 0)) | |
1014 | 1156 | then nil | |
1015 | 1157 | else [IntegerEntry(keyNftTotalBurned, (valueOrElse(getInteger(keyNftTotalBurned), 0) + burned))] | |
1016 | 1158 | $Tuple2((((((issueNftActions ++ burnActions) ++ burnCounterActions) ++ prologActions) ++ changeActions) :+ ScriptTransfer(addressFromStringValue(getStringValue(wlgContract, teamAddrKey)), forTeam, wlgAssetId)), $Tuple2(nftAssetId, wlgRemain)) | |
1017 | 1159 | } | |
1018 | 1160 | } | |
1019 | 1161 | } | |
1020 | 1162 | ||
1021 | 1163 | ||
1022 | 1164 | ||
1023 | 1165 | @Callable(i) | |
1024 | 1166 | func openNftChest () = { | |
1025 | 1167 | let prologActions = prolog(i) | |
1026 | 1168 | if ((size(i.payments) != 1)) | |
1027 | 1169 | then throw("exactly 1 payment must be attached") | |
1028 | 1170 | else { | |
1029 | 1171 | let pmt = i.payments[0] | |
1030 | 1172 | let wlgAmount = pmt.amount | |
1031 | 1173 | if (if (!(isDefined(pmt.assetId))) | |
1032 | 1174 | then true | |
1033 | 1175 | else (value(pmt.assetId) != wlgAssetId)) | |
1034 | 1176 | then throw("WLGOLD payments only!") | |
1035 | 1177 | else { | |
1036 | 1178 | let minWlgFee = fraction(NFT_CHEST_PRICE_USDT, MULT8, getWlgPrice(0)) | |
1037 | 1179 | let change = (wlgAmount - minWlgFee) | |
1038 | 1180 | let forTeam = (minWlgFee / 2) | |
1039 | 1181 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [(minWlgFee - forTeam)], nil)) | |
1040 | 1182 | if ((0 > change)) | |
1041 | 1183 | then throw((("You need to attach " + fixedPoint(minWlgFee, 8)) + " WLGOLD as fee")) | |
1042 | 1184 | else { | |
1043 | 1185 | let changeActions = if ((change > 0)) | |
1044 | 1186 | then [ScriptTransfer(i.caller, change, wlgAssetId)] | |
1045 | 1187 | else nil | |
1046 | 1188 | let addr = toString(i.caller) | |
1047 | 1189 | let finishKey = keyCommit(addr) | |
1048 | 1190 | let finishBlock = valueOrErrorMessage(getInteger(finishKey), "You have to commitForRandom() first!") | |
1049 | 1191 | if ((finishBlock > height)) | |
1050 | 1192 | then throw(("Random number is not ready yet, wait until height = " + toString(finishBlock))) | |
1051 | 1193 | else { | |
1052 | 1194 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
1053 | 1195 | let salt = fromBase58String(split(valueOrElse(getString(keyCurWeekTxIdByUser(addr)), "42_DEFAULT"), "_")[1]) | |
1054 | 1196 | let rand = getRandomNumber(100, salt, entropy) | |
1055 | - | let $ | |
1197 | + | let $t03261332885 = if ((84 > rand)) | |
1056 | 1198 | then $Tuple2(1, idxRarityC) | |
1057 | 1199 | else if ((98 > rand)) | |
1058 | 1200 | then $Tuple2(5, idxRarityU) | |
1059 | 1201 | else $Tuple2(10, idxRarityL) | |
1060 | - | let bonus = $ | |
1061 | - | let rarityIdx = $ | |
1062 | - | let $ | |
1063 | - | let issueNftActions = $ | |
1064 | - | let nftAssetId = $ | |
1202 | + | let bonus = $t03261332885._1 | |
1203 | + | let rarityIdx = $t03261332885._2 | |
1204 | + | let $t03288833038 = issueNftCustom(idxNamePickaxe, rarityIdx, idxCollDig, rarityIdx, bonus, idxDescrPickaxe, idxBonusTypeFp, i.caller) | |
1205 | + | let issueNftActions = $t03288833038._1 | |
1206 | + | let nftAssetId = $t03288833038._2 | |
1065 | 1207 | $Tuple2(((((issueNftActions ++ prologActions) ++ changeActions) :+ ScriptTransfer(addressFromStringValue(getStringValue(wlgContract, teamAddrKey)), forTeam, wlgAssetId)) :+ DeleteEntry(finishKey)), $Tuple2(nftAssetId, wlgRemain)) | |
1066 | 1208 | } | |
1067 | 1209 | } | |
1068 | 1210 | } | |
1069 | 1211 | } | |
1070 | 1212 | } | |
1071 | 1213 | ||
1072 | 1214 | ||
1073 | 1215 | ||
1074 | 1216 | @Callable(i) | |
1075 | 1217 | func commitForRandom () = { | |
1076 | 1218 | let prologActions = prolog(i) | |
1077 | 1219 | let addr = toString(i.caller) | |
1078 | 1220 | let finishKey = keyCommit(addr) | |
1079 | 1221 | if (isDefined(getInteger(finishKey))) | |
1080 | 1222 | then throw("You already commited for random, please use it") | |
1081 | 1223 | else { | |
1082 | 1224 | let finishBlock = (height + RANDOM_DELAY) | |
1083 | 1225 | $Tuple2(([IntegerEntry(finishKey, finishBlock)] ++ prologActions), finishBlock) | |
1084 | 1226 | } | |
1085 | 1227 | } | |
1086 | 1228 | ||
1087 | 1229 | ||
1230 | + | ||
1231 | + | @Callable(i) | |
1232 | + | func drawDaylyPromo () = if ((i.caller != this)) | |
1233 | + | then throw("Permission denied") | |
1234 | + | else { | |
1235 | + | let today = (height % DAY_BLOCKS) | |
1236 | + | let maxValue = valueOrElse(getInteger(keyTotalPromoTickets), 0) | |
1237 | + | if ((maxValue == 0)) | |
1238 | + | then throw("No tickets to draw") | |
1239 | + | else { | |
1240 | + | let b = (today * DAY_BLOCKS) | |
1241 | + | let h = if ((b > VRF_OFFSET)) | |
1242 | + | then b | |
1243 | + | else (b + VRF_OFFSET) | |
1244 | + | let entropy = value(value(blockInfoByHeight(h)).vrf) | |
1245 | + | let promoMap = valueOrElse(getString(keyPromoMap), "") | |
1246 | + | if ((promoMap == "")) | |
1247 | + | then throw("No participants") | |
1248 | + | else { | |
1249 | + | let promoList = split_51C(promoMap, "_") | |
1250 | + | func singleDraw (ac,j) = if ((j >= promoNumPrizes)) | |
1251 | + | then ac | |
1252 | + | else { | |
1253 | + | let rand = getRandomNumber(ac._1, ac._2, entropy) | |
1254 | + | let promo4List = if ((ac._3 == "")) | |
1255 | + | then nil | |
1256 | + | else split_51C(ac._3, "_") | |
1257 | + | func countTickets (acc,el) = { | |
1258 | + | let parts = split(el, ":") | |
1259 | + | let addr = parts[0] | |
1260 | + | let tickets = parseIntValue(parts[1]) | |
1261 | + | let newTotal = (acc._1 + tickets) | |
1262 | + | if (if ((acc._3 == "")) | |
1263 | + | then (newTotal > rand) | |
1264 | + | else false) | |
1265 | + | then $Tuple3(newTotal, tickets, addr) | |
1266 | + | else $Tuple3(newTotal, acc._2, acc._3) | |
1267 | + | } | |
1268 | + | ||
1269 | + | let r = { | |
1270 | + | let $l = promo4List | |
1271 | + | let $s = size($l) | |
1272 | + | let $acc0 = $Tuple3(0, 0, "") | |
1273 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1274 | + | then $a | |
1275 | + | else countTickets($a, $l[$i]) | |
1276 | + | ||
1277 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1278 | + | then $a | |
1279 | + | else throw("List size exceeds 20") | |
1280 | + | ||
1281 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
1282 | + | } | |
1283 | + | let winner = r._3 | |
1284 | + | if ((winner == "")) | |
1285 | + | then ac | |
1286 | + | else { | |
1287 | + | let mapParts = split_51C(ac._3, winner) | |
1288 | + | let newMap = if ((mapParts[0] == "")) | |
1289 | + | then drop(mapParts[1], 5) | |
1290 | + | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 4)) | |
1291 | + | let $t03563635787 = stakeAcresFor(winner, promoAwardPerRound[j], true) | |
1292 | + | let stakeActions = $t03563635787._1 | |
1293 | + | let ignoredWlgClaimedAmount = $t03563635787._2 | |
1294 | + | let newSalt = fromBase58String(valueOrElse(getString(stakingContract, keyCurWeekTxIdByUser(winner)), "DEFAULT")) | |
1295 | + | $Tuple4((ac._1 - r._2), newSalt, newMap, (ac._4 :+ stakeActions)) | |
1296 | + | } | |
1297 | + | } | |
1298 | + | ||
1299 | + | let draws = { | |
1300 | + | let $l = [0, 1, 2] | |
1301 | + | let $s = size($l) | |
1302 | + | let $acc0 = $Tuple4(maxValue, i.transactionId, promoMap, nil) | |
1303 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1304 | + | then $a | |
1305 | + | else singleDraw($a, $l[$i]) | |
1306 | + | ||
1307 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1308 | + | then $a | |
1309 | + | else throw("List size exceeds 3") | |
1310 | + | ||
1311 | + | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
1312 | + | } | |
1313 | + | $Tuple2(([StringEntry(keyPromoMap, draws._3), IntegerEntry(keyTotalPromoTickets, draws._1)] ++ draws._4), 0) | |
1314 | + | } | |
1315 | + | } | |
1316 | + | } | |
1317 | + | ||
1318 | + |
github/deemru/w8io/169f3d6 190.04 ms ◑