tx · 4vLmzA5dArDonP97Q8CrgLKjRLYKYhAVEYn8T1ze1cNT

3MrfwTQPjiMpon8KZcJjatDLHbWNwVyadKE:  -0.02600000 Waves

2022.11.03 16:36 [2301002] smart account 3MrfwTQPjiMpon8KZcJjatDLHbWNwVyadKE > SELF 0.00000000 Waves

{ "type": 13, "id": "4vLmzA5dArDonP97Q8CrgLKjRLYKYhAVEYn8T1ze1cNT", "fee": 2600000, "feeAssetId": null, "timestamp": 1667482621397, "version": 1, "sender": "3MrfwTQPjiMpon8KZcJjatDLHbWNwVyadKE", "senderPublicKey": "6bj3L3GyaTejhux59f2iQkvXJZ9hAukkWN67hi3X8ND4", "proofs": [ "fkvYU4ZR5iJfViFVacgLNxQczwjf7YC577DC2usDyRCJ2xVvsZXB6wnki8pZ4x64KYZA3kf6otghiCvDrXZ5oNt" ], "script": "base64:AAIFAAAAAAAADtEIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFzc2V0TXVs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", "spentComplexity": 0 } View: original | compacted Prev: cdVWkGWzxLhzR8fdcwxzHUAB4KoBojtBRhz9HPVvV7g Next: 5cBxHbsytTubZBggMkSrKBi6qMdnd3oM9n3w4Goo3QTF Diff:
OldNewDifferences
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
10+
11+let scale8 = 100000000
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1015
1116 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1217 let bPriceAssetMULT = toBigInt(priceAssetMULT)
8085
8186
8287 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
88+
89+
90+func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
91+
92+
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
94+
95+
96+func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
97+
98+
99+func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100+
101+
102+func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103+
104+
105+func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106+
107+
108+func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109+
110+
111+func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112+
113+
114+func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115+
116+
117+func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118+
119+
120+func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121+
122+
123+func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
83124
84125
85126 func keyManagerPublicKey () = "%s__managerPublicKey"
163204 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
164205 let isUSDN = (claimedAssetId58 == priceAssetId58)
165206 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
166- let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
167- case end: Int =>
168- (height > end)
169- case _: Unit =>
170- false
171- case _ =>
172- throw("Match error")
173- }
174207 let checks = [if (!(if (isUSDN)
175208 then isUSDNClaimDisabled
176209 else false))
177210 then true
178- else throw("USDN claim is disabled"), if (!(if (isUSDN)
179- then isUSDNClaimEnded
180- else false))
181- then true
182- else throw("USDN claim is ended")]
211+ else throw("USDN claim is disabled")]
183212 if ((checks == checks))
184213 then if ((claimedAssetId58 == priceAssetId58))
185214 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
186215 else if ((claimedAssetId58 == idoAssetId58))
187216 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
188217 else throw(("unsupported assetId: " + claimedAssetId58))
218+ else throw("Strict value is not equal to itself.")
219+ }
220+
221+
222+func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
223+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225+ let periodLength = value(getInteger(keyPeriodLength()))
226+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227+ let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
228+ let $t01183513705 = if ((currentPeriod > 0))
229+ then {
230+ let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
231+ let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
232+ let $t01209512800 = if ((height > lastPeriodEndHeight))
233+ then {
234+ let updatedCurrentPeriod = (currentPeriod + 1)
235+ let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
236+ then {
237+ let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength)
238+ if ((blocksToLastPeriodStart == 0))
239+ then ((height - periodLength) + 1)
240+ else (height - blocksToLastPeriodStart)
241+ }
242+ else (lastPeriodEndHeight + 1)
243+ let periodEnd = ((periodStart + periodLength) - 1)
244+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
245+ }
246+ else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
247+ let updatedCurrentPeriod = $t01209512800._1
248+ let periodStart = $t01209512800._2
249+ let periodEnd = $t01209512800._3
250+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
251+ }
252+ else if (zeroPeriodEndHeighIsDefined)
253+ then {
254+ let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
255+ let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
256+ let $t01305513437 = if ((height > zeroPeriodEndHeight))
257+ then {
258+ let updatedCurrentPeriod = (currentPeriod + 1)
259+ let periodStart = (zeroPeriodEndHeight + 1)
260+ let periodEnd = ((periodStart + periodLength) - 1)
261+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
262+ }
263+ else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
264+ let updatedCurrentPeriod = $t01305513437._1
265+ let periodStart = $t01305513437._2
266+ let periodEnd = $t01305513437._3
267+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
268+ }
269+ else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
270+ let updatedCurrentPeriod = $t01183513705._1
271+ let periodStart = $t01183513705._2
272+ let periodEnd = $t01183513705._3
273+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
274+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
275+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
276+ let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
277+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
278+ let putOneTknV2PriceAssetAmount = scale8
279+ let $t01446014713 = {
280+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
281+ if ($isInstanceOf(@, "(Int, Int, Int)"))
282+ then @
283+ else throw("Couldn't cast Any to (Int, Int, Int)")
284+ }
285+ if (($t01446014713 == $t01446014713))
286+ then {
287+ let bonus = $t01446014713._3
288+ let feeAmount = $t01446014713._2
289+ let lpAmount = $t01446014713._1
290+ let usdtAssetId = value(getString(keyUsdtAssetId()))
291+ let $t01477514993 = {
292+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
293+ if ($isInstanceOf(@, "(Int, Int)"))
294+ then @
295+ else throw("Couldn't cast Any to (Int, Int)")
296+ }
297+ if (($t01477514993 == $t01477514993))
298+ then {
299+ let getOneTknV2FeeAmount = $t01477514993._2
300+ let usdtAmount = $t01477514993._1
301+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
302+ let endPeriodBlocksLeft = (periodEnd - height)
303+ $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
304+ }
305+ else throw("Strict value is not equal to itself.")
306+ }
189307 else throw("Strict value is not equal to itself.")
190308 }
191309
233351 let idoEnd = (idoStart + idoDuration)
234352 if (isDefined(getString(keyConfig())))
235353 then throw("already initialized")
236- else if (("3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP" != toString(i.caller)))
354+ else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
237355 then throw("not authorized")
238356 else if ((size(i.payments) != 1))
239357 then throw("exactly 1 payment must be attached")
309427 if ((userAddress58 != callerAddress58))
310428 then throw("not authorized")
311429 else {
430+ let cfgArray = readConfigArray()
431+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
312432 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
313433 let totalsDiff = claimResultTuple._1
314434 let outAmount = claimResultTuple._2
317437 let newClaimPeriodHeight = claimResultTuple._5
318438 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
319439 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
320- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
440+ let entries = if ((claimedAssetId58 == priceAssetId58))
441+ then {
442+ let $t02064921093 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
443+ let periodMinAvailableToClaim = $t02064921093._1
444+ let periodTotalAvailableToClaim = $t02064921093._2
445+ let periodUserAvailableToClaim = $t02064921093._3
446+ let totalUserAvailableToClaim = $t02064921093._4
447+ let usdtPriceAssetAllowableRatio = $t02064921093._5
448+ let currentUsdtPriceAssetRatio = $t02064921093._6
449+ let endPeriodBlocksLeft = $t02064921093._7
450+ let updatedCurrentPeriod = $t02064921093._8
451+ let periodStart = $t02064921093._9
452+ let periodEnd = $t02064921093._10
453+ let checks = [if ((periodUserAvailableToClaim > 0))
454+ then true
455+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
456+ then true
457+ else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0))
458+ then true
459+ else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
460+ then true
461+ else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
462+ if ((checks == checks))
463+ then {
464+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
465+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
466+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
467+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
468+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
469+ else {
470+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
471+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
472+ }
473+ $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)
474+ }
475+ else throw("Strict value is not equal to itself.")
476+ }
477+ else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
478+ entries
321479 }
322480 }
323481
335493 let availablePriceAmountToClaim = availableToClaimArray[0]
336494 let availableIdoAmountToClaim = availableToClaimArray[1]
337495 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
496+ }
497+
498+
499+
500+@Callable(i)
501+func claimV2READONLY (claimedAssetId58,userAddress58) = {
502+ let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
503+ let totalsDiff = claimResultTuple._1
504+ let outAmount = claimResultTuple._2
505+ let outAssetId = claimResultTuple._3
506+ let origInvestArray = claimResultTuple._4
507+ let newClaimPeriodHeight = claimResultTuple._5
508+ let availableToClaimArray = claimResultTuple._6
509+ let availablePriceAmountToClaim = availableToClaimArray[0]
510+ let availableIdoAmountToClaim = availableToClaimArray[1]
511+ let cfgArray = readConfigArray()
512+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
513+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
514+ let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance)
515+ let $t02712027532 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
516+ let periodMinAvailableToClaim = $t02712027532._1
517+ let periodTotalAvailableToClaim = $t02712027532._2
518+ let periodUserAvailableToClaim = $t02712027532._3
519+ let totalUserAvailableToClaim = $t02712027532._4
520+ let usdtPriceAssetAllowableRatio = $t02712027532._5
521+ let currentUsdtPriceAssetRatio = $t02712027532._6
522+ let endPeriodBlocksLeft = $t02712027532._7
523+ let updatedCurrentPeriod = $t02712027532._8
524+ let periodStart = $t02712027532._9
525+ let periodEnd = $t02712027532._10
526+ let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
527+ let resultString = if ((height > currentPeriodEndHeight))
528+ then {
529+ let periodLenght = value(getInteger(keyPeriodLength()))
530+ let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
531+ let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
532+ makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)
533+ }
534+ else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)
535+ $Tuple2(nil, resultString)
338536 }
339537
340538
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)
10+
11+let scale8 = 100000000
12+
13+func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14+
1015
1116 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1217 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1318 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1419 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
1520 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
1621 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
1722 }
1823
1924
2025 let IdxCfgIdoStart = 1
2126
2227 let IdxCfgIdoDuration = 2
2328
2429 let IdxCfgClaimStart = 3
2530
2631 let IdxCfgClaimDuration = 4
2732
2833 let IdxCfgPrice = 5
2934
3035 let IdxCfgPriceMult = 6
3136
3237 let IdxCfgIdoAssetId = 7
3338
3439 let IdxCfgIdoAssetMult = 8
3540
3641 let IdxCfgPriceAssetId = 9
3742
3843 let IdxCfgPriceAssetMult = 10
3944
4045 let IdxCfgMinInvestAmount = 11
4146
4247 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)
4348
4449
4550 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))
4651
4752
4853 let IdxInvTotalAmount = 1
4954
5055 let IdxInvRemainingAmount = 2
5156
5257 let IdxInvClaimedPriceAssetAmount = 3
5358
5459 let IdxInvClaimedIdoAssetAmount = 4
5560
5661 let IdxInvLastClaimedHeight = 5
5762
5863 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
5964
6065
6166 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6267
6368
6469 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
6570
6671
6772 func keyConfig () = "%s__config"
6873
6974
7075 func keyInvestor (userAddress) = ("%s__" + userAddress)
7176
7277
7378 func keyTotals () = "%s__totals"
7479
7580
7681 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
7782
7883
7984 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8085
8186
8287 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
88+
89+
90+func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
91+
92+
93+func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
94+
95+
96+func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
97+
98+
99+func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100+
101+
102+func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103+
104+
105+func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106+
107+
108+func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109+
110+
111+func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112+
113+
114+func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115+
116+
117+func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118+
119+
120+func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121+
122+
123+func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
83124
84125
85126 func keyManagerPublicKey () = "%s__managerPublicKey"
86127
87128
88129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
89130
90131
91132 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
92133
93134
94135 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
95136
96137
97138 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
98139
99140
100141 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
101142
102143
103144 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
104145
105146
106147 let IdxDiffTotalIncrement = 0
107148
108149 let IdxDiffRemainingPriceAmountIncrement = 1
109150
110151 let IdxDiffClaimedPriceAmountIncrement = 2
111152
112153 let IdxDiffClaimedIdoAssetAmountIncrement = 3
113154
114155 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
115156 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
116157 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
117158 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
118159 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
119160 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
120161 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
121162 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
122163 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
123164 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
124165 if ((0 > newRemainingAmount))
125166 then throw("invalid math")
126167 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
127168 }
128169
129170
130171 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
131172
132173
133174 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
134175
135176
136177 func internalClaim (claimedAssetId58,userAddress,txId) = {
137178 let cfgArray = readConfigArray()
138179 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
139180 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
140181 let claimEnd = (claimStart + claimDuration)
141182 let price = parseIntValue(cfgArray[IdxCfgPrice])
142183 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
143184 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
144185 let idoAssetId = fromBase58String(idoAssetId58)
145186 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
146187 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
147188 let priceAssetId = fromBase58String(priceAssetId58)
148189 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
149190 let userAddress58 = toString(userAddress)
150191 let origInvestArray = readInvestorArrayOrFail(userAddress58)
151192 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
152193 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
153194 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
154195 then claimStart
155196 else investLastClaimedHeightTMP
156197 let newClaimPeriodHeight = if ((height > claimEnd))
157198 then claimEnd
158199 else if ((claimStart > height))
159200 then claimStart
160201 else height
161202 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
162203 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
163204 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
164205 let isUSDN = (claimedAssetId58 == priceAssetId58)
165206 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
166- let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
167- case end: Int =>
168- (height > end)
169- case _: Unit =>
170- false
171- case _ =>
172- throw("Match error")
173- }
174207 let checks = [if (!(if (isUSDN)
175208 then isUSDNClaimDisabled
176209 else false))
177210 then true
178- else throw("USDN claim is disabled"), if (!(if (isUSDN)
179- then isUSDNClaimEnded
180- else false))
181- then true
182- else throw("USDN claim is ended")]
211+ else throw("USDN claim is disabled")]
183212 if ((checks == checks))
184213 then if ((claimedAssetId58 == priceAssetId58))
185214 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
186215 else if ((claimedAssetId58 == idoAssetId58))
187216 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
188217 else throw(("unsupported assetId: " + claimedAssetId58))
218+ else throw("Strict value is not equal to itself.")
219+ }
220+
221+
222+func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
223+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225+ let periodLength = value(getInteger(keyPeriodLength()))
226+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227+ let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
228+ let $t01183513705 = if ((currentPeriod > 0))
229+ then {
230+ let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
231+ let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
232+ let $t01209512800 = if ((height > lastPeriodEndHeight))
233+ then {
234+ let updatedCurrentPeriod = (currentPeriod + 1)
235+ let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
236+ then {
237+ let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength)
238+ if ((blocksToLastPeriodStart == 0))
239+ then ((height - periodLength) + 1)
240+ else (height - blocksToLastPeriodStart)
241+ }
242+ else (lastPeriodEndHeight + 1)
243+ let periodEnd = ((periodStart + periodLength) - 1)
244+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
245+ }
246+ else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
247+ let updatedCurrentPeriod = $t01209512800._1
248+ let periodStart = $t01209512800._2
249+ let periodEnd = $t01209512800._3
250+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
251+ }
252+ else if (zeroPeriodEndHeighIsDefined)
253+ then {
254+ let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
255+ let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
256+ let $t01305513437 = if ((height > zeroPeriodEndHeight))
257+ then {
258+ let updatedCurrentPeriod = (currentPeriod + 1)
259+ let periodStart = (zeroPeriodEndHeight + 1)
260+ let periodEnd = ((periodStart + periodLength) - 1)
261+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
262+ }
263+ else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
264+ let updatedCurrentPeriod = $t01305513437._1
265+ let periodStart = $t01305513437._2
266+ let periodEnd = $t01305513437._3
267+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
268+ }
269+ else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
270+ let updatedCurrentPeriod = $t01183513705._1
271+ let periodStart = $t01183513705._2
272+ let periodEnd = $t01183513705._3
273+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
274+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
275+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
276+ let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
277+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
278+ let putOneTknV2PriceAssetAmount = scale8
279+ let $t01446014713 = {
280+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
281+ if ($isInstanceOf(@, "(Int, Int, Int)"))
282+ then @
283+ else throw("Couldn't cast Any to (Int, Int, Int)")
284+ }
285+ if (($t01446014713 == $t01446014713))
286+ then {
287+ let bonus = $t01446014713._3
288+ let feeAmount = $t01446014713._2
289+ let lpAmount = $t01446014713._1
290+ let usdtAssetId = value(getString(keyUsdtAssetId()))
291+ let $t01477514993 = {
292+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
293+ if ($isInstanceOf(@, "(Int, Int)"))
294+ then @
295+ else throw("Couldn't cast Any to (Int, Int)")
296+ }
297+ if (($t01477514993 == $t01477514993))
298+ then {
299+ let getOneTknV2FeeAmount = $t01477514993._2
300+ let usdtAmount = $t01477514993._1
301+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
302+ let endPeriodBlocksLeft = (periodEnd - height)
303+ $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
304+ }
305+ else throw("Strict value is not equal to itself.")
306+ }
189307 else throw("Strict value is not equal to itself.")
190308 }
191309
192310
193311 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
194312 case s: String =>
195313 fromBase58String(s)
196314 case _: Unit =>
197315 unit
198316 case _ =>
199317 throw("Match error")
200318 }
201319
202320
203321 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
204322 case s: String =>
205323 fromBase58String(s)
206324 case _: Unit =>
207325 unit
208326 case _ =>
209327 throw("Match error")
210328 }
211329
212330
213331 func mustManager (i) = {
214332 let pd = throw("Permission denied")
215333 match managerPublicKeyOrUnit() {
216334 case pk: ByteVector =>
217335 if ((i.callerPublicKey == pk))
218336 then true
219337 else pd
220338 case _: Unit =>
221339 if ((i.caller == this))
222340 then true
223341 else pd
224342 case _ =>
225343 throw("Match error")
226344 }
227345 }
228346
229347
230348 @Callable(i)
231349 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
232350 let priceMult = ((100 * 1000) * 1000)
233351 let idoEnd = (idoStart + idoDuration)
234352 if (isDefined(getString(keyConfig())))
235353 then throw("already initialized")
236- else if (("3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP" != toString(i.caller)))
354+ else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
237355 then throw("not authorized")
238356 else if ((size(i.payments) != 1))
239357 then throw("exactly 1 payment must be attached")
240358 else if ((idoEnd >= claimStart))
241359 then throw("claimStart must be greater than idoEnd")
242360 else {
243361 let pmt = value(i.payments[0])
244362 let idoAssetId = value(pmt.assetId)
245363 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
246364 let idoAssetId58 = toBase58String(idoAssetId)
247365 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
248366 let priceAssetId = fromBase58String(priceAssetId58)
249367 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
250368 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
251369 let origTotalsArray = readTotalsArrayOrDefault()
252370 let totalsDiff = [0, 0, 0, 0]
253371 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
254372 }
255373 }
256374
257375
258376
259377 @Callable(i)
260378 func invest () = {
261379 let cfgArray = readConfigArray()
262380 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
263381 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
264382 let idoEnd = (idoStart + idoDuration)
265383 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
266384 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
267385 let price = parseIntValue(cfgArray[IdxCfgPrice])
268386 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
269387 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
270388 let idoAssetId = fromBase58String(idoAssetId58)
271389 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
272390 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
273391 let priceAssetId = fromBase58String(priceAssetId58)
274392 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
275393 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
276394 let userAddress = toString(i.caller)
277395 if ((idoStart > height))
278396 then throw("ido has not been started yet")
279397 else if ((height > idoEnd))
280398 then throw("ido has been already ended")
281399 else if ((size(i.payments) != 1))
282400 then throw("exactly 1 payment is expected")
283401 else {
284402 let pmt = value(i.payments[0])
285403 let pmtAssetId = value(pmt.assetId)
286404 let pmtAmount = pmt.amount
287405 if ((pmtAssetId != priceAssetId))
288406 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
289407 else {
290408 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
291409 let origTotalsArray = readTotalsArrayOrDefault()
292410 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
293411 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
294412 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
295413 then throw("IDO asset has been - sold consider to use smaller payment")
296414 else {
297415 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
298416 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
299417 }
300418 }
301419 }
302420 }
303421
304422
305423
306424 @Callable(i)
307425 func claim (claimedAssetId58,userAddress58) = {
308426 let callerAddress58 = toString(i.caller)
309427 if ((userAddress58 != callerAddress58))
310428 then throw("not authorized")
311429 else {
430+ let cfgArray = readConfigArray()
431+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
312432 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
313433 let totalsDiff = claimResultTuple._1
314434 let outAmount = claimResultTuple._2
315435 let outAssetId = claimResultTuple._3
316436 let origInvestArray = claimResultTuple._4
317437 let newClaimPeriodHeight = claimResultTuple._5
318438 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
319439 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
320- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
440+ let entries = if ((claimedAssetId58 == priceAssetId58))
441+ then {
442+ let $t02064921093 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
443+ let periodMinAvailableToClaim = $t02064921093._1
444+ let periodTotalAvailableToClaim = $t02064921093._2
445+ let periodUserAvailableToClaim = $t02064921093._3
446+ let totalUserAvailableToClaim = $t02064921093._4
447+ let usdtPriceAssetAllowableRatio = $t02064921093._5
448+ let currentUsdtPriceAssetRatio = $t02064921093._6
449+ let endPeriodBlocksLeft = $t02064921093._7
450+ let updatedCurrentPeriod = $t02064921093._8
451+ let periodStart = $t02064921093._9
452+ let periodEnd = $t02064921093._10
453+ let checks = [if ((periodUserAvailableToClaim > 0))
454+ then true
455+ else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
456+ then true
457+ else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0))
458+ then true
459+ else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
460+ then true
461+ else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
462+ if ((checks == checks))
463+ then {
464+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
465+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
466+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
467+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
468+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
469+ else {
470+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
471+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
472+ }
473+ $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)
474+ }
475+ else throw("Strict value is not equal to itself.")
476+ }
477+ else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
478+ entries
321479 }
322480 }
323481
324482
325483
326484 @Callable(i)
327485 func claimREADONLY (claimedAssetId58,userAddress58) = {
328486 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
329487 let totalsDiff = claimResultTuple._1
330488 let outAmount = claimResultTuple._2
331489 let outAssetId = claimResultTuple._3
332490 let origInvestArray = claimResultTuple._4
333491 let newClaimPeriodHeight = claimResultTuple._5
334492 let availableToClaimArray = claimResultTuple._6
335493 let availablePriceAmountToClaim = availableToClaimArray[0]
336494 let availableIdoAmountToClaim = availableToClaimArray[1]
337495 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
496+ }
497+
498+
499+
500+@Callable(i)
501+func claimV2READONLY (claimedAssetId58,userAddress58) = {
502+ let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
503+ let totalsDiff = claimResultTuple._1
504+ let outAmount = claimResultTuple._2
505+ let outAssetId = claimResultTuple._3
506+ let origInvestArray = claimResultTuple._4
507+ let newClaimPeriodHeight = claimResultTuple._5
508+ let availableToClaimArray = claimResultTuple._6
509+ let availablePriceAmountToClaim = availableToClaimArray[0]
510+ let availableIdoAmountToClaim = availableToClaimArray[1]
511+ let cfgArray = readConfigArray()
512+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
513+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
514+ let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance)
515+ let $t02712027532 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
516+ let periodMinAvailableToClaim = $t02712027532._1
517+ let periodTotalAvailableToClaim = $t02712027532._2
518+ let periodUserAvailableToClaim = $t02712027532._3
519+ let totalUserAvailableToClaim = $t02712027532._4
520+ let usdtPriceAssetAllowableRatio = $t02712027532._5
521+ let currentUsdtPriceAssetRatio = $t02712027532._6
522+ let endPeriodBlocksLeft = $t02712027532._7
523+ let updatedCurrentPeriod = $t02712027532._8
524+ let periodStart = $t02712027532._9
525+ let periodEnd = $t02712027532._10
526+ let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
527+ let resultString = if ((height > currentPeriodEndHeight))
528+ then {
529+ let periodLenght = value(getInteger(keyPeriodLength()))
530+ let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
531+ let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
532+ makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)
533+ }
534+ else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)
535+ $Tuple2(nil, resultString)
338536 }
339537
340538
341539
342540 @Callable(i)
343541 func setManager (pendingManagerPublicKey) = {
344542 let checkCaller = mustManager(i)
345543 if ((checkCaller == checkCaller))
346544 then {
347545 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
348546 if ((checkManagerPublicKey == checkManagerPublicKey))
349547 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
350548 else throw("Strict value is not equal to itself.")
351549 }
352550 else throw("Strict value is not equal to itself.")
353551 }
354552
355553
356554
357555 @Callable(i)
358556 func confirmManager () = {
359557 let pm = pendingManagerPublicKeyOrUnit()
360558 let hasPM = if (isDefined(pm))
361559 then true
362560 else throw("No pending manager")
363561 if ((hasPM == hasPM))
364562 then {
365563 let checkPM = if ((i.callerPublicKey == value(pm)))
366564 then true
367565 else throw("You are not pending manager")
368566 if ((checkPM == checkPM))
369567 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
370568 else throw("Strict value is not equal to itself.")
371569 }
372570 else throw("Strict value is not equal to itself.")
373571 }
374572
375573
376574 @Verifier(tx)
377575 func verify () = {
378576 let targetPublicKey = match managerPublicKeyOrUnit() {
379577 case pk: ByteVector =>
380578 pk
381579 case _: Unit =>
382580 tx.senderPublicKey
383581 case _ =>
384582 throw("Match error")
385583 }
386584 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
387585 }
388586

github/deemru/w8io/026f985 
57.43 ms