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