tx · 9Nqkn9ZExoXmkirPixdcQu6XRKRtFKVJj1Jt2rzsirsp

3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp:  -0.02700000 Waves

2022.12.05 09:29 [2346704] smart account 3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp > SELF 0.00000000 Waves

{ "type": 13, "id": "9Nqkn9ZExoXmkirPixdcQu6XRKRtFKVJj1Jt2rzsirsp", "fee": 2700000, "feeAssetId": null, "timestamp": 1670221781031, "version": 1, "sender": "3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp", "senderPublicKey": "bS6Cchmk25EdDcapkz8W5WkZgthTHHW6sSBbcidSrCb", "proofs": [ "2oDcfyHrkUc6Nnpkyr7F1TU99NhCCVZjgKiPByzg33vQEckKiNdc8PkBMEZEUZoUh38EXMTcEx9dBgpfnbHB3HBL" ], "script": "base64:AAIFAAAAAAAAD0QIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFz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Y29uZmlybU1hbmFnZXIAAAAABAAAAAJjVgkBAAAAAmNmAAAAAAQAAAACY1cDCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAACY1YGCQAAAgAAAAECAAAAEk5vIHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACY1cFAAAAAmNXBAAAAAJjWAMJAAAAAAAAAggFAAAAAmNoAAAAD2NhbGxlclB1YmxpY0tleQkBAAAABXZhbHVlAAAAAQUAAAACY1YGCQAAAgAAAAECAAAAG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAAAAAAAAgUAAAACY1gFAAAAAmNYCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAJhQgAAAAAJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQUAAAACY1YJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAAAmFDAAAAAAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4AAAABAAAAAmNZAQAAAAJjWgAAAAAEAAAAAmRhBAAAAAJjZAkBAAAAAmNjAAAAAAMJAAABAAAAAgUAAAACY2QCAAAACkJ5dGVWZWN0b3IEAAAAAmNqBQAAAAJjZAUAAAACY2oDCQAAAQAAAAIFAAAAAmNkAgAAAARVbml0CAUAAAACY1kAAAAPc2VuZGVyUHVibGljS2V5CQAAAgAAAAECAAAAC01hdGNoIGVycm9yCQAB9AAAAAMIBQAAAAJjWQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmNZAAAABnByb29mcwAAAAAAAAAAAAUAAAACZGFs7YUH", "chainId": 84, "height": 2346704, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FUwBGt91eaTzwrgxUkcWTd8iuxQBXJRNxDR58JGuire9 Next: HNAZjp4N6gzhHXAGGALQMBHMmVB7DdPFK7Wkkc7pC3En Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
1111 let scale8 = 100000000
1212
1313 func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14-
15-
16-func asString (val) = match val {
17- case valStr: String =>
18- valStr
19- case _ =>
20- throw("fail to cast into String")
21-}
2214
2315
2416 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
131123 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
132124
133125
134-func keyInvestorRemainingAmount (address) = makeString(["%s%s", "investorRemainingAmount", address], SEP)
135-
136-
137-func keyTotalRemainingAmount () = makeString(["%s", "totalRemainingAmount"], SEP)
138-
139-
140126 func keyManagerPublicKey () = "%s__managerPublicKey"
141127
142128
180166 let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
181167 let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance)
182168 let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals)
183- let entries = if ((0 > newRemainingAmount))
184- then {
185- let diff = ((newTotalAmount - newClaimedPriceAssetAmount) - newClaimedIdoAssetAmount)
186- let newLogicRemainingAmount = if ((0 > diff))
187- then 0
188- else diff
189- StringEntry(key, formatInvestor(newTotalAmount, newLogicRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
190- }
169+ if ((0 > newRemainingAmount))
170+ then throwErr(makeString(["invalid math", toString(remainingAmount), toString(incrementDiff[IdxDiffRemainingPriceAmountIncrement]), toString(newRemainingAmount), toString(incrementDiff[IdxDiffTotalIncrement])], " "))
191171 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
192- entries
193172 }
194173
195174
250229 let periodLength = value(getInteger(keyPeriodLength()))
251230 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
252231 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
253- let $t01298714857 = if ((currentPeriod > 0))
232+ let $t01248214352 = if ((currentPeriod > 0))
254233 then {
255234 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
256235 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
257- let $t01324713952 = if ((height > lastPeriodEndHeight))
236+ let $t01274213447 = if ((height > lastPeriodEndHeight))
258237 then {
259238 let updatedCurrentPeriod = (currentPeriod + 1)
260239 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
269248 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
270249 }
271250 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
272- let updatedCurrentPeriod = $t01324713952._1
273- let periodStart = $t01324713952._2
274- let periodEnd = $t01324713952._3
251+ let updatedCurrentPeriod = $t01274213447._1
252+ let periodStart = $t01274213447._2
253+ let periodEnd = $t01274213447._3
275254 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
276255 }
277256 else if (zeroPeriodEndHeighIsDefined)
278257 then {
279258 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
280259 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
281- let $t01420714589 = if ((height > zeroPeriodEndHeight))
260+ let $t01370214084 = if ((height > zeroPeriodEndHeight))
282261 then {
283262 let updatedCurrentPeriod = (currentPeriod + 1)
284263 let periodStart = (zeroPeriodEndHeight + 1)
286265 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
287266 }
288267 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
289- let updatedCurrentPeriod = $t01420714589._1
290- let periodStart = $t01420714589._2
291- let periodEnd = $t01420714589._3
268+ let updatedCurrentPeriod = $t01370214084._1
269+ let periodStart = $t01370214084._2
270+ let periodEnd = $t01370214084._3
292271 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
293272 }
294273 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
295- let updatedCurrentPeriod = $t01298714857._1
296- let periodStart = $t01298714857._2
297- let periodEnd = $t01298714857._3
274+ let updatedCurrentPeriod = $t01248214352._1
275+ let periodStart = $t01248214352._2
276+ let periodEnd = $t01248214352._3
298277 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
299278 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
300279 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
301280 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
302281 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
303282 let putOneTknV2PriceAssetAmount = scale8
304- let $t01561215865 = {
283+ let $t01510715360 = {
305284 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
306285 if ($isInstanceOf(@, "(Int, Int, Int)"))
307286 then @
308- else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
287+ else throw("Couldn't cast Any to (Int, Int, Int)")
309288 }
310- if (($t01561215865 == $t01561215865))
289+ if (($t01510715360 == $t01510715360))
311290 then {
312- let bonus = $t01561215865._3
313- let feeAmount = $t01561215865._2
314- let lpAmount = $t01561215865._1
291+ let bonus = $t01510715360._3
292+ let feeAmount = $t01510715360._2
293+ let lpAmount = $t01510715360._1
315294 let usdtAssetId = value(getString(keyUsdtAssetId()))
316- let $t01592716145 = {
295+ let $t01542215640 = {
317296 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
318297 if ($isInstanceOf(@, "(Int, Int)"))
319298 then @
320- else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
299+ else throw("Couldn't cast Any to (Int, Int)")
321300 }
322- if (($t01592716145 == $t01592716145))
301+ if (($t01542215640 == $t01542215640))
323302 then {
324- let getOneTknV2FeeAmount = $t01592716145._2
325- let usdtAmount = $t01592716145._1
303+ let getOneTknV2FeeAmount = $t01542215640._2
304+ let usdtAmount = $t01542215640._1
326305 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
327306 let endPeriodBlocksLeft = (periodEnd - height)
328307 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
466445 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
467446 let entries = if ((claimedAssetId58 == priceAssetId58))
468447 then {
469- let $t02205422498 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
470- let periodMinAvailableToClaim = $t02205422498._1
471- let periodTotalAvailableToClaim = $t02205422498._2
472- let periodUserAvailableToClaim = $t02205422498._3
473- let totalUserAvailableToClaim = $t02205422498._4
474- let usdtPriceAssetAllowableRatio = $t02205422498._5
475- let currentUsdtPriceAssetRatio = $t02205422498._6
476- let endPeriodBlocksLeft = $t02205422498._7
477- let updatedCurrentPeriod = $t02205422498._8
478- let periodStart = $t02205422498._9
479- let periodEnd = $t02205422498._10
448+ let $t02154921993 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
449+ let periodMinAvailableToClaim = $t02154921993._1
450+ let periodTotalAvailableToClaim = $t02154921993._2
451+ let periodUserAvailableToClaim = $t02154921993._3
452+ let totalUserAvailableToClaim = $t02154921993._4
453+ let usdtPriceAssetAllowableRatio = $t02154921993._5
454+ let currentUsdtPriceAssetRatio = $t02154921993._6
455+ let endPeriodBlocksLeft = $t02154921993._7
456+ let updatedCurrentPeriod = $t02154921993._8
457+ let periodStart = $t02154921993._9
458+ let periodEnd = $t02154921993._10
480459 let checks = [if ((periodUserAvailableToClaim > 0))
481460 then true
482461 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
490469 then {
491470 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
492471 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
493- let entries = if ((priceAssetBalance > periodMinAvailableToClaim))
472+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
494473 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
495474 else {
496- let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
497- if ((evaluateResult == evaluateResult))
498- then {
499- let availablePriceAmountToClaim = parseIntValue(evaluateResult[3])
500- let lastClaimEntries = if ((availablePriceAmountToClaim == periodMinAvailableToClaim))
501- then {
502- let investorTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
503- let investorRemainingAmount = parseIntValue(origInvestArray[IdxInvRemainingAmount])
504- let investorPriceAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedPriceAssetAmount])
505- let investorIdoAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedIdoAssetAmount])
506- let investorLastClaimedHeight = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
507- let newInvestArray = [toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)]
508- let totals = readTotalsArrayOrDefault()
509- let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
510- let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
511- let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvRemainingAmount])
512- let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
513- let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
514- let newTotalsRemainingAmount = (totalsRemainingAmount - investorRemainingAmount)
515- let newTotalArray = [toString(totalsTotalAmount), toString(newTotalsRemainingAmount), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)]
516- let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
517-[StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), TotalsEntry(keyInvestor(userAddress58), newInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), newTotalArray, totalsDiff, newClaimPeriodHeight, 0)]
518- }
519- else [TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0)]
520- let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
521- ([ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] ++ lastClaimEntries)
522- }
523- else throw("Strict value is not equal to itself.")
475+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
476+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
524477 }
525478 $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)
526479 }
568521 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
569522 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
570523 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
571- let $t03128231694 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
572- let periodMinAvailableToClaim = $t03128231694._1
573- let periodTotalAvailableToClaim = $t03128231694._2
574- let periodUserAvailableToClaim = $t03128231694._3
575- let totalUserAvailableToClaim = $t03128231694._4
576- let usdtPriceAssetAllowableRatio = $t03128231694._5
577- let currentUsdtPriceAssetRatio = $t03128231694._6
578- let endPeriodBlocksLeft = $t03128231694._7
579- let updatedCurrentPeriod = $t03128231694._8
580- let periodStart = $t03128231694._9
581- let periodEnd = $t03128231694._10
524+ let $t02828628698 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
525+ let periodMinAvailableToClaim = $t02828628698._1
526+ let periodTotalAvailableToClaim = $t02828628698._2
527+ let periodUserAvailableToClaim = $t02828628698._3
528+ let totalUserAvailableToClaim = $t02828628698._4
529+ let usdtPriceAssetAllowableRatio = $t02828628698._5
530+ let currentUsdtPriceAssetRatio = $t02828628698._6
531+ let endPeriodBlocksLeft = $t02828628698._7
532+ let updatedCurrentPeriod = $t02828628698._8
533+ let periodStart = $t02828628698._9
534+ let periodEnd = $t02828628698._10
582535 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
583536 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
584537 let resultString = if ((height > currentPeriodEndHeight))
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# 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], " "))
14-
15-
16-func asString (val) = match val {
17- case valStr: String =>
18- valStr
19- case _ =>
20- throw("fail to cast into String")
21-}
2214
2315
2416 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
2517 let bPriceAssetMULT = toBigInt(priceAssetMULT)
2618 let bIdoAssetMULT = toBigInt(idoAssetMULT)
2719 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2820 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2921 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
3022 }
3123
3224
3325 let IdxCfgIdoStart = 1
3426
3527 let IdxCfgIdoDuration = 2
3628
3729 let IdxCfgClaimStart = 3
3830
3931 let IdxCfgClaimDuration = 4
4032
4133 let IdxCfgPrice = 5
4234
4335 let IdxCfgPriceMult = 6
4436
4537 let IdxCfgIdoAssetId = 7
4638
4739 let IdxCfgIdoAssetMult = 8
4840
4941 let IdxCfgPriceAssetId = 9
5042
5143 let IdxCfgPriceAssetMult = 10
5244
5345 let IdxCfgMinInvestAmount = 11
5446
5547 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)
5648
5749
5850 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))
5951
6052
6153 let IdxInvTotalAmount = 1
6254
6355 let IdxInvRemainingAmount = 2
6456
6557 let IdxInvClaimedPriceAssetAmount = 3
6658
6759 let IdxInvClaimedIdoAssetAmount = 4
6860
6961 let IdxInvLastClaimedHeight = 5
7062
7163 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
7264
7365
7466 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
7567
7668
7769 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7870
7971
8072 func keyConfig () = "%s__config"
8173
8274
8375 func keyInvestor (userAddress) = ("%s__" + userAddress)
8476
8577
8678 func keyTotals () = "%s__totals"
8779
8880
8981 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
9082
9183
9284 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
9385
9486
9587 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
9688
9789
9890 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9991
10092
10193 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
10294
10395
10496 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
10597
10698
10799 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
108100
109101
110102 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
111103
112104
113105 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
114106
115107
116108 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
117109
118110
119111 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
120112
121113
122114 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
123115
124116
125117 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
126118
127119
128120 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
129121
130122
131123 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
132124
133125
134-func keyInvestorRemainingAmount (address) = makeString(["%s%s", "investorRemainingAmount", address], SEP)
135-
136-
137-func keyTotalRemainingAmount () = makeString(["%s", "totalRemainingAmount"], SEP)
138-
139-
140126 func keyManagerPublicKey () = "%s__managerPublicKey"
141127
142128
143129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
144130
145131
146132 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
147133
148134
149135 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
150136
151137
152138 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
153139
154140
155141 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
156142
157143
158144 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
159145
160146
161147 let IdxDiffTotalIncrement = 0
162148
163149 let IdxDiffRemainingPriceAmountIncrement = 1
164150
165151 let IdxDiffClaimedPriceAmountIncrement = 2
166152
167153 let IdxDiffClaimedIdoAssetAmountIncrement = 3
168154
169155 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight,priceAssetBalance) = {
170156 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
171157 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
172158 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
173159 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
174160 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
175161 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
176162 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
177163 let cfgArray = readConfigArray()
178164 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
179165 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
180166 let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
181167 let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance)
182168 let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals)
183- let entries = if ((0 > newRemainingAmount))
184- then {
185- let diff = ((newTotalAmount - newClaimedPriceAssetAmount) - newClaimedIdoAssetAmount)
186- let newLogicRemainingAmount = if ((0 > diff))
187- then 0
188- else diff
189- StringEntry(key, formatInvestor(newTotalAmount, newLogicRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
190- }
169+ if ((0 > newRemainingAmount))
170+ then throwErr(makeString(["invalid math", toString(remainingAmount), toString(incrementDiff[IdxDiffRemainingPriceAmountIncrement]), toString(newRemainingAmount), toString(incrementDiff[IdxDiffTotalIncrement])], " "))
191171 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
192- entries
193172 }
194173
195174
196175 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
197176
198177
199178 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
200179
201180
202181 func internalClaim (claimedAssetId58,userAddress,txId) = {
203182 let cfgArray = readConfigArray()
204183 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
205184 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
206185 let claimEnd = (claimStart + claimDuration)
207186 let price = parseIntValue(cfgArray[IdxCfgPrice])
208187 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
209188 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
210189 let idoAssetId = fromBase58String(idoAssetId58)
211190 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
212191 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
213192 let priceAssetId = fromBase58String(priceAssetId58)
214193 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
215194 let userAddress58 = toString(userAddress)
216195 let origInvestArray = readInvestorArrayOrFail(userAddress58)
217196 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
218197 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
219198 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
220199 then claimStart
221200 else investLastClaimedHeightTMP
222201 let newClaimPeriodHeight = if ((height > claimEnd))
223202 then claimEnd
224203 else if ((claimStart > height))
225204 then claimStart
226205 else height
227206 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
228207 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
229208 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
230209 let isUSDN = (claimedAssetId58 == priceAssetId58)
231210 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
232211 let checks = [if (!(if (isUSDN)
233212 then isUSDNClaimDisabled
234213 else false))
235214 then true
236215 else throw("USDN claim is disabled")]
237216 if ((checks == checks))
238217 then if ((claimedAssetId58 == priceAssetId58))
239218 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
240219 else if ((claimedAssetId58 == idoAssetId58))
241220 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
242221 else throw(("unsupported assetId: " + claimedAssetId58))
243222 else throw("Strict value is not equal to itself.")
244223 }
245224
246225
247226 func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
248227 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
249228 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
250229 let periodLength = value(getInteger(keyPeriodLength()))
251230 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
252231 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
253- let $t01298714857 = if ((currentPeriod > 0))
232+ let $t01248214352 = if ((currentPeriod > 0))
254233 then {
255234 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
256235 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
257- let $t01324713952 = if ((height > lastPeriodEndHeight))
236+ let $t01274213447 = if ((height > lastPeriodEndHeight))
258237 then {
259238 let updatedCurrentPeriod = (currentPeriod + 1)
260239 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
261240 then {
262241 let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength)
263242 if ((blocksToLastPeriodStart == 0))
264243 then ((height - periodLength) + 1)
265244 else (height - blocksToLastPeriodStart)
266245 }
267246 else (lastPeriodEndHeight + 1)
268247 let periodEnd = ((periodStart + periodLength) - 1)
269248 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
270249 }
271250 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
272- let updatedCurrentPeriod = $t01324713952._1
273- let periodStart = $t01324713952._2
274- let periodEnd = $t01324713952._3
251+ let updatedCurrentPeriod = $t01274213447._1
252+ let periodStart = $t01274213447._2
253+ let periodEnd = $t01274213447._3
275254 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
276255 }
277256 else if (zeroPeriodEndHeighIsDefined)
278257 then {
279258 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
280259 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
281- let $t01420714589 = if ((height > zeroPeriodEndHeight))
260+ let $t01370214084 = if ((height > zeroPeriodEndHeight))
282261 then {
283262 let updatedCurrentPeriod = (currentPeriod + 1)
284263 let periodStart = (zeroPeriodEndHeight + 1)
285264 let periodEnd = ((periodStart + periodLength) - 1)
286265 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
287266 }
288267 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
289- let updatedCurrentPeriod = $t01420714589._1
290- let periodStart = $t01420714589._2
291- let periodEnd = $t01420714589._3
268+ let updatedCurrentPeriod = $t01370214084._1
269+ let periodStart = $t01370214084._2
270+ let periodEnd = $t01370214084._3
292271 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
293272 }
294273 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
295- let updatedCurrentPeriod = $t01298714857._1
296- let periodStart = $t01298714857._2
297- let periodEnd = $t01298714857._3
274+ let updatedCurrentPeriod = $t01248214352._1
275+ let periodStart = $t01248214352._2
276+ let periodEnd = $t01248214352._3
298277 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
299278 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
300279 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
301280 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
302281 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
303282 let putOneTknV2PriceAssetAmount = scale8
304- let $t01561215865 = {
283+ let $t01510715360 = {
305284 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
306285 if ($isInstanceOf(@, "(Int, Int, Int)"))
307286 then @
308- else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
287+ else throw("Couldn't cast Any to (Int, Int, Int)")
309288 }
310- if (($t01561215865 == $t01561215865))
289+ if (($t01510715360 == $t01510715360))
311290 then {
312- let bonus = $t01561215865._3
313- let feeAmount = $t01561215865._2
314- let lpAmount = $t01561215865._1
291+ let bonus = $t01510715360._3
292+ let feeAmount = $t01510715360._2
293+ let lpAmount = $t01510715360._1
315294 let usdtAssetId = value(getString(keyUsdtAssetId()))
316- let $t01592716145 = {
295+ let $t01542215640 = {
317296 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
318297 if ($isInstanceOf(@, "(Int, Int)"))
319298 then @
320- else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
299+ else throw("Couldn't cast Any to (Int, Int)")
321300 }
322- if (($t01592716145 == $t01592716145))
301+ if (($t01542215640 == $t01542215640))
323302 then {
324- let getOneTknV2FeeAmount = $t01592716145._2
325- let usdtAmount = $t01592716145._1
303+ let getOneTknV2FeeAmount = $t01542215640._2
304+ let usdtAmount = $t01542215640._1
326305 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
327306 let endPeriodBlocksLeft = (periodEnd - height)
328307 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
329308 }
330309 else throw("Strict value is not equal to itself.")
331310 }
332311 else throw("Strict value is not equal to itself.")
333312 }
334313
335314
336315 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
337316 case s: String =>
338317 fromBase58String(s)
339318 case _: Unit =>
340319 unit
341320 case _ =>
342321 throw("Match error")
343322 }
344323
345324
346325 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
347326 case s: String =>
348327 fromBase58String(s)
349328 case _: Unit =>
350329 unit
351330 case _ =>
352331 throw("Match error")
353332 }
354333
355334
356335 func mustManager (i) = {
357336 let pd = throw("Permission denied")
358337 match managerPublicKeyOrUnit() {
359338 case pk: ByteVector =>
360339 if ((i.callerPublicKey == pk))
361340 then true
362341 else pd
363342 case _: Unit =>
364343 if ((i.caller == this))
365344 then true
366345 else pd
367346 case _ =>
368347 throw("Match error")
369348 }
370349 }
371350
372351
373352 @Callable(i)
374353 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
375354 let priceMult = ((100 * 1000) * 1000)
376355 let idoEnd = (idoStart + idoDuration)
377356 if (isDefined(getString(keyConfig())))
378357 then throw("already initialized")
379358 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
380359 then throw("not authorized")
381360 else if ((size(i.payments) != 1))
382361 then throw("exactly 1 payment must be attached")
383362 else if ((idoEnd >= claimStart))
384363 then throw("claimStart must be greater than idoEnd")
385364 else {
386365 let pmt = value(i.payments[0])
387366 let idoAssetId = value(pmt.assetId)
388367 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
389368 let idoAssetId58 = toBase58String(idoAssetId)
390369 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
391370 let priceAssetId = fromBase58String(priceAssetId58)
392371 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
393372 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
394373 let origTotalsArray = readTotalsArrayOrDefault()
395374 let totalsDiff = [0, 0, 0, 0]
396375 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)]
397376 }
398377 }
399378
400379
401380
402381 @Callable(i)
403382 func invest () = {
404383 let cfgArray = readConfigArray()
405384 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
406385 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
407386 let idoEnd = (idoStart + idoDuration)
408387 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
409388 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
410389 let price = parseIntValue(cfgArray[IdxCfgPrice])
411390 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
412391 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
413392 let idoAssetId = fromBase58String(idoAssetId58)
414393 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
415394 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
416395 let priceAssetId = fromBase58String(priceAssetId58)
417396 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
418397 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
419398 let userAddress = toString(i.caller)
420399 if ((idoStart > height))
421400 then throw("ido has not been started yet")
422401 else if ((height > idoEnd))
423402 then throw("ido has been already ended")
424403 else if ((size(i.payments) != 1))
425404 then throw("exactly 1 payment is expected")
426405 else {
427406 let pmt = value(i.payments[0])
428407 let pmtAssetId = value(pmt.assetId)
429408 let pmtAmount = pmt.amount
430409 if ((pmtAssetId != priceAssetId))
431410 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
432411 else {
433412 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
434413 let origTotalsArray = readTotalsArrayOrDefault()
435414 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
436415 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
437416 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
438417 then throw("IDO asset has been - sold consider to use smaller payment")
439418 else {
440419 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
441420 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
442421 }
443422 }
444423 }
445424 }
446425
447426
448427
449428 @Callable(i)
450429 func claim (claimedAssetId58,userAddress58) = {
451430 let callerAddress58 = toString(i.caller)
452431 if ((userAddress58 != callerAddress58))
453432 then throw("not authorized")
454433 else {
455434 let cfgArray = readConfigArray()
456435 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
457436 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
458437 let totalsDiff = claimResultTuple._1
459438 let outAmount = claimResultTuple._2
460439 let outAssetId = claimResultTuple._3
461440 let origInvestArray = claimResultTuple._4
462441 let newClaimPeriodHeight = claimResultTuple._5
463442 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
464443 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
465444 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
466445 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
467446 let entries = if ((claimedAssetId58 == priceAssetId58))
468447 then {
469- let $t02205422498 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
470- let periodMinAvailableToClaim = $t02205422498._1
471- let periodTotalAvailableToClaim = $t02205422498._2
472- let periodUserAvailableToClaim = $t02205422498._3
473- let totalUserAvailableToClaim = $t02205422498._4
474- let usdtPriceAssetAllowableRatio = $t02205422498._5
475- let currentUsdtPriceAssetRatio = $t02205422498._6
476- let endPeriodBlocksLeft = $t02205422498._7
477- let updatedCurrentPeriod = $t02205422498._8
478- let periodStart = $t02205422498._9
479- let periodEnd = $t02205422498._10
448+ let $t02154921993 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
449+ let periodMinAvailableToClaim = $t02154921993._1
450+ let periodTotalAvailableToClaim = $t02154921993._2
451+ let periodUserAvailableToClaim = $t02154921993._3
452+ let totalUserAvailableToClaim = $t02154921993._4
453+ let usdtPriceAssetAllowableRatio = $t02154921993._5
454+ let currentUsdtPriceAssetRatio = $t02154921993._6
455+ let endPeriodBlocksLeft = $t02154921993._7
456+ let updatedCurrentPeriod = $t02154921993._8
457+ let periodStart = $t02154921993._9
458+ let periodEnd = $t02154921993._10
480459 let checks = [if ((periodUserAvailableToClaim > 0))
481460 then true
482461 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
483462 then true
484463 else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0))
485464 then true
486465 else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
487466 then true
488467 else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
489468 if ((checks == checks))
490469 then {
491470 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
492471 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
493- let entries = if ((priceAssetBalance > periodMinAvailableToClaim))
472+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
494473 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
495474 else {
496- let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
497- if ((evaluateResult == evaluateResult))
498- then {
499- let availablePriceAmountToClaim = parseIntValue(evaluateResult[3])
500- let lastClaimEntries = if ((availablePriceAmountToClaim == periodMinAvailableToClaim))
501- then {
502- let investorTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
503- let investorRemainingAmount = parseIntValue(origInvestArray[IdxInvRemainingAmount])
504- let investorPriceAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedPriceAssetAmount])
505- let investorIdoAssetBalance = parseIntValue(origInvestArray[IdxInvClaimedIdoAssetAmount])
506- let investorLastClaimedHeight = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
507- let newInvestArray = [toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)]
508- let totals = readTotalsArrayOrDefault()
509- let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
510- let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
511- let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvRemainingAmount])
512- let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
513- let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
514- let newTotalsRemainingAmount = (totalsRemainingAmount - investorRemainingAmount)
515- let newTotalArray = [toString(totalsTotalAmount), toString(newTotalsRemainingAmount), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)]
516- let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
517-[StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), TotalsEntry(keyInvestor(userAddress58), newInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), newTotalArray, totalsDiff, newClaimPeriodHeight, 0)]
518- }
519- else [TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0)]
520- let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
521- ([ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] ++ lastClaimEntries)
522- }
523- else throw("Strict value is not equal to itself.")
475+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
476+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, 0), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, 0), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
524477 }
525478 $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)
526479 }
527480 else throw("Strict value is not equal to itself.")
528481 }
529482 else {
530483 let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
531484 $Tuple2([ScriptTransfer(i.caller, (outAmount + priceAssetBalanceIdoDecimals), outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight, priceAssetBalance), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight, priceAssetBalance), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, (claimedIdoAssetAmountFromDiff + priceAssetBalanceIdoDecimals), i.transactionId)], unit)
532485 }
533486 entries
534487 }
535488 }
536489
537490
538491
539492 @Callable(i)
540493 func claimREADONLY (claimedAssetId58,userAddress58) = {
541494 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
542495 let totalsDiff = claimResultTuple._1
543496 let outAmount = claimResultTuple._2
544497 let outAssetId = claimResultTuple._3
545498 let origInvestArray = claimResultTuple._4
546499 let newClaimPeriodHeight = claimResultTuple._5
547500 let availableToClaimArray = claimResultTuple._6
548501 let availablePriceAmountToClaim = availableToClaimArray[0]
549502 let availableIdoAmountToClaim = availableToClaimArray[1]
550503 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
551504 }
552505
553506
554507
555508 @Callable(i)
556509 func claimV2READONLY (claimedAssetId58,userAddress58) = {
557510 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
558511 let totalsDiff = claimResultTuple._1
559512 let outAmount = claimResultTuple._2
560513 let outAssetId = claimResultTuple._3
561514 let origInvestArray = claimResultTuple._4
562515 let newClaimPeriodHeight = claimResultTuple._5
563516 let availableToClaimArray = claimResultTuple._6
564517 let availablePriceAmountToClaim = availableToClaimArray[0]
565518 let availableIdoAmountToClaim = availableToClaimArray[1]
566519 let cfgArray = readConfigArray()
567520 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
568521 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
569522 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
570523 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
571- let $t03128231694 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
572- let periodMinAvailableToClaim = $t03128231694._1
573- let periodTotalAvailableToClaim = $t03128231694._2
574- let periodUserAvailableToClaim = $t03128231694._3
575- let totalUserAvailableToClaim = $t03128231694._4
576- let usdtPriceAssetAllowableRatio = $t03128231694._5
577- let currentUsdtPriceAssetRatio = $t03128231694._6
578- let endPeriodBlocksLeft = $t03128231694._7
579- let updatedCurrentPeriod = $t03128231694._8
580- let periodStart = $t03128231694._9
581- let periodEnd = $t03128231694._10
524+ let $t02828628698 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
525+ let periodMinAvailableToClaim = $t02828628698._1
526+ let periodTotalAvailableToClaim = $t02828628698._2
527+ let periodUserAvailableToClaim = $t02828628698._3
528+ let totalUserAvailableToClaim = $t02828628698._4
529+ let usdtPriceAssetAllowableRatio = $t02828628698._5
530+ let currentUsdtPriceAssetRatio = $t02828628698._6
531+ let endPeriodBlocksLeft = $t02828628698._7
532+ let updatedCurrentPeriod = $t02828628698._8
533+ let periodStart = $t02828628698._9
534+ let periodEnd = $t02828628698._10
582535 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
583536 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
584537 let resultString = if ((height > currentPeriodEndHeight))
585538 then {
586539 let periodLenght = value(getInteger(keyPeriodLength()))
587540 let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
588541 let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
589542 makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP)
590543 }
591544 else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP)
592545 $Tuple2(nil, resultString)
593546 }
594547
595548
596549
597550 @Callable(i)
598551 func setManager (pendingManagerPublicKey) = {
599552 let checkCaller = mustManager(i)
600553 if ((checkCaller == checkCaller))
601554 then {
602555 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
603556 if ((checkManagerPublicKey == checkManagerPublicKey))
604557 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
605558 else throw("Strict value is not equal to itself.")
606559 }
607560 else throw("Strict value is not equal to itself.")
608561 }
609562
610563
611564
612565 @Callable(i)
613566 func confirmManager () = {
614567 let pm = pendingManagerPublicKeyOrUnit()
615568 let hasPM = if (isDefined(pm))
616569 then true
617570 else throw("No pending manager")
618571 if ((hasPM == hasPM))
619572 then {
620573 let checkPM = if ((i.callerPublicKey == value(pm)))
621574 then true
622575 else throw("You are not pending manager")
623576 if ((checkPM == checkPM))
624577 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
625578 else throw("Strict value is not equal to itself.")
626579 }
627580 else throw("Strict value is not equal to itself.")
628581 }
629582
630583
631584 @Verifier(tx)
632585 func verify () = {
633586 let targetPublicKey = match managerPublicKeyOrUnit() {
634587 case pk: ByteVector =>
635588 pk
636589 case _: Unit =>
637590 tx.senderPublicKey
638591 case _ =>
639592 throw("Match error")
640593 }
641594 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
642595 }
643596

github/deemru/w8io/026f985 
81.22 ms