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