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