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