tx · 6SWYDCccc9xoSNsEnhk9VzCL77LcF3M4mxoxRMFrmyxw 3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje: -0.02700000 Waves 2022.11.30 15:20 [2339829] smart account 3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje > SELF 0.00000000 Waves
{ "type": 13, "id": "6SWYDCccc9xoSNsEnhk9VzCL77LcF3M4mxoxRMFrmyxw", "fee": 2700000, "feeAssetId": null, "timestamp": 1669810818482, "version": 1, "sender": "3MwK6nw9HMwuKbXxu6J1rfecvePPd3JyAje", "senderPublicKey": "8JB75GXEKqxmpXc6KVtT9UNqJ3BBSUZDodYD4DU7CUUB", "proofs": [ "2cKkTNWHCcnagHjdY3GeWVPXmfiFH5P6N6FxfQuJ8r1Je6GFKUA3gM3Xgnuv6HF2aeaf6ia8a8a22gX5Wm3vjzZX" ], "script": "base64:AAIFAAAAAAAAD10IAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZU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AAAAQIAAAASTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjWAUAAAACY1gEAAAAAmNZAwkAAAAAAAACCAUAAAACY2oAAAAPY2FsbGVyUHVibGljS2V5CQEAAAAFdmFsdWUAAAABBQAAAAJjVwYJAAACAAAAAQIAAAAbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAAAAAACBQAAAAJjWQUAAAACY1kJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkBAAAAAmFCAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJjVwkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAACYUMAAAAABQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACY1oBAAAAAmRhAAAAAAQAAAACZGIEAAAAAmNmCQEAAAACY2UAAAAAAwkAAAEAAAACBQAAAAJjZgIAAAAKQnl0ZVZlY3RvcgQAAAACY2wFAAAAAmNmBQAAAAJjbAMJAAABAAAAAgUAAAACY2YCAAAABFVuaXQIBQAAAAJjWgAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmNaAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY1oAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJkYoqnMd0=", "chainId": 84, "height": 2339829, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 249zk6hPajqGoYiQbEsDaQaUu7P3iqTLugUMD9CeqYqb Next: 2gfrmtCHstvBSQ7MAUg3aTDWKh1Doq9pKQBu67KhQny9 Diff:
Old | New | Differences | |
---|---|---|---|
168 | 168 | let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals) | |
169 | 169 | let entries = if ((0 > newRemainingAmount)) | |
170 | 170 | then { | |
171 | - | let newLogicRemainingAmount = (newTotalAmount - newClaimedPriceAssetAmount) | |
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)) | |
233 | 233 | let periodLength = value(getInteger(keyPeriodLength())) | |
234 | 234 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
235 | 235 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
236 | - | let $ | |
236 | + | let $t01262114491 = if ((currentPeriod > 0)) | |
237 | 237 | then { | |
238 | 238 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
239 | 239 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
240 | - | let $ | |
240 | + | let $t01288113586 = if ((height > lastPeriodEndHeight)) | |
241 | 241 | then { | |
242 | 242 | let updatedCurrentPeriod = (currentPeriod + 1) | |
243 | 243 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
252 | 252 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
253 | 253 | } | |
254 | 254 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
255 | - | let updatedCurrentPeriod = $ | |
256 | - | let periodStart = $ | |
257 | - | let periodEnd = $ | |
255 | + | let updatedCurrentPeriod = $t01288113586._1 | |
256 | + | let periodStart = $t01288113586._2 | |
257 | + | let periodEnd = $t01288113586._3 | |
258 | 258 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
259 | 259 | } | |
260 | 260 | else if (zeroPeriodEndHeighIsDefined) | |
261 | 261 | then { | |
262 | 262 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
263 | 263 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
264 | - | let $ | |
264 | + | let $t01384114223 = if ((height > zeroPeriodEndHeight)) | |
265 | 265 | then { | |
266 | 266 | let updatedCurrentPeriod = (currentPeriod + 1) | |
267 | 267 | let periodStart = (zeroPeriodEndHeight + 1) | |
269 | 269 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
270 | 270 | } | |
271 | 271 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
272 | - | let updatedCurrentPeriod = $ | |
273 | - | let periodStart = $ | |
274 | - | let periodEnd = $ | |
272 | + | let updatedCurrentPeriod = $t01384114223._1 | |
273 | + | let periodStart = $t01384114223._2 | |
274 | + | let periodEnd = $t01384114223._3 | |
275 | 275 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
276 | 276 | } | |
277 | 277 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
278 | - | let updatedCurrentPeriod = $ | |
279 | - | let periodStart = $ | |
280 | - | let periodEnd = $ | |
278 | + | let updatedCurrentPeriod = $t01262114491._1 | |
279 | + | let periodStart = $t01262114491._2 | |
280 | + | let periodEnd = $t01262114491._3 | |
281 | 281 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
282 | 282 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
283 | 283 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
284 | 284 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
285 | 285 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
286 | 286 | let putOneTknV2PriceAssetAmount = scale8 | |
287 | - | let $ | |
287 | + | let $t01524615499 = { | |
288 | 288 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
289 | 289 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
290 | 290 | then @ | |
291 | 291 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
292 | 292 | } | |
293 | - | if (($ | |
293 | + | if (($t01524615499 == $t01524615499)) | |
294 | 294 | then { | |
295 | - | let bonus = $ | |
296 | - | let feeAmount = $ | |
297 | - | let lpAmount = $ | |
295 | + | let bonus = $t01524615499._3 | |
296 | + | let feeAmount = $t01524615499._2 | |
297 | + | let lpAmount = $t01524615499._1 | |
298 | 298 | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
299 | - | let $ | |
299 | + | let $t01556115779 = { | |
300 | 300 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
301 | 301 | if ($isInstanceOf(@, "(Int, Int)")) | |
302 | 302 | then @ | |
303 | 303 | else throw("Couldn't cast Any to (Int, Int)") | |
304 | 304 | } | |
305 | - | if (($ | |
305 | + | if (($t01556115779 == $t01556115779)) | |
306 | 306 | then { | |
307 | - | let getOneTknV2FeeAmount = $ | |
308 | - | let usdtAmount = $ | |
307 | + | let getOneTknV2FeeAmount = $t01556115779._2 | |
308 | + | let usdtAmount = $t01556115779._1 | |
309 | 309 | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
310 | 310 | let endPeriodBlocksLeft = (periodEnd - height) | |
311 | 311 | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
449 | 449 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
450 | 450 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
451 | 451 | then { | |
452 | - | let $ | |
453 | - | let periodMinAvailableToClaim = $ | |
454 | - | let periodTotalAvailableToClaim = $ | |
455 | - | let periodUserAvailableToClaim = $ | |
456 | - | let totalUserAvailableToClaim = $ | |
457 | - | let usdtPriceAssetAllowableRatio = $ | |
458 | - | let currentUsdtPriceAssetRatio = $ | |
459 | - | let endPeriodBlocksLeft = $ | |
460 | - | let updatedCurrentPeriod = $ | |
461 | - | let periodStart = $ | |
462 | - | let periodEnd = $ | |
452 | + | let $t02168822132 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
453 | + | let periodMinAvailableToClaim = $t02168822132._1 | |
454 | + | let periodTotalAvailableToClaim = $t02168822132._2 | |
455 | + | let periodUserAvailableToClaim = $t02168822132._3 | |
456 | + | let totalUserAvailableToClaim = $t02168822132._4 | |
457 | + | let usdtPriceAssetAllowableRatio = $t02168822132._5 | |
458 | + | let currentUsdtPriceAssetRatio = $t02168822132._6 | |
459 | + | let endPeriodBlocksLeft = $t02168822132._7 | |
460 | + | let updatedCurrentPeriod = $t02168822132._8 | |
461 | + | let periodStart = $t02168822132._9 | |
462 | + | let periodEnd = $t02168822132._10 | |
463 | 463 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
464 | 464 | then true | |
465 | 465 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
525 | 525 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
526 | 526 | let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100) | |
527 | 527 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals) | |
528 | - | let $ | |
529 | - | let periodMinAvailableToClaim = $ | |
530 | - | let periodTotalAvailableToClaim = $ | |
531 | - | let periodUserAvailableToClaim = $ | |
532 | - | let totalUserAvailableToClaim = $ | |
533 | - | let usdtPriceAssetAllowableRatio = $ | |
534 | - | let currentUsdtPriceAssetRatio = $ | |
535 | - | let endPeriodBlocksLeft = $ | |
536 | - | let updatedCurrentPeriod = $ | |
537 | - | let periodStart = $ | |
538 | - | let periodEnd = $ | |
528 | + | let $t02842528837 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
529 | + | let periodMinAvailableToClaim = $t02842528837._1 | |
530 | + | let periodTotalAvailableToClaim = $t02842528837._2 | |
531 | + | let periodUserAvailableToClaim = $t02842528837._3 | |
532 | + | let totalUserAvailableToClaim = $t02842528837._4 | |
533 | + | let usdtPriceAssetAllowableRatio = $t02842528837._5 | |
534 | + | let currentUsdtPriceAssetRatio = $t02842528837._6 | |
535 | + | let endPeriodBlocksLeft = $t02842528837._7 | |
536 | + | let updatedCurrentPeriod = $t02842528837._8 | |
537 | + | let periodStart = $t02842528837._9 | |
538 | + | let periodEnd = $t02842528837._10 | |
539 | 539 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
540 | 540 | let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance) | |
541 | 541 | 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 | - | let newLogicRemainingAmount = (newTotalAmount - newClaimedPriceAssetAmount) | |
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 claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
212 | 212 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
213 | 213 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
214 | 214 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
215 | 215 | let checks = [if (!(if (isUSDN) | |
216 | 216 | then isUSDNClaimDisabled | |
217 | 217 | else false)) | |
218 | 218 | then true | |
219 | 219 | else throw("USDN claim is disabled")] | |
220 | 220 | if ((checks == checks)) | |
221 | 221 | then if ((claimedAssetId58 == priceAssetId58)) | |
222 | 222 | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
223 | 223 | else if ((claimedAssetId58 == idoAssetId58)) | |
224 | 224 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
225 | 225 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
226 | 226 | else throw("Strict value is not equal to itself.") | |
227 | 227 | } | |
228 | 228 | ||
229 | 229 | ||
230 | 230 | func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = { | |
231 | 231 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
232 | 232 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
233 | 233 | let periodLength = value(getInteger(keyPeriodLength())) | |
234 | 234 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
235 | 235 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
236 | - | let $ | |
236 | + | let $t01262114491 = if ((currentPeriod > 0)) | |
237 | 237 | then { | |
238 | 238 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
239 | 239 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
240 | - | let $ | |
240 | + | let $t01288113586 = if ((height > lastPeriodEndHeight)) | |
241 | 241 | then { | |
242 | 242 | let updatedCurrentPeriod = (currentPeriod + 1) | |
243 | 243 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
244 | 244 | then { | |
245 | 245 | let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength) | |
246 | 246 | if ((blocksToLastPeriodStart == 0)) | |
247 | 247 | then ((height - periodLength) + 1) | |
248 | 248 | else (height - blocksToLastPeriodStart) | |
249 | 249 | } | |
250 | 250 | else (lastPeriodEndHeight + 1) | |
251 | 251 | let periodEnd = ((periodStart + periodLength) - 1) | |
252 | 252 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
253 | 253 | } | |
254 | 254 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
255 | - | let updatedCurrentPeriod = $ | |
256 | - | let periodStart = $ | |
257 | - | let periodEnd = $ | |
255 | + | let updatedCurrentPeriod = $t01288113586._1 | |
256 | + | let periodStart = $t01288113586._2 | |
257 | + | let periodEnd = $t01288113586._3 | |
258 | 258 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
259 | 259 | } | |
260 | 260 | else if (zeroPeriodEndHeighIsDefined) | |
261 | 261 | then { | |
262 | 262 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
263 | 263 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
264 | - | let $ | |
264 | + | let $t01384114223 = if ((height > zeroPeriodEndHeight)) | |
265 | 265 | then { | |
266 | 266 | let updatedCurrentPeriod = (currentPeriod + 1) | |
267 | 267 | let periodStart = (zeroPeriodEndHeight + 1) | |
268 | 268 | let periodEnd = ((periodStart + periodLength) - 1) | |
269 | 269 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
270 | 270 | } | |
271 | 271 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
272 | - | let updatedCurrentPeriod = $ | |
273 | - | let periodStart = $ | |
274 | - | let periodEnd = $ | |
272 | + | let updatedCurrentPeriod = $t01384114223._1 | |
273 | + | let periodStart = $t01384114223._2 | |
274 | + | let periodEnd = $t01384114223._3 | |
275 | 275 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
276 | 276 | } | |
277 | 277 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
278 | - | let updatedCurrentPeriod = $ | |
279 | - | let periodStart = $ | |
280 | - | let periodEnd = $ | |
278 | + | let updatedCurrentPeriod = $t01262114491._1 | |
279 | + | let periodStart = $t01262114491._2 | |
280 | + | let periodEnd = $t01262114491._3 | |
281 | 281 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
282 | 282 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
283 | 283 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
284 | 284 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
285 | 285 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
286 | 286 | let putOneTknV2PriceAssetAmount = scale8 | |
287 | - | let $ | |
287 | + | let $t01524615499 = { | |
288 | 288 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
289 | 289 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
290 | 290 | then @ | |
291 | 291 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
292 | 292 | } | |
293 | - | if (($ | |
293 | + | if (($t01524615499 == $t01524615499)) | |
294 | 294 | then { | |
295 | - | let bonus = $ | |
296 | - | let feeAmount = $ | |
297 | - | let lpAmount = $ | |
295 | + | let bonus = $t01524615499._3 | |
296 | + | let feeAmount = $t01524615499._2 | |
297 | + | let lpAmount = $t01524615499._1 | |
298 | 298 | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
299 | - | let $ | |
299 | + | let $t01556115779 = { | |
300 | 300 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
301 | 301 | if ($isInstanceOf(@, "(Int, Int)")) | |
302 | 302 | then @ | |
303 | 303 | else throw("Couldn't cast Any to (Int, Int)") | |
304 | 304 | } | |
305 | - | if (($ | |
305 | + | if (($t01556115779 == $t01556115779)) | |
306 | 306 | then { | |
307 | - | let getOneTknV2FeeAmount = $ | |
308 | - | let usdtAmount = $ | |
307 | + | let getOneTknV2FeeAmount = $t01556115779._2 | |
308 | + | let usdtAmount = $t01556115779._1 | |
309 | 309 | let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount) | |
310 | 310 | let endPeriodBlocksLeft = (periodEnd - height) | |
311 | 311 | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
312 | 312 | } | |
313 | 313 | else throw("Strict value is not equal to itself.") | |
314 | 314 | } | |
315 | 315 | else throw("Strict value is not equal to itself.") | |
316 | 316 | } | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
320 | 320 | case s: String => | |
321 | 321 | fromBase58String(s) | |
322 | 322 | case _: Unit => | |
323 | 323 | unit | |
324 | 324 | case _ => | |
325 | 325 | throw("Match error") | |
326 | 326 | } | |
327 | 327 | ||
328 | 328 | ||
329 | 329 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
330 | 330 | case s: String => | |
331 | 331 | fromBase58String(s) | |
332 | 332 | case _: Unit => | |
333 | 333 | unit | |
334 | 334 | case _ => | |
335 | 335 | throw("Match error") | |
336 | 336 | } | |
337 | 337 | ||
338 | 338 | ||
339 | 339 | func mustManager (i) = { | |
340 | 340 | let pd = throw("Permission denied") | |
341 | 341 | match managerPublicKeyOrUnit() { | |
342 | 342 | case pk: ByteVector => | |
343 | 343 | if ((i.callerPublicKey == pk)) | |
344 | 344 | then true | |
345 | 345 | else pd | |
346 | 346 | case _: Unit => | |
347 | 347 | if ((i.caller == this)) | |
348 | 348 | then true | |
349 | 349 | else pd | |
350 | 350 | case _ => | |
351 | 351 | throw("Match error") | |
352 | 352 | } | |
353 | 353 | } | |
354 | 354 | ||
355 | 355 | ||
356 | 356 | @Callable(i) | |
357 | 357 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
358 | 358 | let priceMult = ((100 * 1000) * 1000) | |
359 | 359 | let idoEnd = (idoStart + idoDuration) | |
360 | 360 | if (isDefined(getString(keyConfig()))) | |
361 | 361 | then throw("already initialized") | |
362 | 362 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
363 | 363 | then throw("not authorized") | |
364 | 364 | else if ((size(i.payments) != 1)) | |
365 | 365 | then throw("exactly 1 payment must be attached") | |
366 | 366 | else if ((idoEnd >= claimStart)) | |
367 | 367 | then throw("claimStart must be greater than idoEnd") | |
368 | 368 | else { | |
369 | 369 | let pmt = value(i.payments[0]) | |
370 | 370 | let idoAssetId = value(pmt.assetId) | |
371 | 371 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
372 | 372 | let idoAssetId58 = toBase58String(idoAssetId) | |
373 | 373 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
374 | 374 | let priceAssetId = fromBase58String(priceAssetId58) | |
375 | 375 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
376 | 376 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
377 | 377 | let origTotalsArray = readTotalsArrayOrDefault() | |
378 | 378 | let totalsDiff = [0, 0, 0, 0] | |
379 | 379 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)] | |
380 | 380 | } | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | @Callable(i) | |
386 | 386 | func invest () = { | |
387 | 387 | let cfgArray = readConfigArray() | |
388 | 388 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
389 | 389 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
390 | 390 | let idoEnd = (idoStart + idoDuration) | |
391 | 391 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
392 | 392 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
393 | 393 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
394 | 394 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
395 | 395 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
396 | 396 | let idoAssetId = fromBase58String(idoAssetId58) | |
397 | 397 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
398 | 398 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
399 | 399 | let priceAssetId = fromBase58String(priceAssetId58) | |
400 | 400 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
401 | 401 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
402 | 402 | let userAddress = toString(i.caller) | |
403 | 403 | if ((idoStart > height)) | |
404 | 404 | then throw("ido has not been started yet") | |
405 | 405 | else if ((height > idoEnd)) | |
406 | 406 | then throw("ido has been already ended") | |
407 | 407 | else if ((size(i.payments) != 1)) | |
408 | 408 | then throw("exactly 1 payment is expected") | |
409 | 409 | else { | |
410 | 410 | let pmt = value(i.payments[0]) | |
411 | 411 | let pmtAssetId = value(pmt.assetId) | |
412 | 412 | let pmtAmount = pmt.amount | |
413 | 413 | if ((pmtAssetId != priceAssetId)) | |
414 | 414 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
415 | 415 | else { | |
416 | 416 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
417 | 417 | let origTotalsArray = readTotalsArrayOrDefault() | |
418 | 418 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
419 | 419 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
420 | 420 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
421 | 421 | then throw("IDO asset has been - sold consider to use smaller payment") | |
422 | 422 | else { | |
423 | 423 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
424 | 424 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
425 | 425 | } | |
426 | 426 | } | |
427 | 427 | } | |
428 | 428 | } | |
429 | 429 | ||
430 | 430 | ||
431 | 431 | ||
432 | 432 | @Callable(i) | |
433 | 433 | func claim (claimedAssetId58,userAddress58) = { | |
434 | 434 | let callerAddress58 = toString(i.caller) | |
435 | 435 | if ((userAddress58 != callerAddress58)) | |
436 | 436 | then throw("not authorized") | |
437 | 437 | else { | |
438 | 438 | let cfgArray = readConfigArray() | |
439 | 439 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
440 | 440 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
441 | 441 | let totalsDiff = claimResultTuple._1 | |
442 | 442 | let outAmount = claimResultTuple._2 | |
443 | 443 | let outAssetId = claimResultTuple._3 | |
444 | 444 | let origInvestArray = claimResultTuple._4 | |
445 | 445 | let newClaimPeriodHeight = claimResultTuple._5 | |
446 | 446 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
447 | 447 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
448 | 448 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
449 | 449 | let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals | |
450 | 450 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
451 | 451 | then { | |
452 | - | let $ | |
453 | - | let periodMinAvailableToClaim = $ | |
454 | - | let periodTotalAvailableToClaim = $ | |
455 | - | let periodUserAvailableToClaim = $ | |
456 | - | let totalUserAvailableToClaim = $ | |
457 | - | let usdtPriceAssetAllowableRatio = $ | |
458 | - | let currentUsdtPriceAssetRatio = $ | |
459 | - | let endPeriodBlocksLeft = $ | |
460 | - | let updatedCurrentPeriod = $ | |
461 | - | let periodStart = $ | |
462 | - | let periodEnd = $ | |
452 | + | let $t02168822132 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
453 | + | let periodMinAvailableToClaim = $t02168822132._1 | |
454 | + | let periodTotalAvailableToClaim = $t02168822132._2 | |
455 | + | let periodUserAvailableToClaim = $t02168822132._3 | |
456 | + | let totalUserAvailableToClaim = $t02168822132._4 | |
457 | + | let usdtPriceAssetAllowableRatio = $t02168822132._5 | |
458 | + | let currentUsdtPriceAssetRatio = $t02168822132._6 | |
459 | + | let endPeriodBlocksLeft = $t02168822132._7 | |
460 | + | let updatedCurrentPeriod = $t02168822132._8 | |
461 | + | let periodStart = $t02168822132._9 | |
462 | + | let periodEnd = $t02168822132._10 | |
463 | 463 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
464 | 464 | then true | |
465 | 465 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
466 | 466 | then true | |
467 | 467 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
468 | 468 | then true | |
469 | 469 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
470 | 470 | then true | |
471 | 471 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
472 | 472 | if ((checks == checks)) | |
473 | 473 | then { | |
474 | 474 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
475 | 475 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
476 | 476 | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
477 | 477 | then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
478 | 478 | else { | |
479 | 479 | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
480 | 480 | [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
481 | 481 | } | |
482 | 482 | $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) | |
483 | 483 | } | |
484 | 484 | else throw("Strict value is not equal to itself.") | |
485 | 485 | } | |
486 | 486 | else { | |
487 | 487 | let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
488 | 488 | $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) | |
489 | 489 | } | |
490 | 490 | entries | |
491 | 491 | } | |
492 | 492 | } | |
493 | 493 | ||
494 | 494 | ||
495 | 495 | ||
496 | 496 | @Callable(i) | |
497 | 497 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
498 | 498 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
499 | 499 | let totalsDiff = claimResultTuple._1 | |
500 | 500 | let outAmount = claimResultTuple._2 | |
501 | 501 | let outAssetId = claimResultTuple._3 | |
502 | 502 | let origInvestArray = claimResultTuple._4 | |
503 | 503 | let newClaimPeriodHeight = claimResultTuple._5 | |
504 | 504 | let availableToClaimArray = claimResultTuple._6 | |
505 | 505 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
506 | 506 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
507 | 507 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
508 | 508 | } | |
509 | 509 | ||
510 | 510 | ||
511 | 511 | ||
512 | 512 | @Callable(i) | |
513 | 513 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
514 | 514 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
515 | 515 | let totalsDiff = claimResultTuple._1 | |
516 | 516 | let outAmount = claimResultTuple._2 | |
517 | 517 | let outAssetId = claimResultTuple._3 | |
518 | 518 | let origInvestArray = claimResultTuple._4 | |
519 | 519 | let newClaimPeriodHeight = claimResultTuple._5 | |
520 | 520 | let availableToClaimArray = claimResultTuple._6 | |
521 | 521 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
522 | 522 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
523 | 523 | let cfgArray = readConfigArray() | |
524 | 524 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
525 | 525 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
526 | 526 | let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100) | |
527 | 527 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals) | |
528 | - | let $ | |
529 | - | let periodMinAvailableToClaim = $ | |
530 | - | let periodTotalAvailableToClaim = $ | |
531 | - | let periodUserAvailableToClaim = $ | |
532 | - | let totalUserAvailableToClaim = $ | |
533 | - | let usdtPriceAssetAllowableRatio = $ | |
534 | - | let currentUsdtPriceAssetRatio = $ | |
535 | - | let endPeriodBlocksLeft = $ | |
536 | - | let updatedCurrentPeriod = $ | |
537 | - | let periodStart = $ | |
538 | - | let periodEnd = $ | |
528 | + | let $t02842528837 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
529 | + | let periodMinAvailableToClaim = $t02842528837._1 | |
530 | + | let periodTotalAvailableToClaim = $t02842528837._2 | |
531 | + | let periodUserAvailableToClaim = $t02842528837._3 | |
532 | + | let totalUserAvailableToClaim = $t02842528837._4 | |
533 | + | let usdtPriceAssetAllowableRatio = $t02842528837._5 | |
534 | + | let currentUsdtPriceAssetRatio = $t02842528837._6 | |
535 | + | let endPeriodBlocksLeft = $t02842528837._7 | |
536 | + | let updatedCurrentPeriod = $t02842528837._8 | |
537 | + | let periodStart = $t02842528837._9 | |
538 | + | let periodEnd = $t02842528837._10 | |
539 | 539 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
540 | 540 | let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance) | |
541 | 541 | let resultString = if ((height > currentPeriodEndHeight)) | |
542 | 542 | then { | |
543 | 543 | let periodLenght = value(getInteger(keyPeriodLength())) | |
544 | 544 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
545 | 545 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
546 | 546 | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP) | |
547 | 547 | } | |
548 | 548 | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP) | |
549 | 549 | $Tuple2(nil, resultString) | |
550 | 550 | } | |
551 | 551 | ||
552 | 552 | ||
553 | 553 | ||
554 | 554 | @Callable(i) | |
555 | 555 | func setManager (pendingManagerPublicKey) = { | |
556 | 556 | let checkCaller = mustManager(i) | |
557 | 557 | if ((checkCaller == checkCaller)) | |
558 | 558 | then { | |
559 | 559 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
560 | 560 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
561 | 561 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
562 | 562 | else throw("Strict value is not equal to itself.") | |
563 | 563 | } | |
564 | 564 | else throw("Strict value is not equal to itself.") | |
565 | 565 | } | |
566 | 566 | ||
567 | 567 | ||
568 | 568 | ||
569 | 569 | @Callable(i) | |
570 | 570 | func confirmManager () = { | |
571 | 571 | let pm = pendingManagerPublicKeyOrUnit() | |
572 | 572 | let hasPM = if (isDefined(pm)) | |
573 | 573 | then true | |
574 | 574 | else throw("No pending manager") | |
575 | 575 | if ((hasPM == hasPM)) | |
576 | 576 | then { | |
577 | 577 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
578 | 578 | then true | |
579 | 579 | else throw("You are not pending manager") | |
580 | 580 | if ((checkPM == checkPM)) | |
581 | 581 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
582 | 582 | else throw("Strict value is not equal to itself.") | |
583 | 583 | } | |
584 | 584 | else throw("Strict value is not equal to itself.") | |
585 | 585 | } | |
586 | 586 | ||
587 | 587 | ||
588 | 588 | @Verifier(tx) | |
589 | 589 | func verify () = { | |
590 | 590 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
591 | 591 | case pk: ByteVector => | |
592 | 592 | pk | |
593 | 593 | case _: Unit => | |
594 | 594 | tx.senderPublicKey | |
595 | 595 | case _ => | |
596 | 596 | throw("Match error") | |
597 | 597 | } | |
598 | 598 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
599 | 599 | } | |
600 | 600 |
github/deemru/w8io/026f985 95.42 ms ◑