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