tx · HNAZjp4N6gzhHXAGGALQMBHMmVB7DdPFK7Wkkc7pC3En

3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp:  -0.02200000 Waves

2022.12.06 09:10 [2348100] smart account 3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp > SELF 0.00000000 Waves

{ "type": 13, "id": "HNAZjp4N6gzhHXAGGALQMBHMmVB7DdPFK7Wkkc7pC3En", "fee": 2200000, "feeAssetId": null, "timestamp": 1670307053564, "version": 1, "sender": "3MqzKJcjfKxqGWSA84WR4kQwZksM5vjxiFp", "senderPublicKey": "bS6Cchmk25EdDcapkz8W5WkZgthTHHW6sSBbcidSrCb", "proofs": [ "5wqDcjKugCr8Pgg4bmiDWTCoCa1h1TnTUMngQimAaN7ChF8n6aPC5o2Hv41d6Roi6mgNddja3mjVgwT5kRcvPNx4" ], "script": "base64:BgKCIwgCEgkKBwEBAQEBCAESABIECgIICBIDCgEIEgQKAggIEgQKAggIEgMKAQgSACIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiA1NFUCIIQlVGU0NBTEUiBnNjYWxlOCIIdGhyb3dFcnIiA21zZyIIYXNTdHJpbmciA3ZhbCIHJG1hdGNoMCIGdmFsU3RyIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2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EFAmNqCQDMCAIJAKQDAQUCY2sJAMwIAgkApAMBBQJkcQUDbmlsBQFjCQCUCgIFA25pbAUCZHICY3ABCnNldE1hbmFnZXIBAmR2BAJkdwkBAmNvAQUCY3ADCQAAAgUCZHcFAmR3BAJkeAkA2QQBBQJkdgMJAAACBQJkeAUCZHgJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAmFJAAUCZHYFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgJjcAEOY29uZmlybU1hbmFnZXIABAJkeQkBAmNuAAQCZHoDCQEJaXNEZWZpbmVkAQUCZHkGCQACAQISTm8gcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmR6BQJkegQCZEEDCQAAAggFAmNwD2NhbGxlclB1YmxpY0tleQkBBXZhbHVlAQUCZHkGCQACAQIbWW91IGFyZSBub3QgcGVuZGluZyBtYW5hZ2VyAwkAAAIFAmRBBQJkQQkAzAgCCQELU3RyaW5nRW50cnkCCQECYUgACQDYBAEJAQV2YWx1ZQEFAmR5CQDMCAIJAQtEZWxldGVFbnRyeQEJAQJhSQAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECZEIBAmRDAAQCZEQEAWoJAQJjbAADCQABAgUBagIKQnl0ZVZlY3RvcgQCY3IFAWoFAmNyAwkAAQIFAWoCBFVuaXQIBQJkQg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZEIJYm9keUJ5dGVzCQCRAwIIBQJkQgZwcm9vZnMAAAUCZETIO7RK", "chainId": 84, "height": 2348100, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Nqkn9ZExoXmkirPixdcQu6XRKRtFKVJj1Jt2rzsirsp Next: 56SzMf9LWuB4o1CUSWaK3fpgpESzmVdRYBBiscuqq2yE Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
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+}
1422
1523
1624 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
123131 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
124132
125133
134+func keyInvestorRemainingAmount (address) = makeString(["%s%s", "investorRemainingAmount", address], SEP)
135+
136+
137+func keyTotalRemainingAmount () = makeString(["%s", "totalRemainingAmount"], SEP)
138+
139+
126140 func keyManagerPublicKey () = "%s__managerPublicKey"
127141
128142
166180 let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
167181 let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance)
168182 let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals)
169- if ((0 > newRemainingAmount))
170- then throwErr(makeString(["invalid math", toString(remainingAmount), toString(incrementDiff[IdxDiffRemainingPriceAmountIncrement]), toString(newRemainingAmount), toString(incrementDiff[IdxDiffTotalIncrement])], " "))
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+ }
171191 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
192+ entries
172193 }
173194
174195
229250 let periodLength = value(getInteger(keyPeriodLength()))
230251 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
231252 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
232- let $t01248214352 = if ((currentPeriod > 0))
253+ let $t01298714857 = if ((currentPeriod > 0))
233254 then {
234255 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
235256 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
236- let $t01274213447 = if ((height > lastPeriodEndHeight))
257+ let $t01324713952 = if ((height > lastPeriodEndHeight))
237258 then {
238259 let updatedCurrentPeriod = (currentPeriod + 1)
239260 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
248269 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
249270 }
250271 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
251- let updatedCurrentPeriod = $t01274213447._1
252- let periodStart = $t01274213447._2
253- let periodEnd = $t01274213447._3
272+ let updatedCurrentPeriod = $t01324713952._1
273+ let periodStart = $t01324713952._2
274+ let periodEnd = $t01324713952._3
254275 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
255276 }
256277 else if (zeroPeriodEndHeighIsDefined)
257278 then {
258279 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
259280 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
260- let $t01370214084 = if ((height > zeroPeriodEndHeight))
281+ let $t01420714589 = if ((height > zeroPeriodEndHeight))
261282 then {
262283 let updatedCurrentPeriod = (currentPeriod + 1)
263284 let periodStart = (zeroPeriodEndHeight + 1)
265286 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
266287 }
267288 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
268- let updatedCurrentPeriod = $t01370214084._1
269- let periodStart = $t01370214084._2
270- let periodEnd = $t01370214084._3
289+ let updatedCurrentPeriod = $t01420714589._1
290+ let periodStart = $t01420714589._2
291+ let periodEnd = $t01420714589._3
271292 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
272293 }
273294 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
274- let updatedCurrentPeriod = $t01248214352._1
275- let periodStart = $t01248214352._2
276- let periodEnd = $t01248214352._3
295+ let updatedCurrentPeriod = $t01298714857._1
296+ let periodStart = $t01298714857._2
297+ let periodEnd = $t01298714857._3
277298 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
278299 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
279300 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
280301 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
281302 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
282303 let putOneTknV2PriceAssetAmount = scale8
283- let $t01510715360 = {
304+ let $t01561215865 = {
284305 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
285306 if ($isInstanceOf(@, "(Int, Int, Int)"))
286307 then @
287- else throw("Couldn't cast Any to (Int, Int, Int)")
308+ else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
288309 }
289- if (($t01510715360 == $t01510715360))
310+ if (($t01561215865 == $t01561215865))
290311 then {
291- let bonus = $t01510715360._3
292- let feeAmount = $t01510715360._2
293- let lpAmount = $t01510715360._1
312+ let bonus = $t01561215865._3
313+ let feeAmount = $t01561215865._2
314+ let lpAmount = $t01561215865._1
294315 let usdtAssetId = value(getString(keyUsdtAssetId()))
295- let $t01542215640 = {
316+ let $t01592716145 = {
296317 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
297318 if ($isInstanceOf(@, "(Int, Int)"))
298319 then @
299- else throw("Couldn't cast Any to (Int, Int)")
320+ else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
300321 }
301- if (($t01542215640 == $t01542215640))
322+ if (($t01592716145 == $t01592716145))
302323 then {
303- let getOneTknV2FeeAmount = $t01542215640._2
304- let usdtAmount = $t01542215640._1
324+ let getOneTknV2FeeAmount = $t01592716145._2
325+ let usdtAmount = $t01592716145._1
305326 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
306327 let endPeriodBlocksLeft = (periodEnd - height)
307328 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
445466 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
446467 let entries = if ((claimedAssetId58 == priceAssetId58))
447468 then {
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
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
459480 let checks = [if ((periodUserAvailableToClaim > 0))
460481 then true
461482 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
469490 then {
470491 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
471492 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
472- let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
493+ let entries = if ((priceAssetBalance > periodMinAvailableToClaim))
473494 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
474495 else {
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)]
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[IdxInvClaimedPriceAssetAmount])
512+ let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
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.")
477524 }
478525 $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)
479526 }
485532 }
486533 entries
487534 }
535+ }
536+
537+
538+
539+@Callable(i)
540+func cleanRemaingAmount (userAddress58) = {
541+ let priceAssetId58 = readConfigArray()[IdxCfgPriceAssetId]
542+ let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
543+ if ((evaluateResult == evaluateResult))
544+ then {
545+ let availablePriceAmountToClaim = parseIntValue(evaluateResult[2])
546+ let checkUnclaimedAssets = if ((availablePriceAmountToClaim == 0))
547+ then true
548+ else throwErr("user have unclaimed assets")
549+ if ((checkUnclaimedAssets == checkUnclaimedAssets))
550+ then {
551+ let investor = split(value(getString(keyInvestor(userAddress58))), SEP)
552+ let investorTotalAmount = parseIntValue(investor[IdxInvTotalAmount])
553+ let investorRemainingAmount = parseIntValue(investor[IdxInvRemainingAmount])
554+ let investorPriceAssetBalance = parseIntValue(investor[IdxInvClaimedPriceAssetAmount])
555+ let investorIdoAssetBalance = parseIntValue(investor[IdxInvClaimedIdoAssetAmount])
556+ let investorLastClaimedHeight = parseIntValue(investor[IdxInvLastClaimedHeight])
557+ let investorRemainingAmountCheck = if ((investorRemainingAmount != 0))
558+ then true
559+ else throwErr("investorRemainingAmount already zero")
560+ if ((investorRemainingAmountCheck == investorRemainingAmountCheck))
561+ then {
562+ let newInvestor = makeString(["%d%d%d%d%d", toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)], SEP)
563+ let totals = split(value(getString(keyTotals())), SEP)
564+ let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
565+ let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
566+ let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
567+ let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
568+ let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
569+ let newTotals = makeString(["%d%d%d%d%d", toString(totalsTotalAmount), toString((totalsRemainingAmount - investorRemainingAmount)), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)], SEP)
570+ let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
571+[StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), StringEntry(keyInvestor(userAddress58), newInvestor), StringEntry(keyTotals(), newTotals)]
572+ }
573+ else throw("Strict value is not equal to itself.")
574+ }
575+ else throw("Strict value is not equal to itself.")
576+ }
577+ else throw("Strict value is not equal to itself.")
488578 }
489579
490580
521611 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
522612 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
523613 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
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
614+ let $t03374934161 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
615+ let periodMinAvailableToClaim = $t03374934161._1
616+ let periodTotalAvailableToClaim = $t03374934161._2
617+ let periodUserAvailableToClaim = $t03374934161._3
618+ let totalUserAvailableToClaim = $t03374934161._4
619+ let usdtPriceAssetAllowableRatio = $t03374934161._5
620+ let currentUsdtPriceAssetRatio = $t03374934161._6
621+ let endPeriodBlocksLeft = $t03374934161._7
622+ let updatedCurrentPeriod = $t03374934161._8
623+ let periodStart = $t03374934161._9
624+ let periodEnd = $t03374934161._10
535625 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
536626 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
537627 let resultString = if ((height > currentPeriodEndHeight))
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
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+}
1422
1523
1624 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1725 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1826 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1927 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2028 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2129 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
2230 }
2331
2432
2533 let IdxCfgIdoStart = 1
2634
2735 let IdxCfgIdoDuration = 2
2836
2937 let IdxCfgClaimStart = 3
3038
3139 let IdxCfgClaimDuration = 4
3240
3341 let IdxCfgPrice = 5
3442
3543 let IdxCfgPriceMult = 6
3644
3745 let IdxCfgIdoAssetId = 7
3846
3947 let IdxCfgIdoAssetMult = 8
4048
4149 let IdxCfgPriceAssetId = 9
4250
4351 let IdxCfgPriceAssetMult = 10
4452
4553 let IdxCfgMinInvestAmount = 11
4654
4755 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)
4856
4957
5058 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))
5159
5260
5361 let IdxInvTotalAmount = 1
5462
5563 let IdxInvRemainingAmount = 2
5664
5765 let IdxInvClaimedPriceAssetAmount = 3
5866
5967 let IdxInvClaimedIdoAssetAmount = 4
6068
6169 let IdxInvLastClaimedHeight = 5
6270
6371 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6472
6573
6674 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6775
6876
6977 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7078
7179
7280 func keyConfig () = "%s__config"
7381
7482
7583 func keyInvestor (userAddress) = ("%s__" + userAddress)
7684
7785
7886 func keyTotals () = "%s__totals"
7987
8088
8189 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
8290
8391
8492 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8593
8694
8795 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
8896
8997
9098 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9199
92100
93101 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
94102
95103
96104 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
97105
98106
99107 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
100108
101109
102110 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103111
104112
105113 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106114
107115
108116 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109117
110118
111119 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112120
113121
114122 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115123
116124
117125 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118126
119127
120128 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121129
122130
123131 func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
124132
125133
134+func keyInvestorRemainingAmount (address) = makeString(["%s%s", "investorRemainingAmount", address], SEP)
135+
136+
137+func keyTotalRemainingAmount () = makeString(["%s", "totalRemainingAmount"], SEP)
138+
139+
126140 func keyManagerPublicKey () = "%s__managerPublicKey"
127141
128142
129143 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
130144
131145
132146 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
133147
134148
135149 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
136150
137151
138152 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
139153
140154
141155 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
142156
143157
144158 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
145159
146160
147161 let IdxDiffTotalIncrement = 0
148162
149163 let IdxDiffRemainingPriceAmountIncrement = 1
150164
151165 let IdxDiffClaimedPriceAmountIncrement = 2
152166
153167 let IdxDiffClaimedIdoAssetAmountIncrement = 3
154168
155169 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight,priceAssetBalance) = {
156170 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
157171 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
158172 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
159173 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
160174 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
161175 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
162176 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
163177 let cfgArray = readConfigArray()
164178 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
165179 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
166180 let priceAssetBalancePriceAssetDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
167181 let newClaimedPriceAssetAmount = ((claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) - priceAssetBalance)
168182 let newClaimedIdoAssetAmount = ((claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) + priceAssetBalancePriceAssetDecimals)
169- if ((0 > newRemainingAmount))
170- then throwErr(makeString(["invalid math", toString(remainingAmount), toString(incrementDiff[IdxDiffRemainingPriceAmountIncrement]), toString(newRemainingAmount), toString(incrementDiff[IdxDiffTotalIncrement])], " "))
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+ }
171191 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
192+ entries
172193 }
173194
174195
175196 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
176197
177198
178199 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
179200
180201
181202 func internalClaim (claimedAssetId58,userAddress,txId) = {
182203 let cfgArray = readConfigArray()
183204 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
184205 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
185206 let claimEnd = (claimStart + claimDuration)
186207 let price = parseIntValue(cfgArray[IdxCfgPrice])
187208 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
188209 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
189210 let idoAssetId = fromBase58String(idoAssetId58)
190211 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
191212 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
192213 let priceAssetId = fromBase58String(priceAssetId58)
193214 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
194215 let userAddress58 = toString(userAddress)
195216 let origInvestArray = readInvestorArrayOrFail(userAddress58)
196217 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
197218 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
198219 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
199220 then claimStart
200221 else investLastClaimedHeightTMP
201222 let newClaimPeriodHeight = if ((height > claimEnd))
202223 then claimEnd
203224 else if ((claimStart > height))
204225 then claimStart
205226 else height
206227 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
207228 let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
208229 let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
209230 let isUSDN = (claimedAssetId58 == priceAssetId58)
210231 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
211232 let checks = [if (!(if (isUSDN)
212233 then isUSDNClaimDisabled
213234 else false))
214235 then true
215236 else throw("USDN claim is disabled")]
216237 if ((checks == checks))
217238 then if ((claimedAssetId58 == priceAssetId58))
218239 then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
219240 else if ((claimedAssetId58 == idoAssetId58))
220241 then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
221242 else throw(("unsupported assetId: " + claimedAssetId58))
222243 else throw("Strict value is not equal to itself.")
223244 }
224245
225246
226247 func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = {
227248 let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
228249 let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
229250 let periodLength = value(getInteger(keyPeriodLength()))
230251 let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
231252 let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0)))
232- let $t01248214352 = if ((currentPeriod > 0))
253+ let $t01298714857 = if ((currentPeriod > 0))
233254 then {
234255 let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod)))
235256 let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod)))
236- let $t01274213447 = if ((height > lastPeriodEndHeight))
257+ let $t01324713952 = if ((height > lastPeriodEndHeight))
237258 then {
238259 let updatedCurrentPeriod = (currentPeriod + 1)
239260 let periodStart = if ((height > (lastPeriodEndHeight + periodLength)))
240261 then {
241262 let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength)
242263 if ((blocksToLastPeriodStart == 0))
243264 then ((height - periodLength) + 1)
244265 else (height - blocksToLastPeriodStart)
245266 }
246267 else (lastPeriodEndHeight + 1)
247268 let periodEnd = ((periodStart + periodLength) - 1)
248269 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
249270 }
250271 else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
251- let updatedCurrentPeriod = $t01274213447._1
252- let periodStart = $t01274213447._2
253- let periodEnd = $t01274213447._3
272+ let updatedCurrentPeriod = $t01324713952._1
273+ let periodStart = $t01324713952._2
274+ let periodEnd = $t01324713952._3
254275 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
255276 }
256277 else if (zeroPeriodEndHeighIsDefined)
257278 then {
258279 let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0)))
259280 let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0)))
260- let $t01370214084 = if ((height > zeroPeriodEndHeight))
281+ let $t01420714589 = if ((height > zeroPeriodEndHeight))
261282 then {
262283 let updatedCurrentPeriod = (currentPeriod + 1)
263284 let periodStart = (zeroPeriodEndHeight + 1)
264285 let periodEnd = ((periodStart + periodLength) - 1)
265286 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
266287 }
267288 else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight)
268- let updatedCurrentPeriod = $t01370214084._1
269- let periodStart = $t01370214084._2
270- let periodEnd = $t01370214084._3
289+ let updatedCurrentPeriod = $t01420714589._1
290+ let periodStart = $t01420714589._2
291+ let periodEnd = $t01420714589._3
271292 $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
272293 }
273294 else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
274- let updatedCurrentPeriod = $t01248214352._1
275- let periodStart = $t01248214352._2
276- let periodEnd = $t01248214352._3
295+ let updatedCurrentPeriod = $t01298714857._1
296+ let periodStart = $t01298714857._2
297+ let periodEnd = $t01298714857._3
277298 let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
278299 let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
279300 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
280301 let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim])
281302 let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
282303 let putOneTknV2PriceAssetAmount = scale8
283- let $t01510715360 = {
304+ let $t01561215865 = {
284305 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
285306 if ($isInstanceOf(@, "(Int, Int, Int)"))
286307 then @
287- else throw("Couldn't cast Any to (Int, Int, Int)")
308+ else throw(($getType(@) + " couldn't be cast to (Int, Int, Int)"))
288309 }
289- if (($t01510715360 == $t01510715360))
310+ if (($t01561215865 == $t01561215865))
290311 then {
291- let bonus = $t01510715360._3
292- let feeAmount = $t01510715360._2
293- let lpAmount = $t01510715360._1
312+ let bonus = $t01561215865._3
313+ let feeAmount = $t01561215865._2
314+ let lpAmount = $t01561215865._1
294315 let usdtAssetId = value(getString(keyUsdtAssetId()))
295- let $t01542215640 = {
316+ let $t01592716145 = {
296317 let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
297318 if ($isInstanceOf(@, "(Int, Int)"))
298319 then @
299- else throw("Couldn't cast Any to (Int, Int)")
320+ else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
300321 }
301- if (($t01542215640 == $t01542215640))
322+ if (($t01592716145 == $t01592716145))
302323 then {
303- let getOneTknV2FeeAmount = $t01542215640._2
304- let usdtAmount = $t01542215640._1
324+ let getOneTknV2FeeAmount = $t01592716145._2
325+ let usdtAmount = $t01592716145._1
305326 let currentUsdtPriceAssetRatio = fraction(putOneTknV2PriceAssetAmount, scale8, usdtAmount)
306327 let endPeriodBlocksLeft = (periodEnd - height)
307328 $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd)
308329 }
309330 else throw("Strict value is not equal to itself.")
310331 }
311332 else throw("Strict value is not equal to itself.")
312333 }
313334
314335
315336 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
316337 case s: String =>
317338 fromBase58String(s)
318339 case _: Unit =>
319340 unit
320341 case _ =>
321342 throw("Match error")
322343 }
323344
324345
325346 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
326347 case s: String =>
327348 fromBase58String(s)
328349 case _: Unit =>
329350 unit
330351 case _ =>
331352 throw("Match error")
332353 }
333354
334355
335356 func mustManager (i) = {
336357 let pd = throw("Permission denied")
337358 match managerPublicKeyOrUnit() {
338359 case pk: ByteVector =>
339360 if ((i.callerPublicKey == pk))
340361 then true
341362 else pd
342363 case _: Unit =>
343364 if ((i.caller == this))
344365 then true
345366 else pd
346367 case _ =>
347368 throw("Match error")
348369 }
349370 }
350371
351372
352373 @Callable(i)
353374 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
354375 let priceMult = ((100 * 1000) * 1000)
355376 let idoEnd = (idoStart + idoDuration)
356377 if (isDefined(getString(keyConfig())))
357378 then throw("already initialized")
358379 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
359380 then throw("not authorized")
360381 else if ((size(i.payments) != 1))
361382 then throw("exactly 1 payment must be attached")
362383 else if ((idoEnd >= claimStart))
363384 then throw("claimStart must be greater than idoEnd")
364385 else {
365386 let pmt = value(i.payments[0])
366387 let idoAssetId = value(pmt.assetId)
367388 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
368389 let idoAssetId58 = toBase58String(idoAssetId)
369390 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
370391 let priceAssetId = fromBase58String(priceAssetId58)
371392 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
372393 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
373394 let origTotalsArray = readTotalsArrayOrDefault()
374395 let totalsDiff = [0, 0, 0, 0]
375396 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0)]
376397 }
377398 }
378399
379400
380401
381402 @Callable(i)
382403 func invest () = {
383404 let cfgArray = readConfigArray()
384405 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
385406 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
386407 let idoEnd = (idoStart + idoDuration)
387408 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
388409 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
389410 let price = parseIntValue(cfgArray[IdxCfgPrice])
390411 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
391412 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
392413 let idoAssetId = fromBase58String(idoAssetId58)
393414 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
394415 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
395416 let priceAssetId = fromBase58String(priceAssetId58)
396417 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
397418 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
398419 let userAddress = toString(i.caller)
399420 if ((idoStart > height))
400421 then throw("ido has not been started yet")
401422 else if ((height > idoEnd))
402423 then throw("ido has been already ended")
403424 else if ((size(i.payments) != 1))
404425 then throw("exactly 1 payment is expected")
405426 else {
406427 let pmt = value(i.payments[0])
407428 let pmtAssetId = value(pmt.assetId)
408429 let pmtAmount = pmt.amount
409430 if ((pmtAssetId != priceAssetId))
410431 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
411432 else {
412433 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
413434 let origTotalsArray = readTotalsArrayOrDefault()
414435 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
415436 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
416437 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
417438 then throw("IDO asset has been - sold consider to use smaller payment")
418439 else {
419440 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
420441 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart, 0), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart, 0), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
421442 }
422443 }
423444 }
424445 }
425446
426447
427448
428449 @Callable(i)
429450 func claim (claimedAssetId58,userAddress58) = {
430451 let callerAddress58 = toString(i.caller)
431452 if ((userAddress58 != callerAddress58))
432453 then throw("not authorized")
433454 else {
434455 let cfgArray = readConfigArray()
435456 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
436457 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
437458 let totalsDiff = claimResultTuple._1
438459 let outAmount = claimResultTuple._2
439460 let outAssetId = claimResultTuple._3
440461 let origInvestArray = claimResultTuple._4
441462 let newClaimPeriodHeight = claimResultTuple._5
442463 let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
443464 let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
444465 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
445466 let priceAssetDecimals = value(assetInfo(fromBase58String(priceAssetId58))).decimals
446467 let entries = if ((claimedAssetId58 == priceAssetId58))
447468 then {
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
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
459480 let checks = [if ((periodUserAvailableToClaim > 0))
460481 then true
461482 else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0))
462483 then true
463484 else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0))
464485 then true
465486 else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio))
466487 then true
467488 else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")]
468489 if ((checks == checks))
469490 then {
470491 let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
471492 let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
472- let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
493+ let entries = if ((priceAssetBalance > periodMinAvailableToClaim))
473494 then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
474495 else {
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)]
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[IdxInvClaimedPriceAssetAmount])
512+ let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
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.")
477524 }
478525 $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)
479526 }
480527 else throw("Strict value is not equal to itself.")
481528 }
482529 else {
483530 let priceAssetBalanceIdoDecimals = fraction(priceAssetBalance, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN))
484531 $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)
485532 }
486533 entries
487534 }
535+ }
536+
537+
538+
539+@Callable(i)
540+func cleanRemaingAmount (userAddress58) = {
541+ let priceAssetId58 = readConfigArray()[IdxCfgPriceAssetId]
542+ let evaluateResult = split(asString(invoke(this, "claimREADONLY", [priceAssetId58, userAddress58], nil)), SEP)
543+ if ((evaluateResult == evaluateResult))
544+ then {
545+ let availablePriceAmountToClaim = parseIntValue(evaluateResult[2])
546+ let checkUnclaimedAssets = if ((availablePriceAmountToClaim == 0))
547+ then true
548+ else throwErr("user have unclaimed assets")
549+ if ((checkUnclaimedAssets == checkUnclaimedAssets))
550+ then {
551+ let investor = split(value(getString(keyInvestor(userAddress58))), SEP)
552+ let investorTotalAmount = parseIntValue(investor[IdxInvTotalAmount])
553+ let investorRemainingAmount = parseIntValue(investor[IdxInvRemainingAmount])
554+ let investorPriceAssetBalance = parseIntValue(investor[IdxInvClaimedPriceAssetAmount])
555+ let investorIdoAssetBalance = parseIntValue(investor[IdxInvClaimedIdoAssetAmount])
556+ let investorLastClaimedHeight = parseIntValue(investor[IdxInvLastClaimedHeight])
557+ let investorRemainingAmountCheck = if ((investorRemainingAmount != 0))
558+ then true
559+ else throwErr("investorRemainingAmount already zero")
560+ if ((investorRemainingAmountCheck == investorRemainingAmountCheck))
561+ then {
562+ let newInvestor = makeString(["%d%d%d%d%d", toString(investorTotalAmount), "0", toString(investorPriceAssetBalance), toString(investorIdoAssetBalance), toString(investorLastClaimedHeight)], SEP)
563+ let totals = split(value(getString(keyTotals())), SEP)
564+ let totalsTotalAmount = parseIntValue(totals[IdxInvTotalAmount])
565+ let totalsRemainingAmount = parseIntValue(totals[IdxInvRemainingAmount])
566+ let totalsClaimedPriceAssetAmount = parseIntValue(totals[IdxInvClaimedPriceAssetAmount])
567+ let totalsClaimedIdoAssetAmount = parseIntValue(totals[IdxInvClaimedIdoAssetAmount])
568+ let totalsLastClaimedHeight = parseIntValue(totals[IdxInvLastClaimedHeight])
569+ let newTotals = makeString(["%d%d%d%d%d", toString(totalsTotalAmount), toString((totalsRemainingAmount - investorRemainingAmount)), toString(totalsClaimedPriceAssetAmount), toString(totalsClaimedIdoAssetAmount), toString(totalsLastClaimedHeight)], SEP)
570+ let newTotalRemainingAmount = (valueOrElse(getInteger(keyTotalRemainingAmount()), 0) + investorRemainingAmount)
571+[StringEntry(keyInvestorRemainingAmount(userAddress58), toString(investorRemainingAmount)), StringEntry(keyTotalRemainingAmount(), toString(newTotalRemainingAmount)), StringEntry(keyInvestor(userAddress58), newInvestor), StringEntry(keyTotals(), newTotals)]
572+ }
573+ else throw("Strict value is not equal to itself.")
574+ }
575+ else throw("Strict value is not equal to itself.")
576+ }
577+ else throw("Strict value is not equal to itself.")
488578 }
489579
490580
491581
492582 @Callable(i)
493583 func claimREADONLY (claimedAssetId58,userAddress58) = {
494584 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
495585 let totalsDiff = claimResultTuple._1
496586 let outAmount = claimResultTuple._2
497587 let outAssetId = claimResultTuple._3
498588 let origInvestArray = claimResultTuple._4
499589 let newClaimPeriodHeight = claimResultTuple._5
500590 let availableToClaimArray = claimResultTuple._6
501591 let availablePriceAmountToClaim = availableToClaimArray[0]
502592 let availableIdoAmountToClaim = availableToClaimArray[1]
503593 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
504594 }
505595
506596
507597
508598 @Callable(i)
509599 func claimV2READONLY (claimedAssetId58,userAddress58) = {
510600 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
511601 let totalsDiff = claimResultTuple._1
512602 let outAmount = claimResultTuple._2
513603 let outAssetId = claimResultTuple._3
514604 let origInvestArray = claimResultTuple._4
515605 let newClaimPeriodHeight = claimResultTuple._5
516606 let availableToClaimArray = claimResultTuple._6
517607 let availablePriceAmountToClaim = availableToClaimArray[0]
518608 let availableIdoAmountToClaim = availableToClaimArray[1]
519609 let cfgArray = readConfigArray()
520610 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
521611 let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
522612 let priceAssetBalanceIdoDecimals = (priceAssetBalance * 100)
523613 let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalanceIdoDecimals)
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
614+ let $t03374934161 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement])
615+ let periodMinAvailableToClaim = $t03374934161._1
616+ let periodTotalAvailableToClaim = $t03374934161._2
617+ let periodUserAvailableToClaim = $t03374934161._3
618+ let totalUserAvailableToClaim = $t03374934161._4
619+ let usdtPriceAssetAllowableRatio = $t03374934161._5
620+ let currentUsdtPriceAssetRatio = $t03374934161._6
621+ let endPeriodBlocksLeft = $t03374934161._7
622+ let updatedCurrentPeriod = $t03374934161._8
623+ let periodStart = $t03374934161._9
624+ let periodEnd = $t03374934161._10
535625 let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0)
536626 let userTotalPriceAssetClaimed = (parseIntValue(readInvestorArrayOrFail(userAddress58)[IdxInvClaimedPriceAssetAmount]) - priceAssetBalance)
537627 let resultString = if ((height > currentPeriodEndHeight))
538628 then {
539629 let periodLenght = value(getInteger(keyPeriodLength()))
540630 let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
541631 let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
542632 makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(userTotalPriceAssetClaimed)], SEP)
543633 }
544634 else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(userTotalPriceAssetClaimed)], SEP)
545635 $Tuple2(nil, resultString)
546636 }
547637
548638
549639
550640 @Callable(i)
551641 func setManager (pendingManagerPublicKey) = {
552642 let checkCaller = mustManager(i)
553643 if ((checkCaller == checkCaller))
554644 then {
555645 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
556646 if ((checkManagerPublicKey == checkManagerPublicKey))
557647 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
558648 else throw("Strict value is not equal to itself.")
559649 }
560650 else throw("Strict value is not equal to itself.")
561651 }
562652
563653
564654
565655 @Callable(i)
566656 func confirmManager () = {
567657 let pm = pendingManagerPublicKeyOrUnit()
568658 let hasPM = if (isDefined(pm))
569659 then true
570660 else throw("No pending manager")
571661 if ((hasPM == hasPM))
572662 then {
573663 let checkPM = if ((i.callerPublicKey == value(pm)))
574664 then true
575665 else throw("You are not pending manager")
576666 if ((checkPM == checkPM))
577667 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
578668 else throw("Strict value is not equal to itself.")
579669 }
580670 else throw("Strict value is not equal to itself.")
581671 }
582672
583673
584674 @Verifier(tx)
585675 func verify () = {
586676 let targetPublicKey = match managerPublicKeyOrUnit() {
587677 case pk: ByteVector =>
588678 pk
589679 case _: Unit =>
590680 tx.senderPublicKey
591681 case _ =>
592682 throw("Match error")
593683 }
594684 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
595685 }
596686

github/deemru/w8io/169f3d6 
114.90 ms