tx · GuP8Xv9mLH4Nfg6XJ7qwX6jG8MxyaMe8a4uKGCrTnG94 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv: -0.02600000 Waves 2022.11.03 15:29 [2300939] smart account 3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv > SELF 0.00000000 Waves
{ "type": 13, "id": "GuP8Xv9mLH4Nfg6XJ7qwX6jG8MxyaMe8a4uKGCrTnG94", "fee": 2600000, "feeAssetId": null, "timestamp": 1667478592466, "version": 1, "sender": "3MvZpvvbmovEt3pvdDZKvhKRjjQxdbUD6Tv", "senderPublicKey": "39YkRD2qWXTcdNBr4CbDnm8g8SAB2FKVaDeGYahcFHHx", "proofs": [ "33qJ6SEP5YTP6rcSRdpF9yBXtZfx6qHWtskUMj8i3feBQLn8QfnRDaWTG2M6rVXH6C38qJ7QQAkKHmgcZJYYGEUf" ], "script": "base64:AAIFAAAAAAAAD0gIAhIJCgcBAQEBAQgBEgASBAoCCAgSBAoCCAgSBAoCCAgSAwoBCBIAIg9nZXRTdHJpbmdPckZhaWwiA2tleSIDU0VQIghCVUZTQ0FMRSIGc2NhbGU4Igh0aHJvd0VyciIDbXNnIh1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldCIQcHJpY2VBc3NldEFtb3VudCIOcHJpY2VBc3NldE1VTFQiBXByaWNlIglwcmljZU1VTFQiDGlkb0Fzc2V0TVVMVCIPYlByaWNlQXNzZXRNVUxUIg1iSWRvQXNzZXRNVUxUIg5iUHJpY2VBc3NldEJVRiIPYkFtb3VudEFzc2V0QlVGIg5JZHhDZmdJZG9TdGFydCIRSWR4Q2ZnSWRvRHVyYXRpb24iEElkeENmZ0NsYWltU3RhcnQiE0lkeENmZ0NsYWltRHVyYXRpb24iC0lkeENmZ1ByaWNlIg9JZHhDZmdQcmljZU11bHQiEElkeENmZ0lkb0Fzc2V0SWQiEklkeENmZ0lkb0Fzc2V0TXVsdCISSWR4Q2ZnUHJpY2VBc3NldElkIhRJ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AAAAgkBAAAAAmFCAAAAAAkAAlgAAAABCQEAAAAFdmFsdWUAAAABBQAAAAJjVgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAACYUMAAAAABQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACY1kBAAAAAmNaAAAAAAQAAAACZGEEAAAAAmNkCQEAAAACY2MAAAAAAwkAAAEAAAACBQAAAAJjZAIAAAAKQnl0ZVZlY3RvcgQAAAACY2oFAAAAAmNkBQAAAAJjagMJAAABAAAAAgUAAAACY2QCAAAABFVuaXQIBQAAAAJjWQAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAmNZAAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY1kAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAJkYbOZp1U=", "chainId": 84, "height": 2300939, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GBouABYyNQ5qo27b5P8iaJYzD4HchJFMfEodyP7GNdtZ Next: Gt88UggJwxKtQUPsE15emTGt1vg7P8xeJqxLfP4A9anP Diff:
Old | New | Differences | |
---|---|---|---|
211 | 211 | else throw("USDN claim is disabled")] | |
212 | 212 | if ((checks == checks)) | |
213 | 213 | then if ((claimedAssetId58 == priceAssetId58)) | |
214 | - | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
214 | + | then { | |
215 | + | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
216 | + | let claimingPriceAssetAmountPriceAssetDecimals = fraction(claimingPriceAssetAmount, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
217 | + | $Tuple6([0, -(claimingPriceAssetAmountPriceAssetDecimals), claimingPriceAssetAmountPriceAssetDecimals, 0], claimingPriceAssetAmountPriceAssetDecimals, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmountPriceAssetDecimals, claimingIdoAssetAmount]) | |
218 | + | } | |
215 | 219 | else if ((claimedAssetId58 == idoAssetId58)) | |
216 | 220 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
217 | 221 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
225 | 229 | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | 230 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | 231 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
228 | - | let $ | |
232 | + | let $t01215314023 = if ((currentPeriod > 0)) | |
229 | 233 | then { | |
230 | 234 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
231 | 235 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
232 | - | let $ | |
236 | + | let $t01241313118 = if ((height > lastPeriodEndHeight)) | |
233 | 237 | then { | |
234 | 238 | let updatedCurrentPeriod = (currentPeriod + 1) | |
235 | 239 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
244 | 248 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
245 | 249 | } | |
246 | 250 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
247 | - | let updatedCurrentPeriod = $ | |
248 | - | let periodStart = $ | |
249 | - | let periodEnd = $ | |
251 | + | let updatedCurrentPeriod = $t01241313118._1 | |
252 | + | let periodStart = $t01241313118._2 | |
253 | + | let periodEnd = $t01241313118._3 | |
250 | 254 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
251 | 255 | } | |
252 | 256 | else if (zeroPeriodEndHeighIsDefined) | |
253 | 257 | then { | |
254 | 258 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
255 | 259 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
256 | - | let $ | |
260 | + | let $t01337313755 = if ((height > zeroPeriodEndHeight)) | |
257 | 261 | then { | |
258 | 262 | let updatedCurrentPeriod = (currentPeriod + 1) | |
259 | 263 | let periodStart = (zeroPeriodEndHeight + 1) | |
261 | 265 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
262 | 266 | } | |
263 | 267 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
264 | - | let updatedCurrentPeriod = $ | |
265 | - | let periodStart = $ | |
266 | - | let periodEnd = $ | |
268 | + | let updatedCurrentPeriod = $t01337313755._1 | |
269 | + | let periodStart = $t01337313755._2 | |
270 | + | let periodEnd = $t01337313755._3 | |
267 | 271 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
268 | 272 | } | |
269 | 273 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
270 | - | let updatedCurrentPeriod = $ | |
271 | - | let periodStart = $ | |
272 | - | let periodEnd = $ | |
274 | + | let updatedCurrentPeriod = $t01215314023._1 | |
275 | + | let periodStart = $t01215314023._2 | |
276 | + | let periodEnd = $t01215314023._3 | |
273 | 277 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
274 | 278 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
275 | 279 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
276 | 280 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
277 | - | let sum = (outAmount + priceAssetBalance) | |
278 | - | let err = throw(makeString([toString(outAmount), toString(priceAssetBalance), toString(sum), toString(periodTotalAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)) | |
279 | - | if ((err == err)) | |
281 | + | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
282 | + | let putOneTknV2PriceAssetAmount = scale8 | |
283 | + | let $t01477815031 = { | |
284 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
285 | + | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
286 | + | then @ | |
287 | + | else throw("Couldn't cast Any to (Int, Int, Int)") | |
288 | + | } | |
289 | + | if (($t01477815031 == $t01477815031)) | |
280 | 290 | then { | |
281 | - | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
282 | - | let putOneTknV2PriceAssetAmount = scale8 | |
283 | - | let $t01471414967 = { | |
284 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
285 | - | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
291 | + | let bonus = $t01477815031._3 | |
292 | + | let feeAmount = $t01477815031._2 | |
293 | + | let lpAmount = $t01477815031._1 | |
294 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | + | let $t01509315311 = { | |
296 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
297 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
286 | 298 | then @ | |
287 | - | else throw("Couldn't cast Any to (Int, Int | |
299 | + | else throw("Couldn't cast Any to (Int, Int)") | |
288 | 300 | } | |
289 | - | if (($ | |
301 | + | if (($t01509315311 == $t01509315311)) | |
290 | 302 | then { | |
291 | - | let bonus = $t01471414967._3 | |
292 | - | let feeAmount = $t01471414967._2 | |
293 | - | let lpAmount = $t01471414967._1 | |
294 | - | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | - | let $t01502915247 = { | |
296 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
297 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
298 | - | then @ | |
299 | - | else throw("Couldn't cast Any to (Int, Int)") | |
300 | - | } | |
301 | - | if (($t01502915247 == $t01502915247)) | |
302 | - | then { | |
303 | - | let getOneTknV2FeeAmount = $t01502915247._2 | |
304 | - | let usdtAmount = $t01502915247._1 | |
305 | - | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
306 | - | let endPeriodBlocksLeft = (periodEnd - height) | |
307 | - | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
308 | - | } | |
309 | - | else throw("Strict value is not equal to itself.") | |
303 | + | let getOneTknV2FeeAmount = $t01509315311._2 | |
304 | + | let usdtAmount = $t01509315311._1 | |
305 | + | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
306 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
307 | + | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
310 | 308 | } | |
311 | 309 | else throw("Strict value is not equal to itself.") | |
312 | 310 | } | |
445 | 443 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
446 | 444 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
447 | 445 | then { | |
448 | - | let $ | |
449 | - | let periodMinAvailableToClaim = $ | |
450 | - | let periodTotalAvailableToClaim = $ | |
451 | - | let periodUserAvailableToClaim = $ | |
452 | - | let totalUserAvailableToClaim = $ | |
453 | - | let usdtPriceAssetAllowableRatio = $ | |
454 | - | let currentUsdtPriceAssetRatio = $ | |
455 | - | let endPeriodBlocksLeft = $ | |
456 | - | let updatedCurrentPeriod = $ | |
457 | - | let periodStart = $ | |
458 | - | let periodEnd = $ | |
446 | + | let $t02096721411 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
447 | + | let periodMinAvailableToClaim = $t02096721411._1 | |
448 | + | let periodTotalAvailableToClaim = $t02096721411._2 | |
449 | + | let periodUserAvailableToClaim = $t02096721411._3 | |
450 | + | let totalUserAvailableToClaim = $t02096721411._4 | |
451 | + | let usdtPriceAssetAllowableRatio = $t02096721411._5 | |
452 | + | let currentUsdtPriceAssetRatio = $t02096721411._6 | |
453 | + | let endPeriodBlocksLeft = $t02096721411._7 | |
454 | + | let updatedCurrentPeriod = $t02096721411._8 | |
455 | + | let periodStart = $t02096721411._9 | |
456 | + | let periodEnd = $t02096721411._10 | |
459 | 457 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
460 | 458 | then true | |
461 | 459 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
472 | 470 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
473 | 471 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
474 | 472 | let periodMinAvailableToClaimPriceAssetDecimals = fraction(periodMinAvailableToClaim, pow(10, 0, priceAssetDecimals, 0, 0, DOWN), scale8) | |
475 | - | let error = throw(makeString([toString(priceAssetDecimals), toString(periodMinAvailableToClaim), toString(periodMinAvailableToClaimPriceAssetDecimals)], SEP)) | |
476 | - | if ((error == error)) | |
477 | - | then { | |
478 | - | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
479 | - | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
480 | - | else { | |
481 | - | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
473 | + | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
474 | + | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
475 | + | else { | |
476 | + | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
482 | 477 | [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
483 | - | } | |
484 | - | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
485 | 478 | } | |
486 | - | | |
479 | + | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
487 | 480 | } | |
488 | 481 | else throw("Strict value is not equal to itself.") | |
489 | 482 | } | |
525 | 518 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
526 | 519 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
527 | 520 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance) | |
528 | - | let $ | |
529 | - | let periodMinAvailableToClaim = $ | |
530 | - | let periodTotalAvailableToClaim = $ | |
531 | - | let periodUserAvailableToClaim = $ | |
532 | - | let totalUserAvailableToClaim = $ | |
533 | - | let usdtPriceAssetAllowableRatio = $ | |
534 | - | let currentUsdtPriceAssetRatio = $ | |
535 | - | let endPeriodBlocksLeft = $ | |
536 | - | let updatedCurrentPeriod = $ | |
537 | - | let periodStart = $ | |
538 | - | let periodEnd = $ | |
521 | + | let $t02774128153 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
522 | + | let periodMinAvailableToClaim = $t02774128153._1 | |
523 | + | let periodTotalAvailableToClaim = $t02774128153._2 | |
524 | + | let periodUserAvailableToClaim = $t02774128153._3 | |
525 | + | let totalUserAvailableToClaim = $t02774128153._4 | |
526 | + | let usdtPriceAssetAllowableRatio = $t02774128153._5 | |
527 | + | let currentUsdtPriceAssetRatio = $t02774128153._6 | |
528 | + | let endPeriodBlocksLeft = $t02774128153._7 | |
529 | + | let updatedCurrentPeriod = $t02774128153._8 | |
530 | + | let periodStart = $t02774128153._9 | |
531 | + | let periodEnd = $t02774128153._10 | |
539 | 532 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
540 | 533 | let decimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
541 | 534 | let resultString = if ((height > currentPeriodEndHeight)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let SEP = "__" | |
8 | 8 | ||
9 | 9 | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | 10 | ||
11 | 11 | let scale8 = 100000000 | |
12 | 12 | ||
13 | 13 | func throwErr (msg) = throw(makeString(["ido.ride:", msg], " ")) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
17 | 17 | let bPriceAssetMULT = toBigInt(priceAssetMULT) | |
18 | 18 | let bIdoAssetMULT = toBigInt(idoAssetMULT) | |
19 | 19 | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceAssetMULT) | |
20 | 20 | let bAmountAssetBUF = fraction(bPriceAssetBUF, toBigInt(priceMULT), toBigInt(price)) | |
21 | 21 | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | let IdxCfgIdoStart = 1 | |
26 | 26 | ||
27 | 27 | let IdxCfgIdoDuration = 2 | |
28 | 28 | ||
29 | 29 | let IdxCfgClaimStart = 3 | |
30 | 30 | ||
31 | 31 | let IdxCfgClaimDuration = 4 | |
32 | 32 | ||
33 | 33 | let IdxCfgPrice = 5 | |
34 | 34 | ||
35 | 35 | let IdxCfgPriceMult = 6 | |
36 | 36 | ||
37 | 37 | let IdxCfgIdoAssetId = 7 | |
38 | 38 | ||
39 | 39 | let IdxCfgIdoAssetMult = 8 | |
40 | 40 | ||
41 | 41 | let IdxCfgPriceAssetId = 9 | |
42 | 42 | ||
43 | 43 | let IdxCfgPriceAssetMult = 10 | |
44 | 44 | ||
45 | 45 | let IdxCfgMinInvestAmount = 11 | |
46 | 46 | ||
47 | 47 | 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) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | 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)) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | let IdxInvTotalAmount = 1 | |
54 | 54 | ||
55 | 55 | let IdxInvRemainingAmount = 2 | |
56 | 56 | ||
57 | 57 | let IdxInvClaimedPriceAssetAmount = 3 | |
58 | 58 | ||
59 | 59 | let IdxInvClaimedIdoAssetAmount = 4 | |
60 | 60 | ||
61 | 61 | let IdxInvLastClaimedHeight = 5 | |
62 | 62 | ||
63 | 63 | func formatInvestorS (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = makeString(["%d%d%d%d%d", totalAmount, remainingAmount, claimedPriceAssetAmount, claimedIdoAssetAmount, lastClaimedHeight], SEP) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func formatInvestor (totalAmount,remainingAmount,claimedPriceAssetAmount,claimedIdoAssetAmount,lastClaimedHeight) = formatInvestorS(toString(totalAmount), toString(remainingAmount), toString(claimedPriceAssetAmount), toString(claimedIdoAssetAmount), toString(lastClaimedHeight)) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func formatHistoryRecord (priceAssetAmount,idoAssetAmount) = makeString(["%d%d%d%d", toString(height), toString(lastBlock.timestamp), toString(priceAssetAmount), toString(idoAssetAmount)], SEP) | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | func keyConfig () = "%s__config" | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func keyInvestor (userAddress) = ("%s__" + userAddress) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyTotals () = "%s__totals" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func keyUSDNClaimDisabled () = "%s__usdnClaimDisabled" | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyUSDNClaimEndHeight () = "%s__usdnClaimEndHeight" | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyPeriodLength () = makeString(["%s", "periodLength"], SEP) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyCurrentPeriod () = makeString(["%s", "currentPeriod"], SEP) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyPeriodStartHeight (periodNum) = makeString(["%s%s", "periodStartHeight", toString(periodNum)], SEP) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyPeriodEndHeight (periodNum) = makeString(["%s%s", "periodEndHeight", toString(periodNum)], SEP) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyUsdtPriceAssetAllowableRatio () = makeString(["%s", "usdtPriceAssetAllowableRatio"], SEP) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyTotalPeriodAllowance (assetId) = makeString(["%s%s", "totalPeriodAllowance", assetId], SEP) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyUserPeriodAllowance (assetId) = makeString(["%s%s", "userPeriodAllowance", assetId], SEP) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keyPeriodTotalAvailableToClaim (assetId,periodNum) = makeString(["%s%s%s", "periodTotalAvailableToClaim", assetId, toString(periodNum)], SEP) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyPeriodUserAvailableToClaim (assetId,periodNum,userAddress) = makeString(["%s%s%s%s", "periodUserAvailableToClaim", assetId, toString(periodNum), userAddress], SEP) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyUsdtPriceAssetStablePool () = makeString(["%s", "usdtPriceAssetStablePool"], SEP) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyUsdtAssetId () = makeString(["%s", "usdtAssetId"], SEP) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyPriceAssetBalance (address) = makeString(["%s%s", "priceAssetBalance", address], SEP) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func readConfigArray () = split(getStringOrFail(keyConfig()), SEP) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func readTotalsArrayOrDefaultByCustomKey (customKey) = split(valueOrElse(getString(customKey), formatInvestorS("0", "0", "0", "0", "0")), SEP) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func readTotalsArrayOrDefault () = readTotalsArrayOrDefaultByCustomKey(keyTotals()) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func readInvestorArrayOrDefault (userAddress) = readTotalsArrayOrDefaultByCustomKey(keyInvestor(userAddress)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func readInvestorArrayOrFail (userAddress) = split(getStringOrFail(keyInvestor(userAddress)), SEP) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | let IdxDiffTotalIncrement = 0 | |
148 | 148 | ||
149 | 149 | let IdxDiffRemainingPriceAmountIncrement = 1 | |
150 | 150 | ||
151 | 151 | let IdxDiffClaimedPriceAmountIncrement = 2 | |
152 | 152 | ||
153 | 153 | let IdxDiffClaimedIdoAssetAmountIncrement = 3 | |
154 | 154 | ||
155 | 155 | func TotalsEntry (key,origArray,incrementDiff,newLastClaimedHeight) = { | |
156 | 156 | let totalAmount = parseIntValue(origArray[IdxInvTotalAmount]) | |
157 | 157 | let remainingAmount = parseIntValue(origArray[IdxInvRemainingAmount]) | |
158 | 158 | let claimedPriceAssetAmount = parseIntValue(origArray[IdxInvClaimedPriceAssetAmount]) | |
159 | 159 | let claimedIdoAssetAmount = parseIntValue(origArray[IdxInvClaimedIdoAssetAmount]) | |
160 | 160 | let lastClaimedHeight = parseIntValue(origArray[IdxInvLastClaimedHeight]) | |
161 | 161 | let newTotalAmount = (totalAmount + incrementDiff[IdxDiffTotalIncrement]) | |
162 | 162 | let newRemainingAmount = (remainingAmount + incrementDiff[IdxDiffRemainingPriceAmountIncrement]) | |
163 | 163 | let newClaimedPriceAssetAmount = (claimedPriceAssetAmount + incrementDiff[IdxDiffClaimedPriceAmountIncrement]) | |
164 | 164 | let newClaimedIdoAssetAmount = (claimedIdoAssetAmount + incrementDiff[IdxDiffClaimedIdoAssetAmountIncrement]) | |
165 | 165 | if ((0 > newRemainingAmount)) | |
166 | 166 | then throw("invalid math") | |
167 | 167 | else StringEntry(key, formatInvestor(newTotalAmount, newRemainingAmount, newClaimedPriceAssetAmount, newClaimedIdoAssetAmount, newLastClaimedHeight)) | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func InvestOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("invest", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func ClaimOperationHistoryEntry (userAddress,priceAssetAmount,idoAssetAmount,txId) = StringEntry(keyOperationHistoryRecord("claim", userAddress, toBase58String(txId)), formatHistoryRecord(priceAssetAmount, idoAssetAmount)) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func internalClaim (claimedAssetId58,userAddress,txId) = { | |
178 | 178 | let cfgArray = readConfigArray() | |
179 | 179 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
180 | 180 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
181 | 181 | let claimEnd = (claimStart + claimDuration) | |
182 | 182 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
183 | 183 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
184 | 184 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
185 | 185 | let idoAssetId = fromBase58String(idoAssetId58) | |
186 | 186 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
187 | 187 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
188 | 188 | let priceAssetId = fromBase58String(priceAssetId58) | |
189 | 189 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
190 | 190 | let userAddress58 = toString(userAddress) | |
191 | 191 | let origInvestArray = readInvestorArrayOrFail(userAddress58) | |
192 | 192 | let investTotalAmount = parseIntValue(origInvestArray[IdxInvTotalAmount]) | |
193 | 193 | let investLastClaimedHeightTMP = parseIntValue(origInvestArray[IdxInvLastClaimedHeight]) | |
194 | 194 | let investLastClaimedHeight = if ((claimStart >= investLastClaimedHeightTMP)) | |
195 | 195 | then claimStart | |
196 | 196 | else investLastClaimedHeightTMP | |
197 | 197 | let newClaimPeriodHeight = if ((height > claimEnd)) | |
198 | 198 | then claimEnd | |
199 | 199 | else if ((claimStart > height)) | |
200 | 200 | then claimStart | |
201 | 201 | else height | |
202 | 202 | let claimingBlocks = (newClaimPeriodHeight - investLastClaimedHeight) | |
203 | 203 | let claimingPriceAssetAmount = fraction(investTotalAmount, claimingBlocks, claimDuration) | |
204 | 204 | let claimingIdoAssetAmount = convertPriceAssetIntoIdoAsset(claimingPriceAssetAmount, priceAssetMult, price, priceMult, idoAssetMult) | |
205 | 205 | let isUSDN = (claimedAssetId58 == priceAssetId58) | |
206 | 206 | let isUSDNClaimDisabled = valueOrElse(getBoolean(keyUSDNClaimDisabled()), false) | |
207 | 207 | let checks = [if (!(if (isUSDN) | |
208 | 208 | then isUSDNClaimDisabled | |
209 | 209 | else false)) | |
210 | 210 | then true | |
211 | 211 | else throw("USDN claim is disabled")] | |
212 | 212 | if ((checks == checks)) | |
213 | 213 | then if ((claimedAssetId58 == priceAssetId58)) | |
214 | - | then $Tuple6([0, -(claimingPriceAssetAmount), claimingPriceAssetAmount, 0], claimingPriceAssetAmount, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
214 | + | then { | |
215 | + | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
216 | + | let claimingPriceAssetAmountPriceAssetDecimals = fraction(claimingPriceAssetAmount, scale8, pow(10, 0, priceAssetDecimals, 0, 0, DOWN)) | |
217 | + | $Tuple6([0, -(claimingPriceAssetAmountPriceAssetDecimals), claimingPriceAssetAmountPriceAssetDecimals, 0], claimingPriceAssetAmountPriceAssetDecimals, priceAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmountPriceAssetDecimals, claimingIdoAssetAmount]) | |
218 | + | } | |
215 | 219 | else if ((claimedAssetId58 == idoAssetId58)) | |
216 | 220 | then $Tuple6([0, -(claimingPriceAssetAmount), 0, claimingIdoAssetAmount], claimingIdoAssetAmount, idoAssetId, origInvestArray, newClaimPeriodHeight, [claimingPriceAssetAmount, claimingIdoAssetAmount]) | |
217 | 221 | else throw(("unsupported assetId: " + claimedAssetId58)) | |
218 | 222 | else throw("Strict value is not equal to itself.") | |
219 | 223 | } | |
220 | 224 | ||
221 | 225 | ||
222 | 226 | func internalClaimV2 (priceAssetId58,userAddress58,outAmount,totalUserAvailableToClaim) = { | |
223 | 227 | let totalPeriodPriceAssetAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
224 | 228 | let userPeriodPriceAssetAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
225 | 229 | let periodLength = value(getInteger(keyPeriodLength())) | |
226 | 230 | let currentPeriod = valueOrElse(getInteger(keyCurrentPeriod()), 0) | |
227 | 231 | let zeroPeriodEndHeighIsDefined = isDefined(getInteger(keyPeriodEndHeight(0))) | |
228 | - | let $ | |
232 | + | let $t01215314023 = if ((currentPeriod > 0)) | |
229 | 233 | then { | |
230 | 234 | let lastPeriodStartHeight = value(getInteger(keyPeriodStartHeight(currentPeriod))) | |
231 | 235 | let lastPeriodEndHeight = value(getInteger(keyPeriodEndHeight(currentPeriod))) | |
232 | - | let $ | |
236 | + | let $t01241313118 = if ((height > lastPeriodEndHeight)) | |
233 | 237 | then { | |
234 | 238 | let updatedCurrentPeriod = (currentPeriod + 1) | |
235 | 239 | let periodStart = if ((height > (lastPeriodEndHeight + periodLength))) | |
236 | 240 | then { | |
237 | 241 | let blocksToLastPeriodStart = ((height - lastPeriodEndHeight) % periodLength) | |
238 | 242 | if ((blocksToLastPeriodStart == 0)) | |
239 | 243 | then ((height - periodLength) + 1) | |
240 | 244 | else (height - blocksToLastPeriodStart) | |
241 | 245 | } | |
242 | 246 | else (lastPeriodEndHeight + 1) | |
243 | 247 | let periodEnd = ((periodStart + periodLength) - 1) | |
244 | 248 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
245 | 249 | } | |
246 | 250 | else $Tuple3(currentPeriod, lastPeriodStartHeight, lastPeriodEndHeight) | |
247 | - | let updatedCurrentPeriod = $ | |
248 | - | let periodStart = $ | |
249 | - | let periodEnd = $ | |
251 | + | let updatedCurrentPeriod = $t01241313118._1 | |
252 | + | let periodStart = $t01241313118._2 | |
253 | + | let periodEnd = $t01241313118._3 | |
250 | 254 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
251 | 255 | } | |
252 | 256 | else if (zeroPeriodEndHeighIsDefined) | |
253 | 257 | then { | |
254 | 258 | let zeroPeriodStartHeight = value(getInteger(keyPeriodStartHeight(0))) | |
255 | 259 | let zeroPeriodEndHeight = value(getInteger(keyPeriodEndHeight(0))) | |
256 | - | let $ | |
260 | + | let $t01337313755 = if ((height > zeroPeriodEndHeight)) | |
257 | 261 | then { | |
258 | 262 | let updatedCurrentPeriod = (currentPeriod + 1) | |
259 | 263 | let periodStart = (zeroPeriodEndHeight + 1) | |
260 | 264 | let periodEnd = ((periodStart + periodLength) - 1) | |
261 | 265 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
262 | 266 | } | |
263 | 267 | else $Tuple3(currentPeriod, zeroPeriodStartHeight, zeroPeriodEndHeight) | |
264 | - | let updatedCurrentPeriod = $ | |
265 | - | let periodStart = $ | |
266 | - | let periodEnd = $ | |
268 | + | let updatedCurrentPeriod = $t01337313755._1 | |
269 | + | let periodStart = $t01337313755._2 | |
270 | + | let periodEnd = $t01337313755._3 | |
267 | 271 | $Tuple3(updatedCurrentPeriod, periodStart, periodEnd) | |
268 | 272 | } | |
269 | 273 | else $Tuple3(currentPeriod, valueOrElse(getInteger(keyPeriodStartHeight(currentPeriod)), height), valueOrElse(getInteger(keyPeriodEndHeight(currentPeriod)), ((height + periodLength) - 1))) | |
270 | - | let updatedCurrentPeriod = $ | |
271 | - | let periodStart = $ | |
272 | - | let periodEnd = $ | |
274 | + | let updatedCurrentPeriod = $t01215314023._1 | |
275 | + | let periodStart = $t01215314023._2 | |
276 | + | let periodEnd = $t01215314023._3 | |
273 | 277 | let periodTotalAvailableToClaim = valueOrElse(getInteger(keyPeriodTotalAvailableToClaim(priceAssetId58, updatedCurrentPeriod)), totalPeriodPriceAssetAllowance) | |
274 | 278 | let periodUserAvailableToClaim = valueOrElse(getInteger(keyPeriodUserAvailableToClaim(priceAssetId58, updatedCurrentPeriod, userAddress58)), userPeriodPriceAssetAllowance) | |
275 | 279 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
276 | 280 | let periodMinAvailableToClaim = min([(outAmount + priceAssetBalance), periodTotalAvailableToClaim, periodUserAvailableToClaim]) | |
277 | - | let sum = (outAmount + priceAssetBalance) | |
278 | - | let err = throw(makeString([toString(outAmount), toString(priceAssetBalance), toString(sum), toString(periodTotalAvailableToClaim), toString(periodUserAvailableToClaim)], SEP)) | |
279 | - | if ((err == err)) | |
281 | + | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
282 | + | let putOneTknV2PriceAssetAmount = scale8 | |
283 | + | let $t01477815031 = { | |
284 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
285 | + | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
286 | + | then @ | |
287 | + | else throw("Couldn't cast Any to (Int, Int, Int)") | |
288 | + | } | |
289 | + | if (($t01477815031 == $t01477815031)) | |
280 | 290 | then { | |
281 | - | let usdtPriceAssetAllowableRatio = value(getInteger(keyUsdtPriceAssetAllowableRatio())) | |
282 | - | let putOneTknV2PriceAssetAmount = scale8 | |
283 | - | let $t01471414967 = { | |
284 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "putOneTknV2WithoutTakeFeeREADONLY", [putOneTknV2PriceAssetAmount, priceAssetId58], nil) | |
285 | - | if ($isInstanceOf(@, "(Int, Int, Int)")) | |
291 | + | let bonus = $t01477815031._3 | |
292 | + | let feeAmount = $t01477815031._2 | |
293 | + | let lpAmount = $t01477815031._1 | |
294 | + | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | + | let $t01509315311 = { | |
296 | + | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
297 | + | if ($isInstanceOf(@, "(Int, Int)")) | |
286 | 298 | then @ | |
287 | - | else throw("Couldn't cast Any to (Int, Int | |
299 | + | else throw("Couldn't cast Any to (Int, Int)") | |
288 | 300 | } | |
289 | - | if (($ | |
301 | + | if (($t01509315311 == $t01509315311)) | |
290 | 302 | then { | |
291 | - | let bonus = $t01471414967._3 | |
292 | - | let feeAmount = $t01471414967._2 | |
293 | - | let lpAmount = $t01471414967._1 | |
294 | - | let usdtAssetId = value(getString(keyUsdtAssetId())) | |
295 | - | let $t01502915247 = { | |
296 | - | let @ = invoke(addressFromStringValue(value(getString(keyUsdtPriceAssetStablePool()))), "getOneTknV2READONLY", [usdtAssetId, lpAmount], nil) | |
297 | - | if ($isInstanceOf(@, "(Int, Int)")) | |
298 | - | then @ | |
299 | - | else throw("Couldn't cast Any to (Int, Int)") | |
300 | - | } | |
301 | - | if (($t01502915247 == $t01502915247)) | |
302 | - | then { | |
303 | - | let getOneTknV2FeeAmount = $t01502915247._2 | |
304 | - | let usdtAmount = $t01502915247._1 | |
305 | - | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
306 | - | let endPeriodBlocksLeft = (periodEnd - height) | |
307 | - | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
308 | - | } | |
309 | - | else throw("Strict value is not equal to itself.") | |
303 | + | let getOneTknV2FeeAmount = $t01509315311._2 | |
304 | + | let usdtAmount = $t01509315311._1 | |
305 | + | let currentUsdtPriceAssetRatio = fraction(usdtAmount, putOneTknV2PriceAssetAmount, scale8) | |
306 | + | let endPeriodBlocksLeft = (periodEnd - height) | |
307 | + | $Tuple10(periodMinAvailableToClaim, periodTotalAvailableToClaim, periodUserAvailableToClaim, totalUserAvailableToClaim, usdtPriceAssetAllowableRatio, currentUsdtPriceAssetRatio, endPeriodBlocksLeft, updatedCurrentPeriod, periodStart, periodEnd) | |
310 | 308 | } | |
311 | 309 | else throw("Strict value is not equal to itself.") | |
312 | 310 | } | |
313 | 311 | else throw("Strict value is not equal to itself.") | |
314 | 312 | } | |
315 | 313 | ||
316 | 314 | ||
317 | 315 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
318 | 316 | case s: String => | |
319 | 317 | fromBase58String(s) | |
320 | 318 | case _: Unit => | |
321 | 319 | unit | |
322 | 320 | case _ => | |
323 | 321 | throw("Match error") | |
324 | 322 | } | |
325 | 323 | ||
326 | 324 | ||
327 | 325 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
328 | 326 | case s: String => | |
329 | 327 | fromBase58String(s) | |
330 | 328 | case _: Unit => | |
331 | 329 | unit | |
332 | 330 | case _ => | |
333 | 331 | throw("Match error") | |
334 | 332 | } | |
335 | 333 | ||
336 | 334 | ||
337 | 335 | func mustManager (i) = { | |
338 | 336 | let pd = throw("Permission denied") | |
339 | 337 | match managerPublicKeyOrUnit() { | |
340 | 338 | case pk: ByteVector => | |
341 | 339 | if ((i.callerPublicKey == pk)) | |
342 | 340 | then true | |
343 | 341 | else pd | |
344 | 342 | case _: Unit => | |
345 | 343 | if ((i.caller == this)) | |
346 | 344 | then true | |
347 | 345 | else pd | |
348 | 346 | case _ => | |
349 | 347 | throw("Match error") | |
350 | 348 | } | |
351 | 349 | } | |
352 | 350 | ||
353 | 351 | ||
354 | 352 | @Callable(i) | |
355 | 353 | func constructor (idoStart,idoDuration,claimStart,claimDuration,price,priceAssetId58,minInvestAmount) = { | |
356 | 354 | let priceMult = ((100 * 1000) * 1000) | |
357 | 355 | let idoEnd = (idoStart + idoDuration) | |
358 | 356 | if (isDefined(getString(keyConfig()))) | |
359 | 357 | then throw("already initialized") | |
360 | 358 | else if (("3PMEHLx1j6zerarZTYfsGqDeeZqQoMpxq5S" != toString(i.caller))) | |
361 | 359 | then throw("not authorized") | |
362 | 360 | else if ((size(i.payments) != 1)) | |
363 | 361 | then throw("exactly 1 payment must be attached") | |
364 | 362 | else if ((idoEnd >= claimStart)) | |
365 | 363 | then throw("claimStart must be greater than idoEnd") | |
366 | 364 | else { | |
367 | 365 | let pmt = value(i.payments[0]) | |
368 | 366 | let idoAssetId = value(pmt.assetId) | |
369 | 367 | let idoAssetInfo = valueOrErrorMessage(assetInfo(idoAssetId), "fail to load ido asset info") | |
370 | 368 | let idoAssetId58 = toBase58String(idoAssetId) | |
371 | 369 | let idoAssetMult = pow(10, 0, idoAssetInfo.decimals, 0, 0, DOWN) | |
372 | 370 | let priceAssetId = fromBase58String(priceAssetId58) | |
373 | 371 | let priceAssetInfo = valueOrErrorMessage(assetInfo(priceAssetId), "fail to load price asset info") | |
374 | 372 | let priceAssetMult = pow(10, 0, priceAssetInfo.decimals, 0, 0, DOWN) | |
375 | 373 | let origTotalsArray = readTotalsArrayOrDefault() | |
376 | 374 | let totalsDiff = [0, 0, 0, 0] | |
377 | 375 | [StringEntry(keyConfig(), fromatConfig(idoStart, idoDuration, claimStart, claimDuration, price, priceMult, idoAssetId58, idoAssetMult, priceAssetId58, priceAssetMult, minInvestAmount, pmt.amount)), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart)] | |
378 | 376 | } | |
379 | 377 | } | |
380 | 378 | ||
381 | 379 | ||
382 | 380 | ||
383 | 381 | @Callable(i) | |
384 | 382 | func invest () = { | |
385 | 383 | let cfgArray = readConfigArray() | |
386 | 384 | let idoStart = parseIntValue(cfgArray[IdxCfgIdoStart]) | |
387 | 385 | let idoDuration = parseIntValue(cfgArray[IdxCfgIdoDuration]) | |
388 | 386 | let idoEnd = (idoStart + idoDuration) | |
389 | 387 | let claimStart = parseIntValue(cfgArray[IdxCfgClaimStart]) | |
390 | 388 | let claimDuration = parseIntValue(cfgArray[IdxCfgClaimDuration]) | |
391 | 389 | let price = parseIntValue(cfgArray[IdxCfgPrice]) | |
392 | 390 | let priceMult = parseIntValue(cfgArray[IdxCfgPriceMult]) | |
393 | 391 | let idoAssetId58 = cfgArray[IdxCfgIdoAssetId] | |
394 | 392 | let idoAssetId = fromBase58String(idoAssetId58) | |
395 | 393 | let idoAssetMult = parseIntValue(cfgArray[IdxCfgIdoAssetMult]) | |
396 | 394 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
397 | 395 | let priceAssetId = fromBase58String(priceAssetId58) | |
398 | 396 | let priceAssetMult = parseIntValue(cfgArray[IdxCfgPriceAssetMult]) | |
399 | 397 | let minIvestAmount = parseIntValue(cfgArray[IdxCfgMinInvestAmount]) | |
400 | 398 | let userAddress = toString(i.caller) | |
401 | 399 | if ((idoStart > height)) | |
402 | 400 | then throw("ido has not been started yet") | |
403 | 401 | else if ((height > idoEnd)) | |
404 | 402 | then throw("ido has been already ended") | |
405 | 403 | else if ((size(i.payments) != 1)) | |
406 | 404 | then throw("exactly 1 payment is expected") | |
407 | 405 | else { | |
408 | 406 | let pmt = value(i.payments[0]) | |
409 | 407 | let pmtAssetId = value(pmt.assetId) | |
410 | 408 | let pmtAmount = pmt.amount | |
411 | 409 | if ((pmtAssetId != priceAssetId)) | |
412 | 410 | then throw((("invalid payment asset id: " + toBase58String(pmtAssetId)) + " is expected")) | |
413 | 411 | else { | |
414 | 412 | let origInvestorArray = readInvestorArrayOrDefault(userAddress) | |
415 | 413 | let origTotalsArray = readTotalsArrayOrDefault() | |
416 | 414 | let newPriceTotalAmount = (parseIntValue(origTotalsArray[IdxInvTotalAmount]) + pmtAmount) | |
417 | 415 | let requiredIdoAssetAmount = (newPriceTotalAmount * 100) | |
418 | 416 | if ((requiredIdoAssetAmount > assetBalance(this, idoAssetId))) | |
419 | 417 | then throw("IDO asset has been - sold consider to use smaller payment") | |
420 | 418 | else { | |
421 | 419 | let totalsDiff = [pmtAmount, pmtAmount, 0, 0] | |
422 | 420 | [TotalsEntry(keyInvestor(userAddress), origInvestorArray, totalsDiff, claimStart), TotalsEntry(keyTotals(), origTotalsArray, totalsDiff, claimStart), InvestOperationHistoryEntry(userAddress, pmtAmount, 0, i.transactionId)] | |
423 | 421 | } | |
424 | 422 | } | |
425 | 423 | } | |
426 | 424 | } | |
427 | 425 | ||
428 | 426 | ||
429 | 427 | ||
430 | 428 | @Callable(i) | |
431 | 429 | func claim (claimedAssetId58,userAddress58) = { | |
432 | 430 | let callerAddress58 = toString(i.caller) | |
433 | 431 | if ((userAddress58 != callerAddress58)) | |
434 | 432 | then throw("not authorized") | |
435 | 433 | else { | |
436 | 434 | let cfgArray = readConfigArray() | |
437 | 435 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
438 | 436 | let claimResultTuple = internalClaim(claimedAssetId58, i.caller, i.transactionId) | |
439 | 437 | let totalsDiff = claimResultTuple._1 | |
440 | 438 | let outAmount = claimResultTuple._2 | |
441 | 439 | let outAssetId = claimResultTuple._3 | |
442 | 440 | let origInvestArray = claimResultTuple._4 | |
443 | 441 | let newClaimPeriodHeight = claimResultTuple._5 | |
444 | 442 | let claimedPriceAmountFromDiff = totalsDiff[IdxDiffClaimedPriceAmountIncrement] | |
445 | 443 | let claimedIdoAssetAmountFromDiff = totalsDiff[IdxDiffClaimedIdoAssetAmountIncrement] | |
446 | 444 | let entries = if ((claimedAssetId58 == priceAssetId58)) | |
447 | 445 | then { | |
448 | - | let $ | |
449 | - | let periodMinAvailableToClaim = $ | |
450 | - | let periodTotalAvailableToClaim = $ | |
451 | - | let periodUserAvailableToClaim = $ | |
452 | - | let totalUserAvailableToClaim = $ | |
453 | - | let usdtPriceAssetAllowableRatio = $ | |
454 | - | let currentUsdtPriceAssetRatio = $ | |
455 | - | let endPeriodBlocksLeft = $ | |
456 | - | let updatedCurrentPeriod = $ | |
457 | - | let periodStart = $ | |
458 | - | let periodEnd = $ | |
446 | + | let $t02096721411 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
447 | + | let periodMinAvailableToClaim = $t02096721411._1 | |
448 | + | let periodTotalAvailableToClaim = $t02096721411._2 | |
449 | + | let periodUserAvailableToClaim = $t02096721411._3 | |
450 | + | let totalUserAvailableToClaim = $t02096721411._4 | |
451 | + | let usdtPriceAssetAllowableRatio = $t02096721411._5 | |
452 | + | let currentUsdtPriceAssetRatio = $t02096721411._6 | |
453 | + | let endPeriodBlocksLeft = $t02096721411._7 | |
454 | + | let updatedCurrentPeriod = $t02096721411._8 | |
455 | + | let periodStart = $t02096721411._9 | |
456 | + | let periodEnd = $t02096721411._10 | |
459 | 457 | let checks = [if ((periodUserAvailableToClaim > 0)) | |
460 | 458 | then true | |
461 | 459 | else throwErr("unavailable to claim because user period allowance reached"), if ((periodTotalAvailableToClaim > 0)) | |
462 | 460 | then true | |
463 | 461 | else throwErr("unavailable to claim because total period allowance reached"), if ((periodMinAvailableToClaim > 0)) | |
464 | 462 | then true | |
465 | 463 | else throwErr("nothing to claim"), if ((usdtPriceAssetAllowableRatio > currentUsdtPriceAssetRatio)) | |
466 | 464 | then true | |
467 | 465 | else throwErr("unavailable to claim because usdn price lower than usdtPriceAssetAllowableRatio")] | |
468 | 466 | if ((checks == checks)) | |
469 | 467 | then { | |
470 | 468 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
471 | 469 | let updatedPeriodTotalAvailableToClaim = (periodTotalAvailableToClaim - periodMinAvailableToClaim) | |
472 | 470 | let updatedPeriodUserAvailableToClaim = (periodUserAvailableToClaim - periodMinAvailableToClaim) | |
473 | 471 | let priceAssetDecimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
474 | 472 | let periodMinAvailableToClaimPriceAssetDecimals = fraction(periodMinAvailableToClaim, pow(10, 0, priceAssetDecimals, 0, 0, DOWN), scale8) | |
475 | - | let error = throw(makeString([toString(priceAssetDecimals), toString(periodMinAvailableToClaim), toString(periodMinAvailableToClaimPriceAssetDecimals)], SEP)) | |
476 | - | if ((error == error)) | |
477 | - | then { | |
478 | - | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
479 | - | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
480 | - | else { | |
481 | - | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
473 | + | let entries = if ((priceAssetBalance >= periodMinAvailableToClaim)) | |
474 | + | then [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), (priceAssetBalance - periodMinAvailableToClaim))] | |
475 | + | else { | |
476 | + | let updatedPriceAssetBalance = ((priceAssetBalance + outAmount) - periodMinAvailableToClaim) | |
482 | 477 | [ScriptTransfer(i.caller, periodMinAvailableToClaimPriceAssetDecimals, outAssetId), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), IntegerEntry(keyPriceAssetBalance(userAddress58), updatedPriceAssetBalance)] | |
483 | - | } | |
484 | - | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
485 | 478 | } | |
486 | - | | |
479 | + | $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, periodMinAvailableToClaimPriceAssetDecimals, claimedIdoAssetAmountFromDiff, i.transactionId)] ++ entries), unit) | |
487 | 480 | } | |
488 | 481 | else throw("Strict value is not equal to itself.") | |
489 | 482 | } | |
490 | 483 | else $Tuple2([ScriptTransfer(i.caller, outAmount, outAssetId), IntegerEntry(keyPriceAssetBalance(userAddress58), 0), TotalsEntry(keyInvestor(userAddress58), origInvestArray, totalsDiff, newClaimPeriodHeight), TotalsEntry(keyTotals(), readTotalsArrayOrDefault(), totalsDiff, newClaimPeriodHeight), ClaimOperationHistoryEntry(userAddress58, claimedPriceAmountFromDiff, claimedIdoAssetAmountFromDiff, i.transactionId)], unit) | |
491 | 484 | entries | |
492 | 485 | } | |
493 | 486 | } | |
494 | 487 | ||
495 | 488 | ||
496 | 489 | ||
497 | 490 | @Callable(i) | |
498 | 491 | func claimREADONLY (claimedAssetId58,userAddress58) = { | |
499 | 492 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
500 | 493 | let totalsDiff = claimResultTuple._1 | |
501 | 494 | let outAmount = claimResultTuple._2 | |
502 | 495 | let outAssetId = claimResultTuple._3 | |
503 | 496 | let origInvestArray = claimResultTuple._4 | |
504 | 497 | let newClaimPeriodHeight = claimResultTuple._5 | |
505 | 498 | let availableToClaimArray = claimResultTuple._6 | |
506 | 499 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
507 | 500 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
508 | 501 | $Tuple2(nil, makeString(["%s%d%d", userAddress58, toString(availablePriceAmountToClaim), toString(availableIdoAmountToClaim)], SEP)) | |
509 | 502 | } | |
510 | 503 | ||
511 | 504 | ||
512 | 505 | ||
513 | 506 | @Callable(i) | |
514 | 507 | func claimV2READONLY (claimedAssetId58,userAddress58) = { | |
515 | 508 | let claimResultTuple = internalClaim(claimedAssetId58, addressFromStringValue(userAddress58), fromBase58String("")) | |
516 | 509 | let totalsDiff = claimResultTuple._1 | |
517 | 510 | let outAmount = claimResultTuple._2 | |
518 | 511 | let outAssetId = claimResultTuple._3 | |
519 | 512 | let origInvestArray = claimResultTuple._4 | |
520 | 513 | let newClaimPeriodHeight = claimResultTuple._5 | |
521 | 514 | let availableToClaimArray = claimResultTuple._6 | |
522 | 515 | let availablePriceAmountToClaim = availableToClaimArray[0] | |
523 | 516 | let availableIdoAmountToClaim = availableToClaimArray[1] | |
524 | 517 | let cfgArray = readConfigArray() | |
525 | 518 | let priceAssetId58 = cfgArray[IdxCfgPriceAssetId] | |
526 | 519 | let priceAssetBalance = valueOrElse(getInteger(keyPriceAssetBalance(userAddress58)), 0) | |
527 | 520 | let availableIdoAmountToClaimWithPriceAssetBalance = (availableIdoAmountToClaim + priceAssetBalance) | |
528 | - | let $ | |
529 | - | let periodMinAvailableToClaim = $ | |
530 | - | let periodTotalAvailableToClaim = $ | |
531 | - | let periodUserAvailableToClaim = $ | |
532 | - | let totalUserAvailableToClaim = $ | |
533 | - | let usdtPriceAssetAllowableRatio = $ | |
534 | - | let currentUsdtPriceAssetRatio = $ | |
535 | - | let endPeriodBlocksLeft = $ | |
536 | - | let updatedCurrentPeriod = $ | |
537 | - | let periodStart = $ | |
538 | - | let periodEnd = $ | |
521 | + | let $t02774128153 = internalClaimV2(priceAssetId58, userAddress58, outAmount, totalsDiff[IdxDiffClaimedPriceAmountIncrement]) | |
522 | + | let periodMinAvailableToClaim = $t02774128153._1 | |
523 | + | let periodTotalAvailableToClaim = $t02774128153._2 | |
524 | + | let periodUserAvailableToClaim = $t02774128153._3 | |
525 | + | let totalUserAvailableToClaim = $t02774128153._4 | |
526 | + | let usdtPriceAssetAllowableRatio = $t02774128153._5 | |
527 | + | let currentUsdtPriceAssetRatio = $t02774128153._6 | |
528 | + | let endPeriodBlocksLeft = $t02774128153._7 | |
529 | + | let updatedCurrentPeriod = $t02774128153._8 | |
530 | + | let periodStart = $t02774128153._9 | |
531 | + | let periodEnd = $t02774128153._10 | |
539 | 532 | let currentPeriodEndHeight = valueOrElse(getInteger(keyPeriodEndHeight(updatedCurrentPeriod)), 0) | |
540 | 533 | let decimals = value(assetInfo(fromBase58String(claimedAssetId58))).decimals | |
541 | 534 | let resultString = if ((height > currentPeriodEndHeight)) | |
542 | 535 | then { | |
543 | 536 | let periodLenght = value(getInteger(keyPeriodLength())) | |
544 | 537 | let userPeriodAllowance = value(getInteger(keyUserPeriodAllowance(priceAssetId58))) | |
545 | 538 | let totalPeriodAllowance = value(getInteger(keyTotalPeriodAllowance(priceAssetId58))) | |
546 | 539 | makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(userPeriodAllowance), toString(totalPeriodAllowance), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(periodLenght), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim), toString(decimals)], SEP) | |
547 | 540 | } | |
548 | 541 | else makeString(["%d%d%d%d%d%d", toString(availableIdoAmountToClaimWithPriceAssetBalance), toString(periodMinAvailableToClaim), toString(periodTotalAvailableToClaim), toString(usdtPriceAssetAllowableRatio), toString(currentUsdtPriceAssetRatio), toString(endPeriodBlocksLeft), toString(outAmount), toString(periodMinAvailableToClaim), toString(periodUserAvailableToClaim), toString(decimals)], SEP) | |
549 | 542 | $Tuple2(nil, resultString) | |
550 | 543 | } | |
551 | 544 | ||
552 | 545 | ||
553 | 546 | ||
554 | 547 | @Callable(i) | |
555 | 548 | func setManager (pendingManagerPublicKey) = { | |
556 | 549 | let checkCaller = mustManager(i) | |
557 | 550 | if ((checkCaller == checkCaller)) | |
558 | 551 | then { | |
559 | 552 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
560 | 553 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
561 | 554 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
562 | 555 | else throw("Strict value is not equal to itself.") | |
563 | 556 | } | |
564 | 557 | else throw("Strict value is not equal to itself.") | |
565 | 558 | } | |
566 | 559 | ||
567 | 560 | ||
568 | 561 | ||
569 | 562 | @Callable(i) | |
570 | 563 | func confirmManager () = { | |
571 | 564 | let pm = pendingManagerPublicKeyOrUnit() | |
572 | 565 | let hasPM = if (isDefined(pm)) | |
573 | 566 | then true | |
574 | 567 | else throw("No pending manager") | |
575 | 568 | if ((hasPM == hasPM)) | |
576 | 569 | then { | |
577 | 570 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
578 | 571 | then true | |
579 | 572 | else throw("You are not pending manager") | |
580 | 573 | if ((checkPM == checkPM)) | |
581 | 574 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
582 | 575 | else throw("Strict value is not equal to itself.") | |
583 | 576 | } | |
584 | 577 | else throw("Strict value is not equal to itself.") | |
585 | 578 | } | |
586 | 579 | ||
587 | 580 | ||
588 | 581 | @Verifier(tx) | |
589 | 582 | func verify () = { | |
590 | 583 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
591 | 584 | case pk: ByteVector => | |
592 | 585 | pk | |
593 | 586 | case _: Unit => | |
594 | 587 | tx.senderPublicKey | |
595 | 588 | case _ => | |
596 | 589 | throw("Match error") | |
597 | 590 | } | |
598 | 591 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
599 | 592 | } | |
600 | 593 |
github/deemru/w8io/026f985 78.30 ms ◑