tx · FtDNSChYhtAPm16gApha11hdpHjD7oyD4GUyieiUry2c 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj: -0.03400000 Waves 2022.06.24 19:28 [2110741] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves
{ "type": 13, "id": "FtDNSChYhtAPm16gApha11hdpHjD7oyD4GUyieiUry2c", "fee": 3400000, "feeAssetId": null, "timestamp": 1656088110106, "version": 1, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "346gA9V8yYw8q6tgz52Hf4jzGSkz2pX2nYRnAiiv4VfW8KwmsXt2DpYNuZ4nRXBSNQVqtKragMkiLwWhpn6Ev77", "o5wdBNRcCSonjyXvu2XfLbYc8dUcWgU1q4cVmzDZyuJrWCLwR7EPtrxE2mNJkd7VhfiUNEVAKce4eAYFwbpaBfo", "3cW7jHfG5d5YC5H4QtQmYzkdAn4uJXGrYUf5QuaEth12cYYSHZNfCvFE7irePkoAax3TNyoXCi24s5mRQFWHAsgf" ], "script": "base64:AAIFAAAAAAAAAD0IAhIOCgwICAgICAgBAQEBAQESBQoDCAgBEgASABIFCgMIAQgSAwoBARIECgIBCBIAEgQKAggBEgQKAggBAAAAfQEAAAAPZ2V0U3RyaW5nT3JGYWlsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAICAAAAD01hbmRhdG9yeSB0aGlzLgUAAAADa2V5AgAAAA8gaXMgbm90IGRlZmluZWQBAAAABWxjYWxjAAAAAQAAAAFsCQAEOQAAAAEFAAAAAWwBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdG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, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HrYmWNzyHft45jNm2oSb2azkTdfvvAQAeqHWKtjwUW8k Next: DQM4mvP7FFZoA2cn95LkxyXeVAB24StMsnEUx41mLtgK Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("Mandatory this." + key) + " is not defined")) | |
5 | + | ||
6 | + | ||
7 | + | func lcalc (l) = calculateLeaseId(l) | |
8 | + | ||
9 | + | ||
4 | 10 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 11 | ||
6 | 12 | ||
19 | 25 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(addressFromStringValue(address), key), false) | |
20 | 26 | ||
21 | 27 | ||
22 | - | func asAnyList ( | |
23 | - | case | |
24 | - | | |
28 | + | func asAnyList (v) = match v { | |
29 | + | case l: List[Any] => | |
30 | + | l | |
25 | 31 | case _ => | |
26 | 32 | throw("fail to cast into List[Any]") | |
27 | 33 | } | |
28 | 34 | ||
29 | 35 | ||
30 | - | func asString ( | |
31 | - | case | |
32 | - | | |
36 | + | func asString (v) = match v { | |
37 | + | case s: String => | |
38 | + | s | |
33 | 39 | case _ => | |
34 | 40 | throw("fail to cast into String") | |
35 | 41 | } | |
36 | 42 | ||
37 | 43 | ||
38 | - | func asInt ( | |
39 | - | case | |
40 | - | | |
44 | + | func asInt (v) = match v { | |
45 | + | case i: Int => | |
46 | + | i | |
41 | 47 | case _ => | |
42 | 48 | throw("fail to cast into Int") | |
43 | 49 | } | |
44 | 50 | ||
45 | 51 | ||
46 | - | func asSwapParamsSTRUCT (val) = match val { | |
52 | + | func asPayment (v) = match v { | |
53 | + | case p: AttachedPayment => | |
54 | + | p | |
55 | + | case _ => | |
56 | + | throw("fail to cast into AttachedPayment") | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | func asSwapParamsSTRUCT (v) = match v { | |
47 | 61 | case struct: (Int, Int, Int, Int, Int) => | |
48 | 62 | struct | |
49 | 63 | case _ => | |
101 | 115 | ||
102 | 116 | let FeesManagerAddressKey = "fees_manager_address" | |
103 | 117 | ||
118 | + | func keyNodeRegistry (address) = ("%s__" + address) | |
119 | + | ||
120 | + | ||
104 | 121 | let PriceKey = "price" | |
105 | 122 | ||
106 | 123 | let PriceIndexKey = "price_index" | |
128 | 145 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
129 | 146 | ||
130 | 147 | ||
148 | + | func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP) | |
149 | + | ||
150 | + | ||
131 | 151 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
152 | + | ||
153 | + | ||
154 | + | func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP) | |
155 | + | ||
156 | + | ||
157 | + | func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP) | |
132 | 158 | ||
133 | 159 | ||
134 | 160 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
355 | 381 | else nil | |
356 | 382 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
357 | 383 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
358 | - | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, | |
384 | + | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
359 | 385 | } | |
360 | 386 | else nil | |
361 | 387 | } | |
362 | 388 | ||
363 | 389 | ||
390 | + | func readNodeInfo (nodeIdx) = { | |
391 | + | let nodeAddress = getStakingNodeAddressByIndex(nodeIdx) | |
392 | + | let leasedAmtKEY = getLeaseAmountKey(nodeIdx) | |
393 | + | let leasedAmt = getNumberByKey(leasedAmtKEY) | |
394 | + | let leaseIdKEY = getLeaseIdKey(nodeIdx) | |
395 | + | let leaseId = value(getBinary(this, leaseIdKEY)) | |
396 | + | $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId) | |
397 | + | } | |
398 | + | ||
399 | + | ||
364 | 400 | func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapParamsByUserSYSREADONLY) = { | |
365 | - | let $ | |
366 | - | let swapLimitMax = $ | |
367 | - | let swapLimitSpent = $ | |
368 | - | let blcks2LmtReset = $ | |
401 | + | let $t01675916839 = swapParamsByUserSYSREADONLY | |
402 | + | let swapLimitMax = $t01675916839._1 | |
403 | + | let swapLimitSpent = $t01675916839._2 | |
404 | + | let blcks2LmtReset = $t01675916839._3 | |
369 | 405 | let minSwapAmount = minSwapAmountREAD(swapType) | |
370 | 406 | let totalLocked = totalLockedREAD(swapType) | |
371 | 407 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr) | |
412 | 448 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
413 | 449 | let totalLocked = totalLockedREAD(swapType) | |
414 | 450 | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
415 | - | let unlockHeight = | |
451 | + | let unlockHeight = selfUnlockHeight | |
416 | 452 | let indexHeight = getHeightPriceByIndex(index) | |
417 | 453 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
418 | 454 | let priceByIndex = getPriceHistory(indexHeight) | |
445 | 481 | else (outFeePart >= PAULI)) | |
446 | 482 | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
447 | 483 | else { | |
448 | - | let | |
484 | + | let unleaseAmount = if (if ((swapType == "neutrino")) | |
449 | 485 | then (outAmountGrossTuple._1 > 0) | |
450 | 486 | else false) | |
451 | - | then | |
452 | - | else | |
453 | - | let state = | |
454 | - | $ | |
487 | + | then outAmountGrossTuple._1 | |
488 | + | else 0 | |
489 | + | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))] | |
490 | + | $Tuple3(state, AttachedPayment(outAmountGrossTuple._2, outFeeAmount), unleaseAmount) | |
455 | 491 | } | |
456 | 492 | } | |
457 | 493 | ||
517 | 553 | ||
518 | 554 | ||
519 | 555 | @Callable(i) | |
520 | - | func withdraw (account,index,swapTxId) = if ((size(i.payments) != 0)) | |
521 | - | then throw("no payments allowed") | |
522 | - | else { | |
523 | - | let $t02418624290 = commonWithdraw(account, index, swapTxId, toBase58String(i.transactionId)) | |
524 | - | let state = $t02418624290._1 | |
525 | - | let depositPayment = $t02418624290._2 | |
526 | - | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [depositPayment]) | |
527 | - | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
528 | - | then state | |
529 | - | else throw("Strict value is not equal to itself.") | |
530 | - | } | |
556 | + | func withdraw (account,index,swapTxId) = { | |
557 | + | let txId = toBase58String(i.transactionId) | |
558 | + | if ((size(i.payments) != 0)) | |
559 | + | then throw("no payments allowed") | |
560 | + | else { | |
561 | + | let commonTuple = commonWithdraw(account, index, swapTxId, txId) | |
562 | + | let state = commonTuple._1 | |
563 | + | let fee = commonTuple._2 | |
564 | + | let unleaseAmt = commonTuple._3 | |
565 | + | let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil) | |
566 | + | if ((unleaseInvOrEmpty == unleaseInvOrEmpty)) | |
567 | + | then if ((0 >= fee.amount)) | |
568 | + | then state | |
569 | + | else { | |
570 | + | let nsbtStakingReward = invoke(nsbtStakingContract, "deposit", nil, [fee]) | |
571 | + | if ((nsbtStakingReward == nsbtStakingReward)) | |
572 | + | then state | |
573 | + | else throw("Strict value is not equal to itself.") | |
574 | + | } | |
575 | + | else throw("Strict value is not equal to itself.") | |
576 | + | } | |
577 | + | } | |
531 | 578 | ||
532 | 579 | ||
533 | 580 | ||
534 | 581 | @Callable(i) | |
535 | - | func transferToAuction () = if ((size(i.payments) != 0)) | |
536 | - | then throw("no payments allowed") | |
537 | - | else { | |
538 | - | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
539 | - | let reserve = asInt(neutrinoMetrics[3]) | |
540 | - | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
541 | - | let surplus = asInt(neutrinoMetrics[6]) | |
542 | - | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
543 | - | let auctionNBAmount = (neutrinoSupply - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) | |
544 | - | let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
545 | - | if (isBlocked) | |
546 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
547 | - | else if ((auctionNBAmount > (1 * PAULI))) | |
548 | - | then [ScriptTransfer(addressFromStringValue(auctionContract), auctionNBAmount, bondAssetId)] | |
549 | - | else if ((surplusWithLiquidation >= (1 * PAULI))) | |
550 | - | then [ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)] | |
551 | - | else throw(((((((("bond were generated or do not need it. Deficit:" + toString(auctionNBAmount)) + "|") + toString(0)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus))) | |
552 | - | } | |
582 | + | func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this)) | |
583 | + | then throw("internalUnleaseAndLease is not public method") | |
584 | + | else prepareUnleaseAndLease(unleaseAmount) | |
553 | 585 | ||
554 | 586 | ||
555 | 587 | ||
564 | 596 | func acceptWaves () = if ((i.caller != addressFromStringValue(auctionContract))) | |
565 | 597 | then throw("Currently only auction contract is allowed to call") | |
566 | 598 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
599 | + | ||
600 | + | ||
601 | + | ||
602 | + | @Callable(i) | |
603 | + | func approveLeasings (nListS,groupNum) = { | |
604 | + | let lAmt = (500000 * WAVELET) | |
605 | + | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
606 | + | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
607 | + | let mngPub = fromBase58String(mngPubS) | |
608 | + | let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE") | |
609 | + | let nodeRegAddr = addressFromStringValue(nodeRegAddrStr) | |
610 | + | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
611 | + | let lGrNodeOpt = getString(this, lGroupNodeListKEY) | |
612 | + | if (isDefined(lGrNodeOpt)) | |
613 | + | then throw((("group " + toString(groupNum)) + " already initialized")) | |
614 | + | else { | |
615 | + | let nList = split(nListS, SEP) | |
616 | + | let expCount = size(nIdxs) | |
617 | + | if ((i.callerPublicKey != mngPub)) | |
618 | + | then throw("approveLeasings not authorized") | |
619 | + | else { | |
620 | + | let $t02735227414 = readNodeInfo(0) | |
621 | + | let nAddr0 = $t02735227414._1 | |
622 | + | let lAmtKEY0 = $t02735227414._2 | |
623 | + | let lAmt0 = $t02735227414._3 | |
624 | + | let lIdKEY0 = $t02735227414._4 | |
625 | + | let lId0 = $t02735227414._5 | |
626 | + | let $t02741727479 = readNodeInfo(1) | |
627 | + | let nAddr1 = $t02741727479._1 | |
628 | + | let lAmtKEY1 = $t02741727479._2 | |
629 | + | let lAmt1 = $t02741727479._3 | |
630 | + | let lIdKEY1 = $t02741727479._4 | |
631 | + | let lId1 = $t02741727479._5 | |
632 | + | let newL0 = Lease(nAddr0, (lAmt0 - ((lAmt * expCount) / 2))) | |
633 | + | let newL1 = Lease(nAddr1, (lAmt1 - ((lAmt * expCount) / 2))) | |
634 | + | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
635 | + | if ((validation == validation)) | |
636 | + | then { | |
637 | + | func forEachNodeValidateAndGenerateLease (a,i) = { | |
638 | + | let node = nList[i] | |
639 | + | let la = Lease(addressFromStringValue(node), lAmt) | |
640 | + | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
641 | + | } | |
642 | + | ||
643 | + | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), BinaryEntry(lIdKEY1, lcalc(newL1)), IntegerEntry(lAmtKEY0, newL0.amount), IntegerEntry(lAmtKEY1, newL1.amount), LeaseCancel(lId0), LeaseCancel(lId1), newL0, newL1] ++ { | |
644 | + | let $l = nIdxs | |
645 | + | let $s = size($l) | |
646 | + | let $acc0 = nil | |
647 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
648 | + | then $a | |
649 | + | else forEachNodeValidateAndGenerateLease($a, $l[$i]) | |
650 | + | ||
651 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
652 | + | then $a | |
653 | + | else throw("List size exceeds 8") | |
654 | + | ||
655 | + | $f0_2($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) | |
656 | + | }) | |
657 | + | } | |
658 | + | else throw("Strict value is not equal to itself.") | |
659 | + | } | |
660 | + | } | |
661 | + | } | |
567 | 662 | ||
568 | 663 | ||
569 | 664 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("Mandatory this." + key) + " is not defined")) | |
5 | + | ||
6 | + | ||
7 | + | func lcalc (l) = calculateLeaseId(l) | |
8 | + | ||
9 | + | ||
4 | 10 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
5 | 11 | ||
6 | 12 | ||
7 | 13 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
8 | 14 | ||
9 | 15 | ||
10 | 16 | func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false) | |
11 | 17 | ||
12 | 18 | ||
13 | 19 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0) | |
14 | 20 | ||
15 | 21 | ||
16 | 22 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "") | |
17 | 23 | ||
18 | 24 | ||
19 | 25 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(addressFromStringValue(address), key), false) | |
20 | 26 | ||
21 | 27 | ||
22 | - | func asAnyList ( | |
23 | - | case | |
24 | - | | |
28 | + | func asAnyList (v) = match v { | |
29 | + | case l: List[Any] => | |
30 | + | l | |
25 | 31 | case _ => | |
26 | 32 | throw("fail to cast into List[Any]") | |
27 | 33 | } | |
28 | 34 | ||
29 | 35 | ||
30 | - | func asString ( | |
31 | - | case | |
32 | - | | |
36 | + | func asString (v) = match v { | |
37 | + | case s: String => | |
38 | + | s | |
33 | 39 | case _ => | |
34 | 40 | throw("fail to cast into String") | |
35 | 41 | } | |
36 | 42 | ||
37 | 43 | ||
38 | - | func asInt ( | |
39 | - | case | |
40 | - | | |
44 | + | func asInt (v) = match v { | |
45 | + | case i: Int => | |
46 | + | i | |
41 | 47 | case _ => | |
42 | 48 | throw("fail to cast into Int") | |
43 | 49 | } | |
44 | 50 | ||
45 | 51 | ||
46 | - | func asSwapParamsSTRUCT (val) = match val { | |
52 | + | func asPayment (v) = match v { | |
53 | + | case p: AttachedPayment => | |
54 | + | p | |
55 | + | case _ => | |
56 | + | throw("fail to cast into AttachedPayment") | |
57 | + | } | |
58 | + | ||
59 | + | ||
60 | + | func asSwapParamsSTRUCT (v) = match v { | |
47 | 61 | case struct: (Int, Int, Int, Int, Int) => | |
48 | 62 | struct | |
49 | 63 | case _ => | |
50 | 64 | throw("fail to cast into Int") | |
51 | 65 | } | |
52 | 66 | ||
53 | 67 | ||
54 | 68 | let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"] | |
55 | 69 | ||
56 | 70 | let SEP = "__" | |
57 | 71 | ||
58 | 72 | let WAVELET = 100000000 | |
59 | 73 | ||
60 | 74 | let PAULI = 1000000 | |
61 | 75 | ||
62 | 76 | let PRICELET = 1000000 | |
63 | 77 | ||
64 | 78 | let DEFAULTSWAPFEE = 20000 | |
65 | 79 | ||
66 | 80 | let IdxNetAmount = 0 | |
67 | 81 | ||
68 | 82 | let IdxFeeAmount = 1 | |
69 | 83 | ||
70 | 84 | let IdxGrossAmount = 2 | |
71 | 85 | ||
72 | 86 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
73 | 87 | ||
74 | 88 | let BondAssetIdKey = "bond_asset_id" | |
75 | 89 | ||
76 | 90 | let AuctionContractKey = "auction_contract" | |
77 | 91 | ||
78 | 92 | let NsbtStakingContractKey = "nsbtStakingContract" | |
79 | 93 | ||
80 | 94 | let LiquidationContractKey = "liquidation_contract" | |
81 | 95 | ||
82 | 96 | let RPDContractKey = "rpd_contract" | |
83 | 97 | ||
84 | 98 | let ContolContractKey = "control_contract" | |
85 | 99 | ||
86 | 100 | let MathContractKey = "math_contract" | |
87 | 101 | ||
88 | 102 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
89 | 103 | ||
90 | 104 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
91 | 105 | ||
92 | 106 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
93 | 107 | ||
94 | 108 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
95 | 109 | ||
96 | 110 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
97 | 111 | ||
98 | 112 | let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart" | |
99 | 113 | ||
100 | 114 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
101 | 115 | ||
102 | 116 | let FeesManagerAddressKey = "fees_manager_address" | |
103 | 117 | ||
118 | + | func keyNodeRegistry (address) = ("%s__" + address) | |
119 | + | ||
120 | + | ||
104 | 121 | let PriceKey = "price" | |
105 | 122 | ||
106 | 123 | let PriceIndexKey = "price_index" | |
107 | 124 | ||
108 | 125 | let IsBlockedKey = "is_blocked" | |
109 | 126 | ||
110 | 127 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
111 | 128 | ||
112 | 129 | ||
113 | 130 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
114 | 131 | ||
115 | 132 | ||
116 | 133 | func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP)) | |
117 | 134 | ||
118 | 135 | ||
119 | 136 | func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx)) | |
120 | 137 | ||
121 | 138 | ||
122 | 139 | func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * WAVELET)) | |
123 | 140 | ||
124 | 141 | ||
125 | 142 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
126 | 143 | ||
127 | 144 | ||
128 | 145 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
129 | 146 | ||
130 | 147 | ||
148 | + | func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP) | |
149 | + | ||
150 | + | ||
131 | 151 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
152 | + | ||
153 | + | ||
154 | + | func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP) | |
155 | + | ||
156 | + | ||
157 | + | func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP) | |
132 | 158 | ||
133 | 159 | ||
134 | 160 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
135 | 161 | ||
136 | 162 | ||
137 | 163 | func totalLockedKEY (swapType) = ("balance_lock_" + swapType) | |
138 | 164 | ||
139 | 165 | ||
140 | 166 | func totalLockedByUserKEY (swapType,owner) = makeString(["balance_lock", swapType, owner], "_") | |
141 | 167 | ||
142 | 168 | ||
143 | 169 | func balanceLockIntervalKEY (swapType) = (("balance_" + swapType) + "_lock_interval") | |
144 | 170 | ||
145 | 171 | ||
146 | 172 | func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval" | |
147 | 173 | ||
148 | 174 | ||
149 | 175 | func outFeePartKEY (swapType) = (swapType + "Out_swap_feePart") | |
150 | 176 | ||
151 | 177 | ||
152 | 178 | func swapsTimeframeKEY () = "swaps_timeframe" | |
153 | 179 | ||
154 | 180 | ||
155 | 181 | func minSwapAmountREAD (swapType) = valueOrElse(getInteger(this, minSwapAmountKEY(swapType)), 0) | |
156 | 182 | ||
157 | 183 | ||
158 | 184 | func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440) | |
159 | 185 | ||
160 | 186 | ||
161 | 187 | func totalLockedREAD (swapType) = valueOrElse(getInteger(this, totalLockedKEY(swapType)), 0) | |
162 | 188 | ||
163 | 189 | ||
164 | 190 | func totalLockedByUserREAD (swapType,owner) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner)), 0) | |
165 | 191 | ||
166 | 192 | ||
167 | 193 | func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440) | |
168 | 194 | ||
169 | 195 | ||
170 | 196 | func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1) | |
171 | 197 | ||
172 | 198 | ||
173 | 199 | func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP) | |
174 | 200 | ||
175 | 201 | ||
176 | 202 | func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP) | |
177 | 203 | ||
178 | 204 | ||
179 | 205 | func feeManagerAddressREAD () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, FeesManagerAddressKey), (FeesManagerAddressKey + " is not specified"))), (FeesManagerAddressKey + " invalid address format")) | |
180 | 206 | ||
181 | 207 | ||
182 | 208 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
183 | 209 | ||
184 | 210 | ||
185 | 211 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
186 | 212 | ||
187 | 213 | ||
188 | 214 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
189 | 215 | ||
190 | 216 | ||
191 | 217 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
192 | 218 | ||
193 | 219 | ||
194 | 220 | func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount))) | |
195 | 221 | ||
196 | 222 | ||
197 | 223 | func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
198 | 224 | ||
199 | 225 | ||
200 | 226 | func priceIndexFAIL (index,priceIndex,indexHeight,unlockHeight,prevIndexHeight) = throw(((((((((("invalid price history index: index=" + toString(index)) + " priceIndex=") + toString(priceIndex)) + " indexHeight=") + toString(indexHeight)) + " unlockHeight=") + toString(unlockHeight)) + " prevIndexHeight=") + toString(prevIndexHeight))) | |
201 | 227 | ||
202 | 228 | ||
203 | 229 | let liquidationContract = getStringByKey(LiquidationContractKey) | |
204 | 230 | ||
205 | 231 | let nsbtStakingContractStr = getStringByKey(NsbtStakingContractKey) | |
206 | 232 | ||
207 | 233 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
208 | 234 | ||
209 | 235 | let auctionContract = getStringByKey(AuctionContractKey) | |
210 | 236 | ||
211 | 237 | let rpdContract = getStringByKey(RPDContractKey) | |
212 | 238 | ||
213 | 239 | let controlContract = getStringByKey(ContolContractKey) | |
214 | 240 | ||
215 | 241 | let mathContractAddress = getStringByKey(MathContractKey) | |
216 | 242 | ||
217 | 243 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
218 | 244 | ||
219 | 245 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
220 | 246 | ||
221 | 247 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
222 | 248 | ||
223 | 249 | let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z") | |
224 | 250 | ||
225 | 251 | let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF") | |
226 | 252 | ||
227 | 253 | let neutrinoContract = this | |
228 | 254 | ||
229 | 255 | let mathContract = addressFromStringValue(mathContractAddress) | |
230 | 256 | ||
231 | 257 | let nsbtStakingContract = addressFromStringValue(nsbtStakingContractStr) | |
232 | 258 | ||
233 | 259 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
234 | 260 | ||
235 | 261 | func checkIsValidMinSponsoredFee (tx) = { | |
236 | 262 | let MINTRANSFERFEE = 100000 | |
237 | 263 | let SponsoredFeeUpperBound = 1000 | |
238 | 264 | let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice) | |
239 | 265 | let minNeutrinoFee = (realNeutrinoFee * 2) | |
240 | 266 | let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100) | |
241 | 267 | let inputFee = value(tx.minSponsoredAssetFee) | |
242 | 268 | if (if ((inputFee >= minNeutrinoFee)) | |
243 | 269 | then (maxNeutrinoFee >= inputFee) | |
244 | 270 | else false) | |
245 | 271 | then (tx.assetId == neutrinoAssetId) | |
246 | 272 | else false | |
247 | 273 | } | |
248 | 274 | ||
249 | 275 | ||
250 | 276 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
251 | 277 | ||
252 | 278 | ||
253 | 279 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
254 | 280 | ||
255 | 281 | ||
256 | 282 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
257 | 283 | ||
258 | 284 | ||
259 | 285 | let sIdxSwapType = 1 | |
260 | 286 | ||
261 | 287 | let sIdxStatus = 2 | |
262 | 288 | ||
263 | 289 | let sIdxInAmount = 3 | |
264 | 290 | ||
265 | 291 | let sIdxPrice = 4 | |
266 | 292 | ||
267 | 293 | let sIdxOutNetAmount = 5 | |
268 | 294 | ||
269 | 295 | let sIdxOutFeeAmount = 6 | |
270 | 296 | ||
271 | 297 | let sIdxStartHeight = 7 | |
272 | 298 | ||
273 | 299 | let sIdxStartTimestamp = 8 | |
274 | 300 | ||
275 | 301 | let sIdxEndHeight = 9 | |
276 | 302 | ||
277 | 303 | let sIdxEndTimestamp = 10 | |
278 | 304 | ||
279 | 305 | let sIdxSelfUnlockHeight = 11 | |
280 | 306 | ||
281 | 307 | let sIdxRandUnlockHeight = 12 | |
282 | 308 | ||
283 | 309 | let sIdxIndex = 13 | |
284 | 310 | ||
285 | 311 | let sIdxWithdrawTxId = 14 | |
286 | 312 | ||
287 | 313 | let sIdxMinRand = 15 | |
288 | 314 | ||
289 | 315 | let sIdxMaxRand = 16 | |
290 | 316 | ||
291 | 317 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
292 | 318 | ||
293 | 319 | ||
294 | 320 | func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax], SEP) | |
295 | 321 | ||
296 | 322 | ||
297 | 323 | func pendingSwapDATA (swapType,inAssetAmount,selfUnlockHeight) = strSwapDATA(swapType, "PENDING", toString(inAssetAmount), "0", "0", "0", toString(height), toString(lastBlock.timestamp), "0", "0", toString(selfUnlockHeight), "0", "0", "NULL", "0", "0") | |
298 | 324 | ||
299 | 325 | ||
300 | 326 | func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId) = strSwapDATA(dataArray[sIdxSwapType], "FINISHED", dataArray[sIdxInAmount], toString(price), toString(outNetAmount), toString(outFeeAmount), dataArray[sIdxStartHeight], dataArray[sIdxStartTimestamp], toString(height), toString(lastBlock.timestamp), dataArray[sIdxSelfUnlockHeight], toString(randUnlockHeight), toString(index), withdrawTxId, dataArray[sIdxMinRand], dataArray[sIdxMaxRand]) | |
301 | 327 | ||
302 | 328 | ||
303 | 329 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
304 | 330 | let swapKey = swapKEY(userAddress, swapTxId) | |
305 | 331 | split(valueOrErrorMessage(getString(this, swapKey), ("no swap data for " + swapKey)), SEP) | |
306 | 332 | } | |
307 | 333 | ||
308 | 334 | ||
309 | 335 | func applyFees (amountGross,feePart) = { | |
310 | 336 | let feeAmount = fraction(amountGross, feePart, PAULI) | |
311 | 337 | [(amountGross - feeAmount), feeAmount, amountGross] | |
312 | 338 | } | |
313 | 339 | ||
314 | 340 | ||
315 | 341 | func abs (x) = if ((0 > x)) | |
316 | 342 | then -(x) | |
317 | 343 | else x | |
318 | 344 | ||
319 | 345 | ||
320 | 346 | func selectNode (unleaseAmount) = { | |
321 | 347 | let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship()) | |
322 | 348 | let oldLeased0 = getNumberByKey(getLeaseAmountKey(0)) | |
323 | 349 | let oldLeased1 = getNumberByKey(getLeaseAmountKey(1)) | |
324 | 350 | let newLeased0 = (amountToLease + oldLeased0) | |
325 | 351 | let newLeased1 = (amountToLease + oldLeased1) | |
326 | 352 | if (if ((newLeased0 > 0)) | |
327 | 353 | then true | |
328 | 354 | else (newLeased1 > 0)) | |
329 | 355 | then { | |
330 | 356 | let delta0 = abs((newLeased0 - oldLeased1)) | |
331 | 357 | let delta1 = abs((newLeased1 - oldLeased0)) | |
332 | 358 | if ((delta1 >= delta0)) | |
333 | 359 | then $Tuple2(0, newLeased0) | |
334 | 360 | else $Tuple2(1, newLeased1) | |
335 | 361 | } | |
336 | 362 | else $Tuple2(-1, 0) | |
337 | 363 | } | |
338 | 364 | ||
339 | 365 | ||
340 | 366 | func thisOnly (i) = if ((i.caller != this)) | |
341 | 367 | then throw("Permission denied: this contract only allowed") | |
342 | 368 | else true | |
343 | 369 | ||
344 | 370 | ||
345 | 371 | func prepareUnleaseAndLease (unleaseAmount) = { | |
346 | 372 | let nodeTuple = selectNode(unleaseAmount) | |
347 | 373 | let nodeIndex = nodeTuple._1 | |
348 | 374 | let newLeaseAmount = nodeTuple._2 | |
349 | 375 | if ((newLeaseAmount > 0)) | |
350 | 376 | then { | |
351 | 377 | let leaseIdKey = getLeaseIdKey(nodeIndex) | |
352 | 378 | let oldLease = getBinary(this, leaseIdKey) | |
353 | 379 | let unleaseOrEmpty = if (isDefined(oldLease)) | |
354 | 380 | then [LeaseCancel(value(oldLease))] | |
355 | 381 | else nil | |
356 | 382 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
357 | 383 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
358 | - | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, | |
384 | + | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
359 | 385 | } | |
360 | 386 | else nil | |
361 | 387 | } | |
362 | 388 | ||
363 | 389 | ||
390 | + | func readNodeInfo (nodeIdx) = { | |
391 | + | let nodeAddress = getStakingNodeAddressByIndex(nodeIdx) | |
392 | + | let leasedAmtKEY = getLeaseAmountKey(nodeIdx) | |
393 | + | let leasedAmt = getNumberByKey(leasedAmtKEY) | |
394 | + | let leaseIdKEY = getLeaseIdKey(nodeIdx) | |
395 | + | let leaseId = value(getBinary(this, leaseIdKEY)) | |
396 | + | $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId) | |
397 | + | } | |
398 | + | ||
399 | + | ||
364 | 400 | func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapParamsByUserSYSREADONLY) = { | |
365 | - | let $ | |
366 | - | let swapLimitMax = $ | |
367 | - | let swapLimitSpent = $ | |
368 | - | let blcks2LmtReset = $ | |
401 | + | let $t01675916839 = swapParamsByUserSYSREADONLY | |
402 | + | let swapLimitMax = $t01675916839._1 | |
403 | + | let swapLimitSpent = $t01675916839._2 | |
404 | + | let blcks2LmtReset = $t01675916839._3 | |
369 | 405 | let minSwapAmount = minSwapAmountREAD(swapType) | |
370 | 406 | let totalLocked = totalLockedREAD(swapType) | |
371 | 407 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr) | |
372 | 408 | let nodeAddress = getStakingNodeByIndex(0) | |
373 | 409 | let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex)) | |
374 | 410 | let isSwapByNode = (nodeAddress == userAddressStr) | |
375 | 411 | let balanceLockMaxInterval = if (isSwapByNode) | |
376 | 412 | then nodeBalanceLockIntervalREAD() | |
377 | 413 | else balanceLockIntervalREAD(swapType) | |
378 | 414 | let selfUnlockHeight = (height + balanceLockMaxInterval) | |
379 | 415 | let swapUsdnVolume = if ((swapType == "neutrino")) | |
380 | 416 | then pmtAmount | |
381 | 417 | else convertWavesToNeutrino(pmtAmount, priceByIndex) | |
382 | 418 | if ((minSwapAmount > pmtAmount)) | |
383 | 419 | then minSwapAmountFAIL(swapType, minSwapAmount) | |
384 | 420 | else if (if (!(isSwapByNode)) | |
385 | 421 | then (swapLimitSpent > 0) | |
386 | 422 | else false) | |
387 | 423 | then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset)))) | |
388 | 424 | else if (if (!(isSwapByNode)) | |
389 | 425 | then (swapUsdnVolume > swapLimitMax) | |
390 | 426 | else false) | |
391 | 427 | then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax))) | |
392 | 428 | else if (isBlocked) | |
393 | 429 | then emergencyShutdownFAIL() | |
394 | 430 | else { | |
395 | 431 | let leasePart = if ((swapType == "waves")) | |
396 | 432 | then prepareUnleaseAndLease(0) | |
397 | 433 | else nil | |
398 | 434 | $Tuple2(([IntegerEntry(keySwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastSwapHeight(userAddressStr), height), IntegerEntry(totalLockedByUserKEY(swapType, userAddressStr), (totalLockedByUser + pmtAmount)), IntegerEntry(getBalanceUnlockBlockKey(userAddressStr), selfUnlockHeight), IntegerEntry(totalLockedKEY(swapType), (totalLocked + pmtAmount)), StringEntry(swapKEY(userAddressStr, txId58), pendingSwapDATA(swapType, pmtAmount, selfUnlockHeight))] ++ leasePart), unit) | |
399 | 435 | } | |
400 | 436 | } | |
401 | 437 | ||
402 | 438 | ||
403 | 439 | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
404 | 440 | let userAddress = addressFromStringValue(account) | |
405 | 441 | let feeManagerAddress = feeManagerAddressREAD() | |
406 | 442 | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
407 | 443 | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
408 | 444 | let swapType = dataArray[sIdxSwapType] | |
409 | 445 | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
410 | 446 | let swapStatus = dataArray[sIdxStatus] | |
411 | 447 | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
412 | 448 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
413 | 449 | let totalLocked = totalLockedREAD(swapType) | |
414 | 450 | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
415 | - | let unlockHeight = | |
451 | + | let unlockHeight = selfUnlockHeight | |
416 | 452 | let indexHeight = getHeightPriceByIndex(index) | |
417 | 453 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
418 | 454 | let priceByIndex = getPriceHistory(indexHeight) | |
419 | 455 | let outAmountGrossTuple = if ((swapType == "waves")) | |
420 | 456 | then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId) | |
421 | 457 | else if ((swapType == "neutrino")) | |
422 | 458 | then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit) | |
423 | 459 | else throw(("Unsupported swap type " + swapType)) | |
424 | 460 | let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart) | |
425 | 461 | let outNetAmount = payoutsArray[IdxNetAmount] | |
426 | 462 | let outFeeAmount = payoutsArray[IdxFeeAmount] | |
427 | 463 | if (isBlocked) | |
428 | 464 | then emergencyShutdownFAIL() | |
429 | 465 | else if ((swapStatus != "PENDING")) | |
430 | 466 | then throw("swap has been already processed") | |
431 | 467 | else if ((unlockHeight > height)) | |
432 | 468 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
433 | 469 | else if (if (if ((index > priceIndex)) | |
434 | 470 | then true | |
435 | 471 | else (unlockHeight > indexHeight)) | |
436 | 472 | then true | |
437 | 473 | else if ((prevIndexHeight != 0)) | |
438 | 474 | then (prevIndexHeight >= unlockHeight) | |
439 | 475 | else false) | |
440 | 476 | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
441 | 477 | else if ((0 >= payoutsArray[IdxGrossAmount])) | |
442 | 478 | then throw("balance equals zero") | |
443 | 479 | else if (if ((0 > outFeePart)) | |
444 | 480 | then true | |
445 | 481 | else (outFeePart >= PAULI)) | |
446 | 482 | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
447 | 483 | else { | |
448 | - | let | |
484 | + | let unleaseAmount = if (if ((swapType == "neutrino")) | |
449 | 485 | then (outAmountGrossTuple._1 > 0) | |
450 | 486 | else false) | |
451 | - | then | |
452 | - | else | |
453 | - | let state = | |
454 | - | $ | |
487 | + | then outAmountGrossTuple._1 | |
488 | + | else 0 | |
489 | + | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))] | |
490 | + | $Tuple3(state, AttachedPayment(outAmountGrossTuple._2, outFeeAmount), unleaseAmount) | |
455 | 491 | } | |
456 | 492 | } | |
457 | 493 | ||
458 | 494 | ||
459 | 495 | @Callable(i) | |
460 | 496 | func constructor (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = { | |
461 | 497 | let checkCaller = thisOnly(i) | |
462 | 498 | if ((checkCaller == checkCaller)) | |
463 | 499 | then if ((size(i.payments) != 0)) | |
464 | 500 | then throw("no payments allowed") | |
465 | 501 | else [StringEntry(NeutrinoAssetIdKey, neutrinoAssetIdPrm), StringEntry(BondAssetIdKey, bondAssetIdPrm), StringEntry(AuctionContractKey, auctionContractPrm), StringEntry(LiquidationContractKey, liquidationContractPrm), StringEntry(RPDContractKey, rpdContractPrm), StringEntry(NodeOracleProviderPubKeyKey, nodeOracleProviderPubKeyPrm), IntegerEntry(BalanceWavesLockIntervalKey, balanceWavesLockIntervalPrm), IntegerEntry(BalanceNeutrinoLockIntervalKey, balanceNeutrinoLockIntervalPrm), IntegerEntry(MinWavesSwapAmountKey, minWavesSwapAmountPrm), IntegerEntry(MinNeutrinoSwapAmountKey, minNeutrinoSwapAmountPrm), IntegerEntry(NeutrinoOutFeePartKey, neutrinoOutFeePartPrm), IntegerEntry(WavesOutFeePartKey, wavesOutFeePartPrm)] | |
466 | 502 | else throw("Strict value is not equal to itself.") | |
467 | 503 | } | |
468 | 504 | ||
469 | 505 | ||
470 | 506 | ||
471 | 507 | @Callable(i) | |
472 | 508 | func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = { | |
473 | 509 | let checkCaller = thisOnly(i) | |
474 | 510 | if ((checkCaller == checkCaller)) | |
475 | 511 | then if ((size(i.payments) != 0)) | |
476 | 512 | then throw("no payments allowed") | |
477 | 513 | else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)] | |
478 | 514 | else throw("Strict value is not equal to itself.") | |
479 | 515 | } | |
480 | 516 | ||
481 | 517 | ||
482 | 518 | ||
483 | 519 | @Callable(i) | |
484 | 520 | func swapWavesToNeutrino () = if ((size(i.payments) != 1)) | |
485 | 521 | then throw("swapWavesToNeutrino require only one payment") | |
486 | 522 | else { | |
487 | 523 | let pmt = value(i.payments[0]) | |
488 | 524 | if (isDefined(pmt.assetId)) | |
489 | 525 | then throw("Only Waves token is allowed for swapping.") | |
490 | 526 | else { | |
491 | 527 | let userAddress = toString(i.caller) | |
492 | 528 | let txId58 = toBase58String(i.transactionId) | |
493 | 529 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
494 | 530 | let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
495 | 531 | commonSwapResult | |
496 | 532 | } | |
497 | 533 | } | |
498 | 534 | ||
499 | 535 | ||
500 | 536 | ||
501 | 537 | @Callable(i) | |
502 | 538 | func swapNeutrinoToWaves () = if ((size(i.payments) != 1)) | |
503 | 539 | then throw("swapNeutrinoToWaves require only one payment") | |
504 | 540 | else { | |
505 | 541 | let pmt = value(i.payments[0]) | |
506 | 542 | if ((pmt.assetId != neutrinoAssetId)) | |
507 | 543 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
508 | 544 | else { | |
509 | 545 | let userAddress = toString(i.caller) | |
510 | 546 | let txId58 = toBase58String(i.transactionId) | |
511 | 547 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
512 | 548 | let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
513 | 549 | commonSwapResult | |
514 | 550 | } | |
515 | 551 | } | |
516 | 552 | ||
517 | 553 | ||
518 | 554 | ||
519 | 555 | @Callable(i) | |
520 | - | func withdraw (account,index,swapTxId) = if ((size(i.payments) != 0)) | |
521 | - | then throw("no payments allowed") | |
522 | - | else { | |
523 | - | let $t02418624290 = commonWithdraw(account, index, swapTxId, toBase58String(i.transactionId)) | |
524 | - | let state = $t02418624290._1 | |
525 | - | let depositPayment = $t02418624290._2 | |
526 | - | let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [depositPayment]) | |
527 | - | if ((nsbtStakingDeposit == nsbtStakingDeposit)) | |
528 | - | then state | |
529 | - | else throw("Strict value is not equal to itself.") | |
530 | - | } | |
556 | + | func withdraw (account,index,swapTxId) = { | |
557 | + | let txId = toBase58String(i.transactionId) | |
558 | + | if ((size(i.payments) != 0)) | |
559 | + | then throw("no payments allowed") | |
560 | + | else { | |
561 | + | let commonTuple = commonWithdraw(account, index, swapTxId, txId) | |
562 | + | let state = commonTuple._1 | |
563 | + | let fee = commonTuple._2 | |
564 | + | let unleaseAmt = commonTuple._3 | |
565 | + | let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil) | |
566 | + | if ((unleaseInvOrEmpty == unleaseInvOrEmpty)) | |
567 | + | then if ((0 >= fee.amount)) | |
568 | + | then state | |
569 | + | else { | |
570 | + | let nsbtStakingReward = invoke(nsbtStakingContract, "deposit", nil, [fee]) | |
571 | + | if ((nsbtStakingReward == nsbtStakingReward)) | |
572 | + | then state | |
573 | + | else throw("Strict value is not equal to itself.") | |
574 | + | } | |
575 | + | else throw("Strict value is not equal to itself.") | |
576 | + | } | |
577 | + | } | |
531 | 578 | ||
532 | 579 | ||
533 | 580 | ||
534 | 581 | @Callable(i) | |
535 | - | func transferToAuction () = if ((size(i.payments) != 0)) | |
536 | - | then throw("no payments allowed") | |
537 | - | else { | |
538 | - | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
539 | - | let reserve = asInt(neutrinoMetrics[3]) | |
540 | - | let neutrinoSupply = asInt(neutrinoMetrics[5]) | |
541 | - | let surplus = asInt(neutrinoMetrics[6]) | |
542 | - | let nsbtSupply = asInt(neutrinoMetrics[9]) | |
543 | - | let auctionNBAmount = (neutrinoSupply - assetBalance(addressFromStringValue(auctionContract), bondAssetId)) | |
544 | - | let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId)) | |
545 | - | if (isBlocked) | |
546 | - | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
547 | - | else if ((auctionNBAmount > (1 * PAULI))) | |
548 | - | then [ScriptTransfer(addressFromStringValue(auctionContract), auctionNBAmount, bondAssetId)] | |
549 | - | else if ((surplusWithLiquidation >= (1 * PAULI))) | |
550 | - | then [ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)] | |
551 | - | else throw(((((((("bond were generated or do not need it. Deficit:" + toString(auctionNBAmount)) + "|") + toString(0)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus))) | |
552 | - | } | |
582 | + | func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this)) | |
583 | + | then throw("internalUnleaseAndLease is not public method") | |
584 | + | else prepareUnleaseAndLease(unleaseAmount) | |
553 | 585 | ||
554 | 586 | ||
555 | 587 | ||
556 | 588 | @Callable(i) | |
557 | 589 | func transferUsdnToUser (amount,addr) = if ((i.caller != addressFromStringValue(auctionContract))) | |
558 | 590 | then throw("Only auction contract is authorized") | |
559 | 591 | else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)] | |
560 | 592 | ||
561 | 593 | ||
562 | 594 | ||
563 | 595 | @Callable(i) | |
564 | 596 | func acceptWaves () = if ((i.caller != addressFromStringValue(auctionContract))) | |
565 | 597 | then throw("Currently only auction contract is allowed to call") | |
566 | 598 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
599 | + | ||
600 | + | ||
601 | + | ||
602 | + | @Callable(i) | |
603 | + | func approveLeasings (nListS,groupNum) = { | |
604 | + | let lAmt = (500000 * WAVELET) | |
605 | + | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
606 | + | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
607 | + | let mngPub = fromBase58String(mngPubS) | |
608 | + | let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE") | |
609 | + | let nodeRegAddr = addressFromStringValue(nodeRegAddrStr) | |
610 | + | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
611 | + | let lGrNodeOpt = getString(this, lGroupNodeListKEY) | |
612 | + | if (isDefined(lGrNodeOpt)) | |
613 | + | then throw((("group " + toString(groupNum)) + " already initialized")) | |
614 | + | else { | |
615 | + | let nList = split(nListS, SEP) | |
616 | + | let expCount = size(nIdxs) | |
617 | + | if ((i.callerPublicKey != mngPub)) | |
618 | + | then throw("approveLeasings not authorized") | |
619 | + | else { | |
620 | + | let $t02735227414 = readNodeInfo(0) | |
621 | + | let nAddr0 = $t02735227414._1 | |
622 | + | let lAmtKEY0 = $t02735227414._2 | |
623 | + | let lAmt0 = $t02735227414._3 | |
624 | + | let lIdKEY0 = $t02735227414._4 | |
625 | + | let lId0 = $t02735227414._5 | |
626 | + | let $t02741727479 = readNodeInfo(1) | |
627 | + | let nAddr1 = $t02741727479._1 | |
628 | + | let lAmtKEY1 = $t02741727479._2 | |
629 | + | let lAmt1 = $t02741727479._3 | |
630 | + | let lIdKEY1 = $t02741727479._4 | |
631 | + | let lId1 = $t02741727479._5 | |
632 | + | let newL0 = Lease(nAddr0, (lAmt0 - ((lAmt * expCount) / 2))) | |
633 | + | let newL1 = Lease(nAddr1, (lAmt1 - ((lAmt * expCount) / 2))) | |
634 | + | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
635 | + | if ((validation == validation)) | |
636 | + | then { | |
637 | + | func forEachNodeValidateAndGenerateLease (a,i) = { | |
638 | + | let node = nList[i] | |
639 | + | let la = Lease(addressFromStringValue(node), lAmt) | |
640 | + | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
641 | + | } | |
642 | + | ||
643 | + | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), BinaryEntry(lIdKEY1, lcalc(newL1)), IntegerEntry(lAmtKEY0, newL0.amount), IntegerEntry(lAmtKEY1, newL1.amount), LeaseCancel(lId0), LeaseCancel(lId1), newL0, newL1] ++ { | |
644 | + | let $l = nIdxs | |
645 | + | let $s = size($l) | |
646 | + | let $acc0 = nil | |
647 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
648 | + | then $a | |
649 | + | else forEachNodeValidateAndGenerateLease($a, $l[$i]) | |
650 | + | ||
651 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
652 | + | then $a | |
653 | + | else throw("List size exceeds 8") | |
654 | + | ||
655 | + | $f0_2($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) | |
656 | + | }) | |
657 | + | } | |
658 | + | else throw("Strict value is not equal to itself.") | |
659 | + | } | |
660 | + | } | |
661 | + | } | |
567 | 662 | ||
568 | 663 | ||
569 | 664 | ||
570 | 665 | @Callable(i) | |
571 | 666 | func swapParamsByUserSYSREADONLY (userAddressStr,nsbtDiff) = { | |
572 | 667 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddressStr], nil)) | |
573 | 668 | if ((nsbtData == nsbtData)) | |
574 | 669 | then { | |
575 | 670 | let gnsbtAmt = (asInt(nsbtData[0]) + nsbtDiff) | |
576 | 671 | let gnsbtAmtTotal = (asInt(nsbtData[1]) + nsbtDiff) | |
577 | 672 | let swapLimitMax = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil)) | |
578 | 673 | let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0) | |
579 | 674 | let swapLimitTimelifeBlocks = swapsTimeframeREAD() | |
580 | 675 | let passedBlocksAfterLastSwap = (height - lastSwapHeight) | |
581 | 676 | let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks) | |
582 | 677 | let swapLimitSpent = if (isSwapTimelifeNew) | |
583 | 678 | then 0 | |
584 | 679 | else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0) | |
585 | 680 | let blcks2LmtReset = if (isSwapTimelifeNew) | |
586 | 681 | then 0 | |
587 | 682 | else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap) | |
588 | 683 | $Tuple2(nil, $Tuple5(swapLimitMax, swapLimitSpent, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal)) | |
589 | 684 | } | |
590 | 685 | else throw("Strict value is not equal to itself.") | |
591 | 686 | } | |
592 | 687 | ||
593 | 688 | ||
594 | 689 | @Verifier(tx) | |
595 | 690 | func verify () = { | |
596 | 691 | let id = toBase58String(tx.id) | |
597 | 692 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
598 | 693 | then 1 | |
599 | 694 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
600 | 695 | then 1 | |
601 | 696 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
602 | 697 | then 1 | |
603 | 698 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
604 | 699 | then 2 | |
605 | 700 | else 0)) | |
606 | 701 | match tx { | |
607 | 702 | case sponsorTx: SponsorFeeTransaction => | |
608 | 703 | if (checkIsValidMinSponsoredFee(sponsorTx)) | |
609 | 704 | then (count >= 3) | |
610 | 705 | else false | |
611 | 706 | case _ => | |
612 | 707 | (count >= 3) | |
613 | 708 | } | |
614 | 709 | } | |
615 | 710 |
github/deemru/w8io/026f985 86.76 ms ◑