tx · ZS1iqKrA77yiCHPZbuBfBNu8jVQzvGzjMZVcAxUHs7S

3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv:  -0.02300000 Waves

2022.11.02 18:24 [2299665] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves

{ "type": 13, "id": "ZS1iqKrA77yiCHPZbuBfBNu8jVQzvGzjMZVcAxUHs7S", "fee": 2300000, "feeAssetId": null, "timestamp": 1667402715287, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "4LLFvDfd8cHC8HiD5ZnXkwwrY5ecb15b4ZNG3DXfDNtpj9xxWVANJ2w4ixEdcYtV2GYv3WvocB869wc1Hi1zQsW8" ], "script": "base64:AAIFAAAAAAAADaQIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Ih1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJZHhDZmdQcmljZUFzc2V0TXVsdCIVSWR4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m1NYW5hZ2VyAAAAAAQAAAACY0QJAQAAAAJidAAAAAAEAAAAAmNFAwkBAAAACWlzRGVmaW5lZAAAAAEFAAAAAmNEBgkAAAIAAAABAgAAABJObyBwZW5kaW5nIG1hbmFnZXIDCQAAAAAAAAIFAAAAAmNFBQAAAAJjRQQAAAACY0YDCQAAAAAAAAIIBQAAAAJidgAAAA9jYWxsZXJQdWJsaWNLZXkJAQAAAAV2YWx1ZQAAAAEFAAAAAmNEBgkAAAIAAAABAgAAABtZb3UgYXJlIG5vdCBwZW5kaW5nIG1hbmFnZXIDCQAAAAAAAAIFAAAAAmNGBQAAAAJjRgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAACYXoAAAAACQACWAAAAAEJAQAAAAV2YWx1ZQAAAAEFAAAAAmNECQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAJhQQAAAAAFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAQAAAAJjRwEAAAACY0gAAAAABAAAAAJjSQQAAAACYm8JAQAAAAJicgAAAAADCQAAAQAAAAIFAAAAAmJvAgAAAApCeXRlVmVjdG9yBAAAAAJieAUAAAACYm8FAAAAAmJ4AwkAAAEAAAACBQAAAAJibwIAAAAEVW5pdAgFAAAAAmNHAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAACY0cAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjRwAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAmNJGZzrOA==", "chainId": 84, "height": 2299665, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2KFoyBoEN1QSqmexi7Z4j6PbkReDnfCcEBApjJYiFoHF Next: 8sBCkrg3ft7WBR5VAFn7k34TtiEaNPPaxUq6DkybBKcX Diff:
OldNewDifferences
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 let scale8 = 100000000
12-
13-func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14-
1512
1613 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1714 let bPriceAssetMULT = toBigInt(priceAssetMULT)
120117 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121118
122119
120+func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
121+
122+
123123 func keyManagerPublicKey () = "%s__managerPublicKey"
124124
125125
197197 then claimStart
198198 else height
199199 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
200- let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration)
201- let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult)
200+ let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
201+ let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
202202 let isUSDN = (claimedAssetId58 == priceAssetId58)
203203 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
204204 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
213213 then isUSDNClaimDisabled
214214 else false))
215215 then true
216- else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
216+ else throw("USDN claim is disabled"), if (!(if (isUSDN)
217217 then isUSDNClaimEnded
218218 else false))
219219 then true
220- else throwErr("USDN claim is ended")]
220+ else throw("USDN claim is ended")]
221221 if ((checks == checks))
222- then {
223- let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224- let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225- let periodLength = value(getInteger(keyPeriodLength()))
226- let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227- let $t01110112019 = if ((currentPeriod > 0))
228- then {
229- let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
230- let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
231- let $t01136911751 = if ((height > lastPeriodEndHeight))
232- then {
233- let updatedCurrentPeriod = (currentPeriod + 1)
234- let periodStart = (lastPeriodEndHeight + 1)
235- let periodEnd = ((periodStart + periodLength) - 1)
236- $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
237- }
238- else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
239- let updatedCurrentPeriod = $t01136911751._1
240- let periodStart = $t01136911751._2
241- let periodEnd = $t01136911751._3
242- $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
243- }
244- else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
245- let updatedCurrentPeriod = $t01110112019._1
246- let periodStart = $t01110112019._2
247- let periodEnd = $t01110112019._3
248- let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
249- let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
250- let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
251- let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
252- let putOneTknV2PriceAssetAmount = scale8
253- let $t01268712940 = {
254- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
255- if ($isInstanceOf(@, "(Int, Int, Int)"))
256- then @
257- else throw("Couldn't cast Any to (Int, Int, Int)")
258- }
259- if (($t01268712940 == $t01268712940))
260- then {
261- let bonus = $t01268712940._3
262- let feeAmount = $t01268712940._2
263- let lpAmount = $t01268712940._1
264- let usdtAssetId = value(getString(keyUsdtAssetId()))
265- let $t01300213220 = {
266- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
267- if ($isInstanceOf(@, "(Int, Int)"))
268- then @
269- else throw("Couldn't cast Any to (Int, Int)")
270- }
271- if (($t01300213220 == $t01300213220))
272- then {
273- let getOneTknV2FeeAmount = $t01300213220._2
274- let usdtAmount = $t01300213220._1
275- let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
276- let endPeriodBlocksLeft = (periodEnd - height)
277- if ((claimedAssetId58 == priceAssetId58))
278- then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
279- else if ((claimedAssetId58 == idoAssetId58))
280- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
281- else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
282- }
283- else throw("Strict value is not equal to itself.")
284- }
285- else throw("Strict value is not equal to itself.")
286- }
222+ then if ((claimedAssetId58 == priceAssetId58))
223+ then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
224+ else if ((claimedAssetId58 == idoAssetId58))
225+ then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
226+ else throw(("unsupported assetId: " + claimedAssetId58))
287227 else throw("Strict value is not equal to itself.")
288228 }
289229
405345 func claim (claimedAssetId58,userAddress58) = {
406346 let callerAddress58 = toString(i.caller)
407347 if ((userAddress58 != callerAddress58))
408- then throwErr("not authorized")
348+ then throw("not authorized")
409349 else {
410- let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
350+ let cfgArray = readConfigArray()
351+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
411352 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
412353 let totalsDiff = claimResultTuple._1
413354 let outAmount = claimResultTuple._2
414355 let outAssetId = claimResultTuple._3
415356 let origInvestArray = claimResultTuple._4
416357 let newClaimPeriodHeight = claimResultTuple._5
417- let availableToClaimArray = claimResultTuple._6
418- let currentPeriod = availableToClaimArray[0]
419- let periodStart = availableToClaimArray[1]
420- let periodEnd = availableToClaimArray[2]
421- let totalUserAvailableToClaim = availableToClaimArray[3]
422- let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
423- let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
424- let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
425- let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
426- let currentPriceAssetRatio = availableToClaimArray[8]
427- let endPriodBlocksLeft = availableToClaimArray[9]
428- let checks = [if (if ((totalUserAvailableToClaim > 0))
429- then true
430- else (periodAvailableIdoAmountToClaim > 0))
431- then true
432- else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0))
433- then true
434- else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0))
435- then true
436- else throwErr("unavailable to claim because total period allowance reached")]
437- if ((checks == checks))
358+ let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
359+ let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
360+ let entries = if ((claimedAssetId58 == priceAssetId58))
438361 then {
439- let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
440- let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
441- let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff)
442- let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff)
443- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
362+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
363+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
364+ let periodLength = value(getInteger(keyPeriodLength()))
365+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
366+ let $t01698717941 = if ((currentPeriod > 0))
367+ then {
368+ let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
369+ let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
370+ let $t01726117657 = if ((height > lastPeriodEndHeight))
371+ then {
372+ let updatedCurrentPeriod = (currentPeriod + 1)
373+ let periodStart = (lastPeriodEndHeight + 1)
374+ let periodEnd = ((periodStart + periodLength) - 1)
375+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
376+ }
377+ else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
378+ let updatedCurrentPeriod = $t01726117657._1
379+ let periodStart = $t01726117657._2
380+ let periodEnd = $t01726117657._3
381+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
382+ }
383+ else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
384+ let updatedCurrentPeriod = $t01698717941._1
385+ let periodStart = $t01698717941._2
386+ let periodEnd = $t01698717941._3
387+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
388+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
389+ let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
390+ let totalUserAvailableToClaim = totalsDiff[IdxInvClaimedPriceAssetAmount]
391+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
392+ let putOneTknV2PriceAssetAmount = scale8
393+ let $t01869718960 = {
394+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
395+ if ($isInstanceOf(@, "(Int, Int, Int)"))
396+ then @
397+ else throw("Couldn't cast Any to (Int, Int, Int)")
398+ }
399+ if (($t01869718960 == $t01869718960))
400+ then {
401+ let bonus = $t01869718960._3
402+ let feeAmount = $t01869718960._2
403+ let lpAmount = $t01869718960._1
404+ let usdtAssetId = value(getString(keyUsdtAssetId()))
405+ let $t01902619254 = {
406+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
407+ if ($isInstanceOf(@, "(Int, Int)"))
408+ then @
409+ else throw("Couldn't cast Any to (Int, Int)")
410+ }
411+ if (($t01902619254 == $t01902619254))
412+ then {
413+ let getOneTknV2FeeAmount = $t01902619254._2
414+ let usdtAmount = $t01902619254._1
415+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
416+ let endPeriodBlocksLeft = (periodEnd - height)
417+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
418+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
419+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
420+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
421+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
422+ else {
423+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
424+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
425+ }
426+ $Tuple2(([IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit)
427+ }
428+ else throw("Strict value is not equal to itself.")
429+ }
430+ else throw("Strict value is not equal to itself.")
444431 }
445- else throw("Strict value is not equal to itself.")
432+ else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
433+ entries
446434 }
447435 }
448436
457445 let origInvestArray = claimResultTuple._4
458446 let newClaimPeriodHeight = claimResultTuple._5
459447 let availableToClaimArray = claimResultTuple._6
460- let availableIdoAmountToClaim = availableToClaimArray[4]
461- let availablePriceAmountToClaim = availableToClaimArray[5]
448+ let availablePriceAmountToClaim = availableToClaimArray[0]
449+ let availableIdoAmountToClaim = availableToClaimArray[1]
462450 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
463- }
464-
465-
466-
467-@Callable(i)
468-func claimV2READONLY (claimedAssetId58,userAddress58) = {
469- let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
470- let totalsDiff = claimResultTuple._1
471- let outAmount = claimResultTuple._2
472- let outAssetId = claimResultTuple._3
473- let origInvestArray = claimResultTuple._4
474- let newClaimPeriodHeight = claimResultTuple._5
475- let availableToClaimArray = claimResultTuple._6
476- let currentPeriod = availableToClaimArray[0]
477- let periodStart = availableToClaimArray[1]
478- let periodEnd = availableToClaimArray[2]
479- let totalUserAvailableToClaim = availableToClaimArray[3]
480- let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
481- let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
482- let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
483- let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
484- let currentPriceAssetRatio = availableToClaimArray[8]
485- let endPriodBlocksLeft = availableToClaimArray[9]
486- let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP)
487- $Tuple2(nil, resultString)
488451 }
489452
490453
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
55
66
77 let SEP = "__"
88
99 let BUFSCALE = toBigInt(1000000000000000000)
1010
1111 let scale8 = 100000000
12-
13-func throwErr (msg) = throw(makeString(["ido.ride:", msg], " "))
14-
1512
1613 func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = {
1714 let bPriceAssetMULT = toBigInt(priceAssetMULT)
1815 let bIdoAssetMULT = toBigInt(idoAssetMULT)
1916 let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT)
2017 let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price))
2118 toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE))
2219 }
2320
2421
2522 let IdxCfgIdoStart = 1
2623
2724 let IdxCfgIdoDuration = 2
2825
2926 let IdxCfgClaimStart = 3
3027
3128 let IdxCfgClaimDuration = 4
3229
3330 let IdxCfgPrice = 5
3431
3532 let IdxCfgPriceMult = 6
3633
3734 let IdxCfgIdoAssetId = 7
3835
3936 let IdxCfgIdoAssetMult = 8
4037
4138 let IdxCfgPriceAssetId = 9
4239
4340 let IdxCfgPriceAssetMult = 10
4441
4542 let IdxCfgMinInvestAmount = 11
4643
4744 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)
4845
4946
5047 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))
5148
5249
5350 let IdxInvTotalAmount = 1
5451
5552 let IdxInvRemainingAmount = 2
5653
5754 let IdxInvClaimedPriceAssetAmount = 3
5855
5956 let IdxInvClaimedIdoAssetAmount = 4
6057
6158 let IdxInvLastClaimedHeight = 5
6259
6360 func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP)
6461
6562
6663 func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight))
6764
6865
6966 func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP)
7067
7168
7269 func keyConfig () = "%s__config"
7370
7471
7572 func keyInvestor (userAddress) = ("%s__" + userAddress)
7673
7774
7875 func keyTotals () = "%s__totals"
7976
8077
8178 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
8279
8380
8481 func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled"
8582
8683
8784 func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight"
8885
8986
9087 func keyPeriodLength () = makeString(["%s", "periodLength"], SEP)
9188
9289
9390 func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP)
9491
9592
9693 func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP)
9794
9895
9996 func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP)
10097
10198
10299 func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP)
103100
104101
105102 func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP)
106103
107104
108105 func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP)
109106
110107
111108 func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP)
112109
113110
114111 func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP)
115112
116113
117114 func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP)
118115
119116
120117 func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP)
121118
122119
120+func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP)
121+
122+
123123 func keyManagerPublicKey () = "%s__managerPublicKey"
124124
125125
126126 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
127127
128128
129129 func readConfigArray () = split(getStringOrFail(keyConfig()), SEP)
130130
131131
132132 func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP)
133133
134134
135135 func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals())
136136
137137
138138 func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress))
139139
140140
141141 func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP)
142142
143143
144144 let IdxDiffTotalIncrement = 0
145145
146146 let IdxDiffRemainingPriceAmountIncrement = 1
147147
148148 let IdxDiffClaimedPriceAmountIncrement = 2
149149
150150 let IdxDiffClaimedIdoAssetAmountIncrement = 3
151151
152152 func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = {
153153 let totalAmount = parseIntValue(origArray[IdxInvTotalAmount])
154154 let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount])
155155 let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount])
156156 let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount])
157157 let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight])
158158 let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement])
159159 let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement])
160160 let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement])
161161 let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement])
162162 if ((0 > newRemainingAmount))
163163 then throw("invalid math")
164164 else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight))
165165 }
166166
167167
168168 func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
169169
170170
171171 func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount))
172172
173173
174174 func internalClaim (claimedAssetId58,userAddress,txId) = {
175175 let cfgArray = readConfigArray()
176176 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
177177 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
178178 let claimEnd = (claimStart + claimDuration)
179179 let price = parseIntValue(cfgArray[IdxCfgPrice])
180180 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
181181 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
182182 let idoAssetId = fromBase58String(idoAssetId58)
183183 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
184184 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
185185 let priceAssetId = fromBase58String(priceAssetId58)
186186 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
187187 let userAddress58 = toString(userAddress)
188188 let origInvestArray = readInvestorArrayOrFail(userAddress58)
189189 let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount])
190190 let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight])
191191 let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP))
192192 then claimStart
193193 else investLastClaimedHeightTMP
194194 let newClaimPeriodHeight = if ((height > claimEnd))
195195 then claimEnd
196196 else if ((claimStart > height))
197197 then claimStart
198198 else height
199199 let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight)
200- let totalUserAvailableToClaim = fraction(investTotalAmount, claimingBlocks, claimDuration)
201- let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(totalUserAvailableToClaim, priceAssetMult, price, priceMult, idoAssetMult)
200+ let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration)
201+ let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult)
202202 let isUSDN = (claimedAssetId58 == priceAssetId58)
203203 let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false)
204204 let isUSDNClaimEnded = match getInteger(keyUSDNClaimEndHeight()) {
205205 case end: Int =>
206206 (height > end)
207207 case _: Unit =>
208208 false
209209 case _ =>
210210 throw("Match error")
211211 }
212212 let checks = [if (!(if (isUSDN)
213213 then isUSDNClaimDisabled
214214 else false))
215215 then true
216- else throwErr("USDN claim is disabled"), if (!(if (isUSDN)
216+ else throw("USDN claim is disabled"), if (!(if (isUSDN)
217217 then isUSDNClaimEnded
218218 else false))
219219 then true
220- else throwErr("USDN claim is ended")]
220+ else throw("USDN claim is ended")]
221221 if ((checks == checks))
222- then {
223- let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
224- let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
225- let periodLength = value(getInteger(keyPeriodLength()))
226- let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
227- let $t01110112019 = if ((currentPeriod > 0))
228- then {
229- let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
230- let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
231- let $t01136911751 = if ((height > lastPeriodEndHeight))
232- then {
233- let updatedCurrentPeriod = (currentPeriod + 1)
234- let periodStart = (lastPeriodEndHeight + 1)
235- let periodEnd = ((periodStart + periodLength) - 1)
236- $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
237- }
238- else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
239- let updatedCurrentPeriod = $t01136911751._1
240- let periodStart = $t01136911751._2
241- let periodEnd = $t01136911751._3
242- $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
243- }
244- else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
245- let updatedCurrentPeriod = $t01110112019._1
246- let periodStart = $t01110112019._2
247- let periodEnd = $t01110112019._3
248- let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
249- let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
250- let availableClaimingPriceAssetAmount = min([totalUserAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim])
251- let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
252- let putOneTknV2PriceAssetAmount = scale8
253- let $t01268712940 = {
254- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
255- if ($isInstanceOf(@, "(Int, Int, Int)"))
256- then @
257- else throw("Couldn't cast Any to (Int, Int, Int)")
258- }
259- if (($t01268712940 == $t01268712940))
260- then {
261- let bonus = $t01268712940._3
262- let feeAmount = $t01268712940._2
263- let lpAmount = $t01268712940._1
264- let usdtAssetId = value(getString(keyUsdtAssetId()))
265- let $t01300213220 = {
266- let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
267- if ($isInstanceOf(@, "(Int, Int)"))
268- then @
269- else throw("Couldn't cast Any to (Int, Int)")
270- }
271- if (($t01300213220 == $t01300213220))
272- then {
273- let getOneTknV2FeeAmount = $t01300213220._2
274- let usdtAmount = $t01300213220._1
275- let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
276- let endPeriodBlocksLeft = (periodEnd - height)
277- if ((claimedAssetId58 == priceAssetId58))
278- then $Tuple6([0, -(availableClaimingPriceAssetAmount), availableClaimingPriceAssetAmount, 0], availableClaimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
279- else if ((claimedAssetId58 == idoAssetId58))
280- then $Tuple6([0, -(availableClaimingPriceAssetAmount), 0, availableClaimingPriceAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [updatedCurrentPeriod, periodStart, periodEnd, totalUserAvailableToClaim, claimingIdoAssetAmount, availableClaimingPriceAssetAmount, periodTotalAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft])
281- else throwErr(makeString(["unsupported assetId:", claimedAssetId58], " "))
282- }
283- else throw("Strict value is not equal to itself.")
284- }
285- else throw("Strict value is not equal to itself.")
286- }
222+ then if ((claimedAssetId58 == priceAssetId58))
223+ then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
224+ else if ((claimedAssetId58 == idoAssetId58))
225+ then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount])
226+ else throw(("unsupported assetId: " + claimedAssetId58))
287227 else throw("Strict value is not equal to itself.")
288228 }
289229
290230
291231 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
292232 case s: String =>
293233 fromBase58String(s)
294234 case _: Unit =>
295235 unit
296236 case _ =>
297237 throw("Match error")
298238 }
299239
300240
301241 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
302242 case s: String =>
303243 fromBase58String(s)
304244 case _: Unit =>
305245 unit
306246 case _ =>
307247 throw("Match error")
308248 }
309249
310250
311251 func mustManager (i) = {
312252 let pd = throw("Permission denied")
313253 match managerPublicKeyOrUnit() {
314254 case pk: ByteVector =>
315255 if ((i.callerPublicKey == pk))
316256 then true
317257 else pd
318258 case _: Unit =>
319259 if ((i.caller == this))
320260 then true
321261 else pd
322262 case _ =>
323263 throw("Match error")
324264 }
325265 }
326266
327267
328268 @Callable(i)
329269 func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = {
330270 let priceMult = ((100 * 1000) * 1000)
331271 let idoEnd = (idoStart + idoDuration)
332272 if (isDefined(getString(keyConfig())))
333273 then throw("already initialized")
334274 else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller)))
335275 then throw("not authorized")
336276 else if ((size(i.payments) != 1))
337277 then throw("exactly 1 payment must be attached")
338278 else if ((idoEnd >= claimStart))
339279 then throw("claimStart must be greater than idoEnd")
340280 else {
341281 let pmt = value(i.payments[0])
342282 let idoAssetId = value(pmt.assetId)
343283 let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info")
344284 let idoAssetId58 = toBase58String(idoAssetId)
345285 let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN)
346286 let priceAssetId = fromBase58String(priceAssetId58)
347287 let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info")
348288 let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN)
349289 let origTotalsArray = readTotalsArrayOrDefault()
350290 let totalsDiff = [0, 0, 0, 0]
351291 [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)]
352292 }
353293 }
354294
355295
356296
357297 @Callable(i)
358298 func invest () = {
359299 let cfgArray = readConfigArray()
360300 let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart])
361301 let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration])
362302 let idoEnd = (idoStart + idoDuration)
363303 let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart])
364304 let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration])
365305 let price = parseIntValue(cfgArray[IdxCfgPrice])
366306 let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult])
367307 let idoAssetId58 = cfgArray[IdxCfgIdoAssetId]
368308 let idoAssetId = fromBase58String(idoAssetId58)
369309 let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult])
370310 let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
371311 let priceAssetId = fromBase58String(priceAssetId58)
372312 let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult])
373313 let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount])
374314 let userAddress = toString(i.caller)
375315 if ((idoStart > height))
376316 then throw("ido has not been started yet")
377317 else if ((height > idoEnd))
378318 then throw("ido has been already ended")
379319 else if ((size(i.payments) != 1))
380320 then throw("exactly 1 payment is expected")
381321 else {
382322 let pmt = value(i.payments[0])
383323 let pmtAssetId = value(pmt.assetId)
384324 let pmtAmount = pmt.amount
385325 if ((pmtAssetId != priceAssetId))
386326 then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected"))
387327 else {
388328 let origInvestorArray = readInvestorArrayOrDefault(userAddress)
389329 let origTotalsArray = readTotalsArrayOrDefault()
390330 let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount)
391331 let requiredIdoAssetAmount = (newPriceTotalAmount * 100)
392332 if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId)))
393333 then throw("IDO asset has been - sold consider to use smaller payment")
394334 else {
395335 let totalsDiff = [pmtAmount, pmtAmount, 0, 0]
396336 [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)]
397337 }
398338 }
399339 }
400340 }
401341
402342
403343
404344 @Callable(i)
405345 func claim (claimedAssetId58,userAddress58) = {
406346 let callerAddress58 = toString(i.caller)
407347 if ((userAddress58 != callerAddress58))
408- then throwErr("not authorized")
348+ then throw("not authorized")
409349 else {
410- let priceAssetId = readConfigArray()[IdxCfgPriceAssetId]
350+ let cfgArray = readConfigArray()
351+ let priceAssetId58 = cfgArray[IdxCfgPriceAssetId]
411352 let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId)
412353 let totalsDiff = claimResultTuple._1
413354 let outAmount = claimResultTuple._2
414355 let outAssetId = claimResultTuple._3
415356 let origInvestArray = claimResultTuple._4
416357 let newClaimPeriodHeight = claimResultTuple._5
417- let availableToClaimArray = claimResultTuple._6
418- let currentPeriod = availableToClaimArray[0]
419- let periodStart = availableToClaimArray[1]
420- let periodEnd = availableToClaimArray[2]
421- let totalUserAvailableToClaim = availableToClaimArray[3]
422- let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
423- let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
424- let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
425- let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
426- let currentPriceAssetRatio = availableToClaimArray[8]
427- let endPriodBlocksLeft = availableToClaimArray[9]
428- let checks = [if (if ((totalUserAvailableToClaim > 0))
429- then true
430- else (periodAvailableIdoAmountToClaim > 0))
431- then true
432- else throwErr("nothing to claim"), if ((periodAvailableUserPriceAmountToClaim > 0))
433- then true
434- else throwErr("unavailable to claim because user period allowance reached"), if ((periodAvailableTotalPriceAmountToClaim > 0))
435- then true
436- else throwErr("unavailable to claim because total period allowance reached")]
437- if ((checks == checks))
358+ let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
359+ let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
360+ let entries = if ((claimedAssetId58 == priceAssetId58))
438361 then {
439- let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement]
440- let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement]
441- let updatedPeriodTotalAvailableToClaim = (periodAvailableTotalPriceAmountToClaim - claimedPriceAmountFromDiff)
442- let updatedPeriodUserAvailableToClaim = (periodAvailableUserPriceAmountToClaim - claimedPriceAmountFromDiff)
443- $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
362+ let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58)))
363+ let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58)))
364+ let periodLength = value(getInteger(keyPeriodLength()))
365+ let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0)
366+ let $t01698717941 = if ((currentPeriod > 0))
367+ then {
368+ let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight((currentPeriod - 1))))
369+ let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight((currentPeriod - 1))))
370+ let $t01726117657 = if ((height > lastPeriodEndHeight))
371+ then {
372+ let updatedCurrentPeriod = (currentPeriod + 1)
373+ let periodStart = (lastPeriodEndHeight + 1)
374+ let periodEnd = ((periodStart + periodLength) - 1)
375+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
376+ }
377+ else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight)
378+ let updatedCurrentPeriod = $t01726117657._1
379+ let periodStart = $t01726117657._2
380+ let periodEnd = $t01726117657._3
381+ $Tuple3(updatedCurrentPeriod, periodStart, periodEnd)
382+ }
383+ else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1)))
384+ let updatedCurrentPeriod = $t01698717941._1
385+ let periodStart = $t01698717941._2
386+ let periodEnd = $t01698717941._3
387+ let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance)
388+ let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance)
389+ let periodMinAvailableToClaim = min([outAmount, periodTotalAvailableToClaim, periodUserAvailableToClaim])
390+ let totalUserAvailableToClaim = totalsDiff[IdxInvClaimedPriceAssetAmount]
391+ let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio()))
392+ let putOneTknV2PriceAssetAmount = scale8
393+ let $t01869718960 = {
394+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil)
395+ if ($isInstanceOf(@, "(Int, Int, Int)"))
396+ then @
397+ else throw("Couldn't cast Any to (Int, Int, Int)")
398+ }
399+ if (($t01869718960 == $t01869718960))
400+ then {
401+ let bonus = $t01869718960._3
402+ let feeAmount = $t01869718960._2
403+ let lpAmount = $t01869718960._1
404+ let usdtAssetId = value(getString(keyUsdtAssetId()))
405+ let $t01902619254 = {
406+ let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil)
407+ if ($isInstanceOf(@, "(Int, Int)"))
408+ then @
409+ else throw("Couldn't cast Any to (Int, Int)")
410+ }
411+ if (($t01902619254 == $t01902619254))
412+ then {
413+ let getOneTknV2FeeAmount = $t01902619254._2
414+ let usdtAmount = $t01902619254._1
415+ let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8)
416+ let endPeriodBlocksLeft = (periodEnd - height)
417+ let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0)
418+ let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim)
419+ let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim)
420+ let entries = if ((priceAssetBalance >= periodMinAvailableToClaim))
421+ then [ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))]
422+ else {
423+ let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim)
424+[ScriptTransfer(i.caller, periodMinAvailableToClaim, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)]
425+ }
426+ $Tuple2(([IntegerEntry(keyCurrentPeriod(), currentPeriod), IntegerEntry(keyPeriodStartHeight(currentPeriod), periodStart), IntegerEntry(keyPeriodEndHeight(currentPeriod), periodEnd), IntegerEntry(keyPeriodTotalAvailableToClaim(priceAssetId58, currentPeriod), updatedPeriodTotalAvailableToClaim), IntegerEntry(keyPeriodUserAvailableToClaim(priceAssetId58, currentPeriod, userAddress58), updatedPeriodUserAvailableToClaim), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit)
427+ }
428+ else throw("Strict value is not equal to itself.")
429+ }
430+ else throw("Strict value is not equal to itself.")
444431 }
445- else throw("Strict value is not equal to itself.")
432+ else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit)
433+ entries
446434 }
447435 }
448436
449437
450438
451439 @Callable(i)
452440 func claimREADONLY (claimedAssetId58,userAddress58) = {
453441 let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
454442 let totalsDiff = claimResultTuple._1
455443 let outAmount = claimResultTuple._2
456444 let outAssetId = claimResultTuple._3
457445 let origInvestArray = claimResultTuple._4
458446 let newClaimPeriodHeight = claimResultTuple._5
459447 let availableToClaimArray = claimResultTuple._6
460- let availableIdoAmountToClaim = availableToClaimArray[4]
461- let availablePriceAmountToClaim = availableToClaimArray[5]
448+ let availablePriceAmountToClaim = availableToClaimArray[0]
449+ let availableIdoAmountToClaim = availableToClaimArray[1]
462450 $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP))
463- }
464-
465-
466-
467-@Callable(i)
468-func claimV2READONLY (claimedAssetId58,userAddress58) = {
469- let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String(""))
470- let totalsDiff = claimResultTuple._1
471- let outAmount = claimResultTuple._2
472- let outAssetId = claimResultTuple._3
473- let origInvestArray = claimResultTuple._4
474- let newClaimPeriodHeight = claimResultTuple._5
475- let availableToClaimArray = claimResultTuple._6
476- let currentPeriod = availableToClaimArray[0]
477- let periodStart = availableToClaimArray[1]
478- let periodEnd = availableToClaimArray[2]
479- let totalUserAvailableToClaim = availableToClaimArray[3]
480- let periodAvailableIdoAmountToClaim = availableToClaimArray[4]
481- let periodAvailableUserPriceAmountToClaim = availableToClaimArray[5]
482- let periodAvailableTotalPriceAmountToClaim = availableToClaimArray[6]
483- let usdtPriceAssetAllowableRatio = availableToClaimArray[7]
484- let currentPriceAssetRatio = availableToClaimArray[8]
485- let endPriodBlocksLeft = availableToClaimArray[9]
486- let resultString = makeString(["%d%d%d%d%d%d%d", toString(totalUserAvailableToClaim), toString(periodAvailableIdoAmountToClaim), toString(periodAvailableUserPriceAmountToClaim), toString(periodAvailableTotalPriceAmountToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentPriceAssetRatio), toString(endPriodBlocksLeft)], SEP)
487- $Tuple2(nil, resultString)
488451 }
489452
490453
491454
492455 @Callable(i)
493456 func setManager (pendingManagerPublicKey) = {
494457 let checkCaller = mustManager(i)
495458 if ((checkCaller == checkCaller))
496459 then {
497460 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
498461 if ((checkManagerPublicKey == checkManagerPublicKey))
499462 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
500463 else throw("Strict value is not equal to itself.")
501464 }
502465 else throw("Strict value is not equal to itself.")
503466 }
504467
505468
506469
507470 @Callable(i)
508471 func confirmManager () = {
509472 let pm = pendingManagerPublicKeyOrUnit()
510473 let hasPM = if (isDefined(pm))
511474 then true
512475 else throw("No pending manager")
513476 if ((hasPM == hasPM))
514477 then {
515478 let checkPM = if ((i.callerPublicKey == value(pm)))
516479 then true
517480 else throw("You are not pending manager")
518481 if ((checkPM == checkPM))
519482 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
520483 else throw("Strict value is not equal to itself.")
521484 }
522485 else throw("Strict value is not equal to itself.")
523486 }
524487
525488
526489 @Verifier(tx)
527490 func verify () = {
528491 let targetPublicKey = match managerPublicKeyOrUnit() {
529492 case pk: ByteVector =>
530493 pk
531494 case _: Unit =>
532495 tx.senderPublicKey
533496 case _ =>
534497 throw("Match error")
535498 }
536499 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
537500 }
538501

github/deemru/w8io/026f985 
71.44 ms