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