tx · HqAkgmHebwhvTA8oYAmQHfAiRE5oiEbgDd6AkCa4ZACj 3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje: -0.02700000 Waves 2022.11.30 18:41 [2340030] smart account 3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje > SELF 0.00000000 Waves
{ "type": 13, "id": "HqAkgmHebwhvTA8oYAmQHfAiRE5oiEbgDd6AkCa4ZACj", "fee": 2700000, "feeAssetId": null, "timestamp": 1669822890149, "version": 1, "sender": "3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje", "senderPublicKey": "8JB75GXEKqxmpXc6KVtT9UNqJ3BBSUZDodYD4DU7CUUB", "proofs": [ "iH3Lc7XrMzngHnFYjm3j8neSwMhpq1CDUnZHgvaAXBDgN5huJN1rBX4dqMp3a4j3iRnpLmpBFZHozDySETxR6d3" ], "script": "base64:AAIFAAAAAAAAD2wIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFzc2V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yBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACZGIBAAAAAmRjAAAAAAQAAAACZGQEAAAAAmNoCQEAAAACY2cAAAAAAwkAAAEAAAACBQAAAAJjaAIAAAAKQnl0ZVZlY3RvcgQAAAACY24FAAAAAmNoBQAAAAJjbgMJAAABAAAAAgUAAAACY2gCAAAABFVuaXQIBQAAAAJkYgAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmRiAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACZGIAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJkZLl8Lto=", "chainId": 84, "height": 2340030, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2gfrmtCHstvBSQ7MAUg3aTDWKh1Doq9pKQBu67KhQny9 Next: 7q2uWdqqVcFGp7wRdhXEoq7UBTJLVm5L3jrBEtGxT4Mj Diff:
Old | New | Differences | |
---|---|---|---|
286 | 286 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
287 | 287 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
288 | 288 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
289 | - | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
290 | - | let putOneTknV2PriceAssetAmount = scale8 | |
291 | - | let $t01556215815 = { | |
292 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
293 | - | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
294 | - | then @ | |
295 | - | else throw("Couldn't cast Any to (Int, Int, Int)") | |
296 | - | } | |
297 | - | if (($t01556215815 == $t01556215815)) | |
289 | + | let err = throw(makeString([toString(outAmount), toString(priceAssetBalance), toString(periodTotalAvailableToClaim), toString(periodUserAvailableToClaim)], " ")) | |
290 | + | if ((err == err)) | |
298 | 291 | then { | |
299 | - | let bonus = $t01556215815._3 | |
300 | - | let feeAmount = $t01556215815._2 | |
301 | - | let lpAmount = $t01556215815._1 | |
302 | - | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
303 | - | let $t01587716095 = { | |
304 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
305 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
292 | + | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
293 | + | let putOneTknV2PriceAssetAmount = scale8 | |
294 | + | let $t01575416007 = { | |
295 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
296 | + | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
306 | 297 | then @ | |
307 | - | else throw("Couldn't cast Any to (Int, Int)") | |
298 | + | else throw("Couldn't cast Any to (Int, Int, Int)") | |
308 | 299 | } | |
309 | - | if (($ | |
300 | + | if (($t01575416007 == $t01575416007)) | |
310 | 301 | then { | |
311 | - | let getOneTknV2FeeAmount = $t01587716095._2 | |
312 | - | let usdtAmount = $t01587716095._1 | |
313 | - | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
314 | - | let endPeriodBlocksLeft = (periodEnd - height) | |
315 | - | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
302 | + | let bonus = $t01575416007._3 | |
303 | + | let feeAmount = $t01575416007._2 | |
304 | + | let lpAmount = $t01575416007._1 | |
305 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
306 | + | let $t01606916287 = { | |
307 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
308 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
309 | + | then @ | |
310 | + | else throw("Couldn't cast Any to (Int, Int)") | |
311 | + | } | |
312 | + | if (($t01606916287 == $t01606916287)) | |
313 | + | then { | |
314 | + | let getOneTknV2FeeAmount = $t01606916287._2 | |
315 | + | let usdtAmount = $t01606916287._1 | |
316 | + | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
317 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
318 | + | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
319 | + | } | |
320 | + | else throw("Strict value is not equal to itself.") | |
316 | 321 | } | |
317 | 322 | else throw("Strict value is not equal to itself.") | |
318 | 323 | } | |
453 | 458 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
454 | 459 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
455 | 460 | then { | |
456 | - | let $ | |
457 | - | let periodMinAvailableToClaim = $ | |
458 | - | let periodTotalAvailableToClaim = $ | |
459 | - | let periodUserAvailableToClaim = $ | |
460 | - | let totalUserAvailableToClaim = $ | |
461 | - | let usdtPriceAssetAllowableRatio = $ | |
462 | - | let currentUsdtPriceAssetRatio = $ | |
463 | - | let endPeriodBlocksLeft = $ | |
464 | - | let updatedCurrentPeriod = $ | |
465 | - | let periodStart = $ | |
466 | - | let periodEnd = $ | |
461 | + | let $t02219622640 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
462 | + | let periodMinAvailableToClaim = $t02219622640._1 | |
463 | + | let periodTotalAvailableToClaim = $t02219622640._2 | |
464 | + | let periodUserAvailableToClaim = $t02219622640._3 | |
465 | + | let totalUserAvailableToClaim = $t02219622640._4 | |
466 | + | let usdtPriceAssetAllowableRatio = $t02219622640._5 | |
467 | + | let currentUsdtPriceAssetRatio = $t02219622640._6 | |
468 | + | let endPeriodBlocksLeft = $t02219622640._7 | |
469 | + | let updatedCurrentPeriod = $t02219622640._8 | |
470 | + | let periodStart = $t02219622640._9 | |
471 | + | let periodEnd = $t02219622640._10 | |
467 | 472 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
468 | 473 | then true | |
469 | 474 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
529 | 534 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
530 | 535 | let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100) | |
531 | 536 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals) | |
532 | - | let $ | |
533 | - | let periodMinAvailableToClaim = $ | |
534 | - | let periodTotalAvailableToClaim = $ | |
535 | - | let periodUserAvailableToClaim = $ | |
536 | - | let totalUserAvailableToClaim = $ | |
537 | - | let usdtPriceAssetAllowableRatio = $ | |
538 | - | let currentUsdtPriceAssetRatio = $ | |
539 | - | let endPeriodBlocksLeft = $ | |
540 | - | let updatedCurrentPeriod = $ | |
541 | - | let periodStart = $ | |
542 | - | let periodEnd = $ | |
537 | + | let $t02893329345 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
538 | + | let periodMinAvailableToClaim = $t02893329345._1 | |
539 | + | let periodTotalAvailableToClaim = $t02893329345._2 | |
540 | + | let periodUserAvailableToClaim = $t02893329345._3 | |
541 | + | let totalUserAvailableToClaim = $t02893329345._4 | |
542 | + | let usdtPriceAssetAllowableRatio = $t02893329345._5 | |
543 | + | let currentUsdtPriceAssetRatio = $t02893329345._6 | |
544 | + | let endPeriodBlocksLeft = $t02893329345._7 | |
545 | + | let updatedCurrentPeriod = $t02893329345._8 | |
546 | + | let periodStart = $t02893329345._9 | |
547 | + | let periodEnd = $t02893329345._10 | |
543 | 548 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
544 | 549 | let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance) | |
545 | 550 | let resultString = if ((height > currentPeriodEndHeight)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let SEP = "__" | |
8 | 8 | ||
9 | 9 | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | 10 | ||
11 | 11 | let scale8 = 100000000 | |
12 | 12 | ||
13 | 13 | func throwErr (msg) = throw(makeString(["ido.ride:", msg], " ")) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
17 | 17 | let bPriceAssetMULT = toBigInt(priceAssetMULT) | |
18 | 18 | let bIdoAssetMULT = toBigInt(idoAssetMULT) | |
19 | 19 | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT) | |
20 | 20 | let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price)) | |
21 | 21 | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | let IdxCfgIdoStart = 1 | |
26 | 26 | ||
27 | 27 | let IdxCfgIdoDuration = 2 | |
28 | 28 | ||
29 | 29 | let IdxCfgClaimStart = 3 | |
30 | 30 | ||
31 | 31 | let IdxCfgClaimDuration = 4 | |
32 | 32 | ||
33 | 33 | let IdxCfgPrice = 5 | |
34 | 34 | ||
35 | 35 | let IdxCfgPriceMult = 6 | |
36 | 36 | ||
37 | 37 | let IdxCfgIdoAssetId = 7 | |
38 | 38 | ||
39 | 39 | let IdxCfgIdoAssetMult = 8 | |
40 | 40 | ||
41 | 41 | let IdxCfgPriceAssetId = 9 | |
42 | 42 | ||
43 | 43 | let IdxCfgPriceAssetMult = 10 | |
44 | 44 | ||
45 | 45 | let IdxCfgMinInvestAmount = 11 | |
46 | 46 | ||
47 | 47 | func fromatConfigS (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = makeString(["%d%d%d%d%d%d%s%d%s%d%d%d", idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, totalIdoAssetToSell], SEP) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func fromatConfig (idoStart,idoDuration,claimStart,claimDuration,price,priceMult,idoAssetId58,idoAssetMult,priceAssetId58,priceAssetMult,minInvestAmount,totalIdoAssetToSell) = fromatConfigS(toString(idoStart), toString(idoDuration), toString(claimStart), toString(claimDuration), toString(price), toString(priceMult), idoAssetId58, toString(idoAssetMult), priceAssetId58, toString(priceAssetMult), toString(minInvestAmount), toString(totalIdoAssetToSell)) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | let IdxInvTotalAmount = 1 | |
54 | 54 | ||
55 | 55 | let IdxInvRemainingAmount = 2 | |
56 | 56 | ||
57 | 57 | let IdxInvClaimedPriceAssetAmount = 3 | |
58 | 58 | ||
59 | 59 | let IdxInvClaimedIdoAssetAmount = 4 | |
60 | 60 | ||
61 | 61 | let IdxInvLastClaimedHeight = 5 | |
62 | 62 | ||
63 | 63 | func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyConfig () = "%s__config" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyInvestor (userAddress) = ("%s__" + userAddress) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyTotals () = "%s__totals" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let IdxDiffTotalIncrement = 0 | |
148 | 148 | ||
149 | 149 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
150 | 150 | ||
151 | 151 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
152 | 152 | ||
153 | 153 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
154 | 154 | ||
155 | 155 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight,priceAssetBalance) = { | |
156 | 156 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
157 | 157 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
158 | 158 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
159 | 159 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
160 | 160 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
161 | 161 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
162 | 162 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
163 | 163 | let cfgArray = readConfigArray() | |
164 | 164 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
165 | 165 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
166 | 166 | let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
167 | 167 | let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance) | |
168 | 168 | let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals) | |
169 | 169 | let entries = if ((0 > newRemainingAmount)) | |
170 | 170 | then { | |
171 | 171 | let newLogicRemainingAmount = ((newTotalAmount - newClaimedPriceAssetAmount) - newClaimedIdoAssetAmount) | |
172 | 172 | StringEntry(key, formatInvestor(newTotalAmount, newLogicRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
173 | 173 | } | |
174 | 174 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
175 | 175 | entries | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
186 | 186 | let cfgArray = readConfigArray() | |
187 | 187 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
188 | 188 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
189 | 189 | let claimEnd = (claimStart + claimDuration) | |
190 | 190 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
191 | 191 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
192 | 192 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
193 | 193 | let idoAssetId = fromBase58String(idoAssetId58) | |
194 | 194 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
195 | 195 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
196 | 196 | let priceAssetId = fromBase58String(priceAssetId58) | |
197 | 197 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
198 | 198 | let userAddress58 = toString(userAddress) | |
199 | 199 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
200 | 200 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
201 | 201 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
202 | 202 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
203 | 203 | then claimStart | |
204 | 204 | else investLastClaimedHeightTMP | |
205 | 205 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
206 | 206 | then claimEnd | |
207 | 207 | else if ((claimStart > height)) | |
208 | 208 | then claimStart | |
209 | 209 | else height | |
210 | 210 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
211 | 211 | let investor = split(value(getString(keyInvestor(userAddress58))), SEP) | |
212 | 212 | let totalAmount = parseIntValue(investor[IdxInvTotalAmount]) | |
213 | 213 | let claimedPriceAssetAmount = parseIntValue(investor[IdxInvClaimedPriceAssetAmount]) | |
214 | 214 | let claimedIdoAssetAmount = parseIntValue(investor[IdxInvClaimedIdoAssetAmount]) | |
215 | 215 | let claimingPriceAssetAmount = ((totalAmount - claimedPriceAssetAmount) - claimedIdoAssetAmount) | |
216 | 216 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
217 | 217 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
218 | 218 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
219 | 219 | let checks = [if (!(if (isUSDN) | |
220 | 220 | then isUSDNClaimDisabled | |
221 | 221 | else false)) | |
222 | 222 | then true | |
223 | 223 | else throw("USDN claim is disabled")] | |
224 | 224 | if ((checks == checks)) | |
225 | 225 | then if ((claimedAssetId58 == priceAssetId58)) | |
226 | 226 | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
227 | 227 | else if ((claimedAssetId58 == idoAssetId58)) | |
228 | 228 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
229 | 229 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
230 | 230 | else throw("Strict value is not equal to itself.") | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = { | |
235 | 235 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
236 | 236 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
237 | 237 | let periodLength = value(getInteger(keyPeriodLength())) | |
238 | 238 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
239 | 239 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
240 | 240 | let $t01293714807 = if ((currentPeriod > 0)) | |
241 | 241 | then { | |
242 | 242 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
243 | 243 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
244 | 244 | let $t01319713902 = if ((height > lastPeriodEndHeight)) | |
245 | 245 | then { | |
246 | 246 | let updatedCurrentPeriod = (currentPeriod + 1) | |
247 | 247 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
248 | 248 | then { | |
249 | 249 | let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength) | |
250 | 250 | if ((blocksToLastPeriodStart == 0)) | |
251 | 251 | then ((height - periodLength) + 1) | |
252 | 252 | else (height - blocksToLastPeriodStart) | |
253 | 253 | } | |
254 | 254 | else (lastPeriodEndHeight + 1) | |
255 | 255 | let periodEnd = ((periodStart + periodLength) - 1) | |
256 | 256 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
257 | 257 | } | |
258 | 258 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
259 | 259 | let updatedCurrentPeriod = $t01319713902._1 | |
260 | 260 | let periodStart = $t01319713902._2 | |
261 | 261 | let periodEnd = $t01319713902._3 | |
262 | 262 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
263 | 263 | } | |
264 | 264 | else if (zeroPeriodEndHeighIsDefined) | |
265 | 265 | then { | |
266 | 266 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
267 | 267 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
268 | 268 | let $t01415714539 = if ((height > zeroPeriodEndHeight)) | |
269 | 269 | then { | |
270 | 270 | let updatedCurrentPeriod = (currentPeriod + 1) | |
271 | 271 | let periodStart = (zeroPeriodEndHeight + 1) | |
272 | 272 | let periodEnd = ((periodStart + periodLength) - 1) | |
273 | 273 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
274 | 274 | } | |
275 | 275 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
276 | 276 | let updatedCurrentPeriod = $t01415714539._1 | |
277 | 277 | let periodStart = $t01415714539._2 | |
278 | 278 | let periodEnd = $t01415714539._3 | |
279 | 279 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
280 | 280 | } | |
281 | 281 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
282 | 282 | let updatedCurrentPeriod = $t01293714807._1 | |
283 | 283 | let periodStart = $t01293714807._2 | |
284 | 284 | let periodEnd = $t01293714807._3 | |
285 | 285 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
286 | 286 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
287 | 287 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
288 | 288 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
289 | - | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
290 | - | let putOneTknV2PriceAssetAmount = scale8 | |
291 | - | let $t01556215815 = { | |
292 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
293 | - | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
294 | - | then @ | |
295 | - | else throw("Couldn't cast Any to (Int, Int, Int)") | |
296 | - | } | |
297 | - | if (($t01556215815 == $t01556215815)) | |
289 | + | let err = throw(makeString([toString(outAmount), toString(priceAssetBalance), toString(periodTotalAvailableToClaim), toString(periodUserAvailableToClaim)], " ")) | |
290 | + | if ((err == err)) | |
298 | 291 | then { | |
299 | - | let bonus = $t01556215815._3 | |
300 | - | let feeAmount = $t01556215815._2 | |
301 | - | let lpAmount = $t01556215815._1 | |
302 | - | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
303 | - | let $t01587716095 = { | |
304 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
305 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
292 | + | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
293 | + | let putOneTknV2PriceAssetAmount = scale8 | |
294 | + | let $t01575416007 = { | |
295 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
296 | + | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
306 | 297 | then @ | |
307 | - | else throw("Couldn't cast Any to (Int, Int)") | |
298 | + | else throw("Couldn't cast Any to (Int, Int, Int)") | |
308 | 299 | } | |
309 | - | if (($ | |
300 | + | if (($t01575416007 == $t01575416007)) | |
310 | 301 | then { | |
311 | - | let getOneTknV2FeeAmount = $t01587716095._2 | |
312 | - | let usdtAmount = $t01587716095._1 | |
313 | - | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
314 | - | let endPeriodBlocksLeft = (periodEnd - height) | |
315 | - | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
302 | + | let bonus = $t01575416007._3 | |
303 | + | let feeAmount = $t01575416007._2 | |
304 | + | let lpAmount = $t01575416007._1 | |
305 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
306 | + | let $t01606916287 = { | |
307 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
308 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
309 | + | then @ | |
310 | + | else throw("Couldn't cast Any to (Int, Int)") | |
311 | + | } | |
312 | + | if (($t01606916287 == $t01606916287)) | |
313 | + | then { | |
314 | + | let getOneTknV2FeeAmount = $t01606916287._2 | |
315 | + | let usdtAmount = $t01606916287._1 | |
316 | + | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
317 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
318 | + | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
319 | + | } | |
320 | + | else throw("Strict value is not equal to itself.") | |
316 | 321 | } | |
317 | 322 | else throw("Strict value is not equal to itself.") | |
318 | 323 | } | |
319 | 324 | else throw("Strict value is not equal to itself.") | |
320 | 325 | } | |
321 | 326 | ||
322 | 327 | ||
323 | 328 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
324 | 329 | case s: String => | |
325 | 330 | fromBase58String(s) | |
326 | 331 | case _: Unit => | |
327 | 332 | unit | |
328 | 333 | case _ => | |
329 | 334 | throw("Match error") | |
330 | 335 | } | |
331 | 336 | ||
332 | 337 | ||
333 | 338 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
334 | 339 | case s: String => | |
335 | 340 | fromBase58String(s) | |
336 | 341 | case _: Unit => | |
337 | 342 | unit | |
338 | 343 | case _ => | |
339 | 344 | throw("Match error") | |
340 | 345 | } | |
341 | 346 | ||
342 | 347 | ||
343 | 348 | func mustManager (i) = { | |
344 | 349 | let pd = throw("Permission denied") | |
345 | 350 | match managerPublicKeyOrUnit() { | |
346 | 351 | case pk: ByteVector => | |
347 | 352 | if ((i.callerPublicKey == pk)) | |
348 | 353 | then true | |
349 | 354 | else pd | |
350 | 355 | case _: Unit => | |
351 | 356 | if ((i.caller == this)) | |
352 | 357 | then true | |
353 | 358 | else pd | |
354 | 359 | case _ => | |
355 | 360 | throw("Match error") | |
356 | 361 | } | |
357 | 362 | } | |
358 | 363 | ||
359 | 364 | ||
360 | 365 | @Callable(i) | |
361 | 366 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
362 | 367 | let priceMult = ((100 * 1000) * 1000) | |
363 | 368 | let idoEnd = (idoStart + idoDuration) | |
364 | 369 | if (isDefined(getString(keyConfig()))) | |
365 | 370 | then throw("already initialized") | |
366 | 371 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
367 | 372 | then throw("not authorized") | |
368 | 373 | else if ((size(i.payments) != 1)) | |
369 | 374 | then throw("exactly 1 payment must be attached") | |
370 | 375 | else if ((idoEnd >= claimStart)) | |
371 | 376 | then throw("claimStart must be greater than idoEnd") | |
372 | 377 | else { | |
373 | 378 | let pmt = value(i.payments[0]) | |
374 | 379 | let idoAssetId = value(pmt.assetId) | |
375 | 380 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
376 | 381 | let idoAssetId58 = toBase58String(idoAssetId) | |
377 | 382 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
378 | 383 | let priceAssetId = fromBase58String(priceAssetId58) | |
379 | 384 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
380 | 385 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
381 | 386 | let origTotalsArray = readTotalsArrayOrDefault() | |
382 | 387 | let totalsDiff = [0, 0, 0, 0] | |
383 | 388 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)] | |
384 | 389 | } | |
385 | 390 | } | |
386 | 391 | ||
387 | 392 | ||
388 | 393 | ||
389 | 394 | @Callable(i) | |
390 | 395 | func invest () = { | |
391 | 396 | let cfgArray = readConfigArray() | |
392 | 397 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
393 | 398 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
394 | 399 | let idoEnd = (idoStart + idoDuration) | |
395 | 400 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
396 | 401 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
397 | 402 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
398 | 403 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
399 | 404 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
400 | 405 | let idoAssetId = fromBase58String(idoAssetId58) | |
401 | 406 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
402 | 407 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
403 | 408 | let priceAssetId = fromBase58String(priceAssetId58) | |
404 | 409 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
405 | 410 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
406 | 411 | let userAddress = toString(i.caller) | |
407 | 412 | if ((idoStart > height)) | |
408 | 413 | then throw("ido has not been started yet") | |
409 | 414 | else if ((height > idoEnd)) | |
410 | 415 | then throw("ido has been already ended") | |
411 | 416 | else if ((size(i.payments) != 1)) | |
412 | 417 | then throw("exactly 1 payment is expected") | |
413 | 418 | else { | |
414 | 419 | let pmt = value(i.payments[0]) | |
415 | 420 | let pmtAssetId = value(pmt.assetId) | |
416 | 421 | let pmtAmount = pmt.amount | |
417 | 422 | if ((pmtAssetId != priceAssetId)) | |
418 | 423 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
419 | 424 | else { | |
420 | 425 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
421 | 426 | let origTotalsArray = readTotalsArrayOrDefault() | |
422 | 427 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
423 | 428 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
424 | 429 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
425 | 430 | then throw("IDO asset has been - sold consider to use smaller payment") | |
426 | 431 | else { | |
427 | 432 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
428 | 433 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
429 | 434 | } | |
430 | 435 | } | |
431 | 436 | } | |
432 | 437 | } | |
433 | 438 | ||
434 | 439 | ||
435 | 440 | ||
436 | 441 | @Callable(i) | |
437 | 442 | func claim (claimedAssetId58,userAddress58) = { | |
438 | 443 | let callerAddress58 = toString(i.caller) | |
439 | 444 | if ((userAddress58 != callerAddress58)) | |
440 | 445 | then throw("not authorized") | |
441 | 446 | else { | |
442 | 447 | let cfgArray = readConfigArray() | |
443 | 448 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
444 | 449 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
445 | 450 | let totalsDiff = claimResultTuple._1 | |
446 | 451 | let outAmount = claimResultTuple._2 | |
447 | 452 | let outAssetId = claimResultTuple._3 | |
448 | 453 | let origInvestArray = claimResultTuple._4 | |
449 | 454 | let newClaimPeriodHeight = claimResultTuple._5 | |
450 | 455 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
451 | 456 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
452 | 457 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
453 | 458 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
454 | 459 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
455 | 460 | then { | |
456 | - | let $ | |
457 | - | let periodMinAvailableToClaim = $ | |
458 | - | let periodTotalAvailableToClaim = $ | |
459 | - | let periodUserAvailableToClaim = $ | |
460 | - | let totalUserAvailableToClaim = $ | |
461 | - | let usdtPriceAssetAllowableRatio = $ | |
462 | - | let currentUsdtPriceAssetRatio = $ | |
463 | - | let endPeriodBlocksLeft = $ | |
464 | - | let updatedCurrentPeriod = $ | |
465 | - | let periodStart = $ | |
466 | - | let periodEnd = $ | |
461 | + | let $t02219622640 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
462 | + | let periodMinAvailableToClaim = $t02219622640._1 | |
463 | + | let periodTotalAvailableToClaim = $t02219622640._2 | |
464 | + | let periodUserAvailableToClaim = $t02219622640._3 | |
465 | + | let totalUserAvailableToClaim = $t02219622640._4 | |
466 | + | let usdtPriceAssetAllowableRatio = $t02219622640._5 | |
467 | + | let currentUsdtPriceAssetRatio = $t02219622640._6 | |
468 | + | let endPeriodBlocksLeft = $t02219622640._7 | |
469 | + | let updatedCurrentPeriod = $t02219622640._8 | |
470 | + | let periodStart = $t02219622640._9 | |
471 | + | let periodEnd = $t02219622640._10 | |
467 | 472 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
468 | 473 | then true | |
469 | 474 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
470 | 475 | then true | |
471 | 476 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
472 | 477 | then true | |
473 | 478 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
474 | 479 | then true | |
475 | 480 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
476 | 481 | if ((checks == checks)) | |
477 | 482 | then { | |
478 | 483 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
479 | 484 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
480 | 485 | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
481 | 486 | then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
482 | 487 | else { | |
483 | 488 | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
484 | 489 | [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
485 | 490 | } | |
486 | 491 | $Tuple2(([IntegerEntry(keyCurrentPeriod(), updatedCurrentPeriod), IntegerEntry(keyPeriodStartHeight(updatedCurrentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(updatedCurrentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, periodMinAvailableToClaim, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
487 | 492 | } | |
488 | 493 | else throw("Strict value is not equal to itself.") | |
489 | 494 | } | |
490 | 495 | else { | |
491 | 496 | let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
492 | 497 | $Tuple2([ScriptTransfer(i.caller, (outAmount + priceAssetBalanceIdoDecimals), outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, priceAssetBalance), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, priceAssetBalance), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, (claimedIdoAssetAmountFromDiff + priceAssetBalanceIdoDecimals), i.transactionId)], unit) | |
493 | 498 | } | |
494 | 499 | entries | |
495 | 500 | } | |
496 | 501 | } | |
497 | 502 | ||
498 | 503 | ||
499 | 504 | ||
500 | 505 | @Callable(i) | |
501 | 506 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
502 | 507 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
503 | 508 | let totalsDiff = claimResultTuple._1 | |
504 | 509 | let outAmount = claimResultTuple._2 | |
505 | 510 | let outAssetId = claimResultTuple._3 | |
506 | 511 | let origInvestArray = claimResultTuple._4 | |
507 | 512 | let newClaimPeriodHeight = claimResultTuple._5 | |
508 | 513 | let availableToClaimArray = claimResultTuple._6 | |
509 | 514 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
510 | 515 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
511 | 516 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
512 | 517 | } | |
513 | 518 | ||
514 | 519 | ||
515 | 520 | ||
516 | 521 | @Callable(i) | |
517 | 522 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
518 | 523 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
519 | 524 | let totalsDiff = claimResultTuple._1 | |
520 | 525 | let outAmount = claimResultTuple._2 | |
521 | 526 | let outAssetId = claimResultTuple._3 | |
522 | 527 | let origInvestArray = claimResultTuple._4 | |
523 | 528 | let newClaimPeriodHeight = claimResultTuple._5 | |
524 | 529 | let availableToClaimArray = claimResultTuple._6 | |
525 | 530 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
526 | 531 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
527 | 532 | let cfgArray = readConfigArray() | |
528 | 533 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
529 | 534 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
530 | 535 | let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100) | |
531 | 536 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals) | |
532 | - | let $ | |
533 | - | let periodMinAvailableToClaim = $ | |
534 | - | let periodTotalAvailableToClaim = $ | |
535 | - | let periodUserAvailableToClaim = $ | |
536 | - | let totalUserAvailableToClaim = $ | |
537 | - | let usdtPriceAssetAllowableRatio = $ | |
538 | - | let currentUsdtPriceAssetRatio = $ | |
539 | - | let endPeriodBlocksLeft = $ | |
540 | - | let updatedCurrentPeriod = $ | |
541 | - | let periodStart = $ | |
542 | - | let periodEnd = $ | |
537 | + | let $t02893329345 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
538 | + | let periodMinAvailableToClaim = $t02893329345._1 | |
539 | + | let periodTotalAvailableToClaim = $t02893329345._2 | |
540 | + | let periodUserAvailableToClaim = $t02893329345._3 | |
541 | + | let totalUserAvailableToClaim = $t02893329345._4 | |
542 | + | let usdtPriceAssetAllowableRatio = $t02893329345._5 | |
543 | + | let currentUsdtPriceAssetRatio = $t02893329345._6 | |
544 | + | let endPeriodBlocksLeft = $t02893329345._7 | |
545 | + | let updatedCurrentPeriod = $t02893329345._8 | |
546 | + | let periodStart = $t02893329345._9 | |
547 | + | let periodEnd = $t02893329345._10 | |
543 | 548 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
544 | 549 | let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance) | |
545 | 550 | let resultString = if ((height > currentPeriodEndHeight)) | |
546 | 551 | then { | |
547 | 552 | let periodLenght = value(getInteger(keyPeriodLength())) | |
548 | 553 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
549 | 554 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
550 | 555 | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP) | |
551 | 556 | } | |
552 | 557 | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP) | |
553 | 558 | $Tuple2(nil, resultString) | |
554 | 559 | } | |
555 | 560 | ||
556 | 561 | ||
557 | 562 | ||
558 | 563 | @Callable(i) | |
559 | 564 | func setManager (pendingManagerPublicKey) = { | |
560 | 565 | let checkCaller = mustManager(i) | |
561 | 566 | if ((checkCaller == checkCaller)) | |
562 | 567 | then { | |
563 | 568 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
564 | 569 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
565 | 570 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
566 | 571 | else throw("Strict value is not equal to itself.") | |
567 | 572 | } | |
568 | 573 | else throw("Strict value is not equal to itself.") | |
569 | 574 | } | |
570 | 575 | ||
571 | 576 | ||
572 | 577 | ||
573 | 578 | @Callable(i) | |
574 | 579 | func confirmManager () = { | |
575 | 580 | let pm = pendingManagerPublicKeyOrUnit() | |
576 | 581 | let hasPM = if (isDefined(pm)) | |
577 | 582 | then true | |
578 | 583 | else throw("No pending manager") | |
579 | 584 | if ((hasPM == hasPM)) | |
580 | 585 | then { | |
581 | 586 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
582 | 587 | then true | |
583 | 588 | else throw("You are not pending manager") | |
584 | 589 | if ((checkPM == checkPM)) | |
585 | 590 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
586 | 591 | else throw("Strict value is not equal to itself.") | |
587 | 592 | } | |
588 | 593 | else throw("Strict value is not equal to itself.") | |
589 | 594 | } | |
590 | 595 | ||
591 | 596 | ||
592 | 597 | @Verifier(tx) | |
593 | 598 | func verify () = { | |
594 | 599 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
595 | 600 | case pk: ByteVector => | |
596 | 601 | pk | |
597 | 602 | case _: Unit => | |
598 | 603 | tx.senderPublicKey | |
599 | 604 | case _ => | |
600 | 605 | throw("Match error") | |
601 | 606 | } | |
602 | 607 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
603 | 608 | } | |
604 | 609 |
github/deemru/w8io/169f3d6 199.46 ms ◑