tx · 6q9jKmWEtf4idm22x5gtq7n6L7fSH7RW7HtZjWQmmbbC 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj: -0.04000000 Waves 2022.09.06 13:40 [2217149] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves
{ "type": 13, "id": "6q9jKmWEtf4idm22x5gtq7n6L7fSH7RW7HtZjWQmmbbC", "fee": 4000000, "feeAssetId": null, "timestamp": 1662460896027, "version": 1, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "3wYdw17rn7WTdLgR2vK7Sa7yMktzmpKxrEraacVFWcZ5Zt5FsB3NPZh5op7gxNpUprPP6Q8BHRVKDhFNyQnrXfPP", "3MbeAzTyv6oNx7Hjjy36ZgQZhx9NygQ5tkNnwsq4Euch9MzVfZ6uVbXbTxMiTMQ6rk17m3ikFnBwoEVs4xwD8PA7", "2V6pz5319cLTsP5umyJgf19ucDD7hqZBUqNf82gqVQgTPHrfC5BSYkiAjxGjD5RzhtGSQ2ywM1s9zk5K4FpcFqcX" ], "script": "base64:BgJXCAISDgoMCAgICAgIAQEBAQEBEgUKAwgIARIAEgASBQoDCAEIEgMKAQESBAoCAQgSABIFCgMIAQESBAoCAQESBAoCCAESBQoDCAEBEgYKBAgIAQESABIAqAEBD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQVsY2FsYwEBbAkAuQgBBQFsAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAA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AnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIJANkEAQkAkQMCBRBwdWJLZXlBZG1pbnNMaXN0AAIAAQAAAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAwkA2QQBCQCRAwIFEHB1YktleUFkbWluc0xpc3QAAwACAAAEByRtYXRjaDAFAnR4AwkAAQIFByRtYXRjaDACFVNwb25zb3JGZWVUcmFuc2FjdGlvbgQJc3BvbnNvclR4BQckbWF0Y2gwAwkBG2NoZWNrSXNWYWxpZE1pblNwb25zb3JlZEZlZQEFCXNwb25zb3JUeAkAZwIFBWNvdW50AAMHCQBnAgUFY291bnQAA3+CL0U=", "chainId": 84, "height": 2217149, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2YG32vXKqsqm5bGr318anrWctr9Uz2BQZiLuui7yxava Next: FBKpVvYZtNmJoLSRfrT4K54ipi1SzUzGcHGVAr44x6No Diff:
Old | New | Differences | |
---|---|---|---|
138 | 138 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
139 | 139 | ||
140 | 140 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
141 | + | ||
142 | + | let nodeRegistryContract = getContractAddressOrFail(controlCfg, IdxControlCfgNodeRegistryDapp) | |
141 | 143 | ||
142 | 144 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
143 | 145 | ||
352 | 354 | ||
353 | 355 | let sIdxMaxRand = 16 | |
354 | 356 | ||
357 | + | let sIdxOutSurfAmount = 17 | |
358 | + | ||
359 | + | let sIdxBR = 18 | |
360 | + | ||
355 | 361 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
356 | 362 | ||
357 | 363 | ||
358 | - | 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) | |
364 | + | func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br], SEP) | |
359 | 365 | ||
360 | 366 | ||
361 | - | 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") | |
367 | + | 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", "0", "0") | |
362 | 368 | ||
363 | 369 | ||
364 | - | 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]) | |
370 | + | func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId,outSurfAmt,br) = 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], toString(outSurfAmt), toString(br)) | |
365 | 371 | ||
366 | 372 | ||
367 | 373 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
547 | 553 | } | |
548 | 554 | ||
549 | 555 | ||
550 | - | func calcWithdraw (swapType,inAmount,price) = { | |
556 | + | func calcWithdraw (swapType,inAmount,price,neutrinoMetrics) = { | |
551 | 557 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
552 | 558 | if (if ((0 > outFeePart)) | |
553 | 559 | then true | |
555 | 561 | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
556 | 562 | else { | |
557 | 563 | let brProtected = valueOrElse(getInteger(this, brProtectedKEY()), BRPROTECTED) | |
558 | - | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
559 | 564 | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
560 | 565 | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
561 | 566 | let usdnSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
583 | 588 | } | |
584 | 589 | ||
585 | 590 | ||
586 | - | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
591 | + | func commonWithdraw (account,index,swapTxId,withdrawTxId,neutrinoMetrics) = { | |
587 | 592 | let userAddress = addressFromStringValue(account) | |
588 | 593 | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
589 | 594 | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
613 | 618 | else false) | |
614 | 619 | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
615 | 620 | else { | |
616 | - | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex) | |
621 | + | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex, neutrinoMetrics) | |
617 | 622 | let outNetAmount = withdrawTuple._1 | |
618 | 623 | let outAssetId = withdrawTuple._2 | |
619 | 624 | let outSurfAmt = withdrawTuple._3 | |
624 | 629 | if ((0 >= outAmtGross)) | |
625 | 630 | then throw("balance equals zero") | |
626 | 631 | else { | |
627 | - | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAssetId), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))] | |
632 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
633 | + | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAssetId), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId, outSurfAmt, BR))] | |
628 | 634 | let surfCondition = if ((outSurfAmt > 0)) | |
629 | 635 | then { | |
630 | 636 | let issueResult = invoke(auctionContract, "issueSurf", [outSurfAmt, account], nil) | |
707 | 713 | if ((size(i.payments) != 0)) | |
708 | 714 | then throw("no payments allowed") | |
709 | 715 | else { | |
710 | - | let commonTuple = commonWithdraw(account, index, swapTxId, txId) | |
716 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
717 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
718 | + | let commonTuple = commonWithdraw(account, index, swapTxId, txId, neutrinoMetrics) | |
711 | 719 | let state = commonTuple._1 | |
712 | 720 | let fee = commonTuple._2 | |
713 | 721 | let unleaseAmt = commonTuple._3 | |
717 | 725 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", ["", 0, 0], nil)) | |
718 | 726 | let gnsbtAmtTotal = asInt(gnsbtData[1]) | |
719 | 727 | let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3]) | |
720 | - | let | |
728 | + | let surfFeeAmt1 = if ((gnsbtAmtTotal != 0)) | |
721 | 729 | then fraction(fee.amount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal) | |
722 | 730 | else 0 | |
731 | + | let surfFeeAmt2 = if ((gnsbtAmtTotal != 0)) | |
732 | + | then fraction(fee.amount, (PAULI - BR), PAULI) | |
733 | + | else 0 | |
734 | + | let surfFeeAmt = max([surfFeeAmt1, surfFeeAmt2]) | |
723 | 735 | let nsbtFeeAmt = (fee.amount - surfFeeAmt) | |
724 | 736 | let surfDeposit = if ((surfFeeAmt > 0)) | |
725 | 737 | then { | |
773 | 785 | ||
774 | 786 | ||
775 | 787 | @Callable(i) | |
776 | - | func approveLeasings (nListS,groupNum) = { | |
777 | - | let lAmt = (50 * WAVELET) | |
788 | + | func approveLeasings (nListS,groupNum,lAmt) = { | |
778 | 789 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
779 | 790 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
780 | 791 | let mngPub = fromBase58String(mngPubS) | |
790 | 801 | if ((i.callerPublicKey != mngPub)) | |
791 | 802 | then throw("approveLeasings not authorized") | |
792 | 803 | else { | |
793 | - | let $t03363933701 = readNodeInfo(0) | |
794 | - | let nAddr0 = $t03363933701._1 | |
795 | - | let lAmtKEY0 = $t03363933701._2 | |
796 | - | let lAmt0 = $t03363933701._3 | |
797 | - | let lIdKEY0 = $t03363933701._4 | |
798 | - | let lId0 = $t03363933701._5 | |
799 | - | let $t03370433766 = readNodeInfo(1) | |
800 | - | let nAddr1 = $t03370433766._1 | |
801 | - | let lAmtKEY1 = $t03370433766._2 | |
802 | - | let lAmt1 = $t03370433766._3 | |
803 | - | let lIdKEY1 = $t03370433766._4 | |
804 | - | let lId1 = $t03370433766._5 | |
805 | - | let newL0 = Lease(nAddr0, (lAmt0 - ((lAmt * expCount) / 2))) | |
806 | - | let newL1 = Lease(nAddr1, (lAmt1 - ((lAmt * expCount) / 2))) | |
804 | + | let $t03442334485 = readNodeInfo(0) | |
805 | + | let nAddr0 = $t03442334485._1 | |
806 | + | let lAmtKEY0 = $t03442334485._2 | |
807 | + | let lAmt0 = $t03442334485._3 | |
808 | + | let lIdKEY0 = $t03442334485._4 | |
809 | + | let lId0 = $t03442334485._5 | |
810 | + | let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount))) | |
807 | 811 | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
808 | 812 | if ((validation == validation)) | |
809 | 813 | then { | |
813 | 817 | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
814 | 818 | } | |
815 | 819 | ||
816 | - | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), | |
820 | + | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0] ++ { | |
817 | 821 | let $l = nIdxs | |
818 | 822 | let $s = size($l) | |
819 | 823 | let $acc0 = nil | |
847 | 851 | then throw("rebalanceLeasings not authorized") | |
848 | 852 | else { | |
849 | 853 | let unleaseAmt = ((amount / size(nList)) + 1) | |
850 | - | let $ | |
851 | - | let nAddr0 = $ | |
852 | - | let lAmtKEY0 = $ | |
853 | - | let lAmt0 = $ | |
854 | - | let lIdKEY0 = $ | |
855 | - | let lId0 = $ | |
854 | + | let $t03572535787 = readNodeInfo(0) | |
855 | + | let nAddr0 = $t03572535787._1 | |
856 | + | let lAmtKEY0 = $t03572535787._2 | |
857 | + | let lAmt0 = $t03572535787._3 | |
858 | + | let lIdKEY0 = $t03572535787._4 | |
859 | + | let lId0 = $t03572535787._5 | |
856 | 860 | let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList)))) | |
857 | 861 | func forEachNodeDoUnlease (a,i) = { | |
858 | 862 | let node = nList[i] | |
909 | 913 | ||
910 | 914 | ||
911 | 915 | @Callable(i) | |
912 | - | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price) = $Tuple2(nil, calcWithdraw(swapType, inAmount, price)) | |
916 | + | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price) = { | |
917 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
918 | + | $Tuple2(nil, calcWithdraw(swapType, inAmount, price, neutrinoMetrics)) | |
919 | + | } | |
920 | + | ||
921 | + | ||
922 | + | ||
923 | + | @Callable(i) | |
924 | + | func replaceCommunityNode (oldAddrStr,newAddrStr,groupNum,penaltyAmount) = { | |
925 | + | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
926 | + | let mngPub = fromBase58String(mngPubS) | |
927 | + | if ((i.callerPublicKey != mngPub)) | |
928 | + | then throw("replaceCommunityNode not authorized") | |
929 | + | else { | |
930 | + | let groupKey = getLeaseGroupNodeListKey(groupNum) | |
931 | + | let groupNodeListS = getStringOrFail(this, groupKey) | |
932 | + | if (!(contains(groupNodeListS, oldAddrStr))) | |
933 | + | then throw(((("Group " + toString(groupNum)) + " does not contain address ") + oldAddrStr)) | |
934 | + | else { | |
935 | + | let doReplace = invoke(nodeRegistryContract, "replaceApprovedNode", [oldAddrStr, newAddrStr, groupNum, penaltyAmount], nil) | |
936 | + | if ((doReplace == doReplace)) | |
937 | + | then { | |
938 | + | let oldLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr) | |
939 | + | let oldLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr) | |
940 | + | let leaseAmt = getIntegerValue(oldLeaseAmtKey) | |
941 | + | let newLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr) | |
942 | + | let newLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr) | |
943 | + | let newLease = Lease(addressFromStringValue(newAddrStr), leaseAmt) | |
944 | + | let updatedGroupNodeListS = makeString(split(groupNodeListS, oldAddrStr), newAddrStr) | |
945 | + | $Tuple2([LeaseCancel(getBinaryValue(oldLeaseIdKey)), DeleteEntry(oldLeaseIdKey), DeleteEntry(oldLeaseAmtKey), StringEntry(groupKey, updatedGroupNodeListS), newLease, BinaryEntry(newLeaseIdKey, lcalc(newLease)), IntegerEntry(newLeaseAmtKey, leaseAmt)], unit) | |
946 | + | } | |
947 | + | else throw("Strict value is not equal to itself.") | |
948 | + | } | |
949 | + | } | |
950 | + | } | |
913 | 951 | ||
914 | 952 | ||
915 | 953 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func lcalc (l) = calculateLeaseId(l) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func asAnyList (v) = match v { | |
29 | 29 | case l: List[Any] => | |
30 | 30 | l | |
31 | 31 | case _ => | |
32 | 32 | throw("fail to cast into List[Any]") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func asString (v) = match v { | |
37 | 37 | case s: String => | |
38 | 38 | s | |
39 | 39 | case _ => | |
40 | 40 | throw("fail to cast into String") | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func asInt (v) = match v { | |
45 | 45 | case i: Int => | |
46 | 46 | i | |
47 | 47 | case _ => | |
48 | 48 | throw("fail to cast into Int") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func asBytes (val) = match val { | |
53 | 53 | case valByte: ByteVector => | |
54 | 54 | valByte | |
55 | 55 | case _ => | |
56 | 56 | throw("fail to cast into ByteVector") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func asPayment (v) = match v { | |
61 | 61 | case p: AttachedPayment => | |
62 | 62 | p | |
63 | 63 | case _ => | |
64 | 64 | throw("fail to cast into AttachedPayment") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func asSwapParamsSTRUCT (v) = match v { | |
69 | 69 | case struct: (Int, Int, Int, Int, Int, Int, Int) => | |
70 | 70 | struct | |
71 | 71 | case _ => | |
72 | 72 | throw("fail to cast into Tuple5 ints") | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | let SEP = "__" | |
77 | 77 | ||
78 | 78 | let WAVELET = 100000000 | |
79 | 79 | ||
80 | 80 | let PAULI = 1000000 | |
81 | 81 | ||
82 | 82 | let PRICELET = 1000000 | |
83 | 83 | ||
84 | 84 | let DEFAULTSWAPFEE = 20000 | |
85 | 85 | ||
86 | 86 | let BRPROTECTED = 100000 | |
87 | 87 | ||
88 | 88 | let IdxNetAmount = 0 | |
89 | 89 | ||
90 | 90 | let IdxFeeAmount = 1 | |
91 | 91 | ||
92 | 92 | let IdxGrossAmount = 2 | |
93 | 93 | ||
94 | 94 | let IdxControlCfgNeutrinoDapp = 1 | |
95 | 95 | ||
96 | 96 | let IdxControlCfgAuctionDapp = 2 | |
97 | 97 | ||
98 | 98 | let IdxControlCfgRpdDapp = 3 | |
99 | 99 | ||
100 | 100 | let IdxControlCfgMathDapp = 4 | |
101 | 101 | ||
102 | 102 | let IdxControlCfgLiquidationDapp = 5 | |
103 | 103 | ||
104 | 104 | let IdxControlCfgRestDapp = 6 | |
105 | 105 | ||
106 | 106 | let IdxControlCfgNodeRegistryDapp = 7 | |
107 | 107 | ||
108 | 108 | let IdxControlCfgNsbtStakingDapp = 8 | |
109 | 109 | ||
110 | 110 | let IdxControlCfgMediatorDapp = 9 | |
111 | 111 | ||
112 | 112 | let IdxControlCfgSurfStakingDapp = 10 | |
113 | 113 | ||
114 | 114 | let IdxControlCfgGnsbtControllerDapp = 11 | |
115 | 115 | ||
116 | 116 | func keyControlAddress () = "%s%s__config__controlAddress" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyControlCfg () = "%s__controlConfig" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func readControlCfgOrFail (control) = split(getStringOrFail(control, keyControlCfg()), SEP) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx))) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx")) | |
129 | 129 | ||
130 | 130 | let controlCfg = readControlCfgOrFail(controlContract) | |
131 | 131 | ||
132 | 132 | let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp) | |
133 | 133 | ||
134 | 134 | let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp) | |
135 | 135 | ||
136 | 136 | let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp) | |
137 | 137 | ||
138 | 138 | let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp) | |
139 | 139 | ||
140 | 140 | let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp) | |
141 | + | ||
142 | + | let nodeRegistryContract = getContractAddressOrFail(controlCfg, IdxControlCfgNodeRegistryDapp) | |
141 | 143 | ||
142 | 144 | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
143 | 145 | ||
144 | 146 | let BondAssetIdKey = "bond_asset_id" | |
145 | 147 | ||
146 | 148 | let AuctionContractKey = "auction_contract" | |
147 | 149 | ||
148 | 150 | let NsbtStakingContractKey = "nsbtStakingContract" | |
149 | 151 | ||
150 | 152 | let LiquidationContractKey = "liquidation_contract" | |
151 | 153 | ||
152 | 154 | let RPDContractKey = "rpd_contract" | |
153 | 155 | ||
154 | 156 | let ContolContractKey = "control_contract" | |
155 | 157 | ||
156 | 158 | let MathContractKey = "math_contract" | |
157 | 159 | ||
158 | 160 | let BalanceWavesLockIntervalKey = "balance_waves_lock_interval" | |
159 | 161 | ||
160 | 162 | let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval" | |
161 | 163 | ||
162 | 164 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
163 | 165 | ||
164 | 166 | let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount" | |
165 | 167 | ||
166 | 168 | let NodeOracleProviderPubKeyKey = "node_oracle_provider" | |
167 | 169 | ||
168 | 170 | let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart" | |
169 | 171 | ||
170 | 172 | let WavesOutFeePartKey = "wavesOut_swap_feePart" | |
171 | 173 | ||
172 | 174 | func keyNodeRegistry (address) = ("%s__" + address) | |
173 | 175 | ||
174 | 176 | ||
175 | 177 | let PriceKey = "price" | |
176 | 178 | ||
177 | 179 | let PriceIndexKey = "price_index" | |
178 | 180 | ||
179 | 181 | let IsBlockedKey = "is_blocked" | |
180 | 182 | ||
181 | 183 | func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block)) | |
182 | 184 | ||
183 | 185 | ||
184 | 186 | func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index)) | |
185 | 187 | ||
186 | 188 | ||
187 | 189 | func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP)) | |
188 | 190 | ||
189 | 191 | ||
190 | 192 | func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx)) | |
191 | 193 | ||
192 | 194 | ||
193 | 195 | func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * WAVELET)) | |
194 | 196 | ||
195 | 197 | ||
196 | 198 | func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner) | |
197 | 199 | ||
198 | 200 | ||
199 | 201 | func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP) | |
200 | 202 | ||
201 | 203 | ||
202 | 204 | func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP) | |
203 | 205 | ||
204 | 206 | ||
205 | 207 | func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP) | |
206 | 208 | ||
207 | 209 | ||
208 | 210 | func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP) | |
209 | 211 | ||
210 | 212 | ||
211 | 213 | func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP) | |
212 | 214 | ||
213 | 215 | ||
214 | 216 | func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount") | |
215 | 217 | ||
216 | 218 | ||
217 | 219 | func totalLockedKEY (swapType) = ("balance_lock_" + swapType) | |
218 | 220 | ||
219 | 221 | ||
220 | 222 | func totalLockedByUserKEY (swapType,owner) = makeString(["balance_lock", swapType, owner], "_") | |
221 | 223 | ||
222 | 224 | ||
223 | 225 | func balanceLockIntervalKEY (swapType) = (("balance_" + swapType) + "_lock_interval") | |
224 | 226 | ||
225 | 227 | ||
226 | 228 | func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval" | |
227 | 229 | ||
228 | 230 | ||
229 | 231 | func outFeePartKEY (swapType) = (swapType + "Out_swap_feePart") | |
230 | 232 | ||
231 | 233 | ||
232 | 234 | func swapsTimeframeKEY () = "swaps_timeframe" | |
233 | 235 | ||
234 | 236 | ||
235 | 237 | func brProtectedKEY () = "min_BR_protection_level" | |
236 | 238 | ||
237 | 239 | ||
238 | 240 | func minSwapAmountREAD (swapType) = valueOrElse(getInteger(this, minSwapAmountKEY(swapType)), 0) | |
239 | 241 | ||
240 | 242 | ||
241 | 243 | func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440) | |
242 | 244 | ||
243 | 245 | ||
244 | 246 | func totalLockedREAD (swapType) = valueOrElse(getInteger(this, totalLockedKEY(swapType)), 0) | |
245 | 247 | ||
246 | 248 | ||
247 | 249 | func totalLockedByUserREAD (swapType,owner) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner)), 0) | |
248 | 250 | ||
249 | 251 | ||
250 | 252 | func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440) | |
251 | 253 | ||
252 | 254 | ||
253 | 255 | func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1) | |
254 | 256 | ||
255 | 257 | ||
256 | 258 | func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP) | |
257 | 259 | ||
258 | 260 | ||
259 | 261 | func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP) | |
260 | 262 | ||
261 | 263 | ||
262 | 264 | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI) | |
263 | 265 | ||
264 | 266 | ||
265 | 267 | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET) | |
266 | 268 | ||
267 | 269 | ||
268 | 270 | func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price) | |
269 | 271 | ||
270 | 272 | ||
271 | 273 | func convertJsonArrayToList (jsonArray) = split(jsonArray, ",") | |
272 | 274 | ||
273 | 275 | ||
274 | 276 | func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount))) | |
275 | 277 | ||
276 | 278 | ||
277 | 279 | func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
278 | 280 | ||
279 | 281 | ||
280 | 282 | 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))) | |
281 | 283 | ||
282 | 284 | ||
283 | 285 | let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey)) | |
284 | 286 | ||
285 | 287 | let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey) | |
286 | 288 | ||
287 | 289 | let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey) | |
288 | 290 | ||
289 | 291 | let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey)) | |
290 | 292 | ||
291 | 293 | let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z") | |
292 | 294 | ||
293 | 295 | let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF") | |
294 | 296 | ||
295 | 297 | let neutrinoContract = this | |
296 | 298 | ||
297 | 299 | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
298 | 300 | ||
299 | 301 | func checkIsValidMinSponsoredFee (tx) = { | |
300 | 302 | let MINTRANSFERFEE = 100000 | |
301 | 303 | let SponsoredFeeUpperBound = 1000 | |
302 | 304 | let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice) | |
303 | 305 | let minNeutrinoFee = (realNeutrinoFee * 2) | |
304 | 306 | let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100) | |
305 | 307 | let inputFee = value(tx.minSponsoredAssetFee) | |
306 | 308 | if (if ((inputFee >= minNeutrinoFee)) | |
307 | 309 | then (maxNeutrinoFee >= inputFee) | |
308 | 310 | else false) | |
309 | 311 | then (tx.assetId == neutrinoAssetId) | |
310 | 312 | else false | |
311 | 313 | } | |
312 | 314 | ||
313 | 315 | ||
314 | 316 | func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block)) | |
315 | 317 | ||
316 | 318 | ||
317 | 319 | func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index)) | |
318 | 320 | ||
319 | 321 | ||
320 | 322 | func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP) | |
321 | 323 | ||
322 | 324 | ||
323 | 325 | let sIdxSwapType = 1 | |
324 | 326 | ||
325 | 327 | let sIdxStatus = 2 | |
326 | 328 | ||
327 | 329 | let sIdxInAmount = 3 | |
328 | 330 | ||
329 | 331 | let sIdxPrice = 4 | |
330 | 332 | ||
331 | 333 | let sIdxOutNetAmount = 5 | |
332 | 334 | ||
333 | 335 | let sIdxOutFeeAmount = 6 | |
334 | 336 | ||
335 | 337 | let sIdxStartHeight = 7 | |
336 | 338 | ||
337 | 339 | let sIdxStartTimestamp = 8 | |
338 | 340 | ||
339 | 341 | let sIdxEndHeight = 9 | |
340 | 342 | ||
341 | 343 | let sIdxEndTimestamp = 10 | |
342 | 344 | ||
343 | 345 | let sIdxSelfUnlockHeight = 11 | |
344 | 346 | ||
345 | 347 | let sIdxRandUnlockHeight = 12 | |
346 | 348 | ||
347 | 349 | let sIdxIndex = 13 | |
348 | 350 | ||
349 | 351 | let sIdxWithdrawTxId = 14 | |
350 | 352 | ||
351 | 353 | let sIdxMinRand = 15 | |
352 | 354 | ||
353 | 355 | let sIdxMaxRand = 16 | |
354 | 356 | ||
357 | + | let sIdxOutSurfAmount = 17 | |
358 | + | ||
359 | + | let sIdxBR = 18 | |
360 | + | ||
355 | 361 | func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP) | |
356 | 362 | ||
357 | 363 | ||
358 | - | 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) | |
364 | + | func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br], SEP) | |
359 | 365 | ||
360 | 366 | ||
361 | - | 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") | |
367 | + | 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", "0", "0") | |
362 | 368 | ||
363 | 369 | ||
364 | - | 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]) | |
370 | + | func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId,outSurfAmt,br) = 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], toString(outSurfAmt), toString(br)) | |
365 | 371 | ||
366 | 372 | ||
367 | 373 | func swapDataFailOrREAD (userAddress,swapTxId) = { | |
368 | 374 | let swapKey = swapKEY(userAddress, swapTxId) | |
369 | 375 | split(valueOrErrorMessage(getString(this, swapKey), ("no swap data for " + swapKey)), SEP) | |
370 | 376 | } | |
371 | 377 | ||
372 | 378 | ||
373 | 379 | func applyFees (amountOutGross,inAmtToSURF,feePart) = { | |
374 | 380 | let feeAmount = fraction(amountOutGross, feePart, PAULI) | |
375 | 381 | [(amountOutGross - feeAmount), feeAmount] | |
376 | 382 | } | |
377 | 383 | ||
378 | 384 | ||
379 | 385 | func abs (x) = if ((0 > x)) | |
380 | 386 | then -(x) | |
381 | 387 | else x | |
382 | 388 | ||
383 | 389 | ||
384 | 390 | func selectNode (unleaseAmount) = { | |
385 | 391 | let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship()) | |
386 | 392 | let oldLeased0 = getNumberByKey(getLeaseAmountKey(0)) | |
387 | 393 | let oldLeased1 = getNumberByKey(getLeaseAmountKey(1)) | |
388 | 394 | let newLeased0 = (amountToLease + oldLeased0) | |
389 | 395 | let newLeased1 = (amountToLease + oldLeased1) | |
390 | 396 | if (if ((newLeased0 > 0)) | |
391 | 397 | then true | |
392 | 398 | else (newLeased1 > 0)) | |
393 | 399 | then { | |
394 | 400 | let delta0 = abs((newLeased0 - oldLeased1)) | |
395 | 401 | let delta1 = abs((newLeased1 - oldLeased0)) | |
396 | 402 | if ((delta1 >= delta0)) | |
397 | 403 | then $Tuple2(0, newLeased0) | |
398 | 404 | else $Tuple2(1, newLeased1) | |
399 | 405 | } | |
400 | 406 | else $Tuple2(-1, 0) | |
401 | 407 | } | |
402 | 408 | ||
403 | 409 | ||
404 | 410 | func thisOnly (i) = if ((i.caller != this)) | |
405 | 411 | then throw("Permission denied: this contract only allowed") | |
406 | 412 | else true | |
407 | 413 | ||
408 | 414 | ||
409 | 415 | func prepareUnleaseAndLease (unleaseAmount) = { | |
410 | 416 | let nodeTuple = selectNode(unleaseAmount) | |
411 | 417 | let nodeIndex = nodeTuple._1 | |
412 | 418 | let newLeaseAmount = nodeTuple._2 | |
413 | 419 | if ((newLeaseAmount > 0)) | |
414 | 420 | then { | |
415 | 421 | let leaseIdKey = getLeaseIdKey(nodeIndex) | |
416 | 422 | let oldLease = getBinary(this, leaseIdKey) | |
417 | 423 | let unleaseOrEmpty = if (isDefined(oldLease)) | |
418 | 424 | then [LeaseCancel(value(oldLease))] | |
419 | 425 | else nil | |
420 | 426 | let leaseAmountKey = getLeaseAmountKey(nodeIndex) | |
421 | 427 | let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount) | |
422 | 428 | (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)]) | |
423 | 429 | } | |
424 | 430 | else nil | |
425 | 431 | } | |
426 | 432 | ||
427 | 433 | ||
428 | 434 | func readNodeInfo (nodeIdx) = { | |
429 | 435 | let nodeAddress = getStakingNodeAddressByIndex(nodeIdx) | |
430 | 436 | let leasedAmtKEY = getLeaseAmountKey(nodeIdx) | |
431 | 437 | let leasedAmt = getNumberByKey(leasedAmtKEY) | |
432 | 438 | let leaseIdKEY = getLeaseIdKey(nodeIdx) | |
433 | 439 | let leaseId = value(getBinary(this, leaseIdKEY)) | |
434 | 440 | $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId) | |
435 | 441 | } | |
436 | 442 | ||
437 | 443 | ||
438 | 444 | func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapParamsByUserSYSREADONLY) = { | |
439 | 445 | let swapLimitSpent = swapParamsByUserSYSREADONLY._2 | |
440 | 446 | let blcks2LmtReset = swapParamsByUserSYSREADONLY._3 | |
441 | 447 | let wavesSwapLimitMax = swapParamsByUserSYSREADONLY._6 | |
442 | 448 | let usdnSwapLimitMax = swapParamsByUserSYSREADONLY._7 | |
443 | 449 | let minSwapAmount = minSwapAmountREAD(swapType) | |
444 | 450 | let totalLocked = totalLockedREAD(swapType) | |
445 | 451 | let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr) | |
446 | 452 | let nodeAddress = getStakingNodeByIndex(0) | |
447 | 453 | let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex)) | |
448 | 454 | let isSwapByNode = (nodeAddress == userAddressStr) | |
449 | 455 | let balanceLockMaxInterval = if (isSwapByNode) | |
450 | 456 | then nodeBalanceLockIntervalREAD() | |
451 | 457 | else balanceLockIntervalREAD(swapType) | |
452 | 458 | let selfUnlockHeight = (height + balanceLockMaxInterval) | |
453 | 459 | let swapUsdnVolume = if ((swapType == "neutrino")) | |
454 | 460 | then pmtAmount | |
455 | 461 | else convertWavesToNeutrino(pmtAmount, priceByIndex) | |
456 | 462 | let swapLimitMax = if ((swapType == "neutrino")) | |
457 | 463 | then usdnSwapLimitMax | |
458 | 464 | else convertWavesToNeutrino(wavesSwapLimitMax, priceByIndex) | |
459 | 465 | if ((minSwapAmount > pmtAmount)) | |
460 | 466 | then minSwapAmountFAIL(swapType, minSwapAmount) | |
461 | 467 | else if (if (!(isSwapByNode)) | |
462 | 468 | then (swapLimitSpent > 0) | |
463 | 469 | else false) | |
464 | 470 | then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset)))) | |
465 | 471 | else if (if (!(isSwapByNode)) | |
466 | 472 | then (swapUsdnVolume > swapLimitMax) | |
467 | 473 | else false) | |
468 | 474 | then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax))) | |
469 | 475 | else if (isBlocked) | |
470 | 476 | then emergencyShutdownFAIL() | |
471 | 477 | else { | |
472 | 478 | let leasePart = if ((swapType == "waves")) | |
473 | 479 | then prepareUnleaseAndLease(0) | |
474 | 480 | else nil | |
475 | 481 | $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) | |
476 | 482 | } | |
477 | 483 | } | |
478 | 484 | ||
479 | 485 | ||
480 | 486 | let nMetricIdxPrice = 0 | |
481 | 487 | ||
482 | 488 | let nMetricIdxUsdnLockedBalance = 1 | |
483 | 489 | ||
484 | 490 | let nMetricIdxWavesLockedBalance = 2 | |
485 | 491 | ||
486 | 492 | let nMetricIdxReserve = 3 | |
487 | 493 | ||
488 | 494 | let nMetricIdxReserveInUsdn = 4 | |
489 | 495 | ||
490 | 496 | let nMetricIdxUsdnSupply = 5 | |
491 | 497 | ||
492 | 498 | let nMetricIdxSurplus = 6 | |
493 | 499 | ||
494 | 500 | let nMetricIdxSurplusPercent = 7 | |
495 | 501 | ||
496 | 502 | let nMetricIdxBR = 8 | |
497 | 503 | ||
498 | 504 | let nMetricIdxNsbtSupply = 9 | |
499 | 505 | ||
500 | 506 | let nMetricIdxMaxNsbtSupply = 10 | |
501 | 507 | ||
502 | 508 | let nMetricIdxSurfSupply = 11 | |
503 | 509 | ||
504 | 510 | let bFuncIdxSurf = 0 | |
505 | 511 | ||
506 | 512 | let bFuncIdxWaves = 1 | |
507 | 513 | ||
508 | 514 | let bFuncIdxUsdn = 2 | |
509 | 515 | ||
510 | 516 | let bFuncIdxReserveStart = 3 | |
511 | 517 | ||
512 | 518 | let bFuncIdxSupplyStart = 4 | |
513 | 519 | ||
514 | 520 | let bFuncIdxBRStart = 5 | |
515 | 521 | ||
516 | 522 | let bFuncIdxReserveEnd = 6 | |
517 | 523 | ||
518 | 524 | let bFuncIdxSupplyEnd = 7 | |
519 | 525 | ||
520 | 526 | let bFuncIdxBREnd = 8 | |
521 | 527 | ||
522 | 528 | let bFuncIdxRest = 9 | |
523 | 529 | ||
524 | 530 | let bFuncIdxWavesPrice = 10 | |
525 | 531 | ||
526 | 532 | func calcWithdrawW2U (wavesIn,price) = { | |
527 | 533 | let outAmtGross = convertWavesToNeutrino(wavesIn, price) | |
528 | 534 | $Tuple9(outAmtGross, neutrinoAssetId, 0, unit, 0, wavesIn, 0, 0, 0) | |
529 | 535 | } | |
530 | 536 | ||
531 | 537 | ||
532 | 538 | func calcWithdrawU2W (usdnIn,price,br,reservesInUsdn,usdnSupply) = { | |
533 | 539 | let brProtected = valueOrElse(getInteger(this, brProtectedKEY()), BRPROTECTED) | |
534 | 540 | let maxAllowedUsdnBeforeMinBr = if ((brProtected >= br)) | |
535 | 541 | then 0 | |
536 | 542 | else fraction((reservesInUsdn - fraction(brProtected, usdnSupply, PAULI)), PAULI, (PAULI - brProtected)) | |
537 | 543 | let allowedUsdnBeforeMinBr = if ((usdnIn > maxAllowedUsdnBeforeMinBr)) | |
538 | 544 | then maxAllowedUsdnBeforeMinBr | |
539 | 545 | else usdnIn | |
540 | 546 | let allowedUsdnAfterMinBr = if ((usdnIn > maxAllowedUsdnBeforeMinBr)) | |
541 | 547 | then fraction((usdnIn - maxAllowedUsdnBeforeMinBr), br, PAULI) | |
542 | 548 | else 0 | |
543 | 549 | let allowedUsdn = (allowedUsdnBeforeMinBr + allowedUsdnAfterMinBr) | |
544 | 550 | let usdn2SURF = (usdnIn - allowedUsdn) | |
545 | 551 | let outAmtGross = convertNeutrinoToWaves(allowedUsdn, price) | |
546 | 552 | $Tuple9(outAmtGross, unit, usdn2SURF, neutrinoAssetId, outAmtGross, allowedUsdn, maxAllowedUsdnBeforeMinBr, allowedUsdnBeforeMinBr, allowedUsdnAfterMinBr) | |
547 | 553 | } | |
548 | 554 | ||
549 | 555 | ||
550 | - | func calcWithdraw (swapType,inAmount,price) = { | |
556 | + | func calcWithdraw (swapType,inAmount,price,neutrinoMetrics) = { | |
551 | 557 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
552 | 558 | if (if ((0 > outFeePart)) | |
553 | 559 | then true | |
554 | 560 | else (outFeePart >= PAULI)) | |
555 | 561 | then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart))) | |
556 | 562 | else { | |
557 | 563 | let brProtected = valueOrElse(getInteger(this, brProtectedKEY()), BRPROTECTED) | |
558 | - | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
559 | 564 | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
560 | 565 | let reservesInUsdn = asInt(neutrinoMetrics[nMetricIdxReserveInUsdn]) | |
561 | 566 | let usdnSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply]) | |
562 | 567 | let outDataTuple = if ((swapType == "waves")) | |
563 | 568 | then calcWithdrawW2U(inAmount, price) | |
564 | 569 | else if ((swapType == "neutrino")) | |
565 | 570 | then calcWithdrawU2W(inAmount, price, BR, reservesInUsdn, usdnSupply) | |
566 | 571 | else throw(("Unsupported swap type " + swapType)) | |
567 | 572 | let outAmtGross = outDataTuple._1 | |
568 | 573 | let outAssetId = outDataTuple._2 | |
569 | 574 | let inAmtToSurfPart = outDataTuple._3 | |
570 | 575 | let inAssetId = outDataTuple._4 | |
571 | 576 | let unleaseAmt = outDataTuple._5 | |
572 | 577 | let payoutsArray = applyFees(outAmtGross, inAmtToSurfPart, outFeePart) | |
573 | 578 | let outNetAmt = payoutsArray[IdxNetAmount] | |
574 | 579 | let outFeeAmt = payoutsArray[IdxFeeAmount] | |
575 | 580 | let outSurfAmt = if ((0 >= inAmtToSurfPart)) | |
576 | 581 | then 0 | |
577 | 582 | else { | |
578 | 583 | let surfResult = asAnyList(invoke(mathContract, "surfFunctionREADONLY", [inAmtToSurfPart, inAssetId], nil)) | |
579 | 584 | asInt(surfResult[bFuncIdxSurf]) | |
580 | 585 | } | |
581 | 586 | $Tuple7(outNetAmt, outAssetId, outSurfAmt, inAmtToSurfPart, unleaseAmt, outFeeAmt, outAmtGross) | |
582 | 587 | } | |
583 | 588 | } | |
584 | 589 | ||
585 | 590 | ||
586 | - | func commonWithdraw (account,index,swapTxId,withdrawTxId) = { | |
591 | + | func commonWithdraw (account,index,swapTxId,withdrawTxId,neutrinoMetrics) = { | |
587 | 592 | let userAddress = addressFromStringValue(account) | |
588 | 593 | let dataArray = swapDataFailOrREAD(account, swapTxId) | |
589 | 594 | let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight]) | |
590 | 595 | let swapType = dataArray[sIdxSwapType] | |
591 | 596 | let inAmount = parseIntValue(dataArray[sIdxInAmount]) | |
592 | 597 | let swapStatus = dataArray[sIdxStatus] | |
593 | 598 | let startHeight = parseIntValue(dataArray[sIdxStartHeight]) | |
594 | 599 | let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE) | |
595 | 600 | let totalLocked = totalLockedREAD(swapType) | |
596 | 601 | let totalLockedByUser = totalLockedByUserREAD(swapType, account) | |
597 | 602 | let unlockHeight = selfUnlockHeight | |
598 | 603 | let indexHeight = getHeightPriceByIndex(index) | |
599 | 604 | let prevIndexHeight = getHeightPriceByIndex((index - 1)) | |
600 | 605 | let priceByIndex = getPriceHistory(indexHeight) | |
601 | 606 | if (isBlocked) | |
602 | 607 | then emergencyShutdownFAIL() | |
603 | 608 | else if ((swapStatus != "PENDING")) | |
604 | 609 | then throw("swap has been already processed") | |
605 | 610 | else if ((unlockHeight > height)) | |
606 | 611 | then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds")) | |
607 | 612 | else if (if (if ((index > priceIndex)) | |
608 | 613 | then true | |
609 | 614 | else (unlockHeight > indexHeight)) | |
610 | 615 | then true | |
611 | 616 | else if ((prevIndexHeight != 0)) | |
612 | 617 | then (prevIndexHeight >= unlockHeight) | |
613 | 618 | else false) | |
614 | 619 | then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight) | |
615 | 620 | else { | |
616 | - | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex) | |
621 | + | let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex, neutrinoMetrics) | |
617 | 622 | let outNetAmount = withdrawTuple._1 | |
618 | 623 | let outAssetId = withdrawTuple._2 | |
619 | 624 | let outSurfAmt = withdrawTuple._3 | |
620 | 625 | let inAmtToSurfPart = withdrawTuple._4 | |
621 | 626 | let unleaseAmt = withdrawTuple._5 | |
622 | 627 | let outFeeAmount = withdrawTuple._6 | |
623 | 628 | let outAmtGross = withdrawTuple._7 | |
624 | 629 | if ((0 >= outAmtGross)) | |
625 | 630 | then throw("balance equals zero") | |
626 | 631 | else { | |
627 | - | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAssetId), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId))] | |
632 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
633 | + | let state = [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAssetId), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, withdrawTxId, outSurfAmt, BR))] | |
628 | 634 | let surfCondition = if ((outSurfAmt > 0)) | |
629 | 635 | then { | |
630 | 636 | let issueResult = invoke(auctionContract, "issueSurf", [outSurfAmt, account], nil) | |
631 | 637 | if ((issueResult == issueResult)) | |
632 | 638 | then 0 | |
633 | 639 | else throw("Strict value is not equal to itself.") | |
634 | 640 | } | |
635 | 641 | else 0 | |
636 | 642 | if ((surfCondition == surfCondition)) | |
637 | 643 | then $Tuple3(state, AttachedPayment(outAssetId, outFeeAmount), unleaseAmt) | |
638 | 644 | else throw("Strict value is not equal to itself.") | |
639 | 645 | } | |
640 | 646 | } | |
641 | 647 | } | |
642 | 648 | ||
643 | 649 | ||
644 | 650 | @Callable(i) | |
645 | 651 | func constructor (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = { | |
646 | 652 | let checkCaller = thisOnly(i) | |
647 | 653 | if ((checkCaller == checkCaller)) | |
648 | 654 | then if ((size(i.payments) != 0)) | |
649 | 655 | then throw("no payments allowed") | |
650 | 656 | 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)] | |
651 | 657 | else throw("Strict value is not equal to itself.") | |
652 | 658 | } | |
653 | 659 | ||
654 | 660 | ||
655 | 661 | ||
656 | 662 | @Callable(i) | |
657 | 663 | func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = { | |
658 | 664 | let checkCaller = thisOnly(i) | |
659 | 665 | if ((checkCaller == checkCaller)) | |
660 | 666 | then if ((size(i.payments) != 0)) | |
661 | 667 | then throw("no payments allowed") | |
662 | 668 | else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)] | |
663 | 669 | else throw("Strict value is not equal to itself.") | |
664 | 670 | } | |
665 | 671 | ||
666 | 672 | ||
667 | 673 | ||
668 | 674 | @Callable(i) | |
669 | 675 | func swapWavesToNeutrino () = if ((size(i.payments) != 1)) | |
670 | 676 | then throw("swapWavesToNeutrino require only one payment") | |
671 | 677 | else { | |
672 | 678 | let pmt = value(i.payments[0]) | |
673 | 679 | if (isDefined(pmt.assetId)) | |
674 | 680 | then throw("Only Waves token is allowed for swapping.") | |
675 | 681 | else { | |
676 | 682 | let userAddress = toString(i.caller) | |
677 | 683 | let txId58 = toBase58String(i.transactionId) | |
678 | 684 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
679 | 685 | let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
680 | 686 | commonSwapResult | |
681 | 687 | } | |
682 | 688 | } | |
683 | 689 | ||
684 | 690 | ||
685 | 691 | ||
686 | 692 | @Callable(i) | |
687 | 693 | func swapNeutrinoToWaves () = if ((size(i.payments) != 1)) | |
688 | 694 | then throw("swapNeutrinoToWaves require only one payment") | |
689 | 695 | else { | |
690 | 696 | let pmt = value(i.payments[0]) | |
691 | 697 | if ((pmt.assetId != neutrinoAssetId)) | |
692 | 698 | then throw("Only appropriate Neutrino tokens are allowed for swapping.") | |
693 | 699 | else { | |
694 | 700 | let userAddress = toString(i.caller) | |
695 | 701 | let txId58 = toBase58String(i.transactionId) | |
696 | 702 | let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddress, 0], nil)) | |
697 | 703 | let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapParamsSTRUCT) | |
698 | 704 | commonSwapResult | |
699 | 705 | } | |
700 | 706 | } | |
701 | 707 | ||
702 | 708 | ||
703 | 709 | ||
704 | 710 | @Callable(i) | |
705 | 711 | func withdraw (account,index,swapTxId) = { | |
706 | 712 | let txId = toBase58String(i.transactionId) | |
707 | 713 | if ((size(i.payments) != 0)) | |
708 | 714 | then throw("no payments allowed") | |
709 | 715 | else { | |
710 | - | let commonTuple = commonWithdraw(account, index, swapTxId, txId) | |
716 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
717 | + | let BR = asInt(neutrinoMetrics[nMetricIdxBR]) | |
718 | + | let commonTuple = commonWithdraw(account, index, swapTxId, txId, neutrinoMetrics) | |
711 | 719 | let state = commonTuple._1 | |
712 | 720 | let fee = commonTuple._2 | |
713 | 721 | let unleaseAmt = commonTuple._3 | |
714 | 722 | let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil) | |
715 | 723 | if ((unleaseInvOrEmpty == unleaseInvOrEmpty)) | |
716 | 724 | then { | |
717 | 725 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", ["", 0, 0], nil)) | |
718 | 726 | let gnsbtAmtTotal = asInt(gnsbtData[1]) | |
719 | 727 | let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3]) | |
720 | - | let | |
728 | + | let surfFeeAmt1 = if ((gnsbtAmtTotal != 0)) | |
721 | 729 | then fraction(fee.amount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal) | |
722 | 730 | else 0 | |
731 | + | let surfFeeAmt2 = if ((gnsbtAmtTotal != 0)) | |
732 | + | then fraction(fee.amount, (PAULI - BR), PAULI) | |
733 | + | else 0 | |
734 | + | let surfFeeAmt = max([surfFeeAmt1, surfFeeAmt2]) | |
723 | 735 | let nsbtFeeAmt = (fee.amount - surfFeeAmt) | |
724 | 736 | let surfDeposit = if ((surfFeeAmt > 0)) | |
725 | 737 | then { | |
726 | 738 | let surfInv = invoke(surfStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, surfFeeAmt)]) | |
727 | 739 | if ((surfInv == surfInv)) | |
728 | 740 | then nil | |
729 | 741 | else throw("Strict value is not equal to itself.") | |
730 | 742 | } | |
731 | 743 | else nil | |
732 | 744 | if ((surfDeposit == surfDeposit)) | |
733 | 745 | then { | |
734 | 746 | let nsbtDeposit = if ((nsbtFeeAmt > 0)) | |
735 | 747 | then { | |
736 | 748 | let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, nsbtFeeAmt)]) | |
737 | 749 | if ((nsbtInv == nsbtInv)) | |
738 | 750 | then nil | |
739 | 751 | else throw("Strict value is not equal to itself.") | |
740 | 752 | } | |
741 | 753 | else nil | |
742 | 754 | if ((nsbtDeposit == nsbtDeposit)) | |
743 | 755 | then state | |
744 | 756 | else throw("Strict value is not equal to itself.") | |
745 | 757 | } | |
746 | 758 | else throw("Strict value is not equal to itself.") | |
747 | 759 | } | |
748 | 760 | else throw("Strict value is not equal to itself.") | |
749 | 761 | } | |
750 | 762 | } | |
751 | 763 | ||
752 | 764 | ||
753 | 765 | ||
754 | 766 | @Callable(i) | |
755 | 767 | func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this)) | |
756 | 768 | then throw("internalUnleaseAndLease is not public method") | |
757 | 769 | else prepareUnleaseAndLease(unleaseAmount) | |
758 | 770 | ||
759 | 771 | ||
760 | 772 | ||
761 | 773 | @Callable(i) | |
762 | 774 | func transferUsdnToUser (amount,addr) = if ((i.caller != auctionContract)) | |
763 | 775 | then throw("Only auction contract is authorized") | |
764 | 776 | else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)] | |
765 | 777 | ||
766 | 778 | ||
767 | 779 | ||
768 | 780 | @Callable(i) | |
769 | 781 | func acceptWaves () = if ((i.caller != auctionContract)) | |
770 | 782 | then throw("Currently only auction contract is allowed to call") | |
771 | 783 | else $Tuple2(prepareUnleaseAndLease(0), "success") | |
772 | 784 | ||
773 | 785 | ||
774 | 786 | ||
775 | 787 | @Callable(i) | |
776 | - | func approveLeasings (nListS,groupNum) = { | |
777 | - | let lAmt = (50 * WAVELET) | |
788 | + | func approveLeasings (nListS,groupNum,lAmt) = { | |
778 | 789 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
779 | 790 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
780 | 791 | let mngPub = fromBase58String(mngPubS) | |
781 | 792 | let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE") | |
782 | 793 | let nodeRegAddr = addressFromStringValue(nodeRegAddrStr) | |
783 | 794 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
784 | 795 | let lGrNodeOpt = getString(this, lGroupNodeListKEY) | |
785 | 796 | if (isDefined(lGrNodeOpt)) | |
786 | 797 | then throw((("group " + toString(groupNum)) + " already initialized")) | |
787 | 798 | else { | |
788 | 799 | let nList = split(nListS, SEP) | |
789 | 800 | let expCount = size(nIdxs) | |
790 | 801 | if ((i.callerPublicKey != mngPub)) | |
791 | 802 | then throw("approveLeasings not authorized") | |
792 | 803 | else { | |
793 | - | let $t03363933701 = readNodeInfo(0) | |
794 | - | let nAddr0 = $t03363933701._1 | |
795 | - | let lAmtKEY0 = $t03363933701._2 | |
796 | - | let lAmt0 = $t03363933701._3 | |
797 | - | let lIdKEY0 = $t03363933701._4 | |
798 | - | let lId0 = $t03363933701._5 | |
799 | - | let $t03370433766 = readNodeInfo(1) | |
800 | - | let nAddr1 = $t03370433766._1 | |
801 | - | let lAmtKEY1 = $t03370433766._2 | |
802 | - | let lAmt1 = $t03370433766._3 | |
803 | - | let lIdKEY1 = $t03370433766._4 | |
804 | - | let lId1 = $t03370433766._5 | |
805 | - | let newL0 = Lease(nAddr0, (lAmt0 - ((lAmt * expCount) / 2))) | |
806 | - | let newL1 = Lease(nAddr1, (lAmt1 - ((lAmt * expCount) / 2))) | |
804 | + | let $t03442334485 = readNodeInfo(0) | |
805 | + | let nAddr0 = $t03442334485._1 | |
806 | + | let lAmtKEY0 = $t03442334485._2 | |
807 | + | let lAmt0 = $t03442334485._3 | |
808 | + | let lIdKEY0 = $t03442334485._4 | |
809 | + | let lId0 = $t03442334485._5 | |
810 | + | let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount))) | |
807 | 811 | let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil) | |
808 | 812 | if ((validation == validation)) | |
809 | 813 | then { | |
810 | 814 | func forEachNodeValidateAndGenerateLease (a,i) = { | |
811 | 815 | let node = nList[i] | |
812 | 816 | let la = Lease(addressFromStringValue(node), lAmt) | |
813 | 817 | (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)]) | |
814 | 818 | } | |
815 | 819 | ||
816 | - | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), | |
820 | + | ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0] ++ { | |
817 | 821 | let $l = nIdxs | |
818 | 822 | let $s = size($l) | |
819 | 823 | let $acc0 = nil | |
820 | 824 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
821 | 825 | then $a | |
822 | 826 | else forEachNodeValidateAndGenerateLease($a, $l[$i]) | |
823 | 827 | ||
824 | 828 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
825 | 829 | then $a | |
826 | 830 | else throw("List size exceeds 8") | |
827 | 831 | ||
828 | 832 | $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) | |
829 | 833 | }) | |
830 | 834 | } | |
831 | 835 | else throw("Strict value is not equal to itself.") | |
832 | 836 | } | |
833 | 837 | } | |
834 | 838 | } | |
835 | 839 | ||
836 | 840 | ||
837 | 841 | ||
838 | 842 | @Callable(i) | |
839 | 843 | func rebalanceLeasings (amount,groupNum) = { | |
840 | 844 | let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7] | |
841 | 845 | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
842 | 846 | let mngPub = fromBase58String(mngPubS) | |
843 | 847 | let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum) | |
844 | 848 | let nListS = getStringOrFail(this, lGroupNodeListKEY) | |
845 | 849 | let nList = split(nListS, SEP) | |
846 | 850 | if ((i.callerPublicKey != mngPub)) | |
847 | 851 | then throw("rebalanceLeasings not authorized") | |
848 | 852 | else { | |
849 | 853 | let unleaseAmt = ((amount / size(nList)) + 1) | |
850 | - | let $ | |
851 | - | let nAddr0 = $ | |
852 | - | let lAmtKEY0 = $ | |
853 | - | let lAmt0 = $ | |
854 | - | let lIdKEY0 = $ | |
855 | - | let lId0 = $ | |
854 | + | let $t03572535787 = readNodeInfo(0) | |
855 | + | let nAddr0 = $t03572535787._1 | |
856 | + | let lAmtKEY0 = $t03572535787._2 | |
857 | + | let lAmt0 = $t03572535787._3 | |
858 | + | let lIdKEY0 = $t03572535787._4 | |
859 | + | let lId0 = $t03572535787._5 | |
856 | 860 | let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList)))) | |
857 | 861 | func forEachNodeDoUnlease (a,i) = { | |
858 | 862 | let node = nList[i] | |
859 | 863 | let lIdKEY = getLeaseIdByAddressKey(node) | |
860 | 864 | let lId = getBinaryValue(this, lIdKEY) | |
861 | 865 | let lAmtKEY = getLeaseAmountByAddressKey(node) | |
862 | 866 | let lAmt = getIntegerValue(this, lAmtKEY) | |
863 | 867 | let ula = LeaseCancel(value(lId)) | |
864 | 868 | let la = Lease(addressFromStringValue(node), (lAmt - unleaseAmt)) | |
865 | 869 | (a ++ [LeaseCancel(value(lId)), la, BinaryEntry(lIdKEY, lcalc(la)), IntegerEntry(lAmtKEY, la.amount)]) | |
866 | 870 | } | |
867 | 871 | ||
868 | 872 | ({ | |
869 | 873 | let $l = nIdxs | |
870 | 874 | let $s = size($l) | |
871 | 875 | let $acc0 = nil | |
872 | 876 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
873 | 877 | then $a | |
874 | 878 | else forEachNodeDoUnlease($a, $l[$i]) | |
875 | 879 | ||
876 | 880 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
877 | 881 | then $a | |
878 | 882 | else throw("List size exceeds 8") | |
879 | 883 | ||
880 | 884 | $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) | |
881 | 885 | } ++ [BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0]) | |
882 | 886 | } | |
883 | 887 | } | |
884 | 888 | ||
885 | 889 | ||
886 | 890 | ||
887 | 891 | @Callable(i) | |
888 | 892 | func swapParamsByUserSYSREADONLY (userAddressStr,gnsbtDiff) = { | |
889 | 893 | let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStr, 0, 0], nil)) | |
890 | 894 | let gnsbtAmt = (asInt(gnsbtData[0]) + gnsbtDiff) | |
891 | 895 | let gnsbtAmtTotal = (asInt(gnsbtData[1]) + gnsbtDiff) | |
892 | 896 | let swapLimitData = asAnyList(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil)) | |
893 | 897 | let wavesSwapLimitInUsdnMax = asInt(swapLimitData[0]) | |
894 | 898 | let wavesSwapLimitMax = asInt(swapLimitData[1]) | |
895 | 899 | let usdnSwapLimitMax = asInt(swapLimitData[2]) | |
896 | 900 | let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0) | |
897 | 901 | let swapLimitTimelifeBlocks = swapsTimeframeREAD() | |
898 | 902 | let passedBlocksAfterLastSwap = (height - lastSwapHeight) | |
899 | 903 | let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks) | |
900 | 904 | let swapLimitSpentInUsdn = if (isSwapTimelifeNew) | |
901 | 905 | then 0 | |
902 | 906 | else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0) | |
903 | 907 | let blcks2LmtReset = if (isSwapTimelifeNew) | |
904 | 908 | then 0 | |
905 | 909 | else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap) | |
906 | 910 | $Tuple2(nil, $Tuple7(wavesSwapLimitInUsdnMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, wavesSwapLimitMax, usdnSwapLimitMax)) | |
907 | 911 | } | |
908 | 912 | ||
909 | 913 | ||
910 | 914 | ||
911 | 915 | @Callable(i) | |
912 | - | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price) = $Tuple2(nil, calcWithdraw(swapType, inAmount, price)) | |
916 | + | func calcWithdrawResultSYSREADONLY (swapType,inAmount,price) = { | |
917 | + | let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
918 | + | $Tuple2(nil, calcWithdraw(swapType, inAmount, price, neutrinoMetrics)) | |
919 | + | } | |
920 | + | ||
921 | + | ||
922 | + | ||
923 | + | @Callable(i) | |
924 | + | func replaceCommunityNode (oldAddrStr,newAddrStr,groupNum,penaltyAmount) = { | |
925 | + | let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur") | |
926 | + | let mngPub = fromBase58String(mngPubS) | |
927 | + | if ((i.callerPublicKey != mngPub)) | |
928 | + | then throw("replaceCommunityNode not authorized") | |
929 | + | else { | |
930 | + | let groupKey = getLeaseGroupNodeListKey(groupNum) | |
931 | + | let groupNodeListS = getStringOrFail(this, groupKey) | |
932 | + | if (!(contains(groupNodeListS, oldAddrStr))) | |
933 | + | then throw(((("Group " + toString(groupNum)) + " does not contain address ") + oldAddrStr)) | |
934 | + | else { | |
935 | + | let doReplace = invoke(nodeRegistryContract, "replaceApprovedNode", [oldAddrStr, newAddrStr, groupNum, penaltyAmount], nil) | |
936 | + | if ((doReplace == doReplace)) | |
937 | + | then { | |
938 | + | let oldLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr) | |
939 | + | let oldLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr) | |
940 | + | let leaseAmt = getIntegerValue(oldLeaseAmtKey) | |
941 | + | let newLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr) | |
942 | + | let newLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr) | |
943 | + | let newLease = Lease(addressFromStringValue(newAddrStr), leaseAmt) | |
944 | + | let updatedGroupNodeListS = makeString(split(groupNodeListS, oldAddrStr), newAddrStr) | |
945 | + | $Tuple2([LeaseCancel(getBinaryValue(oldLeaseIdKey)), DeleteEntry(oldLeaseIdKey), DeleteEntry(oldLeaseAmtKey), StringEntry(groupKey, updatedGroupNodeListS), newLease, BinaryEntry(newLeaseIdKey, lcalc(newLease)), IntegerEntry(newLeaseAmtKey, leaseAmt)], unit) | |
946 | + | } | |
947 | + | else throw("Strict value is not equal to itself.") | |
948 | + | } | |
949 | + | } | |
950 | + | } | |
913 | 951 | ||
914 | 952 | ||
915 | 953 | ||
916 | 954 | @Callable(i) | |
917 | 955 | func updateReservesAndNeutrinoSupply () = { | |
918 | 956 | func getNumberByKeyInternal (key) = match getInteger(this, key) { | |
919 | 957 | case a: Int => | |
920 | 958 | a | |
921 | 959 | case _ => | |
922 | 960 | 0 | |
923 | 961 | } | |
924 | 962 | ||
925 | 963 | let nMetrix = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil)) | |
926 | 964 | let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx") | |
927 | 965 | let newIdx = (idx + 1) | |
928 | 966 | [IntegerEntry("updateReservesAndNeutrinoSupplyIdx", newIdx), IntegerEntry("reserve", asInt(nMetrix[3])), IntegerEntry("neutrinoSupply", asInt(nMetrix[5])), IntegerEntry("reservesInUsdn", convertWavesToNeutrino(asInt(nMetrix[3]), asInt(nMetrix[0]))), IntegerEntry("surplus", asInt(nMetrix[6])), IntegerEntry("deficit", -(asInt(nMetrix[6])))] | |
929 | 967 | } | |
930 | 968 | ||
931 | 969 | ||
932 | 970 | ||
933 | 971 | @Callable(i) | |
934 | 972 | func wavesBalancesVsPayment () = { | |
935 | 973 | let b = wavesBalance(this) | |
936 | 974 | [IntegerEntry("wavesBalance_available", b.available), IntegerEntry("wavesBalance_regular", b.regular), IntegerEntry("wavesBalance_generating", b.generating), IntegerEntry("wavesBalance_effective", b.effective), IntegerEntry("waves_payment", value(i.payments[0]).amount)] | |
937 | 975 | } | |
938 | 976 | ||
939 | 977 | ||
940 | 978 | @Verifier(tx) | |
941 | 979 | func verify () = { | |
942 | 980 | let id = toBase58String(tx.id) | |
943 | 981 | let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP) | |
944 | 982 | let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP) | |
945 | 983 | let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0]))) | |
946 | 984 | then 1 | |
947 | 985 | else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1]))) | |
948 | 986 | then 1 | |
949 | 987 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2]))) | |
950 | 988 | then 1 | |
951 | 989 | else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3]))) | |
952 | 990 | then 2 | |
953 | 991 | else 0)) | |
954 | 992 | match tx { | |
955 | 993 | case sponsorTx: SponsorFeeTransaction => | |
956 | 994 | if (checkIsValidMinSponsoredFee(sponsorTx)) | |
957 | 995 | then (count >= 3) | |
958 | 996 | else false | |
959 | 997 | case _ => | |
960 | 998 | (count >= 3) | |
961 | 999 | } | |
962 | 1000 | } | |
963 | 1001 |
github/deemru/w8io/026f985 111.06 ms ◑