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