tx · 7npvjwSRh6LG5mXgESqSSetbVn28p92CmpgdhvJHSmFM 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv: -0.02400000 Waves 2022.11.02 16:01 [2299525] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves
{ "type": 13, "id": "7npvjwSRh6LG5mXgESqSSetbVn28p92CmpgdhvJHSmFM", "fee": 2400000, "feeAssetId": null, "timestamp": 1667394154737, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "5fKEDW1wrCFwTy4fDSCUTc9Rdk4wmM1cbFZ24etuqbmBSnUHbvSGmGChsdmbNTiDz1wRAYSV64LaK33q3AHsqUFi" ], "script": "base64:AAIFAAAAAAAADfwIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFz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c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJjSQEAAAACY0oAAAAABAAAAAJjSwQAAAACYm8JAQAAAAJiUwAAAAADCQAAAQAAAAIFAAAAAmJvAgAAAApCeXRlVmVjdG9yBAAAAAJiWQUAAAACYm8FAAAAAmJZAwkAAAEAAAACBQAAAAJibwIAAAAEVW5pdAgFAAAAAmNJAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY0kAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjSQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNLSHb+Gw==", "chainId": 84, "height": 2299525, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: jsupw7HNM16HghuxVRZ6ByGuFsj1qwanVSqxhtUgriZ Next: 3ZQ1FzYhuRtanVvCLvTZDi35rzHSoJHjvUjeH9Ruzexd Diff:
Old | New | Differences | |
---|---|---|---|
90 | 90 | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | - | func | |
93 | + | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP) | |
222 | 222 | then { | |
223 | 223 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
224 | 224 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
225 | - | let currentPeriod = valueOrElse(getInteger(keyCurrnetPeriod()), 0) | |
226 | - | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance) | |
227 | - | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
225 | + | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | + | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | + | let $t01110112019 = if ((currentPeriod > 0)) | |
228 | + | then { | |
229 | + | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))) | |
230 | + | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1)))) | |
231 | + | let $t01136911751 = if ((height > lastPeriodEndHeight)) | |
232 | + | then { | |
233 | + | let updatedCurrentPeriod = (currentPeriod + 1) | |
234 | + | let periodStart = (lastPeriodEndHeight + 1) | |
235 | + | let periodEnd = ((periodStart + periodLength) - 1) | |
236 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
237 | + | } | |
238 | + | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
239 | + | let updatedCurrentPeriod = $t01136911751._1 | |
240 | + | let periodStart = $t01136911751._2 | |
241 | + | let periodEnd = $t01136911751._3 | |
242 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
243 | + | } | |
244 | + | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
245 | + | let updatedCurrentPeriod = $t01110112019._1 | |
246 | + | let periodStart = $t01110112019._2 | |
247 | + | let periodEnd = $t01110112019._3 | |
248 | + | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
249 | + | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
228 | 250 | let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
229 | 251 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
230 | - | let | |
231 | - | let $ | |
232 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [ | |
252 | + | let putOneTknV2PriceAssetAmount = scale8 | |
253 | + | let $t01268712940 = { | |
254 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
233 | 255 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
234 | 256 | then @ | |
235 | 257 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
236 | 258 | } | |
237 | - | if (($ | |
259 | + | if (($t01268712940 == $t01268712940)) | |
238 | 260 | then { | |
239 | - | let bonus = $ | |
240 | - | let feeAmount = $ | |
241 | - | let lpAmount = $ | |
242 | - | let usdtAssetId = value( | |
243 | - | let $ | |
261 | + | let bonus = $t01268712940._3 | |
262 | + | let feeAmount = $t01268712940._2 | |
263 | + | let lpAmount = $t01268712940._1 | |
264 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
265 | + | let $t01300213220 = { | |
244 | 266 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
245 | 267 | if ($isInstanceOf(@, "(Int, Int)")) | |
246 | 268 | then @ | |
247 | 269 | else throw("Couldn't cast Any to (Int, Int)") | |
248 | 270 | } | |
249 | - | if (($ | |
271 | + | if (($t01300213220 == $t01300213220)) | |
250 | 272 | then { | |
251 | - | let getOneTknV2FeeAmount = $ | |
252 | - | let usdtAmount = $ | |
253 | - | let currentUsdtPriceAssetRatio = fraction(usdtAmount, | |
254 | - | let endPeriodBlocksLeft = ( | |
273 | + | let getOneTknV2FeeAmount = $t01300213220._2 | |
274 | + | let usdtAmount = $t01300213220._1 | |
275 | + | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
276 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
255 | 277 | if ((claimedAssetId58 == priceAssetId58)) | |
256 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
278 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
257 | 279 | else if ((claimedAssetId58 == idoAssetId58)) | |
258 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, currentUsdtPriceAssetRatio, | |
280 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
259 | 281 | else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " ")) | |
260 | 282 | } | |
261 | 283 | else throw("Strict value is not equal to itself.") | |
385 | 407 | if ((userAddress58 != callerAddress58)) | |
386 | 408 | then throwErr("not authorized") | |
387 | 409 | else { | |
410 | + | let priceAssetId = readConfigArray()[IdxCfgPriceAssetId] | |
388 | 411 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
389 | 412 | let totalsDiff = claimResultTuple._1 | |
390 | 413 | let outAmount = claimResultTuple._2 | |
392 | 415 | let origInvestArray = claimResultTuple._4 | |
393 | 416 | let newClaimPeriodHeight = claimResultTuple._5 | |
394 | 417 | let availableToClaimArray = claimResultTuple._6 | |
395 | - | let totalUserAvailableToClaim = availableToClaimArray[0] | |
396 | - | let periodAvailableIdoAmountToClaim = availableToClaimArray[1] | |
397 | - | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[2] | |
398 | - | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[3] | |
418 | + | let currentPeriod = availableToClaimArray[0] | |
419 | + | let periodStart = availableToClaimArray[1] | |
420 | + | let periodEnd = availableToClaimArray[2] | |
421 | + | let totalUserAvailableToClaim = availableToClaimArray[3] | |
422 | + | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
423 | + | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
424 | + | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
425 | + | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
426 | + | let currentPriceAssetRatio = availableToClaimArray[8] | |
427 | + | let endPriodBlocksLeft = availableToClaimArray[9] | |
399 | 428 | let checks = [if (if ((totalUserAvailableToClaim > 0)) | |
400 | 429 | then true | |
401 | 430 | else (periodAvailableIdoAmountToClaim > 0)) | |
409 | 438 | then { | |
410 | 439 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
411 | 440 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
412 | - | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
441 | + | let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff) | |
442 | + | let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff) | |
443 | + | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
413 | 444 | } | |
414 | 445 | else throw("Strict value is not equal to itself.") | |
415 | 446 | } | |
426 | 457 | let origInvestArray = claimResultTuple._4 | |
427 | 458 | let newClaimPeriodHeight = claimResultTuple._5 | |
428 | 459 | let availableToClaimArray = claimResultTuple._6 | |
429 | - | let | |
430 | - | let | |
460 | + | let availableIdoAmountToClaim = availableToClaimArray[4] | |
461 | + | let availablePriceAmountToClaim = availableToClaimArray[5] | |
431 | 462 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
432 | 463 | } | |
433 | 464 | ||
442 | 473 | let origInvestArray = claimResultTuple._4 | |
443 | 474 | let newClaimPeriodHeight = claimResultTuple._5 | |
444 | 475 | let availableToClaimArray = claimResultTuple._6 | |
445 | - | let totalUserAvailableToClaim = availableToClaimArray[0] | |
446 | - | let periodAvailableIdoAmountToClaim = availableToClaimArray[1] | |
447 | - | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[2] | |
448 | - | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[3] | |
449 | - | let usdtPriceAssetAllowableRatio = availableToClaimArray[4] | |
450 | - | let currentPriceAssetRatio = availableToClaimArray[5] | |
451 | - | let endPriodBlocksLeft = availableToClaimArray[6] | |
476 | + | let currentPeriod = availableToClaimArray[0] | |
477 | + | let periodStart = availableToClaimArray[1] | |
478 | + | let periodEnd = availableToClaimArray[2] | |
479 | + | let totalUserAvailableToClaim = availableToClaimArray[3] | |
480 | + | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
481 | + | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
482 | + | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
483 | + | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
484 | + | let currentPriceAssetRatio = availableToClaimArray[8] | |
485 | + | let endPriodBlocksLeft = availableToClaimArray[9] | |
452 | 486 | let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP) | |
453 | 487 | $Tuple2(nil, resultString) | |
454 | 488 | } |
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 | - | func | |
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 keyManagerPublicKey () = "%s__managerPublicKey" | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | let IdxDiffTotalIncrement = 0 | |
145 | 145 | ||
146 | 146 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
147 | 147 | ||
148 | 148 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
149 | 149 | ||
150 | 150 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
151 | 151 | ||
152 | 152 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = { | |
153 | 153 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
154 | 154 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
155 | 155 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
156 | 156 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
157 | 157 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
158 | 158 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
159 | 159 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
160 | 160 | let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) | |
161 | 161 | let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) | |
162 | 162 | if ((0 > newRemainingAmount)) | |
163 | 163 | then throw("invalid math") | |
164 | 164 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
175 | 175 | let cfgArray = readConfigArray() | |
176 | 176 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
177 | 177 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
178 | 178 | let claimEnd = (claimStart + claimDuration) | |
179 | 179 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
180 | 180 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
181 | 181 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
182 | 182 | let idoAssetId = fromBase58String(idoAssetId58) | |
183 | 183 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
184 | 184 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
185 | 185 | let priceAssetId = fromBase58String(priceAssetId58) | |
186 | 186 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
187 | 187 | let userAddress58 = toString(userAddress) | |
188 | 188 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
189 | 189 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
190 | 190 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
191 | 191 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
192 | 192 | then claimStart | |
193 | 193 | else investLastClaimedHeightTMP | |
194 | 194 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
195 | 195 | then claimEnd | |
196 | 196 | else if ((claimStart > height)) | |
197 | 197 | then claimStart | |
198 | 198 | else height | |
199 | 199 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
200 | 200 | let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
201 | 201 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult) | |
202 | 202 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
203 | 203 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
204 | 204 | let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) { | |
205 | 205 | case end: Int => | |
206 | 206 | (height > end) | |
207 | 207 | case _: Unit => | |
208 | 208 | false | |
209 | 209 | case _ => | |
210 | 210 | throw("Match error") | |
211 | 211 | } | |
212 | 212 | let checks = [if (!(if (isUSDN) | |
213 | 213 | then isUSDNClaimDisabled | |
214 | 214 | else false)) | |
215 | 215 | then true | |
216 | 216 | else throwErr("USDN claim is disabled"), if (!(if (isUSDN) | |
217 | 217 | then isUSDNClaimEnded | |
218 | 218 | else false)) | |
219 | 219 | then true | |
220 | 220 | else throwErr("USDN claim is ended")] | |
221 | 221 | if ((checks == checks)) | |
222 | 222 | then { | |
223 | 223 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
224 | 224 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
225 | - | let currentPeriod = valueOrElse(getInteger(keyCurrnetPeriod()), 0) | |
226 | - | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod)), totalPeriodPriceAssetAllowance) | |
227 | - | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
225 | + | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | + | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | + | let $t01110112019 = if ((currentPeriod > 0)) | |
228 | + | then { | |
229 | + | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1)))) | |
230 | + | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1)))) | |
231 | + | let $t01136911751 = if ((height > lastPeriodEndHeight)) | |
232 | + | then { | |
233 | + | let updatedCurrentPeriod = (currentPeriod + 1) | |
234 | + | let periodStart = (lastPeriodEndHeight + 1) | |
235 | + | let periodEnd = ((periodStart + periodLength) - 1) | |
236 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
237 | + | } | |
238 | + | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
239 | + | let updatedCurrentPeriod = $t01136911751._1 | |
240 | + | let periodStart = $t01136911751._2 | |
241 | + | let periodEnd = $t01136911751._3 | |
242 | + | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
243 | + | } | |
244 | + | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
245 | + | let updatedCurrentPeriod = $t01110112019._1 | |
246 | + | let periodStart = $t01110112019._2 | |
247 | + | let periodEnd = $t01110112019._3 | |
248 | + | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
249 | + | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
228 | 250 | let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
229 | 251 | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
230 | - | let | |
231 | - | let $ | |
232 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [ | |
252 | + | let putOneTknV2PriceAssetAmount = scale8 | |
253 | + | let $t01268712940 = { | |
254 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
233 | 255 | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
234 | 256 | then @ | |
235 | 257 | else throw("Couldn't cast Any to (Int, Int, Int)") | |
236 | 258 | } | |
237 | - | if (($ | |
259 | + | if (($t01268712940 == $t01268712940)) | |
238 | 260 | then { | |
239 | - | let bonus = $ | |
240 | - | let feeAmount = $ | |
241 | - | let lpAmount = $ | |
242 | - | let usdtAssetId = value( | |
243 | - | let $ | |
261 | + | let bonus = $t01268712940._3 | |
262 | + | let feeAmount = $t01268712940._2 | |
263 | + | let lpAmount = $t01268712940._1 | |
264 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
265 | + | let $t01300213220 = { | |
244 | 266 | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
245 | 267 | if ($isInstanceOf(@, "(Int, Int)")) | |
246 | 268 | then @ | |
247 | 269 | else throw("Couldn't cast Any to (Int, Int)") | |
248 | 270 | } | |
249 | - | if (($ | |
271 | + | if (($t01300213220 == $t01300213220)) | |
250 | 272 | then { | |
251 | - | let getOneTknV2FeeAmount = $ | |
252 | - | let usdtAmount = $ | |
253 | - | let currentUsdtPriceAssetRatio = fraction(usdtAmount, | |
254 | - | let endPeriodBlocksLeft = ( | |
273 | + | let getOneTknV2FeeAmount = $t01300213220._2 | |
274 | + | let usdtAmount = $t01300213220._1 | |
275 | + | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
276 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
255 | 277 | if ((claimedAssetId58 == priceAssetId58)) | |
256 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
278 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
257 | 279 | else if ((claimedAssetId58 == idoAssetId58)) | |
258 | - | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, currentUsdtPriceAssetRatio, | |
280 | + | then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft]) | |
259 | 281 | else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " ")) | |
260 | 282 | } | |
261 | 283 | else throw("Strict value is not equal to itself.") | |
262 | 284 | } | |
263 | 285 | else throw("Strict value is not equal to itself.") | |
264 | 286 | } | |
265 | 287 | else throw("Strict value is not equal to itself.") | |
266 | 288 | } | |
267 | 289 | ||
268 | 290 | ||
269 | 291 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
270 | 292 | case s: String => | |
271 | 293 | fromBase58String(s) | |
272 | 294 | case _: Unit => | |
273 | 295 | unit | |
274 | 296 | case _ => | |
275 | 297 | throw("Match error") | |
276 | 298 | } | |
277 | 299 | ||
278 | 300 | ||
279 | 301 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
280 | 302 | case s: String => | |
281 | 303 | fromBase58String(s) | |
282 | 304 | case _: Unit => | |
283 | 305 | unit | |
284 | 306 | case _ => | |
285 | 307 | throw("Match error") | |
286 | 308 | } | |
287 | 309 | ||
288 | 310 | ||
289 | 311 | func mustManager (i) = { | |
290 | 312 | let pd = throw("Permission denied") | |
291 | 313 | match managerPublicKeyOrUnit() { | |
292 | 314 | case pk: ByteVector => | |
293 | 315 | if ((i.callerPublicKey == pk)) | |
294 | 316 | then true | |
295 | 317 | else pd | |
296 | 318 | case _: Unit => | |
297 | 319 | if ((i.caller == this)) | |
298 | 320 | then true | |
299 | 321 | else pd | |
300 | 322 | case _ => | |
301 | 323 | throw("Match error") | |
302 | 324 | } | |
303 | 325 | } | |
304 | 326 | ||
305 | 327 | ||
306 | 328 | @Callable(i) | |
307 | 329 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
308 | 330 | let priceMult = ((100 * 1000) * 1000) | |
309 | 331 | let idoEnd = (idoStart + idoDuration) | |
310 | 332 | if (isDefined(getString(keyConfig()))) | |
311 | 333 | then throw("already initialized") | |
312 | 334 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
313 | 335 | then throw("not authorized") | |
314 | 336 | else if ((size(i.payments) != 1)) | |
315 | 337 | then throw("exactly 1 payment must be attached") | |
316 | 338 | else if ((idoEnd >= claimStart)) | |
317 | 339 | then throw("claimStart must be greater than idoEnd") | |
318 | 340 | else { | |
319 | 341 | let pmt = value(i.payments[0]) | |
320 | 342 | let idoAssetId = value(pmt.assetId) | |
321 | 343 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
322 | 344 | let idoAssetId58 = toBase58String(idoAssetId) | |
323 | 345 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
324 | 346 | let priceAssetId = fromBase58String(priceAssetId58) | |
325 | 347 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
326 | 348 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
327 | 349 | let origTotalsArray = readTotalsArrayOrDefault() | |
328 | 350 | let totalsDiff = [0, 0, 0, 0] | |
329 | 351 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
330 | 352 | } | |
331 | 353 | } | |
332 | 354 | ||
333 | 355 | ||
334 | 356 | ||
335 | 357 | @Callable(i) | |
336 | 358 | func invest () = { | |
337 | 359 | let cfgArray = readConfigArray() | |
338 | 360 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
339 | 361 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
340 | 362 | let idoEnd = (idoStart + idoDuration) | |
341 | 363 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
342 | 364 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
343 | 365 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
344 | 366 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
345 | 367 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
346 | 368 | let idoAssetId = fromBase58String(idoAssetId58) | |
347 | 369 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
348 | 370 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
349 | 371 | let priceAssetId = fromBase58String(priceAssetId58) | |
350 | 372 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
351 | 373 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
352 | 374 | let userAddress = toString(i.caller) | |
353 | 375 | if ((idoStart > height)) | |
354 | 376 | then throw("ido has not been started yet") | |
355 | 377 | else if ((height > idoEnd)) | |
356 | 378 | then throw("ido has been already ended") | |
357 | 379 | else if ((size(i.payments) != 1)) | |
358 | 380 | then throw("exactly 1 payment is expected") | |
359 | 381 | else { | |
360 | 382 | let pmt = value(i.payments[0]) | |
361 | 383 | let pmtAssetId = value(pmt.assetId) | |
362 | 384 | let pmtAmount = pmt.amount | |
363 | 385 | if ((pmtAssetId != priceAssetId)) | |
364 | 386 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
365 | 387 | else { | |
366 | 388 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
367 | 389 | let origTotalsArray = readTotalsArrayOrDefault() | |
368 | 390 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
369 | 391 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
370 | 392 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
371 | 393 | then throw("IDO asset has been - sold consider to use smaller payment") | |
372 | 394 | else { | |
373 | 395 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
374 | 396 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
375 | 397 | } | |
376 | 398 | } | |
377 | 399 | } | |
378 | 400 | } | |
379 | 401 | ||
380 | 402 | ||
381 | 403 | ||
382 | 404 | @Callable(i) | |
383 | 405 | func claim (claimedAssetId58,userAddress58) = { | |
384 | 406 | let callerAddress58 = toString(i.caller) | |
385 | 407 | if ((userAddress58 != callerAddress58)) | |
386 | 408 | then throwErr("not authorized") | |
387 | 409 | else { | |
410 | + | let priceAssetId = readConfigArray()[IdxCfgPriceAssetId] | |
388 | 411 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
389 | 412 | let totalsDiff = claimResultTuple._1 | |
390 | 413 | let outAmount = claimResultTuple._2 | |
391 | 414 | let outAssetId = claimResultTuple._3 | |
392 | 415 | let origInvestArray = claimResultTuple._4 | |
393 | 416 | let newClaimPeriodHeight = claimResultTuple._5 | |
394 | 417 | let availableToClaimArray = claimResultTuple._6 | |
395 | - | let totalUserAvailableToClaim = availableToClaimArray[0] | |
396 | - | let periodAvailableIdoAmountToClaim = availableToClaimArray[1] | |
397 | - | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[2] | |
398 | - | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[3] | |
418 | + | let currentPeriod = availableToClaimArray[0] | |
419 | + | let periodStart = availableToClaimArray[1] | |
420 | + | let periodEnd = availableToClaimArray[2] | |
421 | + | let totalUserAvailableToClaim = availableToClaimArray[3] | |
422 | + | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
423 | + | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
424 | + | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
425 | + | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
426 | + | let currentPriceAssetRatio = availableToClaimArray[8] | |
427 | + | let endPriodBlocksLeft = availableToClaimArray[9] | |
399 | 428 | let checks = [if (if ((totalUserAvailableToClaim > 0)) | |
400 | 429 | then true | |
401 | 430 | else (periodAvailableIdoAmountToClaim > 0)) | |
402 | 431 | then true | |
403 | 432 | else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0)) | |
404 | 433 | then true | |
405 | 434 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0)) | |
406 | 435 | then true | |
407 | 436 | else throwErr("unavailable to claim because total period allowance reached")] | |
408 | 437 | if ((checks == checks)) | |
409 | 438 | then { | |
410 | 439 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
411 | 440 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
412 | - | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
441 | + | let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff) | |
442 | + | let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff) | |
443 | + | $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
413 | 444 | } | |
414 | 445 | else throw("Strict value is not equal to itself.") | |
415 | 446 | } | |
416 | 447 | } | |
417 | 448 | ||
418 | 449 | ||
419 | 450 | ||
420 | 451 | @Callable(i) | |
421 | 452 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
422 | 453 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
423 | 454 | let totalsDiff = claimResultTuple._1 | |
424 | 455 | let outAmount = claimResultTuple._2 | |
425 | 456 | let outAssetId = claimResultTuple._3 | |
426 | 457 | let origInvestArray = claimResultTuple._4 | |
427 | 458 | let newClaimPeriodHeight = claimResultTuple._5 | |
428 | 459 | let availableToClaimArray = claimResultTuple._6 | |
429 | - | let | |
430 | - | let | |
460 | + | let availableIdoAmountToClaim = availableToClaimArray[4] | |
461 | + | let availablePriceAmountToClaim = availableToClaimArray[5] | |
431 | 462 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
432 | 463 | } | |
433 | 464 | ||
434 | 465 | ||
435 | 466 | ||
436 | 467 | @Callable(i) | |
437 | 468 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
438 | 469 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
439 | 470 | let totalsDiff = claimResultTuple._1 | |
440 | 471 | let outAmount = claimResultTuple._2 | |
441 | 472 | let outAssetId = claimResultTuple._3 | |
442 | 473 | let origInvestArray = claimResultTuple._4 | |
443 | 474 | let newClaimPeriodHeight = claimResultTuple._5 | |
444 | 475 | let availableToClaimArray = claimResultTuple._6 | |
445 | - | let totalUserAvailableToClaim = availableToClaimArray[0] | |
446 | - | let periodAvailableIdoAmountToClaim = availableToClaimArray[1] | |
447 | - | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[2] | |
448 | - | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[3] | |
449 | - | let usdtPriceAssetAllowableRatio = availableToClaimArray[4] | |
450 | - | let currentPriceAssetRatio = availableToClaimArray[5] | |
451 | - | let endPriodBlocksLeft = availableToClaimArray[6] | |
476 | + | let currentPeriod = availableToClaimArray[0] | |
477 | + | let periodStart = availableToClaimArray[1] | |
478 | + | let periodEnd = availableToClaimArray[2] | |
479 | + | let totalUserAvailableToClaim = availableToClaimArray[3] | |
480 | + | let periodAvailableIdoAmountToClaim = availableToClaimArray[4] | |
481 | + | let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5] | |
482 | + | let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6] | |
483 | + | let usdtPriceAssetAllowableRatio = availableToClaimArray[7] | |
484 | + | let currentPriceAssetRatio = availableToClaimArray[8] | |
485 | + | let endPriodBlocksLeft = availableToClaimArray[9] | |
452 | 486 | let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP) | |
453 | 487 | $Tuple2(nil, resultString) | |
454 | 488 | } | |
455 | 489 | ||
456 | 490 | ||
457 | 491 | ||
458 | 492 | @Callable(i) | |
459 | 493 | func setManager (pendingManagerPublicKey) = { | |
460 | 494 | let checkCaller = mustManager(i) | |
461 | 495 | if ((checkCaller == checkCaller)) | |
462 | 496 | then { | |
463 | 497 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
464 | 498 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
465 | 499 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
466 | 500 | else throw("Strict value is not equal to itself.") | |
467 | 501 | } | |
468 | 502 | else throw("Strict value is not equal to itself.") | |
469 | 503 | } | |
470 | 504 | ||
471 | 505 | ||
472 | 506 | ||
473 | 507 | @Callable(i) | |
474 | 508 | func confirmManager () = { | |
475 | 509 | let pm = pendingManagerPublicKeyOrUnit() | |
476 | 510 | let hasPM = if (isDefined(pm)) | |
477 | 511 | then true | |
478 | 512 | else throw("No pending manager") | |
479 | 513 | if ((hasPM == hasPM)) | |
480 | 514 | then { | |
481 | 515 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
482 | 516 | then true | |
483 | 517 | else throw("You are not pending manager") | |
484 | 518 | if ((checkPM == checkPM)) | |
485 | 519 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
486 | 520 | else throw("Strict value is not equal to itself.") | |
487 | 521 | } | |
488 | 522 | else throw("Strict value is not equal to itself.") | |
489 | 523 | } | |
490 | 524 | ||
491 | 525 | ||
492 | 526 | @Verifier(tx) | |
493 | 527 | func verify () = { | |
494 | 528 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
495 | 529 | case pk: ByteVector => | |
496 | 530 | pk | |
497 | 531 | case _: Unit => | |
498 | 532 | tx.senderPublicKey | |
499 | 533 | case _ => | |
500 | 534 | throw("Match error") | |
501 | 535 | } | |
502 | 536 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
503 | 537 | } | |
504 | 538 |
github/deemru/w8io/026f985 65.98 ms ◑