tx · 4FzvezCYuo6RJZyzVpca5geyJtLbDjCoz7SpGm6Ka1N6 3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL: -0.03900000 Waves 2022.09.22 17:44 [2240475] smart account 3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL > SELF 0.00000000 Waves
{ "type": 13, "id": "4FzvezCYuo6RJZyzVpca5geyJtLbDjCoz7SpGm6Ka1N6", "fee": 3900000, "feeAssetId": null, "timestamp": 1663857888621, "version": 2, "chainId": 84, "sender": "3MqQg3GcBjjk5727HxPKgQfqGQwWm6QA2yL", "senderPublicKey": "4AhS4PdxdW6j71mgHB4Xq7Eewk1rPdm57kDHAwQTTweK", "proofs": [ "3xWxsCiKgyaPZwKdJx18n7tgk6g1yg9x7kALmY5Lcex1TrVVawHD2fGzhdqYaVoJR2oZHsANCSq45etUhRbsMRje", "5MqWxaBanJQuRzTMKtKLVa1mrw1wCjXY9TZpsQUHrRJWPWxb3FB6b4fh3Rqrmfk2nvuiQ7CW2yopYfJUsN7BBNNe" ], "script": "base64:BgJlCAISBAoCEQESBQoDCAEBEgQKAgEEEgQKAhEIEgMKAQESBgoECAgBCBIECgIIARIDCgEREgQKAhEBEgUKAwEICBIECgIIARIFCgMIAQESABIAEgQKAhEEEgQKAgEBEgASABIAEgBUAAlQUkVDSVNJT04AwIQ9AAVNQVhfQQDAhD0ADE1BWF9BX0NIQU5HRQAKAAhERUNJTUFMUwAGAA1NSU5fUkFNUF9USU1FCQBpAgCAowUAPAAHdmVyc2lvbgIFMy4wLjAACGtWZXJzaW9uAgd2ZXJzaW9uAAdrQXNzZXRzAglhc3NldF9pZHMADWtBc3NldEJhbGFuY2UCCF9iYWxhbmNlAAdrQWN0aXZlAgZhY3RpdmUABmtDYXVzZQIOc2h1dGRvd25fY2F1c2UADWtTaGFyZUFzc2V0SWQCDnNoYXJlX2Fzc2V0X2lkABFrU2hhcmVBc3NldFN1cHBseQISc2hhcmVfYXNzZXRfc3VwcGx5AARrRmVlAg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cEDXNpZ25lZEJ5QWRtaW4DAwMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MgYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MwYJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFEWFkbWluUHViS2V5SW52b2tlAwMFE2NhbGxUYWtlSW50b0FjY291bnQFDXNpZ25lZEJ5QWRtaW4HBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWluczYulaQ=", "height": 2240475, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6jWLsSCEiqv863AGbEtUcMNChrGXDasyZyWVvYS9mYbp Next: none Diff:
Old | New | Differences | |
---|---|---|---|
38 | 38 | let kDiscountValues = "discount_values" | |
39 | 39 | ||
40 | 40 | let kUserSwopInGov = "_SWOP_amount" | |
41 | - | ||
42 | - | let kFirstHarvest = "first_harvest" | |
43 | - | ||
44 | - | let kFirstHarvestHeight = "first_harvest_height" | |
45 | - | ||
46 | - | let kShareLimit = "share_limit_on_first_harvest" | |
47 | - | ||
48 | - | let kBasePeriod = "base_period" | |
49 | - | ||
50 | - | let kPeriodLength = "period_length" | |
51 | - | ||
52 | - | let kStartHeight = "start_height" | |
53 | 41 | ||
54 | 42 | let kAdminPubKey1 = "admin_pub_1" | |
55 | 43 | ||
102 | 90 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
103 | 91 | ||
104 | 92 | let stakingAssets = [toBase58String(USDN)] | |
105 | - | ||
106 | - | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
107 | - | ||
108 | - | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
109 | - | ||
110 | - | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
111 | - | ||
112 | - | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
113 | 93 | ||
114 | 94 | let active = getBooleanValue(this, kActive) | |
115 | 95 | ||
299 | 279 | else $Tuple2(D, false) | |
300 | 280 | } | |
301 | 281 | ||
302 | - | let $ | |
282 | + | let $t061916303 = { | |
303 | 283 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
304 | 284 | let $s = size($l) | |
305 | 285 | let $acc0 = $Tuple2(toBigInt(S), false) | |
313 | 293 | ||
314 | 294 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
315 | 295 | } | |
316 | - | let D = $ | |
317 | - | let finished = $ | |
296 | + | let D = $t061916303._1 | |
297 | + | let finished = $t061916303._2 | |
318 | 298 | if ((finished == false)) | |
319 | 299 | then throw(("get_D() not finished with " + toString(D))) | |
320 | 300 | else toInt(D) | |
340 | 320 | let D = get_D(xp_, amp) | |
341 | 321 | let Ann = (amp * nCoins) | |
342 | 322 | func S_c (acc,i) = { | |
343 | - | let $ | |
344 | - | let S_ = $ | |
345 | - | let c = $ | |
323 | + | let $t068746891 = acc | |
324 | + | let S_ = $t068746891._1 | |
325 | + | let c = $t068746891._2 | |
346 | 326 | let x_ = if ((in == i)) | |
347 | 327 | then x | |
348 | 328 | else xp_[i] | |
353 | 333 | else $Tuple2(S_, c) | |
354 | 334 | } | |
355 | 335 | ||
356 | - | let $ | |
336 | + | let $t070997200 = { | |
357 | 337 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
358 | 338 | let $s = size($l) | |
359 | 339 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
367 | 347 | ||
368 | 348 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
369 | 349 | } | |
370 | - | let S_ = $ | |
371 | - | let c_ = $ | |
350 | + | let S_ = $t070997200._1 | |
351 | + | let c_ = $t070997200._2 | |
372 | 352 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
373 | 353 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
374 | 354 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
385 | 365 | else $Tuple2(y, false) | |
386 | 366 | } | |
387 | 367 | ||
388 | - | let $ | |
368 | + | let $t076827799 = { | |
389 | 369 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
390 | 370 | let $s = size($l) | |
391 | 371 | let $acc0 = $Tuple2(toBigInt(D), false) | |
399 | 379 | ||
400 | 380 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
401 | 381 | } | |
402 | - | let y = $ | |
403 | - | let finished = $ | |
382 | + | let y = $t076827799._1 | |
383 | + | let finished = $t076827799._2 | |
404 | 384 | if ((finished == false)) | |
405 | 385 | then throw(("getY() not finished with " + toString(y))) | |
406 | 386 | else toInt(y) | |
414 | 394 | else { | |
415 | 395 | let Ann = (A_ * nCoins) | |
416 | 396 | func S_c (acc,i) = { | |
417 | - | let $ | |
418 | - | let S_ = $ | |
419 | - | let c = $ | |
397 | + | let $t081788195 = acc | |
398 | + | let S_ = $t081788195._1 | |
399 | + | let c = $t081788195._2 | |
420 | 400 | let x_ = if (if ((in != i)) | |
421 | 401 | then (nCoins > i) | |
422 | 402 | else false) | |
429 | 409 | else $Tuple2(S_, c) | |
430 | 410 | } | |
431 | 411 | ||
432 | - | let $ | |
412 | + | let $t084158516 = { | |
433 | 413 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
434 | 414 | let $s = size($l) | |
435 | 415 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
443 | 423 | ||
444 | 424 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
445 | 425 | } | |
446 | - | let S_ = $ | |
447 | - | let c_ = $ | |
426 | + | let S_ = $t084158516._1 | |
427 | + | let c_ = $t084158516._2 | |
448 | 428 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
449 | 429 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
450 | 430 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
461 | 441 | else $Tuple2(y, false) | |
462 | 442 | } | |
463 | 443 | ||
464 | - | let $ | |
444 | + | let $t089999118 = { | |
465 | 445 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
466 | 446 | let $s = size($l) | |
467 | 447 | let $acc0 = $Tuple2(toBigInt(D), false) | |
475 | 455 | ||
476 | 456 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
477 | 457 | } | |
478 | - | let y = $ | |
479 | - | let finished = $ | |
458 | + | let y = $t089999118._1 | |
459 | + | let finished = $t089999118._2 | |
480 | 460 | if ((finished == false)) | |
481 | 461 | then throw(("get_y_D() not finished with " + toString(y))) | |
482 | 462 | else toInt(y) | |
493 | 473 | let new_y = get_y_D(amp, i, xp, D1) | |
494 | 474 | let dy_0 = (xp[i] - new_y) | |
495 | 475 | func xp_reduced_proc (acc,xp_j) = { | |
496 | - | let $ | |
497 | - | let xp_reduced = $ | |
498 | - | let index = $ | |
476 | + | let $t097599788 = acc | |
477 | + | let xp_reduced = $t097599788._1 | |
478 | + | let index = $t097599788._2 | |
499 | 479 | let dx_expected = if ((index == i)) | |
500 | 480 | then (fraction(xp_j, D1, D0) - new_y) | |
501 | 481 | else (xp_j - fraction(xp_j, D1, D0)) | |
502 | 482 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
503 | 483 | } | |
504 | 484 | ||
505 | - | let $ | |
485 | + | let $t01005010114 = { | |
506 | 486 | let $l = xp | |
507 | 487 | let $s = size($l) | |
508 | 488 | let $acc0 = $Tuple2(nil, 0) | |
516 | 496 | ||
517 | 497 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
518 | 498 | } | |
519 | - | let xp_reduced = $ | |
520 | - | let index = $ | |
499 | + | let xp_reduced = $t01005010114._1 | |
500 | + | let index = $t01005010114._2 | |
521 | 501 | let xp_reduced_i = xp_reduced[i] | |
522 | 502 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
523 | 503 | $Tuple2(dy, (dy_0 - dy)) | |
541 | 521 | ||
542 | 522 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
543 | 523 | then { | |
544 | - | let $ | |
545 | - | let call = $ | |
546 | - | let stakingAddr = $ | |
524 | + | let $t01067810744 = calcStakingFuncAndAddres(stake, assetId) | |
525 | + | let call = $t01067810744._1 | |
526 | + | let stakingAddr = $t01067810744._2 | |
547 | 527 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
548 | 528 | } | |
549 | 529 | else { | |
550 | - | let $ | |
551 | - | let call = $ | |
552 | - | let stakingAddr = $ | |
530 | + | let $t01083010896 = calcStakingFuncAndAddres(stake, assetId) | |
531 | + | let call = $t01083010896._1 | |
532 | + | let stakingAddr = $t01083010896._2 | |
553 | 533 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
554 | 534 | } | |
555 | 535 | ||
556 | 536 | ||
557 | 537 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
558 | 538 | then { | |
559 | - | let $ | |
560 | - | let call = $ | |
561 | - | let addr = $ | |
562 | - | let params = $ | |
563 | - | let payments = $ | |
539 | + | let $t01108311185 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
540 | + | let call = $t01108311185._1 | |
541 | + | let addr = $t01108311185._2 | |
542 | + | let params = $t01108311185._3 | |
543 | + | let payments = $t01108311185._4 | |
564 | 544 | invoke(addr, call, params, payments) | |
565 | 545 | } | |
566 | 546 | else 0 | |
568 | 548 | ||
569 | 549 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
570 | 550 | then { | |
571 | - | let $ | |
572 | - | let call = $ | |
573 | - | let addr = $ | |
574 | - | let params = $ | |
575 | - | let payments = $ | |
551 | + | let $t01137011473 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
552 | + | let call = $t01137011473._1 | |
553 | + | let addr = $t01137011473._2 | |
554 | + | let params = $t01137011473._3 | |
555 | + | let payments = $t01137011473._4 | |
576 | 556 | invoke(addr, call, params, payments) | |
577 | 557 | } | |
578 | 558 | else 0 | |
601 | 581 | func checkSuspicious () = { | |
602 | 582 | let contractBalances = _xp() | |
603 | 583 | func checkBalance (acc,assetId) = { | |
604 | - | let $ | |
605 | - | let suspicious = $ | |
606 | - | let i = $ | |
584 | + | let $t01208412109 = acc | |
585 | + | let suspicious = $t01208412109._1 | |
586 | + | let i = $t01208412109._2 | |
607 | 587 | if (suspicious) | |
608 | 588 | then $Tuple2(suspicious, i) | |
609 | 589 | else { | |
696 | 676 | ||
697 | 677 | ||
698 | 678 | @Callable(msg) | |
699 | - | func init (assetIds,_A,_dAppThresholdCoef | |
679 | + | func init (assetIds,_A,_dAppThresholdCoef) = if (!(isDataStorageUntouched(this))) | |
700 | 680 | then throw("Already initialized") | |
701 | 681 | else if ((0 >= _A)) | |
702 | 682 | then throw("Amp must be must > 0") | |
709 | 689 | let tokenId = calculateAssetId(issueToken) | |
710 | 690 | if (checkCoins(assetIds)) | |
711 | 691 | then throw() | |
712 | - | else { | |
713 | - | let baseEntry = [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
714 | - | if (firstHarvest) | |
715 | - | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
716 | - | else baseEntry | |
717 | - | } | |
692 | + | else [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
718 | 693 | } | |
719 | 694 | ||
720 | 695 | ||
763 | 738 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
764 | 739 | else { | |
765 | 740 | func parsePayments (acc,assetId) = { | |
766 | - | let $ | |
767 | - | let newBalances = $ | |
768 | - | let i = $ | |
769 | - | let j = $ | |
741 | + | let $t01612516154 = acc | |
742 | + | let newBalances = $t01612516154._1 | |
743 | + | let i = $t01612516154._2 | |
744 | + | let j = $t01612516154._3 | |
770 | 745 | if (if ((paymentsSize > j)) | |
771 | 746 | then (getStrAssetId(payments[j].assetId) == assetId) | |
772 | 747 | else false) | |
774 | 749 | else $Tuple3((newBalances :+ xp[i]), (i + 1), j) | |
775 | 750 | } | |
776 | 751 | ||
777 | - | let $ | |
752 | + | let $t01637416460 = { | |
778 | 753 | let $l = assetIds | |
779 | 754 | let $s = size($l) | |
780 | 755 | let $acc0 = $Tuple3(nil, 0, 0) | |
788 | 763 | ||
789 | 764 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
790 | 765 | } | |
791 | - | let newBalances = $ | |
792 | - | let k = $ | |
793 | - | let parsedPayments = $ | |
766 | + | let newBalances = $t01637416460._1 | |
767 | + | let k = $t01637416460._2 | |
768 | + | let parsedPayments = $t01637416460._3 | |
794 | 769 | if ((paymentsSize > parsedPayments)) | |
795 | 770 | then throw("Incorect payments order") | |
796 | 771 | else if (checkDAppThreshold(newBalances)) | |
802 | 777 | else { | |
803 | 778 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
804 | 779 | func calcScriptActions (acc,newBalance) = { | |
805 | - | let $ | |
806 | - | let invBalances = $ | |
807 | - | let scriptActions = $ | |
808 | - | let i = $ | |
780 | + | let $t01686116902 = acc | |
781 | + | let invBalances = $t01686116902._1 | |
782 | + | let scriptActions = $t01686116902._2 | |
783 | + | let i = $t01686116902._3 | |
809 | 784 | if ((shareSupply > 0)) | |
810 | 785 | then { | |
811 | 786 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
843 | 818 | } | |
844 | 819 | } | |
845 | 820 | ||
846 | - | let $ | |
821 | + | let $t01860718695 = { | |
847 | 822 | let $l = newBalances | |
848 | 823 | let $s = size($l) | |
849 | 824 | let $acc0 = $Tuple3(nil, nil, 0) | |
857 | 832 | ||
858 | 833 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
859 | 834 | } | |
860 | - | let invBalances = $ | |
861 | - | let scriptActions = $ | |
835 | + | let invBalances = $t01860718695._1 | |
836 | + | let scriptActions = $t01860718695._2 | |
862 | 837 | let D2 = getDMem(invBalances, amp) | |
863 | 838 | let mint_amount = if ((shareSupply == 0)) | |
864 | 839 | then D1 | |
897 | 872 | let D0 = getDMem(xp, amp) | |
898 | 873 | let feeDiscount = calculateFeeDiscount(user) | |
899 | 874 | func calcInvBalances (acc,newBalance) = { | |
900 | - | let $ | |
901 | - | let invBalances = $ | |
902 | - | let i = $ | |
875 | + | let $t01988419910 = acc | |
876 | + | let invBalances = $t01988419910._1 | |
877 | + | let i = $t01988419910._2 | |
903 | 878 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
904 | 879 | let fees = { | |
905 | 880 | let idealBalance = fraction(D1, xp[i], D0) | |
912 | 887 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
913 | 888 | } | |
914 | 889 | ||
915 | - | let $ | |
890 | + | let $t02051220582 = { | |
916 | 891 | let $l = newBalances | |
917 | 892 | let $s = size($l) | |
918 | 893 | let $acc0 = $Tuple2(nil, 0) | |
926 | 901 | ||
927 | 902 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
928 | 903 | } | |
929 | - | let invBalances = $ | |
930 | - | let k = $ | |
904 | + | let invBalances = $t02051220582._1 | |
905 | + | let k = $t02051220582._2 | |
931 | 906 | let D2 = getDMem(invBalances, amp) | |
932 | 907 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
933 | 908 | $Tuple2(nil, mintAmount) | |
974 | 949 | let x = (xp[fromIndex] + dx) | |
975 | 950 | let y = getY(fromIndex, toIndex, x, xp) | |
976 | 951 | let _dy = ((xp[toIndex] - y) - 1) | |
977 | - | let feeDiscount = calculateFeeDiscount(msg. | |
952 | + | let feeDiscount = calculateFeeDiscount(msg.originCaller) | |
978 | 953 | let _fee = fraction(_dy, fraction(fee, feeDiscount, feeScale6, CEILING), feeScale6) | |
979 | 954 | let dy = (_dy - _fee) | |
980 | 955 | let governanceFees = fraction(_fee, feeGovernance, feeScale6) | |
982 | 957 | then throw("Exchange resulted in fewer coins than expected") | |
983 | 958 | else { | |
984 | 959 | func makeNewBalances (acc,tokenBalance) = { | |
985 | - | let $ | |
986 | - | let newBalances = $ | |
987 | - | let i = $ | |
960 | + | let $t02262322649 = acc | |
961 | + | let newBalances = $t02262322649._1 | |
962 | + | let i = $t02262322649._2 | |
988 | 963 | if ((i == fromIndex)) | |
989 | 964 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
990 | 965 | else if ((i == toIndex)) | |
992 | 967 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
993 | 968 | } | |
994 | 969 | ||
995 | - | let $ | |
970 | + | let $t02290022961 = { | |
996 | 971 | let $l = xp | |
997 | 972 | let $s = size($l) | |
998 | 973 | let $acc0 = $Tuple2(nil, 0) | |
1006 | 981 | ||
1007 | 982 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1008 | 983 | } | |
1009 | - | let newBalances = $ | |
1010 | - | let i = $ | |
984 | + | let newBalances = $t02290022961._1 | |
985 | + | let i = $t02290022961._2 | |
1011 | 986 | if (checkDAppThreshold(newBalances)) | |
1012 | 987 | then throw() | |
1013 | 988 | else { | |
1049 | 1024 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
1050 | 1025 | else { | |
1051 | 1026 | func calcScriptActions (acc,balance) = { | |
1052 | - | let $ | |
1053 | - | let scriptActions = $ | |
1054 | - | let i = $ | |
1027 | + | let $t02425224280 = acc | |
1028 | + | let scriptActions = $t02425224280._1 | |
1029 | + | let i = $t02425224280._2 | |
1055 | 1030 | let wAmount = fraction(balance, pmtAmount, shareSupply) | |
1056 | 1031 | if (assert((wAmount >= minAmounts[i]))) | |
1057 | 1032 | then throw("Withdrawal resulted in fewer coins than expected") | |
1063 | 1038 | } | |
1064 | 1039 | } | |
1065 | 1040 | ||
1066 | - | let $ | |
1041 | + | let $t02477024838 = { | |
1067 | 1042 | let $l = _xp() | |
1068 | 1043 | let $s = size($l) | |
1069 | 1044 | let $acc0 = $Tuple2(nil, 0) | |
1077 | 1052 | ||
1078 | 1053 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1079 | 1054 | } | |
1080 | - | let scriptActions = $ | |
1081 | - | let i = $ | |
1055 | + | let scriptActions = $t02477024838._1 | |
1056 | + | let i = $t02477024838._2 | |
1082 | 1057 | (scriptActions ++ [Burn(shareAssetId, pmtAmount), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))]) | |
1083 | 1058 | } | |
1084 | 1059 | } | |
1143 | 1118 | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1144 | 1119 | let tokenOutB58 = fromBase58String(tokenOut) | |
1145 | 1120 | let xp = _xp() | |
1146 | - | let $ | |
1147 | - | let dy = $ | |
1148 | - | let dy_fee = $ | |
1121 | + | let $t02680226884 = _calcWithdrawOneCoin(xp, pmtAmount, outIndex, msg.originCaller) | |
1122 | + | let dy = $t02680226884._1 | |
1123 | + | let dy_fee = $t02680226884._2 | |
1149 | 1124 | if (assert((dy >= minAmount))) | |
1150 | 1125 | then throw("Not enough coins removed") | |
1151 | 1126 | else { | |
1152 | 1127 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
1153 | 1128 | let dy_and_fee = (dy + dy_fee) | |
1154 | 1129 | func makeNewBalances (acc,tokenBalance) = { | |
1155 | - | let $ | |
1156 | - | let newBalances = $ | |
1157 | - | let i = $ | |
1130 | + | let $t02714227168 = acc | |
1131 | + | let newBalances = $t02714227168._1 | |
1132 | + | let i = $t02714227168._2 | |
1158 | 1133 | if ((i == outIndex)) | |
1159 | 1134 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
1160 | 1135 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1161 | 1136 | } | |
1162 | 1137 | ||
1163 | - | let $ | |
1138 | + | let $t02733527396 = { | |
1164 | 1139 | let $l = xp | |
1165 | 1140 | let $s = size($l) | |
1166 | 1141 | let $acc0 = $Tuple2(nil, 0) | |
1174 | 1149 | ||
1175 | 1150 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1176 | 1151 | } | |
1177 | - | let newBalances = $ | |
1178 | - | let v = $ | |
1152 | + | let newBalances = $t02733527396._1 | |
1153 | + | let v = $t02733527396._2 | |
1179 | 1154 | if (checkDAppThreshold(newBalances)) | |
1180 | 1155 | then throw() | |
1181 | 1156 | else { | |
1251 | 1226 | let balances = _xp() | |
1252 | 1227 | let D0 = getDMem(balances, amp) | |
1253 | 1228 | func calcNewBalances (acc,balance) = { | |
1254 | - | let $ | |
1255 | - | let newBalances = $ | |
1256 | - | let i = $ | |
1229 | + | let $t02941329439 = acc | |
1230 | + | let newBalances = $t02941329439._1 | |
1231 | + | let i = $t02941329439._2 | |
1257 | 1232 | let newBalance = (balance + (if (deposit) | |
1258 | 1233 | then amounts[i] | |
1259 | 1234 | else -(amounts[i]))) | |
1328 | 1303 | ||
1329 | 1304 | ||
1330 | 1305 | @Callable(msg) | |
1331 | - | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), [IntegerEntry(kShareLimit, shareLimit)])) | |
1306 | + | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), if ((msg.caller != moneyBoxAddress)) | |
1307 | + | then throw("Only the wallet can call this function") | |
1308 | + | else { | |
1309 | + | let balances = _xp() | |
1310 | + | func takeExtraFunds (acc,assetId) = { | |
1311 | + | let $t03178131799 = acc | |
1312 | + | let sum = $t03178131799._1 | |
1313 | + | let i = $t03178131799._2 | |
1314 | + | let tokenB58 = fromBase58String(assetId) | |
1315 | + | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1316 | + | let enrollAmount = (rBalance - balances[i]) | |
1317 | + | if ((0 > enrollAmount)) | |
1318 | + | then suspend(("Enroll amount negative for asset" + assetId)) | |
1319 | + | else { | |
1320 | + | let airdrop = if ((enrollAmount > 0)) | |
1321 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1322 | + | else 0 | |
1323 | + | if ((airdrop == airdrop)) | |
1324 | + | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1325 | + | else throw("Strict value is not equal to itself.") | |
1326 | + | } | |
1327 | + | } | |
1328 | + | ||
1329 | + | let k = { | |
1330 | + | let $l = assetIds | |
1331 | + | let $s = size($l) | |
1332 | + | let $acc0 = $Tuple2(0, 0) | |
1333 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1334 | + | then $a | |
1335 | + | else takeExtraFunds($a, $l[$i]) | |
1336 | + | ||
1337 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1338 | + | then $a | |
1339 | + | else throw("List size exceeds 15") | |
1340 | + | ||
1341 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1342 | + | } | |
1343 | + | if ((k._1 == 0)) | |
1344 | + | then throw("No money to take") | |
1345 | + | else nil | |
1346 | + | }) | |
1332 | 1347 | ||
1333 | 1348 | ||
1334 | 1349 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let PRECISION = 1000000 | |
5 | 5 | ||
6 | 6 | let MAX_A = 1000000 | |
7 | 7 | ||
8 | 8 | let MAX_A_CHANGE = 10 | |
9 | 9 | ||
10 | 10 | let DECIMALS = 6 | |
11 | 11 | ||
12 | 12 | let MIN_RAMP_TIME = (86400 / 60) | |
13 | 13 | ||
14 | 14 | let version = "3.0.0" | |
15 | 15 | ||
16 | 16 | let kVersion = "version" | |
17 | 17 | ||
18 | 18 | let kAssets = "asset_ids" | |
19 | 19 | ||
20 | 20 | let kAssetBalance = "_balance" | |
21 | 21 | ||
22 | 22 | let kActive = "active" | |
23 | 23 | ||
24 | 24 | let kCause = "shutdown_cause" | |
25 | 25 | ||
26 | 26 | let kShareAssetId = "share_asset_id" | |
27 | 27 | ||
28 | 28 | let kShareAssetSupply = "share_asset_supply" | |
29 | 29 | ||
30 | 30 | let kFee = "commission" | |
31 | 31 | ||
32 | 32 | let kDAppThresholdCoef = "dAppThresholdCoef" | |
33 | 33 | ||
34 | 34 | let kUSDNAddress = "staking_usdnnsbt_address" | |
35 | 35 | ||
36 | 36 | let kDiscounts = "discounts" | |
37 | 37 | ||
38 | 38 | let kDiscountValues = "discount_values" | |
39 | 39 | ||
40 | 40 | let kUserSwopInGov = "_SWOP_amount" | |
41 | - | ||
42 | - | let kFirstHarvest = "first_harvest" | |
43 | - | ||
44 | - | let kFirstHarvestHeight = "first_harvest_height" | |
45 | - | ||
46 | - | let kShareLimit = "share_limit_on_first_harvest" | |
47 | - | ||
48 | - | let kBasePeriod = "base_period" | |
49 | - | ||
50 | - | let kPeriodLength = "period_length" | |
51 | - | ||
52 | - | let kStartHeight = "start_height" | |
53 | 41 | ||
54 | 42 | let kAdminPubKey1 = "admin_pub_1" | |
55 | 43 | ||
56 | 44 | let kAdminPubKey2 = "admin_pub_2" | |
57 | 45 | ||
58 | 46 | let kAdminPubKey3 = "admin_pub_3" | |
59 | 47 | ||
60 | 48 | let kAdminInvokePubKey = "admin_invoke_pub" | |
61 | 49 | ||
62 | 50 | let kMoneyBoxAddress = "money_box_address" | |
63 | 51 | ||
64 | 52 | let kGovAddress = "governance_address" | |
65 | 53 | ||
66 | 54 | let kVotingAddress = "voting_address" | |
67 | 55 | ||
68 | 56 | let kFarmingAddress = "farming_address" | |
69 | 57 | ||
70 | 58 | let kLPFarmingAddress = "lp_farming" | |
71 | 59 | ||
72 | 60 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
73 | 61 | ||
74 | 62 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
75 | 63 | case string: String => | |
76 | 64 | fromBase58String(string) | |
77 | 65 | case nothing => | |
78 | 66 | throw((key + "is empty")) | |
79 | 67 | } | |
80 | 68 | ||
81 | 69 | ||
82 | 70 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
83 | 71 | ||
84 | 72 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
85 | 73 | ||
86 | 74 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
87 | 75 | ||
88 | 76 | let adminPubKeyInvoke = getBase58FromOracle(kAdminInvokePubKey) | |
89 | 77 | ||
90 | 78 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
91 | 79 | ||
92 | 80 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
93 | 81 | ||
94 | 82 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
95 | 83 | ||
96 | 84 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
97 | 85 | ||
98 | 86 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
99 | 87 | ||
100 | 88 | let lpFarmingAddress = Address(getBase58FromOracle(kLPFarmingAddress)) | |
101 | 89 | ||
102 | 90 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
103 | 91 | ||
104 | 92 | let stakingAssets = [toBase58String(USDN)] | |
105 | - | ||
106 | - | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
107 | - | ||
108 | - | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
109 | - | ||
110 | - | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
111 | - | ||
112 | - | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
113 | 93 | ||
114 | 94 | let active = getBooleanValue(this, kActive) | |
115 | 95 | ||
116 | 96 | let shareAssetId = fromBase58String(getStringValue(this, kShareAssetId)) | |
117 | 97 | ||
118 | 98 | let shareSupply = getIntegerValue(this, kShareAssetSupply) | |
119 | 99 | ||
120 | 100 | let feeScale6 = 1000000 | |
121 | 101 | ||
122 | 102 | let fee = getIntegerValue(this, kFee) | |
123 | 103 | ||
124 | 104 | let feeGovernance = fraction(40, feeScale6, 100) | |
125 | 105 | ||
126 | 106 | let initial_A = getIntegerValue(this, "initial_A") | |
127 | 107 | ||
128 | 108 | let future_A = getIntegerValue(this, "future_A") | |
129 | 109 | ||
130 | 110 | let initial_A_time = valueOrElse(getInteger(this, "initial_A_time"), 0) | |
131 | 111 | ||
132 | 112 | let future_A_time = valueOrElse(getInteger(this, "future_A_time"), 0) | |
133 | 113 | ||
134 | 114 | let assetIds = split(getStringValue(this, kAssets), ",") | |
135 | 115 | ||
136 | 116 | let nCoins = size(assetIds) | |
137 | 117 | ||
138 | 118 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
139 | 119 | ||
140 | 120 | ||
141 | 121 | func throwIsActive () = throw("DApp is already active") | |
142 | 122 | ||
143 | 123 | ||
144 | 124 | func isActive () = if (active) | |
145 | 125 | then unit | |
146 | 126 | else throw("DApp is inactive at this moment") | |
147 | 127 | ||
148 | 128 | ||
149 | 129 | func isAdminCall (i) = if (containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)) | |
150 | 130 | then unit | |
151 | 131 | else throw("Only admin can call this function") | |
152 | 132 | ||
153 | 133 | ||
154 | 134 | func isSelfCall (i) = if ((this == i.caller)) | |
155 | 135 | then unit | |
156 | 136 | else throw("Only contract itself can call this function") | |
157 | 137 | ||
158 | 138 | ||
159 | 139 | let big2 = toBigInt(2) | |
160 | 140 | ||
161 | 141 | let blockTimestamp = height | |
162 | 142 | ||
163 | 143 | func assert (a) = if (a) | |
164 | 144 | then false | |
165 | 145 | else true | |
166 | 146 | ||
167 | 147 | ||
168 | 148 | func calculateFeeDiscount (userAddr) = { | |
169 | 149 | let user = match userAddr { | |
170 | 150 | case u: Address => | |
171 | 151 | toString(u) | |
172 | 152 | case u: String => | |
173 | 153 | u | |
174 | 154 | case _ => | |
175 | 155 | throw("Unknow type of user Addr") | |
176 | 156 | } | |
177 | 157 | let swopAmount = valueOrElse(getInteger(govAddress, (user + kUserSwopInGov)), 0) | |
178 | 158 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
179 | 159 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
180 | 160 | if (if ((swopAmount >= parseIntValue(discountValues[0]))) | |
181 | 161 | then (parseIntValue(discountValues[1]) > swopAmount) | |
182 | 162 | else false) | |
183 | 163 | then (feeScale6 - parseIntValue(discounts[0])) | |
184 | 164 | else if (if ((swopAmount >= parseIntValue(discountValues[1]))) | |
185 | 165 | then (parseIntValue(discountValues[2]) > swopAmount) | |
186 | 166 | else false) | |
187 | 167 | then (feeScale6 - parseIntValue(discounts[1])) | |
188 | 168 | else if (if ((swopAmount >= parseIntValue(discountValues[2]))) | |
189 | 169 | then (parseIntValue(discountValues[3]) > swopAmount) | |
190 | 170 | else false) | |
191 | 171 | then (feeScale6 - parseIntValue(discounts[2])) | |
192 | 172 | else if (if ((swopAmount >= parseIntValue(discountValues[3]))) | |
193 | 173 | then (parseIntValue(discountValues[4]) > swopAmount) | |
194 | 174 | else false) | |
195 | 175 | then (feeScale6 - parseIntValue(discounts[3])) | |
196 | 176 | else if ((swopAmount >= parseIntValue(discountValues[4]))) | |
197 | 177 | then (feeScale6 - parseIntValue(discounts[4])) | |
198 | 178 | else feeScale6 | |
199 | 179 | } | |
200 | 180 | ||
201 | 181 | ||
202 | 182 | func _A () = { | |
203 | 183 | let t1 = future_A_time | |
204 | 184 | let A1 = future_A | |
205 | 185 | if ((t1 > blockTimestamp)) | |
206 | 186 | then { | |
207 | 187 | let A0 = initial_A | |
208 | 188 | let t0 = initial_A_time | |
209 | 189 | if ((A1 > A0)) | |
210 | 190 | then (A0 + (((A1 - A0) * (blockTimestamp - t0)) / (t1 - t0))) | |
211 | 191 | else (A0 - (((A0 - A1) * (blockTimestamp - t0)) / (t1 - t0))) | |
212 | 192 | } | |
213 | 193 | else A1 | |
214 | 194 | } | |
215 | 195 | ||
216 | 196 | ||
217 | 197 | func _xp () = { | |
218 | 198 | func assetBalances (acc,assetId) = (acc :+ valueOrElse(getInteger(this, (assetId + kAssetBalance)), 0)) | |
219 | 199 | ||
220 | 200 | let $l = assetIds | |
221 | 201 | let $s = size($l) | |
222 | 202 | let $acc0 = nil | |
223 | 203 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
224 | 204 | then $a | |
225 | 205 | else assetBalances($a, $l[$i]) | |
226 | 206 | ||
227 | 207 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
228 | 208 | then $a | |
229 | 209 | else throw("List size exceeds 15") | |
230 | 210 | ||
231 | 211 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
232 | 212 | } | |
233 | 213 | ||
234 | 214 | ||
235 | 215 | func _xp_mem (xp) = xp | |
236 | 216 | ||
237 | 217 | ||
238 | 218 | func sumList (acc,element) = (acc + element) | |
239 | 219 | ||
240 | 220 | ||
241 | 221 | func get_D (xp,amp) = { | |
242 | 222 | let @ = invoke(this, "D", [xp, amp], nil) | |
243 | 223 | if ($isInstanceOf(@, "Int")) | |
244 | 224 | then @ | |
245 | 225 | else throw(($getType(invoke(this, "D", [xp, amp], nil)) + " couldn't be cast to Int")) | |
246 | 226 | } | |
247 | 227 | ||
248 | 228 | ||
249 | 229 | func get_D_internal (xp,amp) = { | |
250 | 230 | let S = { | |
251 | 231 | let $l = xp | |
252 | 232 | let $s = size($l) | |
253 | 233 | let $acc0 = 0 | |
254 | 234 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
255 | 235 | then $a | |
256 | 236 | else sumList($a, $l[$i]) | |
257 | 237 | ||
258 | 238 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
259 | 239 | then $a | |
260 | 240 | else throw("List size exceeds 15") | |
261 | 241 | ||
262 | 242 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
263 | 243 | } | |
264 | 244 | if ((S == 0)) | |
265 | 245 | then 0 | |
266 | 246 | else { | |
267 | 247 | let Ann = (amp * nCoins) | |
268 | 248 | let AnnS = (toBigInt(Ann) * toBigInt(S)) | |
269 | 249 | let Ann1 = toBigInt((Ann - 1)) | |
270 | 250 | func Dproc (acc,i) = if ((acc._2 == true)) | |
271 | 251 | then acc | |
272 | 252 | else { | |
273 | 253 | let Dprev = acc._1 | |
274 | 254 | func D_PProc (D_P,i) = if ((nCoins > i)) | |
275 | 255 | then ((D_P * Dprev) / (toBigInt(xp[i]) * toBigInt(nCoins))) | |
276 | 256 | else D_P | |
277 | 257 | ||
278 | 258 | let D_P = { | |
279 | 259 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
280 | 260 | let $s = size($l) | |
281 | 261 | let $acc0 = Dprev | |
282 | 262 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
283 | 263 | then $a | |
284 | 264 | else D_PProc($a, $l[$i]) | |
285 | 265 | ||
286 | 266 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
287 | 267 | then $a | |
288 | 268 | else throw("List size exceeds 15") | |
289 | 269 | ||
290 | 270 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
291 | 271 | } | |
292 | 272 | let D = fraction((AnnS + (toBigInt(nCoins) * D_P)), Dprev, ((Ann1 * Dprev) + (toBigInt((nCoins + 1)) * D_P))) | |
293 | 273 | if ((D > Dprev)) | |
294 | 274 | then if ((1 >= toInt((D - Dprev)))) | |
295 | 275 | then $Tuple2(D, true) | |
296 | 276 | else $Tuple2(D, false) | |
297 | 277 | else if ((1 >= toInt((Dprev - D)))) | |
298 | 278 | then $Tuple2(D, true) | |
299 | 279 | else $Tuple2(D, false) | |
300 | 280 | } | |
301 | 281 | ||
302 | - | let $ | |
282 | + | let $t061916303 = { | |
303 | 283 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
304 | 284 | let $s = size($l) | |
305 | 285 | let $acc0 = $Tuple2(toBigInt(S), false) | |
306 | 286 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
307 | 287 | then $a | |
308 | 288 | else Dproc($a, $l[$i]) | |
309 | 289 | ||
310 | 290 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
311 | 291 | then $a | |
312 | 292 | else throw("List size exceeds 15") | |
313 | 293 | ||
314 | 294 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
315 | 295 | } | |
316 | - | let D = $ | |
317 | - | let finished = $ | |
296 | + | let D = $t061916303._1 | |
297 | + | let finished = $t061916303._2 | |
318 | 298 | if ((finished == false)) | |
319 | 299 | then throw(("get_D() not finished with " + toString(D))) | |
320 | 300 | else toInt(D) | |
321 | 301 | } | |
322 | 302 | } | |
323 | 303 | ||
324 | 304 | ||
325 | 305 | func getDMem (xp,amp) = get_D(_xp_mem(xp), amp) | |
326 | 306 | ||
327 | 307 | ||
328 | 308 | func getY (in,out,x,xp_) = if (assert((in != out))) | |
329 | 309 | then throw("same coin") | |
330 | 310 | else if (assert(if ((out >= 0)) | |
331 | 311 | then (in >= 0) | |
332 | 312 | else false)) | |
333 | 313 | then throw("below zero") | |
334 | 314 | else if (assert(if ((nCoins > out)) | |
335 | 315 | then (nCoins > in) | |
336 | 316 | else false)) | |
337 | 317 | then throw("above N_COINS") | |
338 | 318 | else { | |
339 | 319 | let amp = _A() | |
340 | 320 | let D = get_D(xp_, amp) | |
341 | 321 | let Ann = (amp * nCoins) | |
342 | 322 | func S_c (acc,i) = { | |
343 | - | let $ | |
344 | - | let S_ = $ | |
345 | - | let c = $ | |
323 | + | let $t068746891 = acc | |
324 | + | let S_ = $t068746891._1 | |
325 | + | let c = $t068746891._2 | |
346 | 326 | let x_ = if ((in == i)) | |
347 | 327 | then x | |
348 | 328 | else xp_[i] | |
349 | 329 | if (if ((i != out)) | |
350 | 330 | then (nCoins > i) | |
351 | 331 | else false) | |
352 | 332 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
353 | 333 | else $Tuple2(S_, c) | |
354 | 334 | } | |
355 | 335 | ||
356 | - | let $ | |
336 | + | let $t070997200 = { | |
357 | 337 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
358 | 338 | let $s = size($l) | |
359 | 339 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
360 | 340 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
361 | 341 | then $a | |
362 | 342 | else S_c($a, $l[$i]) | |
363 | 343 | ||
364 | 344 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
365 | 345 | then $a | |
366 | 346 | else throw("List size exceeds 15") | |
367 | 347 | ||
368 | 348 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
369 | 349 | } | |
370 | - | let S_ = $ | |
371 | - | let c_ = $ | |
350 | + | let S_ = $t070997200._1 | |
351 | + | let c_ = $t070997200._2 | |
372 | 352 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
373 | 353 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
374 | 354 | func y_proc (acc,_i) = if ((acc._2 == true)) | |
375 | 355 | then acc | |
376 | 356 | else { | |
377 | 357 | let y_prev = acc._1 | |
378 | 358 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
379 | 359 | if ((y > y_prev)) | |
380 | 360 | then if ((1 >= toInt((y - y_prev)))) | |
381 | 361 | then $Tuple2(y, true) | |
382 | 362 | else $Tuple2(y, false) | |
383 | 363 | else if ((1 >= toInt((y_prev - y)))) | |
384 | 364 | then $Tuple2(y, true) | |
385 | 365 | else $Tuple2(y, false) | |
386 | 366 | } | |
387 | 367 | ||
388 | - | let $ | |
368 | + | let $t076827799 = { | |
389 | 369 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
390 | 370 | let $s = size($l) | |
391 | 371 | let $acc0 = $Tuple2(toBigInt(D), false) | |
392 | 372 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
393 | 373 | then $a | |
394 | 374 | else y_proc($a, $l[$i]) | |
395 | 375 | ||
396 | 376 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
397 | 377 | then $a | |
398 | 378 | else throw("List size exceeds 16") | |
399 | 379 | ||
400 | 380 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
401 | 381 | } | |
402 | - | let y = $ | |
403 | - | let finished = $ | |
382 | + | let y = $t076827799._1 | |
383 | + | let finished = $t076827799._2 | |
404 | 384 | if ((finished == false)) | |
405 | 385 | then throw(("getY() not finished with " + toString(y))) | |
406 | 386 | else toInt(y) | |
407 | 387 | } | |
408 | 388 | ||
409 | 389 | ||
410 | 390 | func get_y_D (A_,in,xp,D) = if (assert((in >= 0))) | |
411 | 391 | then throw("i below zero") | |
412 | 392 | else if (assert((nCoins > in))) | |
413 | 393 | then throw("i above N_COINS") | |
414 | 394 | else { | |
415 | 395 | let Ann = (A_ * nCoins) | |
416 | 396 | func S_c (acc,i) = { | |
417 | - | let $ | |
418 | - | let S_ = $ | |
419 | - | let c = $ | |
397 | + | let $t081788195 = acc | |
398 | + | let S_ = $t081788195._1 | |
399 | + | let c = $t081788195._2 | |
420 | 400 | let x_ = if (if ((in != i)) | |
421 | 401 | then (nCoins > i) | |
422 | 402 | else false) | |
423 | 403 | then xp[i] | |
424 | 404 | else 0 | |
425 | 405 | if (if ((nCoins > i)) | |
426 | 406 | then (in != i) | |
427 | 407 | else false) | |
428 | 408 | then $Tuple2((S_ + x_), fraction(c, toBigInt(D), toBigInt((x_ * nCoins)))) | |
429 | 409 | else $Tuple2(S_, c) | |
430 | 410 | } | |
431 | 411 | ||
432 | - | let $ | |
412 | + | let $t084158516 = { | |
433 | 413 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
434 | 414 | let $s = size($l) | |
435 | 415 | let $acc0 = $Tuple2(0, toBigInt(D)) | |
436 | 416 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
437 | 417 | then $a | |
438 | 418 | else S_c($a, $l[$i]) | |
439 | 419 | ||
440 | 420 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
441 | 421 | then $a | |
442 | 422 | else throw("List size exceeds 15") | |
443 | 423 | ||
444 | 424 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
445 | 425 | } | |
446 | - | let S_ = $ | |
447 | - | let c_ = $ | |
426 | + | let S_ = $t084158516._1 | |
427 | + | let c_ = $t084158516._2 | |
448 | 428 | let c = fraction(c_, toBigInt(D), toBigInt((Ann * nCoins))) | |
449 | 429 | let bD = toBigInt(((S_ + (D / Ann)) - D)) | |
450 | 430 | func y_D_proc (acc,i) = if ((acc._2 == true)) | |
451 | 431 | then acc | |
452 | 432 | else { | |
453 | 433 | let y_prev = acc._1 | |
454 | 434 | let y = (((y_prev * y_prev) + c) / ((big2 * y_prev) + bD)) | |
455 | 435 | if ((y > y_prev)) | |
456 | 436 | then if ((1 >= toInt((y - y_prev)))) | |
457 | 437 | then $Tuple2(y, true) | |
458 | 438 | else $Tuple2(y, false) | |
459 | 439 | else if ((1 >= toInt((y_prev - y)))) | |
460 | 440 | then $Tuple2(y, true) | |
461 | 441 | else $Tuple2(y, false) | |
462 | 442 | } | |
463 | 443 | ||
464 | - | let $ | |
444 | + | let $t089999118 = { | |
465 | 445 | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
466 | 446 | let $s = size($l) | |
467 | 447 | let $acc0 = $Tuple2(toBigInt(D), false) | |
468 | 448 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
469 | 449 | then $a | |
470 | 450 | else y_D_proc($a, $l[$i]) | |
471 | 451 | ||
472 | 452 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
473 | 453 | then $a | |
474 | 454 | else throw("List size exceeds 16") | |
475 | 455 | ||
476 | 456 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
477 | 457 | } | |
478 | - | let y = $ | |
479 | - | let finished = $ | |
458 | + | let y = $t089999118._1 | |
459 | + | let finished = $t089999118._2 | |
480 | 460 | if ((finished == false)) | |
481 | 461 | then throw(("get_y_D() not finished with " + toString(y))) | |
482 | 462 | else toInt(y) | |
483 | 463 | } | |
484 | 464 | ||
485 | 465 | ||
486 | 466 | func _calcWithdrawOneCoin (xp,_token_amount,i,caller) = { | |
487 | 467 | let feeDiscount = calculateFeeDiscount(caller) | |
488 | 468 | let amp = _A() | |
489 | 469 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
490 | 470 | let total_supply = shareSupply | |
491 | 471 | let D0 = get_D(xp, amp) | |
492 | 472 | let D1 = (D0 - fraction(_token_amount, D0, total_supply)) | |
493 | 473 | let new_y = get_y_D(amp, i, xp, D1) | |
494 | 474 | let dy_0 = (xp[i] - new_y) | |
495 | 475 | func xp_reduced_proc (acc,xp_j) = { | |
496 | - | let $ | |
497 | - | let xp_reduced = $ | |
498 | - | let index = $ | |
476 | + | let $t097599788 = acc | |
477 | + | let xp_reduced = $t097599788._1 | |
478 | + | let index = $t097599788._2 | |
499 | 479 | let dx_expected = if ((index == i)) | |
500 | 480 | then (fraction(xp_j, D1, D0) - new_y) | |
501 | 481 | else (xp_j - fraction(xp_j, D1, D0)) | |
502 | 482 | $Tuple2((xp_reduced :+ (xp_j - fraction(_fee, dx_expected, feeScale6))), (index + 1)) | |
503 | 483 | } | |
504 | 484 | ||
505 | - | let $ | |
485 | + | let $t01005010114 = { | |
506 | 486 | let $l = xp | |
507 | 487 | let $s = size($l) | |
508 | 488 | let $acc0 = $Tuple2(nil, 0) | |
509 | 489 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
510 | 490 | then $a | |
511 | 491 | else xp_reduced_proc($a, $l[$i]) | |
512 | 492 | ||
513 | 493 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
514 | 494 | then $a | |
515 | 495 | else throw("List size exceeds 15") | |
516 | 496 | ||
517 | 497 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
518 | 498 | } | |
519 | - | let xp_reduced = $ | |
520 | - | let index = $ | |
499 | + | let xp_reduced = $t01005010114._1 | |
500 | + | let index = $t01005010114._2 | |
521 | 501 | let xp_reduced_i = xp_reduced[i] | |
522 | 502 | let dy = ((xp_reduced_i - get_y_D(amp, i, xp_reduced, D1)) - 1) | |
523 | 503 | $Tuple2(dy, (dy_0 - dy)) | |
524 | 504 | } | |
525 | 505 | ||
526 | 506 | ||
527 | 507 | func getStrAssetId (assetId) = match assetId { | |
528 | 508 | case id: ByteVector => | |
529 | 509 | toBase58String(id) | |
530 | 510 | case waves: Unit => | |
531 | 511 | "WAVES" | |
532 | 512 | case _ => | |
533 | 513 | throw("Match error") | |
534 | 514 | } | |
535 | 515 | ||
536 | 516 | ||
537 | 517 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
538 | 518 | then $Tuple2("lockNeutrino", stakingUSDNAddress) | |
539 | 519 | else $Tuple2("unlockNeutrino", stakingUSDNAddress) | |
540 | 520 | ||
541 | 521 | ||
542 | 522 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
543 | 523 | then { | |
544 | - | let $ | |
545 | - | let call = $ | |
546 | - | let stakingAddr = $ | |
524 | + | let $t01067810744 = calcStakingFuncAndAddres(stake, assetId) | |
525 | + | let call = $t01067810744._1 | |
526 | + | let stakingAddr = $t01067810744._2 | |
547 | 527 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
548 | 528 | } | |
549 | 529 | else { | |
550 | - | let $ | |
551 | - | let call = $ | |
552 | - | let stakingAddr = $ | |
530 | + | let $t01083010896 = calcStakingFuncAndAddres(stake, assetId) | |
531 | + | let call = $t01083010896._1 | |
532 | + | let stakingAddr = $t01083010896._2 | |
553 | 533 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
554 | 534 | } | |
555 | 535 | ||
556 | 536 | ||
557 | 537 | func stake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
558 | 538 | then { | |
559 | - | let $ | |
560 | - | let call = $ | |
561 | - | let addr = $ | |
562 | - | let params = $ | |
563 | - | let payments = $ | |
539 | + | let $t01108311185 = calcStakingParams(true, amount, fromBase58String(assetIdString)) | |
540 | + | let call = $t01108311185._1 | |
541 | + | let addr = $t01108311185._2 | |
542 | + | let params = $t01108311185._3 | |
543 | + | let payments = $t01108311185._4 | |
564 | 544 | invoke(addr, call, params, payments) | |
565 | 545 | } | |
566 | 546 | else 0 | |
567 | 547 | ||
568 | 548 | ||
569 | 549 | func unstake (amount,assetIdString) = if (containsElement(stakingAssets, assetIdString)) | |
570 | 550 | then { | |
571 | - | let $ | |
572 | - | let call = $ | |
573 | - | let addr = $ | |
574 | - | let params = $ | |
575 | - | let payments = $ | |
551 | + | let $t01137011473 = calcStakingParams(false, amount, fromBase58String(assetIdString)) | |
552 | + | let call = $t01137011473._1 | |
553 | + | let addr = $t01137011473._2 | |
554 | + | let params = $t01137011473._3 | |
555 | + | let payments = $t01137011473._4 | |
576 | 556 | invoke(addr, call, params, payments) | |
577 | 557 | } | |
578 | 558 | else 0 | |
579 | 559 | ||
580 | 560 | ||
581 | 561 | func stakedAmount (assetId) = { | |
582 | 562 | let stakedAmountCalculated = match assetId { | |
583 | 563 | case aId: ByteVector => | |
584 | 564 | if ((aId == USDN)) | |
585 | 565 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
586 | 566 | else 0 | |
587 | 567 | case _: Unit => | |
588 | 568 | 0 | |
589 | 569 | case _ => | |
590 | 570 | throw("Match error") | |
591 | 571 | } | |
592 | 572 | match stakedAmountCalculated { | |
593 | 573 | case i: Int => | |
594 | 574 | i | |
595 | 575 | case _ => | |
596 | 576 | 0 | |
597 | 577 | } | |
598 | 578 | } | |
599 | 579 | ||
600 | 580 | ||
601 | 581 | func checkSuspicious () = { | |
602 | 582 | let contractBalances = _xp() | |
603 | 583 | func checkBalance (acc,assetId) = { | |
604 | - | let $ | |
605 | - | let suspicious = $ | |
606 | - | let i = $ | |
584 | + | let $t01208412109 = acc | |
585 | + | let suspicious = $t01208412109._1 | |
586 | + | let i = $t01208412109._2 | |
607 | 587 | if (suspicious) | |
608 | 588 | then $Tuple2(suspicious, i) | |
609 | 589 | else { | |
610 | 590 | let aBalance = (assetBalance(this, fromBase58String(assetId)) + stakedAmount(fromBase58String(assetId))) | |
611 | 591 | if ((contractBalances[i] > aBalance)) | |
612 | 592 | then $Tuple2(true, i) | |
613 | 593 | else $Tuple2(false, (i + 1)) | |
614 | 594 | } | |
615 | 595 | } | |
616 | 596 | ||
617 | 597 | let $l = assetIds | |
618 | 598 | let $s = size($l) | |
619 | 599 | let $acc0 = $Tuple2(false, 0) | |
620 | 600 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
621 | 601 | then $a | |
622 | 602 | else checkBalance($a, $l[$i]) | |
623 | 603 | ||
624 | 604 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
625 | 605 | then $a | |
626 | 606 | else throw("List size exceeds 15") | |
627 | 607 | ||
628 | 608 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
629 | 609 | } | |
630 | 610 | ||
631 | 611 | ||
632 | 612 | func suspendSuspicious (i) = suspend(("Suspicious state with asset: " + assetIds[i])) | |
633 | 613 | ||
634 | 614 | ||
635 | 615 | func returnPayments (caller,payments) = { | |
636 | 616 | func parsePayments (acc,payment) = (acc :+ ScriptTransfer(caller, payment.amount, payment.assetId)) | |
637 | 617 | ||
638 | 618 | let $l = payments | |
639 | 619 | let $s = size($l) | |
640 | 620 | let $acc0 = nil | |
641 | 621 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
642 | 622 | then $a | |
643 | 623 | else parsePayments($a, $l[$i]) | |
644 | 624 | ||
645 | 625 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
646 | 626 | then $a | |
647 | 627 | else throw("List size exceeds 15") | |
648 | 628 | ||
649 | 629 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
650 | 630 | } | |
651 | 631 | ||
652 | 632 | ||
653 | 633 | func checkDAppThreshold (newBalances) = { | |
654 | 634 | let dAppThresholdCoef = valueOrErrorMessage(getInteger(this, kDAppThresholdCoef), "No dAppThresholdCoef key") | |
655 | 635 | let thresholdScale = 10000 | |
656 | 636 | let maxBalance = max(newBalances) | |
657 | 637 | let minBalance = min(newBalances) | |
658 | 638 | let ratio = fraction(maxBalance, thresholdScale, minBalance) | |
659 | 639 | if ((ratio > (dAppThresholdCoef * thresholdScale))) | |
660 | 640 | then throw("New balance in assets of the DApp is less than threshold") | |
661 | 641 | else false | |
662 | 642 | } | |
663 | 643 | ||
664 | 644 | ||
665 | 645 | func checkCoins (assetIds) = { | |
666 | 646 | let coins = split(assetIds, ",") | |
667 | 647 | func checkCoin (error,assetId) = { | |
668 | 648 | let asset = valueOrErrorMessage(fromBase58String(assetId), ("fromBase58String: " + assetId)) | |
669 | 649 | let decimals = valueOrErrorMessage(assetInfo(asset), ("assetInfo: " + assetId)).decimals | |
670 | 650 | if ((decimals != DECIMALS)) | |
671 | 651 | then throw("wrong decimals") | |
672 | 652 | else false | |
673 | 653 | } | |
674 | 654 | ||
675 | 655 | let $l = coins | |
676 | 656 | let $s = size($l) | |
677 | 657 | let $acc0 = false | |
678 | 658 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
679 | 659 | then $a | |
680 | 660 | else checkCoin($a, $l[$i]) | |
681 | 661 | ||
682 | 662 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
683 | 663 | then $a | |
684 | 664 | else throw("List size exceeds 15") | |
685 | 665 | ||
686 | 666 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
687 | 667 | } | |
688 | 668 | ||
689 | 669 | ||
690 | 670 | @Callable(msg) | |
691 | 671 | func D (xp,amp) = { | |
692 | 672 | let D = get_D_internal(xp, amp) | |
693 | 673 | $Tuple2([IntegerEntry("D", D)], D) | |
694 | 674 | } | |
695 | 675 | ||
696 | 676 | ||
697 | 677 | ||
698 | 678 | @Callable(msg) | |
699 | - | func init (assetIds,_A,_dAppThresholdCoef | |
679 | + | func init (assetIds,_A,_dAppThresholdCoef) = if (!(isDataStorageUntouched(this))) | |
700 | 680 | then throw("Already initialized") | |
701 | 681 | else if ((0 >= _A)) | |
702 | 682 | then throw("Amp must be must > 0") | |
703 | 683 | else if ((0 >= _dAppThresholdCoef)) | |
704 | 684 | then throw("dApp Threshold Coef must be > 0") | |
705 | 685 | else { | |
706 | 686 | let shareName = "s_Multi_USD" | |
707 | 687 | let shareDescription = ("ShareToken of SwopFi protocol for MultiStable USD pool at address " + toString(this)) | |
708 | 688 | let issueToken = Issue(shareName, shareDescription, 0, 6, true) | |
709 | 689 | let tokenId = calculateAssetId(issueToken) | |
710 | 690 | if (checkCoins(assetIds)) | |
711 | 691 | then throw() | |
712 | - | else { | |
713 | - | let baseEntry = [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
714 | - | if (firstHarvest) | |
715 | - | then (baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
716 | - | else baseEntry | |
717 | - | } | |
692 | + | else [StringEntry(kVersion, version), StringEntry(kAssets, assetIds), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_flat")), StringEntry(kShareAssetId, toBase58String(tokenId)), IntegerEntry(kShareAssetSupply, 0), IntegerEntry(kDAppThresholdCoef, _dAppThresholdCoef), BooleanEntry(kActive, true), issueToken] | |
718 | 693 | } | |
719 | 694 | ||
720 | 695 | ||
721 | 696 | ||
722 | 697 | @Callable(msg) | |
723 | 698 | func addLiquidity (minMintAmount,stakeFarming) = valueOrElse(isActive(), { | |
724 | 699 | let amp = _A() | |
725 | 700 | let xp = _xp() | |
726 | 701 | let D0 = if ((shareSupply == 0)) | |
727 | 702 | then 0 | |
728 | 703 | else getDMem(xp, amp) | |
729 | 704 | let payments = msg.payments | |
730 | 705 | let paymentsSize = size(payments) | |
731 | 706 | func validPayments (n) = if ((paymentsSize > nCoins)) | |
732 | 707 | then throw(("payments size > " + toString(nCoins))) | |
733 | 708 | else if ((1 > paymentsSize)) | |
734 | 709 | then throw("payments size < 1") | |
735 | 710 | else if (if ((shareSupply == 0)) | |
736 | 711 | then (nCoins != paymentsSize) | |
737 | 712 | else false) | |
738 | 713 | then throw("initial deposit requires all coins") | |
739 | 714 | else { | |
740 | 715 | func paymantValid (acc,payment) = if (containsElement(assetIds, getStrAssetId(payment.assetId))) | |
741 | 716 | then true | |
742 | 717 | else throw("Invalid asset in payment") | |
743 | 718 | ||
744 | 719 | let $l = payments | |
745 | 720 | let $s = size($l) | |
746 | 721 | let $acc0 = false | |
747 | 722 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
748 | 723 | then $a | |
749 | 724 | else paymantValid($a, $l[$i]) | |
750 | 725 | ||
751 | 726 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
752 | 727 | then $a | |
753 | 728 | else throw("List size exceeds 15") | |
754 | 729 | ||
755 | 730 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
756 | 731 | } | |
757 | 732 | ||
758 | 733 | if (!(validPayments(paymentsSize))) | |
759 | 734 | then throw() | |
760 | 735 | else { | |
761 | 736 | let suspicious = checkSuspicious() | |
762 | 737 | if (suspicious._1) | |
763 | 738 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, payments)) | |
764 | 739 | else { | |
765 | 740 | func parsePayments (acc,assetId) = { | |
766 | - | let $ | |
767 | - | let newBalances = $ | |
768 | - | let i = $ | |
769 | - | let j = $ | |
741 | + | let $t01612516154 = acc | |
742 | + | let newBalances = $t01612516154._1 | |
743 | + | let i = $t01612516154._2 | |
744 | + | let j = $t01612516154._3 | |
770 | 745 | if (if ((paymentsSize > j)) | |
771 | 746 | then (getStrAssetId(payments[j].assetId) == assetId) | |
772 | 747 | else false) | |
773 | 748 | then $Tuple3((newBalances :+ (xp[i] + payments[j].amount)), (i + 1), (j + 1)) | |
774 | 749 | else $Tuple3((newBalances :+ xp[i]), (i + 1), j) | |
775 | 750 | } | |
776 | 751 | ||
777 | - | let $ | |
752 | + | let $t01637416460 = { | |
778 | 753 | let $l = assetIds | |
779 | 754 | let $s = size($l) | |
780 | 755 | let $acc0 = $Tuple3(nil, 0, 0) | |
781 | 756 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
782 | 757 | then $a | |
783 | 758 | else parsePayments($a, $l[$i]) | |
784 | 759 | ||
785 | 760 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
786 | 761 | then $a | |
787 | 762 | else throw("List size exceeds 15") | |
788 | 763 | ||
789 | 764 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
790 | 765 | } | |
791 | - | let newBalances = $ | |
792 | - | let k = $ | |
793 | - | let parsedPayments = $ | |
766 | + | let newBalances = $t01637416460._1 | |
767 | + | let k = $t01637416460._2 | |
768 | + | let parsedPayments = $t01637416460._3 | |
794 | 769 | if ((paymentsSize > parsedPayments)) | |
795 | 770 | then throw("Incorect payments order") | |
796 | 771 | else if (checkDAppThreshold(newBalances)) | |
797 | 772 | then throw() | |
798 | 773 | else { | |
799 | 774 | let D1 = getDMem(newBalances, amp) | |
800 | 775 | if (assert((D1 > D0))) | |
801 | 776 | then throw("D1 > D0") | |
802 | 777 | else { | |
803 | 778 | let feeDiscount = calculateFeeDiscount(msg.caller) | |
804 | 779 | func calcScriptActions (acc,newBalance) = { | |
805 | - | let $ | |
806 | - | let invBalances = $ | |
807 | - | let scriptActions = $ | |
808 | - | let i = $ | |
780 | + | let $t01686116902 = acc | |
781 | + | let invBalances = $t01686116902._1 | |
782 | + | let scriptActions = $t01686116902._2 | |
783 | + | let i = $t01686116902._3 | |
809 | 784 | if ((shareSupply > 0)) | |
810 | 785 | then { | |
811 | 786 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
812 | 787 | let fees = { | |
813 | 788 | let idealBalance = fraction(D1, xp[i], D0) | |
814 | 789 | let difference = if ((idealBalance > newBalance)) | |
815 | 790 | then (idealBalance - newBalance) | |
816 | 791 | else (newBalance - idealBalance) | |
817 | 792 | fraction(_fee, difference, feeScale6) | |
818 | 793 | } | |
819 | 794 | let governanceFees = fraction(fees, feeGovernance, feeScale6) | |
820 | 795 | let finalBalance = (newBalance - fees) | |
821 | 796 | let invariantBalance = (newBalance - fees) | |
822 | 797 | let pmt = (newBalance - xp[i]) | |
823 | 798 | let lpFees = (fees - governanceFees) | |
824 | 799 | let inv = if ((pmt > 0)) | |
825 | 800 | then stake((pmt - fees), assetIds[i]) | |
826 | 801 | else unstake(fees, assetIds[i]) | |
827 | 802 | if ((inv == inv)) | |
828 | 803 | then { | |
829 | 804 | let airdrop = if ((lpFees > 0)) | |
830 | 805 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(fromBase58String(assetIds[i]), lpFees)]) | |
831 | 806 | else 0 | |
832 | 807 | if ((airdrop == airdrop)) | |
833 | 808 | then $Tuple3((invBalances :+ invariantBalance), (scriptActions ++ [ScriptTransfer(moneyBoxAddress, governanceFees, fromBase58String(assetIds[i])), IntegerEntry((assetIds[i] + kAssetBalance), finalBalance)]), (i + 1)) | |
834 | 809 | else throw("Strict value is not equal to itself.") | |
835 | 810 | } | |
836 | 811 | else throw("Strict value is not equal to itself.") | |
837 | 812 | } | |
838 | 813 | else { | |
839 | 814 | let inv = stake(newBalance, assetIds[i]) | |
840 | 815 | if ((inv == inv)) | |
841 | 816 | then $Tuple3((invBalances :+ newBalance), (scriptActions :+ IntegerEntry((assetIds[i] + kAssetBalance), newBalance)), (i + 1)) | |
842 | 817 | else throw("Strict value is not equal to itself.") | |
843 | 818 | } | |
844 | 819 | } | |
845 | 820 | ||
846 | - | let $ | |
821 | + | let $t01860718695 = { | |
847 | 822 | let $l = newBalances | |
848 | 823 | let $s = size($l) | |
849 | 824 | let $acc0 = $Tuple3(nil, nil, 0) | |
850 | 825 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
851 | 826 | then $a | |
852 | 827 | else calcScriptActions($a, $l[$i]) | |
853 | 828 | ||
854 | 829 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
855 | 830 | then $a | |
856 | 831 | else throw("List size exceeds 15") | |
857 | 832 | ||
858 | 833 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
859 | 834 | } | |
860 | - | let invBalances = $ | |
861 | - | let scriptActions = $ | |
835 | + | let invBalances = $t01860718695._1 | |
836 | + | let scriptActions = $t01860718695._2 | |
862 | 837 | let D2 = getDMem(invBalances, amp) | |
863 | 838 | let mint_amount = if ((shareSupply == 0)) | |
864 | 839 | then D1 | |
865 | 840 | else fraction(shareSupply, (D2 - D0), D0) | |
866 | 841 | if (assert((mint_amount >= minMintAmount))) | |
867 | 842 | then throw("Slippage screwed you") | |
868 | 843 | else if (stakeFarming) | |
869 | 844 | then { | |
870 | 845 | let re = invoke(this, "reissueShare", [mint_amount], nil) | |
871 | 846 | if ((re == re)) | |
872 | 847 | then { | |
873 | 848 | let s = invoke(farmingAddress, "lockShareTokens", [toString(this)], [AttachedPayment(shareAssetId, mint_amount)]) | |
874 | 849 | if ((s == s)) | |
875 | 850 | then (scriptActions :+ IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))) | |
876 | 851 | else throw("Strict value is not equal to itself.") | |
877 | 852 | } | |
878 | 853 | else throw("Strict value is not equal to itself.") | |
879 | 854 | } | |
880 | 855 | else (scriptActions ++ [Reissue(shareAssetId, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, shareAssetId), IntegerEntry(kShareAssetSupply, (shareSupply + mint_amount))]) | |
881 | 856 | } | |
882 | 857 | } | |
883 | 858 | } | |
884 | 859 | } | |
885 | 860 | }) | |
886 | 861 | ||
887 | 862 | ||
888 | 863 | ||
889 | 864 | @Callable(msg) | |
890 | 865 | func calcMintAmount (newBalances,user) = { | |
891 | 866 | let amp = _A() | |
892 | 867 | let xp = _xp() | |
893 | 868 | let D1 = getDMem(newBalances, amp) | |
894 | 869 | if ((shareSupply == 0)) | |
895 | 870 | then $Tuple2(nil, D1) | |
896 | 871 | else { | |
897 | 872 | let D0 = getDMem(xp, amp) | |
898 | 873 | let feeDiscount = calculateFeeDiscount(user) | |
899 | 874 | func calcInvBalances (acc,newBalance) = { | |
900 | - | let $ | |
901 | - | let invBalances = $ | |
902 | - | let i = $ | |
875 | + | let $t01988419910 = acc | |
876 | + | let invBalances = $t01988419910._1 | |
877 | + | let i = $t01988419910._2 | |
903 | 878 | let _fee = ((fraction(fee, feeDiscount, feeScale6, CEILING) * nCoins) / (4 * (nCoins - 1))) | |
904 | 879 | let fees = { | |
905 | 880 | let idealBalance = fraction(D1, xp[i], D0) | |
906 | 881 | let difference = if ((idealBalance > newBalance)) | |
907 | 882 | then (idealBalance - newBalance) | |
908 | 883 | else (newBalance - idealBalance) | |
909 | 884 | fraction(_fee, difference, feeScale6) | |
910 | 885 | } | |
911 | 886 | let invariantBalance = (newBalance - fees) | |
912 | 887 | $Tuple2((invBalances :+ invariantBalance), (i + 1)) | |
913 | 888 | } | |
914 | 889 | ||
915 | - | let $ | |
890 | + | let $t02051220582 = { | |
916 | 891 | let $l = newBalances | |
917 | 892 | let $s = size($l) | |
918 | 893 | let $acc0 = $Tuple2(nil, 0) | |
919 | 894 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
920 | 895 | then $a | |
921 | 896 | else calcInvBalances($a, $l[$i]) | |
922 | 897 | ||
923 | 898 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
924 | 899 | then $a | |
925 | 900 | else throw("List size exceeds 15") | |
926 | 901 | ||
927 | 902 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
928 | 903 | } | |
929 | - | let invBalances = $ | |
930 | - | let k = $ | |
904 | + | let invBalances = $t02051220582._1 | |
905 | + | let k = $t02051220582._2 | |
931 | 906 | let D2 = getDMem(invBalances, amp) | |
932 | 907 | let mintAmount = fraction(shareSupply, (D2 - D0), D0) | |
933 | 908 | $Tuple2(nil, mintAmount) | |
934 | 909 | } | |
935 | 910 | } | |
936 | 911 | ||
937 | 912 | ||
938 | 913 | ||
939 | 914 | @Callable(msg) | |
940 | 915 | func reissueShare (amount) = valueOrElse(isSelfCall(msg), [Reissue(shareAssetId, amount, true)]) | |
941 | 916 | ||
942 | 917 | ||
943 | 918 | ||
944 | 919 | @Callable(msg) | |
945 | 920 | func getDy (assetFrom,assetTo,dx,userAddress) = { | |
946 | 921 | let xp = _xp() | |
947 | 922 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, assetFrom), "unknown token in") | |
948 | 923 | let toIndex = valueOrErrorMessage(indexOf(assetIds, assetTo), "unknown token out") | |
949 | 924 | let x = (xp[fromIndex] + dx) | |
950 | 925 | let y = getY(fromIndex, toIndex, x, xp) | |
951 | 926 | let dy = ((xp[toIndex] - y) - 1) | |
952 | 927 | let feeDiscount = calculateFeeDiscount(Address(fromBase58String(userAddress))) | |
953 | 928 | let _fee = fraction(fraction(fee, feeDiscount, feeScale6, CEILING), dy, feeScale6) | |
954 | 929 | $Tuple2(nil, $Tuple2((dy - _fee), _fee)) | |
955 | 930 | } | |
956 | 931 | ||
957 | 932 | ||
958 | 933 | ||
959 | 934 | @Callable(msg) | |
960 | 935 | func exchange (tokenOut,min_dy) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
961 | 936 | then throw("size(payments) != 1") | |
962 | 937 | else { | |
963 | 938 | let suspicious = checkSuspicious() | |
964 | 939 | if (suspicious._1) | |
965 | 940 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
966 | 941 | else { | |
967 | 942 | let payment = msg.payments[0] | |
968 | 943 | let tokenIn = getStrAssetId(payment.assetId) | |
969 | 944 | let tokenOutB58 = fromBase58String(tokenOut) | |
970 | 945 | let dx = payment.amount | |
971 | 946 | let fromIndex = valueOrErrorMessage(indexOf(assetIds, tokenIn), "unknown token in") | |
972 | 947 | let toIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
973 | 948 | let xp = _xp() | |
974 | 949 | let x = (xp[fromIndex] + dx) | |
975 | 950 | let y = getY(fromIndex, toIndex, x, xp) | |
976 | 951 | let _dy = ((xp[toIndex] - y) - 1) | |
977 | - | let feeDiscount = calculateFeeDiscount(msg. | |
952 | + | let feeDiscount = calculateFeeDiscount(msg.originCaller) | |
978 | 953 | let _fee = fraction(_dy, fraction(fee, feeDiscount, feeScale6, CEILING), feeScale6) | |
979 | 954 | let dy = (_dy - _fee) | |
980 | 955 | let governanceFees = fraction(_fee, feeGovernance, feeScale6) | |
981 | 956 | if (assert((dy >= min_dy))) | |
982 | 957 | then throw("Exchange resulted in fewer coins than expected") | |
983 | 958 | else { | |
984 | 959 | func makeNewBalances (acc,tokenBalance) = { | |
985 | - | let $ | |
986 | - | let newBalances = $ | |
987 | - | let i = $ | |
960 | + | let $t02262322649 = acc | |
961 | + | let newBalances = $t02262322649._1 | |
962 | + | let i = $t02262322649._2 | |
988 | 963 | if ((i == fromIndex)) | |
989 | 964 | then $Tuple2((newBalances :+ (tokenBalance + dx)), (i + 1)) | |
990 | 965 | else if ((i == toIndex)) | |
991 | 966 | then $Tuple2((newBalances :+ (tokenBalance - _dy)), (i + 1)) | |
992 | 967 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
993 | 968 | } | |
994 | 969 | ||
995 | - | let $ | |
970 | + | let $t02290022961 = { | |
996 | 971 | let $l = xp | |
997 | 972 | let $s = size($l) | |
998 | 973 | let $acc0 = $Tuple2(nil, 0) | |
999 | 974 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1000 | 975 | then $a | |
1001 | 976 | else makeNewBalances($a, $l[$i]) | |
1002 | 977 | ||
1003 | 978 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1004 | 979 | then $a | |
1005 | 980 | else throw("List size exceeds 15") | |
1006 | 981 | ||
1007 | 982 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1008 | 983 | } | |
1009 | - | let newBalances = $ | |
1010 | - | let i = $ | |
984 | + | let newBalances = $t02290022961._1 | |
985 | + | let i = $t02290022961._2 | |
1011 | 986 | if (checkDAppThreshold(newBalances)) | |
1012 | 987 | then throw() | |
1013 | 988 | else { | |
1014 | 989 | let s = stake(payment.amount, getStrAssetId(payment.assetId)) | |
1015 | 990 | if ((s == s)) | |
1016 | 991 | then { | |
1017 | 992 | let us = unstake(_dy, tokenOut) | |
1018 | 993 | if ((us == us)) | |
1019 | 994 | then { | |
1020 | 995 | let lpFees = (_fee - governanceFees) | |
1021 | 996 | let airdrop = if ((lpFees > 0)) | |
1022 | 997 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1023 | 998 | else 0 | |
1024 | 999 | if ((airdrop == airdrop)) | |
1025 | 1000 | then $Tuple2([IntegerEntry((tokenIn + kAssetBalance), x), IntegerEntry((tokenOut + kAssetBalance), (xp[toIndex] - _dy)), ScriptTransfer(msg.caller, dy, tokenOutB58), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58)], [dy, tokenOutB58]) | |
1026 | 1001 | else throw("Strict value is not equal to itself.") | |
1027 | 1002 | } | |
1028 | 1003 | else throw("Strict value is not equal to itself.") | |
1029 | 1004 | } | |
1030 | 1005 | else throw("Strict value is not equal to itself.") | |
1031 | 1006 | } | |
1032 | 1007 | } | |
1033 | 1008 | } | |
1034 | 1009 | }) | |
1035 | 1010 | ||
1036 | 1011 | ||
1037 | 1012 | ||
1038 | 1013 | @Callable(msg) | |
1039 | 1014 | func withdraw (minAmounts) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1040 | 1015 | then throw("size(payments) != 1") | |
1041 | 1016 | else { | |
1042 | 1017 | let pmtAmount = msg.payments[0].amount | |
1043 | 1018 | let pmtAssetId = msg.payments[0].assetId | |
1044 | 1019 | if ((shareAssetId != pmtAssetId)) | |
1045 | 1020 | then throw("unknown payment token") | |
1046 | 1021 | else { | |
1047 | 1022 | let suspicious = checkSuspicious() | |
1048 | 1023 | if (suspicious._1) | |
1049 | 1024 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
1050 | 1025 | else { | |
1051 | 1026 | func calcScriptActions (acc,balance) = { | |
1052 | - | let $ | |
1053 | - | let scriptActions = $ | |
1054 | - | let i = $ | |
1027 | + | let $t02425224280 = acc | |
1028 | + | let scriptActions = $t02425224280._1 | |
1029 | + | let i = $t02425224280._2 | |
1055 | 1030 | let wAmount = fraction(balance, pmtAmount, shareSupply) | |
1056 | 1031 | if (assert((wAmount >= minAmounts[i]))) | |
1057 | 1032 | then throw("Withdrawal resulted in fewer coins than expected") | |
1058 | 1033 | else { | |
1059 | 1034 | let us = unstake(wAmount, assetIds[i]) | |
1060 | 1035 | if ((us == us)) | |
1061 | 1036 | then $Tuple2((scriptActions ++ [IntegerEntry((assetIds[i] + kAssetBalance), (balance - wAmount)), ScriptTransfer(msg.originCaller, wAmount, fromBase58String(assetIds[i]))]), (i + 1)) | |
1062 | 1037 | else throw("Strict value is not equal to itself.") | |
1063 | 1038 | } | |
1064 | 1039 | } | |
1065 | 1040 | ||
1066 | - | let $ | |
1041 | + | let $t02477024838 = { | |
1067 | 1042 | let $l = _xp() | |
1068 | 1043 | let $s = size($l) | |
1069 | 1044 | let $acc0 = $Tuple2(nil, 0) | |
1070 | 1045 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1071 | 1046 | then $a | |
1072 | 1047 | else calcScriptActions($a, $l[$i]) | |
1073 | 1048 | ||
1074 | 1049 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1075 | 1050 | then $a | |
1076 | 1051 | else throw("List size exceeds 15") | |
1077 | 1052 | ||
1078 | 1053 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1079 | 1054 | } | |
1080 | - | let scriptActions = $ | |
1081 | - | let i = $ | |
1055 | + | let scriptActions = $t02477024838._1 | |
1056 | + | let i = $t02477024838._2 | |
1082 | 1057 | (scriptActions ++ [Burn(shareAssetId, pmtAmount), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))]) | |
1083 | 1058 | } | |
1084 | 1059 | } | |
1085 | 1060 | }) | |
1086 | 1061 | ||
1087 | 1062 | ||
1088 | 1063 | ||
1089 | 1064 | @Callable(msg) | |
1090 | 1065 | func withdrawWithUnlock (minAmounts,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1091 | 1066 | then throw("Unlock amount must be positive") | |
1092 | 1067 | else { | |
1093 | 1068 | let suspicious = checkSuspicious() | |
1094 | 1069 | if (suspicious._1) | |
1095 | 1070 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1096 | 1071 | else { | |
1097 | 1072 | let pmtAmount = if ((size(msg.payments) > 0)) | |
1098 | 1073 | then if ((size(msg.payments) != 1)) | |
1099 | 1074 | then throw("size(payments) != 1") | |
1100 | 1075 | else { | |
1101 | 1076 | let pmtAssetId = msg.payments[0].assetId | |
1102 | 1077 | if ((shareAssetId != pmtAssetId)) | |
1103 | 1078 | then throw("unknown payment token") | |
1104 | 1079 | else msg.payments[0].amount | |
1105 | 1080 | } | |
1106 | 1081 | else 0 | |
1107 | 1082 | let unlock = invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil) | |
1108 | 1083 | if ((unlock == unlock)) | |
1109 | 1084 | then { | |
1110 | 1085 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1111 | 1086 | let inv = invoke(this, "withdraw", [minAmounts], [AttachedPayment(shareAssetId, withdrawAmount)]) | |
1112 | 1087 | if ((inv == inv)) | |
1113 | 1088 | then nil | |
1114 | 1089 | else throw("Strict value is not equal to itself.") | |
1115 | 1090 | } | |
1116 | 1091 | else throw("Strict value is not equal to itself.") | |
1117 | 1092 | } | |
1118 | 1093 | }) | |
1119 | 1094 | ||
1120 | 1095 | ||
1121 | 1096 | ||
1122 | 1097 | @Callable(msg) | |
1123 | 1098 | func calcWithdrawOneCoin (tokenAmount,tokenOut,user) = { | |
1124 | 1099 | let i = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1125 | 1100 | $Tuple2(nil, _calcWithdrawOneCoin(_xp(), tokenAmount, i, Address(fromBase58String(user)))._1) | |
1126 | 1101 | } | |
1127 | 1102 | ||
1128 | 1103 | ||
1129 | 1104 | ||
1130 | 1105 | @Callable(msg) | |
1131 | 1106 | func withdrawOneCoin (tokenOut,minAmount) = valueOrElse(isActive(), if ((size(msg.payments) != 1)) | |
1132 | 1107 | then throw("size(payments) != 1") | |
1133 | 1108 | else { | |
1134 | 1109 | let suspicious = checkSuspicious() | |
1135 | 1110 | if (suspicious._1) | |
1136 | 1111 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.originCaller, msg.payments)) | |
1137 | 1112 | else { | |
1138 | 1113 | let pmtAmount = msg.payments[0].amount | |
1139 | 1114 | let pmtAssetId = msg.payments[0].assetId | |
1140 | 1115 | if ((pmtAssetId != shareAssetId)) | |
1141 | 1116 | then throw("unknown token") | |
1142 | 1117 | else { | |
1143 | 1118 | let outIndex = valueOrErrorMessage(indexOf(assetIds, tokenOut), "unknown token out") | |
1144 | 1119 | let tokenOutB58 = fromBase58String(tokenOut) | |
1145 | 1120 | let xp = _xp() | |
1146 | - | let $ | |
1147 | - | let dy = $ | |
1148 | - | let dy_fee = $ | |
1121 | + | let $t02680226884 = _calcWithdrawOneCoin(xp, pmtAmount, outIndex, msg.originCaller) | |
1122 | + | let dy = $t02680226884._1 | |
1123 | + | let dy_fee = $t02680226884._2 | |
1149 | 1124 | if (assert((dy >= minAmount))) | |
1150 | 1125 | then throw("Not enough coins removed") | |
1151 | 1126 | else { | |
1152 | 1127 | let governanceFees = fraction(dy_fee, feeGovernance, feeScale6) | |
1153 | 1128 | let dy_and_fee = (dy + dy_fee) | |
1154 | 1129 | func makeNewBalances (acc,tokenBalance) = { | |
1155 | - | let $ | |
1156 | - | let newBalances = $ | |
1157 | - | let i = $ | |
1130 | + | let $t02714227168 = acc | |
1131 | + | let newBalances = $t02714227168._1 | |
1132 | + | let i = $t02714227168._2 | |
1158 | 1133 | if ((i == outIndex)) | |
1159 | 1134 | then $Tuple2((newBalances :+ (tokenBalance - dy_and_fee)), (i + 1)) | |
1160 | 1135 | else $Tuple2((newBalances :+ tokenBalance), (i + 1)) | |
1161 | 1136 | } | |
1162 | 1137 | ||
1163 | - | let $ | |
1138 | + | let $t02733527396 = { | |
1164 | 1139 | let $l = xp | |
1165 | 1140 | let $s = size($l) | |
1166 | 1141 | let $acc0 = $Tuple2(nil, 0) | |
1167 | 1142 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1168 | 1143 | then $a | |
1169 | 1144 | else makeNewBalances($a, $l[$i]) | |
1170 | 1145 | ||
1171 | 1146 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1172 | 1147 | then $a | |
1173 | 1148 | else throw("List size exceeds 15") | |
1174 | 1149 | ||
1175 | 1150 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1176 | 1151 | } | |
1177 | - | let newBalances = $ | |
1178 | - | let v = $ | |
1152 | + | let newBalances = $t02733527396._1 | |
1153 | + | let v = $t02733527396._2 | |
1179 | 1154 | if (checkDAppThreshold(newBalances)) | |
1180 | 1155 | then throw() | |
1181 | 1156 | else { | |
1182 | 1157 | let us = unstake(dy_and_fee, tokenOut) | |
1183 | 1158 | if ((us == us)) | |
1184 | 1159 | then { | |
1185 | 1160 | let lpFees = (dy_fee - governanceFees) | |
1186 | 1161 | let airdrop = if ((lpFees > 0)) | |
1187 | 1162 | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenOutB58, lpFees)]) | |
1188 | 1163 | else 0 | |
1189 | 1164 | if ((airdrop == airdrop)) | |
1190 | 1165 | then [ScriptTransfer(msg.originCaller, dy, tokenOutB58), IntegerEntry((assetIds[outIndex] + kAssetBalance), (xp[outIndex] - dy_and_fee)), Burn(shareAssetId, pmtAmount), ScriptTransfer(moneyBoxAddress, governanceFees, tokenOutB58), IntegerEntry(kShareAssetSupply, (shareSupply - pmtAmount))] | |
1191 | 1166 | else throw("Strict value is not equal to itself.") | |
1192 | 1167 | } | |
1193 | 1168 | else throw("Strict value is not equal to itself.") | |
1194 | 1169 | } | |
1195 | 1170 | } | |
1196 | 1171 | } | |
1197 | 1172 | } | |
1198 | 1173 | }) | |
1199 | 1174 | ||
1200 | 1175 | ||
1201 | 1176 | ||
1202 | 1177 | @Callable(msg) | |
1203 | 1178 | func withdrawOneCoinWithUnlock (tokenOut,minAmount,unlockAmount) = valueOrElse(isActive(), if ((0 >= unlockAmount)) | |
1204 | 1179 | then throw("Unlock amount must be positive") | |
1205 | 1180 | else { | |
1206 | 1181 | let suspicious = checkSuspicious() | |
1207 | 1182 | if (suspicious._1) | |
1208 | 1183 | then (suspendSuspicious(suspicious._2) ++ returnPayments(msg.caller, msg.payments)) | |
1209 | 1184 | else { | |
1210 | 1185 | let pmtAmount = if ((size(msg.payments) > 0)) | |
1211 | 1186 | then if ((size(msg.payments) != 1)) | |
1212 | 1187 | then throw("size(payments) != 1") | |
1213 | 1188 | else { | |
1214 | 1189 | let pmtAssetId = msg.payments[0].assetId | |
1215 | 1190 | if ((shareAssetId != pmtAssetId)) | |
1216 | 1191 | then throw("unknown payment token") | |
1217 | 1192 | else msg.payments[0].amount | |
1218 | 1193 | } | |
1219 | 1194 | else 0 | |
1220 | 1195 | let unlock = invoke(farmingAddress, "withdrawShareTokens", [toString(this), unlockAmount], nil) | |
1221 | 1196 | if ((unlock == unlock)) | |
1222 | 1197 | then { | |
1223 | 1198 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1224 | 1199 | let inv = invoke(this, "withdrawOneCoin", [tokenOut, minAmount], [AttachedPayment(shareAssetId, withdrawAmount)]) | |
1225 | 1200 | if ((inv == inv)) | |
1226 | 1201 | then nil | |
1227 | 1202 | else throw("Strict value is not equal to itself.") | |
1228 | 1203 | } | |
1229 | 1204 | else throw("Strict value is not equal to itself.") | |
1230 | 1205 | } | |
1231 | 1206 | }) | |
1232 | 1207 | ||
1233 | 1208 | ||
1234 | 1209 | ||
1235 | 1210 | @Callable(msg) | |
1236 | 1211 | func A () = $Tuple2(nil, _A()) | |
1237 | 1212 | ||
1238 | 1213 | ||
1239 | 1214 | ||
1240 | 1215 | @Callable(msg) | |
1241 | 1216 | func getVirtualPrice () = { | |
1242 | 1217 | let D = get_D(_xp(), _A()) | |
1243 | 1218 | $Tuple2(nil, fraction(D, PRECISION, shareSupply)) | |
1244 | 1219 | } | |
1245 | 1220 | ||
1246 | 1221 | ||
1247 | 1222 | ||
1248 | 1223 | @Callable(msg) | |
1249 | 1224 | func calcTokenAmount (amounts,deposit) = { | |
1250 | 1225 | let amp = _A() | |
1251 | 1226 | let balances = _xp() | |
1252 | 1227 | let D0 = getDMem(balances, amp) | |
1253 | 1228 | func calcNewBalances (acc,balance) = { | |
1254 | - | let $ | |
1255 | - | let newBalances = $ | |
1256 | - | let i = $ | |
1229 | + | let $t02941329439 = acc | |
1230 | + | let newBalances = $t02941329439._1 | |
1231 | + | let i = $t02941329439._2 | |
1257 | 1232 | let newBalance = (balance + (if (deposit) | |
1258 | 1233 | then amounts[i] | |
1259 | 1234 | else -(amounts[i]))) | |
1260 | 1235 | $Tuple2((newBalances :+ newBalance), (i + 1)) | |
1261 | 1236 | } | |
1262 | 1237 | ||
1263 | 1238 | let newBalances = ( let $l = balances | |
1264 | 1239 | let $s = size($l) | |
1265 | 1240 | let $acc0 = $Tuple2(nil, 0) | |
1266 | 1241 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1267 | 1242 | then $a | |
1268 | 1243 | else calcNewBalances($a, $l[$i]) | |
1269 | 1244 | ||
1270 | 1245 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1271 | 1246 | then $a | |
1272 | 1247 | else throw("List size exceeds 15") | |
1273 | 1248 | ||
1274 | 1249 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15))._1 | |
1275 | 1250 | let D1 = getDMem(newBalances, amp) | |
1276 | 1251 | let diff = if (deposit) | |
1277 | 1252 | then (D1 - D0) | |
1278 | 1253 | else (D0 - D1) | |
1279 | 1254 | $Tuple2(nil, fraction(diff, shareSupply, D0)) | |
1280 | 1255 | } | |
1281 | 1256 | ||
1282 | 1257 | ||
1283 | 1258 | ||
1284 | 1259 | @Callable(msg) | |
1285 | 1260 | func rampA (_futureA,_futureTime) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), if (assert((blockTimestamp >= (initial_A_time + MIN_RAMP_TIME)))) | |
1286 | 1261 | then throw("too often") | |
1287 | 1262 | else if (assert((_futureTime >= (blockTimestamp + MIN_RAMP_TIME)))) | |
1288 | 1263 | then throw("insufficient time") | |
1289 | 1264 | else { | |
1290 | 1265 | let _initial_A = _A() | |
1291 | 1266 | if (assert(if ((_futureA > 0)) | |
1292 | 1267 | then (MAX_A > _futureA) | |
1293 | 1268 | else false)) | |
1294 | 1269 | then throw("out of base range") | |
1295 | 1270 | else if (assert(if (if ((_futureA >= _initial_A)) | |
1296 | 1271 | then ((_initial_A * MAX_A_CHANGE) >= _futureA) | |
1297 | 1272 | else false) | |
1298 | 1273 | then true | |
1299 | 1274 | else if ((_initial_A > _futureA)) | |
1300 | 1275 | then ((_futureA * MAX_A_CHANGE) >= _initial_A) | |
1301 | 1276 | else false)) | |
1302 | 1277 | then throw("out of range") | |
1303 | 1278 | else [IntegerEntry("initial_A", _initial_A), IntegerEntry("future_A", _futureA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", _futureTime)] | |
1304 | 1279 | })) | |
1305 | 1280 | ||
1306 | 1281 | ||
1307 | 1282 | ||
1308 | 1283 | @Callable(msg) | |
1309 | 1284 | func stopRampA () = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), { | |
1310 | 1285 | let currentA = _A() | |
1311 | 1286 | [IntegerEntry("initial_A", currentA), IntegerEntry("future_A", currentA), IntegerEntry("initial_A_time", blockTimestamp), IntegerEntry("future_A_time", blockTimestamp)] | |
1312 | 1287 | })) | |
1313 | 1288 | ||
1314 | 1289 | ||
1315 | 1290 | ||
1316 | 1291 | @Callable(msg) | |
1317 | 1292 | func shutdown () = valueOrElse(isAdminCall(msg), if (!(active)) | |
1318 | 1293 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, kCause), "the cause wasn't specified"))) | |
1319 | 1294 | else suspend("Paused by admin")) | |
1320 | 1295 | ||
1321 | 1296 | ||
1322 | 1297 | ||
1323 | 1298 | @Callable(msg) | |
1324 | 1299 | func activate () = valueOrElse(isAdminCall(msg), if (active) | |
1325 | 1300 | then throwIsActive() | |
1326 | 1301 | else [BooleanEntry(kActive, true), DeleteEntry(kCause)]) | |
1327 | 1302 | ||
1328 | 1303 | ||
1329 | 1304 | ||
1330 | 1305 | @Callable(msg) | |
1331 | - | func keepLimitForFirstHarvest (shareLimit) = valueOrElse(isActive(), valueOrElse(isAdminCall(msg), [IntegerEntry(kShareLimit, shareLimit)])) | |
1306 | + | func takeIntoAccountExtraFunds () = valueOrElse(isActive(), if ((msg.caller != moneyBoxAddress)) | |
1307 | + | then throw("Only the wallet can call this function") | |
1308 | + | else { | |
1309 | + | let balances = _xp() | |
1310 | + | func takeExtraFunds (acc,assetId) = { | |
1311 | + | let $t03178131799 = acc | |
1312 | + | let sum = $t03178131799._1 | |
1313 | + | let i = $t03178131799._2 | |
1314 | + | let tokenB58 = fromBase58String(assetId) | |
1315 | + | let rBalance = (assetBalance(this, tokenB58) + stakedAmount(tokenB58)) | |
1316 | + | let enrollAmount = (rBalance - balances[i]) | |
1317 | + | if ((0 > enrollAmount)) | |
1318 | + | then suspend(("Enroll amount negative for asset" + assetId)) | |
1319 | + | else { | |
1320 | + | let airdrop = if ((enrollAmount > 0)) | |
1321 | + | then invoke(lpFarmingAddress, "airDrop", nil, [AttachedPayment(tokenB58, enrollAmount)]) | |
1322 | + | else 0 | |
1323 | + | if ((airdrop == airdrop)) | |
1324 | + | then $Tuple2((sum + enrollAmount), (i + 1)) | |
1325 | + | else throw("Strict value is not equal to itself.") | |
1326 | + | } | |
1327 | + | } | |
1328 | + | ||
1329 | + | let k = { | |
1330 | + | let $l = assetIds | |
1331 | + | let $s = size($l) | |
1332 | + | let $acc0 = $Tuple2(0, 0) | |
1333 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1334 | + | then $a | |
1335 | + | else takeExtraFunds($a, $l[$i]) | |
1336 | + | ||
1337 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1338 | + | then $a | |
1339 | + | else throw("List size exceeds 15") | |
1340 | + | ||
1341 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
1342 | + | } | |
1343 | + | if ((k._1 == 0)) | |
1344 | + | then throw("No money to take") | |
1345 | + | else nil | |
1346 | + | }) | |
1332 | 1347 | ||
1333 | 1348 | ||
1334 | 1349 | @Verifier(tx) | |
1335 | 1350 | func verify () = { | |
1336 | 1351 | let multiSignedByAdmins = { | |
1337 | 1352 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1338 | 1353 | then 1 | |
1339 | 1354 | else 0 | |
1340 | 1355 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
1341 | 1356 | then 1 | |
1342 | 1357 | else 0 | |
1343 | 1358 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
1344 | 1359 | then 1 | |
1345 | 1360 | else 0 | |
1346 | 1361 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
1347 | 1362 | } | |
1348 | 1363 | match tx { | |
1349 | 1364 | case inv: InvokeScriptTransaction => | |
1350 | 1365 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
1351 | 1366 | then (inv.function == "takeIntoAccountExtraFunds") | |
1352 | 1367 | else false | |
1353 | 1368 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1354 | 1369 | then true | |
1355 | 1370 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
1356 | 1371 | then true | |
1357 | 1372 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
1358 | 1373 | then true | |
1359 | 1374 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyInvoke) | |
1360 | 1375 | if (if (callTakeIntoAccount) | |
1361 | 1376 | then signedByAdmin | |
1362 | 1377 | else false) | |
1363 | 1378 | then true | |
1364 | 1379 | else multiSignedByAdmins | |
1365 | 1380 | case _ => | |
1366 | 1381 | multiSignedByAdmins | |
1367 | 1382 | } | |
1368 | 1383 | } | |
1369 | 1384 |
github/deemru/w8io/026f985 217.13 ms ◑