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:AAIFAAAAAAAADfwIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUF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0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJjSQEAAAACY0oAAAAABAAAAAJjSwQAAAACYm8JAQAAAAJiUwAAAAADCQAAAQAAAAIFAAAAAmJvAgAAAApCeXRlVmVjdG9yBAAAAAJiWQUAAAACYm8FAAAAAmJZAwkAAAEAAAACBQAAAAJibwIAAAAEVW5pdAgFAAAAAmNJAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY0kAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjSQAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNLSHb+Gw==", "chainId": 84, "height": 2299525, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: jsupw7HNM16HghuxVRZ6ByGuFsj1qwanVSqxhtUgriZ Next: 3ZQ1FzYhuRtanVvCLvTZDi35rzHSoJHjvUjeH9Ruzexd Diff:
OldNewDifferences
9090 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9191
9292
93-func keyCurrnetPeriod () = makeString(["%s", "currentPeriod"], SEP)
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9494
9595
9696 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
222222 then {
223223 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224224 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)
228250 let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
229251 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
230- let putOneTknV2PriceAssestAmount = scale8
231- let $t01169311945 = {
232- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssestAmount, priceAssetId], nil)
252+ let putOneTknV2PriceAssetAmount = scale8
253+ let $t01268712940 = {
254+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
233255 if ($isInstanceOf(@, "(Int, Int, Int)"))
234256 then @
235257 else throw("Couldn't cast Any to (Int, Int, Int)")
236258 }
237- if (($t01169311945 == $t01169311945))
259+ if (($t01268712940 == $t01268712940))
238260 then {
239- let bonus = $t01169311945._3
240- let feeAmount = $t01169311945._2
241- let lpAmount = $t01169311945._1
242- let usdtAssetId = value(fromBase58String(value(getString(keyUsdtAssetId()))))
243- let $t01203412252 = {
261+ let bonus = $t01268712940._3
262+ let feeAmount = $t01268712940._2
263+ let lpAmount = $t01268712940._1
264+ let usdtAssetId = value(getString(keyUsdtAssetId()))
265+ let $t01300213220 = {
244266 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
245267 if ($isInstanceOf(@, "(Int, Int)"))
246268 then @
247269 else throw("Couldn't cast Any to (Int, Int)")
248270 }
249- if (($t01203412252 == $t01203412252))
271+ if (($t01300213220 == $t01300213220))
250272 then {
251- let getOneTknV2FeeAmount = $t01203412252._2
252- let usdtAmount = $t01203412252._1
253- let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssestAmount, scale8)
254- let endPeriodBlocksLeft = (valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), claimEnd) - height)
273+ let getOneTknV2FeeAmount = $t01300213220._2
274+ let usdtAmount = $t01300213220._1
275+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
276+ let endPeriodBlocksLeft = (periodEnd - height)
255277 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])
257279 else if ((claimedAssetId58 == idoAssetId58))
258- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, currentUsdtPriceAssetRatio, usdtPriceAssetAllowableRatio])
280+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
259281 else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
260282 }
261283 else throw("Strict value is not equal to itself.")
385407 if ((userAddress58 != callerAddress58))
386408 then throwErr("not authorized")
387409 else {
410+ let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
388411 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
389412 let totalsDiff = claimResultTuple._1
390413 let outAmount = claimResultTuple._2
392415 let origInvestArray = claimResultTuple._4
393416 let newClaimPeriodHeight = claimResultTuple._5
394417 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]
399428 let checks = [if (if ((totalUserAvailableToClaim > 0))
400429 then true
401430 else (periodAvailableIdoAmountToClaim > 0))
409438 then {
410439 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
411440 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)
413444 }
414445 else throw("Strict value is not equal to itself.")
415446 }
426457 let origInvestArray = claimResultTuple._4
427458 let newClaimPeriodHeight = claimResultTuple._5
428459 let availableToClaimArray = claimResultTuple._6
429- let availablePriceAmountToClaim = availableToClaimArray[1]
430- let availableIdoAmountToClaim = availableToClaimArray[2]
460+ let availableIdoAmountToClaim = availableToClaimArray[4]
461+ let availablePriceAmountToClaim = availableToClaimArray[5]
431462 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
432463 }
433464
442473 let origInvestArray = claimResultTuple._4
443474 let newClaimPeriodHeight = claimResultTuple._5
444475 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]
452486 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)
453487 $Tuple2(nil, resultString)
454488 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
55
66
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 let scale8 = 100000000
1212
1313 func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
1414
1515
1616 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1717 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1818 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1919 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2020 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2121 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
2222 }
2323
2424
2525 let IdxCfgIdoStart = 1
2626
2727 let IdxCfgIdoDuration = 2
2828
2929 let IdxCfgClaimStart = 3
3030
3131 let IdxCfgClaimDuration = 4
3232
3333 let IdxCfgPrice = 5
3434
3535 let IdxCfgPriceMult = 6
3636
3737 let IdxCfgIdoAssetId = 7
3838
3939 let IdxCfgIdoAssetMult = 8
4040
4141 let IdxCfgPriceAssetId = 9
4242
4343 let IdxCfgPriceAssetMult = 10
4444
4545 let IdxCfgMinInvestAmount = 11
4646
4747 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)
4848
4949
5050 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))
5151
5252
5353 let IdxInvTotalAmount = 1
5454
5555 let IdxInvRemainingAmount = 2
5656
5757 let IdxInvClaimedPriceAssetAmount = 3
5858
5959 let IdxInvClaimedIdoAssetAmount = 4
6060
6161 let IdxInvLastClaimedHeight = 5
6262
6363 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6464
6565
6666 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6767
6868
6969 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7070
7171
7272 func keyConfig () = "%s__config"
7373
7474
7575 func keyInvestor (userAddress) = ("%s__" + userAddress)
7676
7777
7878 func keyTotals () = "%s__totals"
7979
8080
8181 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
8282
8383
8484 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8585
8686
8787 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
8888
8989
9090 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9191
9292
93-func keyCurrnetPeriod () = makeString(["%s", "currentPeriod"], SEP)
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9494
9595
9696 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
9797
9898
9999 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100100
101101
102102 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103103
104104
105105 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106106
107107
108108 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109109
110110
111111 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112112
113113
114114 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115115
116116
117117 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118118
119119
120120 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121121
122122
123123 func keyManagerPublicKey () = "%s__managerPublicKey"
124124
125125
126126 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
127127
128128
129129 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
130130
131131
132132 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
133133
134134
135135 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
136136
137137
138138 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
139139
140140
141141 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
142142
143143
144144 let IdxDiffTotalIncrement = 0
145145
146146 let IdxDiffRemainingPriceAmountIncrement = 1
147147
148148 let IdxDiffClaimedPriceAmountIncrement = 2
149149
150150 let IdxDiffClaimedIdoAssetAmountIncrement = 3
151151
152152 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
153153 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
154154 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
155155 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
156156 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
157157 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
158158 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
159159 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
160160 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
161161 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
162162 if ((0 > newRemainingAmount))
163163 then throw("invalid math")
164164 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
165165 }
166166
167167
168168 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
169169
170170
171171 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
172172
173173
174174 func internalClaim (claimedAssetId58,userAddress,txId) = {
175175 let cfgArray = readConfigArray()
176176 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
177177 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
178178 let claimEnd = (claimStart + claimDuration)
179179 let price = parseIntValue(cfgArray[IdxCfgPrice])
180180 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
181181 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
182182 let idoAssetId = fromBase58String(idoAssetId58)
183183 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
184184 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
185185 let priceAssetId = fromBase58String(priceAssetId58)
186186 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
187187 let userAddress58 = toString(userAddress)
188188 let origInvestArray = readInvestorArrayOrFail(userAddress58)
189189 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
190190 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
191191 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
192192 then claimStart
193193 else investLastClaimedHeightTMP
194194 let newClaimPeriodHeight = if ((height > claimEnd))
195195 then claimEnd
196196 else if ((claimStart > height))
197197 then claimStart
198198 else height
199199 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
200200 let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration)
201201 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult)
202202 let isUSDN = (claimedAssetId58 == priceAssetId58)
203203 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
204204 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
205205 case end: Int =>
206206 (height > end)
207207 case _: Unit =>
208208 false
209209 case _ =>
210210 throw("Match error")
211211 }
212212 let checks = [if (!(if (isUSDN)
213213 then isUSDNClaimDisabled
214214 else false))
215215 then true
216216 else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
217217 then isUSDNClaimEnded
218218 else false))
219219 then true
220220 else throwErr("USDN claim is ended")]
221221 if ((checks == checks))
222222 then {
223223 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224224 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)
228250 let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
229251 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
230- let putOneTknV2PriceAssestAmount = scale8
231- let $t01169311945 = {
232- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssestAmount, priceAssetId], nil)
252+ let putOneTknV2PriceAssetAmount = scale8
253+ let $t01268712940 = {
254+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
233255 if ($isInstanceOf(@, "(Int, Int, Int)"))
234256 then @
235257 else throw("Couldn't cast Any to (Int, Int, Int)")
236258 }
237- if (($t01169311945 == $t01169311945))
259+ if (($t01268712940 == $t01268712940))
238260 then {
239- let bonus = $t01169311945._3
240- let feeAmount = $t01169311945._2
241- let lpAmount = $t01169311945._1
242- let usdtAssetId = value(fromBase58String(value(getString(keyUsdtAssetId()))))
243- let $t01203412252 = {
261+ let bonus = $t01268712940._3
262+ let feeAmount = $t01268712940._2
263+ let lpAmount = $t01268712940._1
264+ let usdtAssetId = value(getString(keyUsdtAssetId()))
265+ let $t01300213220 = {
244266 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
245267 if ($isInstanceOf(@, "(Int, Int)"))
246268 then @
247269 else throw("Couldn't cast Any to (Int, Int)")
248270 }
249- if (($t01203412252 == $t01203412252))
271+ if (($t01300213220 == $t01300213220))
250272 then {
251- let getOneTknV2FeeAmount = $t01203412252._2
252- let usdtAmount = $t01203412252._1
253- let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssestAmount, scale8)
254- let endPeriodBlocksLeft = (valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), claimEnd) - height)
273+ let getOneTknV2FeeAmount = $t01300213220._2
274+ let usdtAmount = $t01300213220._1
275+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
276+ let endPeriodBlocksLeft = (periodEnd - height)
255277 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])
257279 else if ((claimedAssetId58 == idoAssetId58))
258- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, currentUsdtPriceAssetRatio, usdtPriceAssetAllowableRatio])
280+ then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
259281 else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
260282 }
261283 else throw("Strict value is not equal to itself.")
262284 }
263285 else throw("Strict value is not equal to itself.")
264286 }
265287 else throw("Strict value is not equal to itself.")
266288 }
267289
268290
269291 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
270292 case s: String =>
271293 fromBase58String(s)
272294 case _: Unit =>
273295 unit
274296 case _ =>
275297 throw("Match error")
276298 }
277299
278300
279301 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
280302 case s: String =>
281303 fromBase58String(s)
282304 case _: Unit =>
283305 unit
284306 case _ =>
285307 throw("Match error")
286308 }
287309
288310
289311 func mustManager (i) = {
290312 let pd = throw("Permission denied")
291313 match managerPublicKeyOrUnit() {
292314 case pk: ByteVector =>
293315 if ((i.callerPublicKey == pk))
294316 then true
295317 else pd
296318 case _: Unit =>
297319 if ((i.caller == this))
298320 then true
299321 else pd
300322 case _ =>
301323 throw("Match error")
302324 }
303325 }
304326
305327
306328 @Callable(i)
307329 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
308330 let priceMult = ((100 * 1000) * 1000)
309331 let idoEnd = (idoStart + idoDuration)
310332 if (isDefined(getString(keyConfig())))
311333 then throw("already initialized")
312334 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
313335 then throw("not authorized")
314336 else if ((size(i.payments) != 1))
315337 then throw("exactly 1 payment must be attached")
316338 else if ((idoEnd >= claimStart))
317339 then throw("claimStart must be greater than idoEnd")
318340 else {
319341 let pmt = value(i.payments[0])
320342 let idoAssetId = value(pmt.assetId)
321343 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
322344 let idoAssetId58 = toBase58String(idoAssetId)
323345 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
324346 let priceAssetId = fromBase58String(priceAssetId58)
325347 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
326348 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
327349 let origTotalsArray = readTotalsArrayOrDefault()
328350 let totalsDiff = [0, 0, 0, 0]
329351 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
330352 }
331353 }
332354
333355
334356
335357 @Callable(i)
336358 func invest () = {
337359 let cfgArray = readConfigArray()
338360 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
339361 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
340362 let idoEnd = (idoStart + idoDuration)
341363 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
342364 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
343365 let price = parseIntValue(cfgArray[IdxCfgPrice])
344366 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
345367 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
346368 let idoAssetId = fromBase58String(idoAssetId58)
347369 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
348370 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
349371 let priceAssetId = fromBase58String(priceAssetId58)
350372 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
351373 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
352374 let userAddress = toString(i.caller)
353375 if ((idoStart > height))
354376 then throw("ido has not been started yet")
355377 else if ((height > idoEnd))
356378 then throw("ido has been already ended")
357379 else if ((size(i.payments) != 1))
358380 then throw("exactly 1 payment is expected")
359381 else {
360382 let pmt = value(i.payments[0])
361383 let pmtAssetId = value(pmt.assetId)
362384 let pmtAmount = pmt.amount
363385 if ((pmtAssetId != priceAssetId))
364386 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
365387 else {
366388 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
367389 let origTotalsArray = readTotalsArrayOrDefault()
368390 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
369391 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
370392 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
371393 then throw("IDO asset has been - sold consider to use smaller payment")
372394 else {
373395 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
374396 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
375397 }
376398 }
377399 }
378400 }
379401
380402
381403
382404 @Callable(i)
383405 func claim (claimedAssetId58,userAddress58) = {
384406 let callerAddress58 = toString(i.caller)
385407 if ((userAddress58 != callerAddress58))
386408 then throwErr("not authorized")
387409 else {
410+ let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
388411 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
389412 let totalsDiff = claimResultTuple._1
390413 let outAmount = claimResultTuple._2
391414 let outAssetId = claimResultTuple._3
392415 let origInvestArray = claimResultTuple._4
393416 let newClaimPeriodHeight = claimResultTuple._5
394417 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]
399428 let checks = [if (if ((totalUserAvailableToClaim > 0))
400429 then true
401430 else (periodAvailableIdoAmountToClaim > 0))
402431 then true
403432 else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0))
404433 then true
405434 else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0))
406435 then true
407436 else throwErr("unavailable to claim because total period allowance reached")]
408437 if ((checks == checks))
409438 then {
410439 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
411440 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)
413444 }
414445 else throw("Strict value is not equal to itself.")
415446 }
416447 }
417448
418449
419450
420451 @Callable(i)
421452 func claimREADONLY (claimedAssetId58,userAddress58) = {
422453 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
423454 let totalsDiff = claimResultTuple._1
424455 let outAmount = claimResultTuple._2
425456 let outAssetId = claimResultTuple._3
426457 let origInvestArray = claimResultTuple._4
427458 let newClaimPeriodHeight = claimResultTuple._5
428459 let availableToClaimArray = claimResultTuple._6
429- let availablePriceAmountToClaim = availableToClaimArray[1]
430- let availableIdoAmountToClaim = availableToClaimArray[2]
460+ let availableIdoAmountToClaim = availableToClaimArray[4]
461+ let availablePriceAmountToClaim = availableToClaimArray[5]
431462 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
432463 }
433464
434465
435466
436467 @Callable(i)
437468 func claimV2READONLY (claimedAssetId58,userAddress58) = {
438469 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
439470 let totalsDiff = claimResultTuple._1
440471 let outAmount = claimResultTuple._2
441472 let outAssetId = claimResultTuple._3
442473 let origInvestArray = claimResultTuple._4
443474 let newClaimPeriodHeight = claimResultTuple._5
444475 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]
452486 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)
453487 $Tuple2(nil, resultString)
454488 }
455489
456490
457491
458492 @Callable(i)
459493 func setManager (pendingManagerPublicKey) = {
460494 let checkCaller = mustManager(i)
461495 if ((checkCaller == checkCaller))
462496 then {
463497 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
464498 if ((checkManagerPublicKey == checkManagerPublicKey))
465499 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
466500 else throw("Strict value is not equal to itself.")
467501 }
468502 else throw("Strict value is not equal to itself.")
469503 }
470504
471505
472506
473507 @Callable(i)
474508 func confirmManager () = {
475509 let pm = pendingManagerPublicKeyOrUnit()
476510 let hasPM = if (isDefined(pm))
477511 then true
478512 else throw("No pending manager")
479513 if ((hasPM == hasPM))
480514 then {
481515 let checkPM = if ((i.callerPublicKey == value(pm)))
482516 then true
483517 else throw("You are not pending manager")
484518 if ((checkPM == checkPM))
485519 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
486520 else throw("Strict value is not equal to itself.")
487521 }
488522 else throw("Strict value is not equal to itself.")
489523 }
490524
491525
492526 @Verifier(tx)
493527 func verify () = {
494528 let targetPublicKey = match managerPublicKeyOrUnit() {
495529 case pk: ByteVector =>
496530 pk
497531 case _: Unit =>
498532 tx.senderPublicKey
499533 case _ =>
500534 throw("Match error")
501535 }
502536 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
503537 }
504538

github/deemru/w8io/026f985 
65.98 ms