tx · Gn5nZLHSDvYTSnwaawZkoCQb51JSgtp1hgfSxqBJ8ghd

3N9be2mwrA52WJho6DiesZkk4351GvpnWuj:  -0.04100000 Waves

2023.02.23 12:47 [2462140] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves

{ "type": 13, "id": "Gn5nZLHSDvYTSnwaawZkoCQb51JSgtp1hgfSxqBJ8ghd", "fee": 4100000, "feeAssetId": null, "timestamp": 1677145697314, "version": 2, "chainId": 84, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "5sBEZX1wQtXzcUyhMm5YcBeJRgjDopnvWmdd1U3TFEHHffYV6MitjNSaBc2Ky9k4mfSp4gSbXfu3CSJ9BePjZKDo", "4SyaQoBFCZVhC8zh5JC7kiPk4E1XmpWkUE5Bsxs71BwP4JyQbsGAnT7gW7VuWSb8hg6wTCTFg5a6SQzVVMgRie7m", "43ETCUhBK3wVm61w2fEHn5786w4dzyM7sfepktEZY6dDaN4Qa78D4iK8uijrZAusiD5nqy8iAkqr4k6oieB8nhx2" ], "script": "base64:BgJdCAISDgoMCAgICAgIAQEBAQEBEgUKAwgIARIHCgUYAQEBARIAEgASBQoDCAEIEgMKAQESBAoCAQgSABIFCgMIAQESBAoCAQESBAoCCAESBgoECAEBCBIGCgQICAEBsgEBD2dldFN0cmluZ09yRmFpbAIHYWRkcmVzcwNrZXkJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQdhZGRyZXNzBQNrZXkJALkJAgkAzAgCAgptYW5kYXRvcnkgCQDMCAIJAKUIAQUHYWRkcmVzcwkAzAgCAgEuCQDMCAIFA2tleQkAzAgCAg8gaXMgbm90IGRlZmluZWQFA25pbAIAAQVsY2FsYwEBbAkAuQgBBQFsAQ5nZXROdW1iZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHR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TcG9uc29yZWRGZWUBBQlzcG9uc29yVHgJAGcCBQVjb3VudAADBwkAZwIFBWNvdW50AAPgEatJ", "height": 2462140, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9hTC4fZnts2hDPiKz7Cbne6CWauhDcEAKHVJKL4aQ4Fz Next: 731LHi8RJPMrgiecRGEVQzBn632rg4hbYdDxxXZZzo9V Diff:
OldNewDifferences
202202
203203 let MinNeutrinoSwapAmountKey = "min_outMulti_swap_amount"
204204
205+let LegacyMinNeutrinoSwapAmountKey = "min_neutrino_swap_amount"
206+
205207 let NodeOracleProviderPubKeyKey = "node_oracle_provider"
206208
207209 let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart"
291293 func basketWeightByAssetKey (assetId) = ("%s%s%s__common__weightByAsset__" + assetId)
292294
293295
294-func minSwapAmountREAD (swapType,assetId) = valueOrElse(if ((swapType == "outMulti"))
295- then getInteger(MinNeutrinoSwapAmountKey)
296- else getInteger(MinTokenSwapAmountKey(assetId)), 0)
296+func keyPriceByAsset (assetId) = ("%s%s%s__common__priceByAsset__" + assetId)
297+
298+
299+func minSwapAmountREAD (swapType,assetId) = if ((swapType == "outMulti"))
300+ then valueOrElse(getInteger(MinNeutrinoSwapAmountKey), getNumberByKey(LegacyMinNeutrinoSwapAmountKey))
301+ else getNumberByKey(MinTokenSwapAmountKey(assetId))
297302
298303
299304 func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440)
320325 func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
321326
322327
323-func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
328+func convertTokenToUsd (amount,price) = fraction(amount, price, MULT8)
324329
325330
326-func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
331+func convertWavesToBond (amount,price) = convertTokenToUsd(amount, price)
327332
328333
329334 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
330335
331336
332337 func convertBasketItemToNeutrino (inAmount,inAsset,basketInfoStr,neutrinoPrice) = {
333- let basketInfo = split(basketInfoStr, "_")
338+ let basketInfo = split_4C(basketInfoStr, "_")
334339 func findItem (acc,item) = {
335340 let bItem = split(item, LISTSEP)
336341 if ((bItem[0] == inAsset))
371376
372377
373378 func convertNeutrinoToBasket (amount,basketInfoStr,neutrinoSupply) = {
374- let basketInfo = split(basketInfoStr, "_")
379+ let basketInfo = split_4C(basketInfoStr, "_")
375380 func conv (acc,item) = {
376381 let parts = split(item, LISTSEP)
377382 let assetId = parts[0]
432437 func checkIsValidMinSponsoredFee (tx) = {
433438 let MINTRANSFERFEE = 100000
434439 let SponsoredFeeUpperBound = 1000
435- let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice)
440+ let realNeutrinoFee = convertTokenToUsd(MINTRANSFERFEE, currentPrice)
436441 let minNeutrinoFee = (realNeutrinoFee * 2)
437442 let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100)
438443 let inputFee = value(tx.minSponsoredAssetFee)
474479 func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP)
475480
476481
477-func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br,basketData,inAsset) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d%s%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br, basketData, inAsset], SEP)
482+func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br,basketData,inAsset) = makeString_2C(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d%s%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br, basketData, inAsset], SEP)
478483
479484
480485 func pendingSwapDATA (swapType,inAssetAmount,selfUnlockHeight,inAsset) = strSwapDATA(swapType, "PENDING", toString(inAssetAmount), "0", "0", "0", toString(height), toString(lastBlock.timestamp), "0", "0", toString(selfUnlockHeight), "0", "0", "NULL", "0", "0", "0", "0", "", inAsset)
518523
519524 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
520525 }
521- makeString(a, "_")
526+ makeString_2C(a, "_")
522527 }
523528
524529
583588
584589 func commonSwap (swapType,pmtAmount,inAsset,userAddressStr,txId58) = {
585590 let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil))
591+ let tokenSwapLimitUsd = swapParamsSTRUCT._1
586592 let swapLimitSpent = swapParamsSTRUCT._2
587593 let blcks2LmtReset = swapParamsSTRUCT._3
588- let wavesSwapLimitMax = swapParamsSTRUCT._6
589594 let usdnSwapLimitMax = swapParamsSTRUCT._7
590595 let minSwapAmount = minSwapAmountREAD(swapType, inAsset)
591596 let totalLocked = totalLockedREAD(swapType, inAsset)
592597 let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr, inAsset)
593598 let nodeAddress = getStakingNodeByIndex(0)
594- let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
595599 let isSwapByNode = (nodeAddress == userAddressStr)
596600 let balanceLockMaxInterval = if (isSwapByNode)
597601 then nodeBalanceLockIntervalREAD()
598602 else balanceLockIntervalREAD(swapType)
599603 let selfUnlockHeight = (height + balanceLockMaxInterval)
604+ let pr = valueOrElse(getInteger(controlContract, keyPriceByAsset(inAsset)), MULT6)
600605 let swapUsdnVolume = if ((swapType == "outNeutrino"))
601- then convertWavesToNeutrino(pmtAmount, priceByIndex)
606+ then convertTokenToUsd(pmtAmount, pr)
602607 else pmtAmount
603608 let swapLimitMax = if ((swapType == "outNeutrino"))
604- then convertWavesToNeutrino(wavesSwapLimitMax, priceByIndex)
609+ then tokenSwapLimitUsd
605610 else usdnSwapLimitMax
606611 if ((minSwapAmount > pmtAmount))
607612 then minSwapAmountFAIL(swapType, minSwapAmount)
888893 let gnsbtAmtTotal = asInt(gnsbtData[1])
889894 let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3])
890895 let commonActions = [IntegerEntry(totalLockedByUserKEY(swapType, account, inAsset), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType, inAsset), (totalLocked - inAmount)), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, withdrawPrice, outNetAmount, outFeeAmount, unlockHeight, index, txId, outSurfAmt, BR, withdrawBasket, inAsset))]
891- if ((swapType == "outMulti"))
896+ func deposits (surfFees,nsbtFees,surfPayments,nsbtPayments) = {
897+ let surfDeposit = if ((surfFees > 0))
898+ then asInt(invoke(surfStakingContract, "deposit", nil, surfPayments))
899+ else 0
900+ let nsbtDeposit = if ((nsbtFees > 0))
901+ then asInt(invoke(nsbtStakingContract, "deposit", nil, nsbtPayments))
902+ else 0
903+ (surfDeposit + nsbtDeposit)
904+ }
905+
906+ func divideFees (feeAmount) = {
907+ let surfAmt1 = if ((gnsbtAmtTotal != 0))
908+ then fraction(feeAmount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
909+ else 0
910+ let surfAmt2 = if ((gnsbtAmtTotal != 0))
911+ then fraction(feeAmount, (MULT6 - BR), MULT6)
912+ else 0
913+ let surfAmt = max([surfAmt1, surfAmt2])
914+ let nsbtAmt = (feeAmount - surfAmt)
915+[surfAmt, nsbtAmt]
916+ }
917+
918+ let transfers = if ((swapType == "outMulti"))
892919 then {
893- let basket = split(withdrawBasket, "_")
920+ let basket = split_4C(withdrawBasket, "_")
894921 func looper (acc,item) = {
895922 let it = split(item, LISTSEP)
896923 let tempAssetId = fromBase58String(it[0])
899926 else tempAssetId
900927 let netAmount = parseIntValue(it[2])
901928 let feeAmount = parseIntValue(it[3])
902- let surfAmt1 = if ((gnsbtAmtTotal != 0))
903- then fraction(feeAmount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
904- else 0
905- let surfAmt2 = if ((gnsbtAmtTotal != 0))
906- then fraction(feeAmount, (MULT6 - BR), MULT6)
907- else 0
908- let surfAmt = max([surfAmt1, surfAmt2])
909- let nsbtAmt = (feeAmount - surfAmt)
910- $Tuple5((acc._1 :+ ScriptTransfer(userAddress, netAmount, assetId)), (acc._2 :+ AttachedPayment(assetId, surfAmt)), (acc._3 :+ AttachedPayment(assetId, nsbtAmt)), (acc._4 + surfAmt), (acc._5 + nsbtAmt))
929+ let fees = divideFees(feeAmount)
930+ $Tuple5((acc._1 :+ ScriptTransfer(userAddress, netAmount, assetId)), (acc._2 :+ AttachedPayment(assetId, fees[0])), (acc._3 :+ AttachedPayment(assetId, fees[1])), (acc._4 + fees[0]), (acc._5 + fees[1]))
911931 }
912932
913933 let r = {
924944
925945 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
926946 }
927- let surfDeposit = if ((r._4 > 0))
928- then {
929- let surfInv = invoke(surfStakingContract, "deposit", nil, r._2)
930- if ((surfInv == surfInv))
931- then 0
932- else throw("Strict value is not equal to itself.")
933- }
934- else 0
935- if ((surfDeposit == surfDeposit))
936- then {
937- let nsbtDeposit = if ((r._5 > 0))
938- then {
939- let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, r._3)
940- if ((nsbtInv == nsbtInv))
941- then 0
942- else throw("Strict value is not equal to itself.")
943- }
944- else 0
945- if ((nsbtDeposit == nsbtDeposit))
946- then (commonActions ++ r._1)
947- else throw("Strict value is not equal to itself.")
948- }
949- else throw("Strict value is not equal to itself.")
947+ let depoResult = deposits(r._4, r._5, r._2, r._3)
948+ $Tuple2(r._1, depoResult)
950949 }
951950 else {
952- let fee = AttachedPayment(outAssetId, outFeeAmount)
953- let surfFeeAmt1 = if ((gnsbtAmtTotal != 0))
954- then fraction(fee.amount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
955- else 0
956- let surfFeeAmt2 = if ((gnsbtAmtTotal != 0))
957- then fraction(fee.amount, (MULT6 - BR), MULT6)
958- else 0
959- let surfFeeAmt = max([surfFeeAmt1, surfFeeAmt2])
960- let nsbtFeeAmt = (fee.amount - surfFeeAmt)
961- let surfDeposit = if ((surfFeeAmt > 0))
962- then {
963- let surfInv = invoke(surfStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, surfFeeAmt)])
964- if ((surfInv == surfInv))
965- then nil
966- else throw("Strict value is not equal to itself.")
967- }
968- else nil
969- if ((surfDeposit == surfDeposit))
970- then {
971- let nsbtDeposit = if ((nsbtFeeAmt > 0))
972- then {
973- let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, nsbtFeeAmt)])
974- if ((nsbtInv == nsbtInv))
975- then nil
976- else throw("Strict value is not equal to itself.")
977- }
978- else nil
979- if ((nsbtDeposit == nsbtDeposit))
980- then (commonActions :+ ScriptTransfer(userAddress, outNetAmount, outAssetId))
981- else throw("Strict value is not equal to itself.")
982- }
983- else throw("Strict value is not equal to itself.")
951+ let fees = divideFees(outFeeAmount)
952+ let depoResult = deposits(fees[0], fees[1], [AttachedPayment(outAssetId, fees[0])], [AttachedPayment(outAssetId, fees[1])])
953+ $Tuple2([ScriptTransfer(userAddress, outNetAmount, outAssetId)], depoResult)
984954 }
955+ $Tuple2((commonActions ++ transfers._1), transfers._2)
985956 }
986957 else throw("Strict value is not equal to itself.")
987958 }
10331004 if ((i.callerPublicKey != mngPub))
10341005 then throw("approveLeasings not authorized")
10351006 else {
1036- let $t04308643148 = readNodeInfo(0)
1037- let nAddr0 = $t04308643148._1
1038- let lAmtKEY0 = $t04308643148._2
1039- let lAmt0 = $t04308643148._3
1040- let lIdKEY0 = $t04308643148._4
1041- let lId0 = $t04308643148._5
1007+ let $t04360243664 = readNodeInfo(0)
1008+ let nAddr0 = $t04360243664._1
1009+ let lAmtKEY0 = $t04360243664._2
1010+ let lAmt0 = $t04360243664._3
1011+ let lIdKEY0 = $t04360243664._4
1012+ let lId0 = $t04360243664._5
10421013 let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount)))
10431014 let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil)
10441015 if ((validation == validation))
10831054 then throw("rebalanceLeasings not authorized")
10841055 else {
10851056 let unleaseAmt = ((amount / size(nList)) + 1)
1086- let $t04438844450 = readNodeInfo(0)
1087- let nAddr0 = $t04438844450._1
1088- let lAmtKEY0 = $t04438844450._2
1089- let lAmt0 = $t04438844450._3
1090- let lIdKEY0 = $t04438844450._4
1091- let lId0 = $t04438844450._5
1057+ let $t04490444966 = readNodeInfo(0)
1058+ let nAddr0 = $t04490444966._1
1059+ let lAmtKEY0 = $t04490444966._2
1060+ let lAmt0 = $t04490444966._3
1061+ let lIdKEY0 = $t04490444966._4
1062+ let lId0 = $t04490444966._5
10921063 let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList))))
10931064 func forEachNodeDoUnlease (a,i) = {
10941065 let node = nList[i]
11261097 let gnsbtAmt = (asInt(gnsbtData[0]) + gnsbtDiff)
11271098 let gnsbtAmtTotal = (asInt(gnsbtData[1]) + gnsbtDiff)
11281099 let swapLimitData = asAnyList(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil))
1129- let wavesSwapLimitInUsdnMax = asInt(swapLimitData[0])
1130- let wavesSwapLimitMax = asInt(swapLimitData[1])
1100+ let tokenSwapLimitInUsdMax = asInt(swapLimitData[0])
11311101 let usdnSwapLimitMax = asInt(swapLimitData[2])
11321102 let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0)
11331103 let swapLimitTimelifeBlocks = swapsTimeframeREAD()
11391109 let blcks2LmtReset = if (isSwapTimelifeNew)
11401110 then 0
11411111 else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap)
1142- $Tuple2(nil, $Tuple7(wavesSwapLimitInUsdnMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, wavesSwapLimitMax, usdnSwapLimitMax))
1112+ $Tuple2(nil, $Tuple7(tokenSwapLimitInUsdMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, 0, usdnSwapLimitMax))
11431113 }
11441114
11451115
11821152 }
11831153
11841154
1185-
1186-@Callable(i)
1187-func updateReservesAndNeutrinoSupply () = {
1188- func getNumberByKeyInternal (key) = match getInteger(this, key) {
1189- case a: Int =>
1190- a
1191- case _ =>
1192- 0
1193- }
1194-
1195- let nMetrix = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
1196- let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
1197- let newIdx = (idx + 1)
1198-[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])))]
1199- }
1200-
1201-
1202-
1203-@Callable(i)
1204-func wavesBalancesVsPayment () = {
1205- let b = wavesBalance(this)
1206-[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)]
1207- }
1208-
1209-
12101155 @Verifier(tx)
12111156 func verify () = {
12121157 let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
55
66
77 func lcalc (l) = calculateLeaseId(l)
88
99
1010 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
1111
1212
1313 func getStringByKey (key) = valueOrElse(getString(this, key), "")
1414
1515
1616 func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false)
1717
1818
1919 func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(address, key), 0)
2020
2121
2222 func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "")
2323
2424
2525 func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(address, key), false)
2626
2727
2828 func asAnyList (v) = match v {
2929 case l: List[Any] =>
3030 l
3131 case _ =>
3232 throw("fail to cast into List[Any]")
3333 }
3434
3535
3636 func asString (v) = match v {
3737 case s: String =>
3838 s
3939 case _ =>
4040 throw("fail to cast into String")
4141 }
4242
4343
4444 func asInt (v) = match v {
4545 case i: Int =>
4646 i
4747 case _ =>
4848 throw("fail to cast into Int")
4949 }
5050
5151
5252 func asBytes (val) = match val {
5353 case valByte: ByteVector =>
5454 valByte
5555 case _ =>
5656 throw("fail to cast into ByteVector")
5757 }
5858
5959
6060 func asPayment (v) = match v {
6161 case p: AttachedPayment =>
6262 p
6363 case _ =>
6464 throw("fail to cast into AttachedPayment")
6565 }
6666
6767
6868 func asSwapParamsSTRUCT (v) = match v {
6969 case struct: (Int, Int, Int, Int, Int, Int, Int) =>
7070 struct
7171 case _ =>
7272 throw("fail to cast into Tuple5 ints")
7373 }
7474
7575
7676 let SEP = "__"
7777
7878 let LISTSEP = ":"
7979
8080 let MULT8 = 100000000
8181
8282 let MULT6 = 1000000
8383
8484 let DEFAULTSWAPFEE = 20000
8585
8686 let BRPROTECTED = 100000
8787
8888 let WAVESID = base58'WAVES'
8989
9090 let nMetricIdxPrice = 0
9191
9292 let nMetricIdxUsdnLockedBalance = 1
9393
9494 let nMetricIdxWavesLockedBalance = 2
9595
9696 let nMetricIdxReserve = 3
9797
9898 let nMetricIdxReserveInUsdn = 4
9999
100100 let nMetricIdxUsdnSupply = 5
101101
102102 let nMetricIdxSurplus = 6
103103
104104 let nMetricIdxSurplusPercent = 7
105105
106106 let nMetricIdxBR = 8
107107
108108 let nMetricIdxNsbtSupply = 9
109109
110110 let nMetricIdxMaxNsbtSupply = 10
111111
112112 let nMetricIdxSurfSupply = 11
113113
114114 let nMetricUsdnUsdtPeg = 12
115115
116116 let nMetricCurrentPriceAdj = 13
117117
118118 let nMetricBasketInfo = 14
119119
120120 let nMetricWeightedPrice = 15
121121
122122 let nMetricTotalReservesUsd = 16
123123
124124 let IdxControlCfgNeutrinoDapp = 1
125125
126126 let IdxControlCfgAuctionDapp = 2
127127
128128 let IdxControlCfgRpdDapp = 3
129129
130130 let IdxControlCfgMathDapp = 4
131131
132132 let IdxControlCfgLiquidationDapp = 5
133133
134134 let IdxControlCfgRestDapp = 6
135135
136136 let IdxControlCfgNodeRegistryDapp = 7
137137
138138 let IdxControlCfgNsbtStakingDapp = 8
139139
140140 let IdxControlCfgMediatorDapp = 9
141141
142142 let IdxControlCfgSurfStakingDapp = 10
143143
144144 let IdxControlCfgGnsbtControllerDapp = 11
145145
146146 let IdxControlCfgRestV2Dapp = 12
147147
148148 let IdxControlCfgGovernanceDapp = 13
149149
150150 func keyControlAddress () = "%s%s__config__controlAddress"
151151
152152
153153 func keyControlCfg () = "%s__controlConfig"
154154
155155
156156 func readControlCfgOrFail (control) = split_4C(getStringOrFail(control, keyControlCfg()), SEP)
157157
158158
159159 func getContractAddressOrFail (controlCfg,idx) = valueOrErrorMessage(addressFromString(controlCfg[idx]), ("Control cfg doesn't contain address at index " + toString(idx)))
160160
161161
162162 let controlContract = addressFromStringValue(valueOrElse(getString(this, keyControlAddress()), "3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx"))
163163
164164 let controlCfg = readControlCfgOrFail(controlContract)
165165
166166 let mathContract = getContractAddressOrFail(controlCfg, IdxControlCfgMathDapp)
167167
168168 let nsbtStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgNsbtStakingDapp)
169169
170170 let surfStakingContract = getContractAddressOrFail(controlCfg, IdxControlCfgSurfStakingDapp)
171171
172172 let gnsbtControllerContract = getContractAddressOrFail(controlCfg, IdxControlCfgGnsbtControllerDapp)
173173
174174 let auctionContract = getContractAddressOrFail(controlCfg, IdxControlCfgAuctionDapp)
175175
176176 let nodeRegistryContract = getContractAddressOrFail(controlCfg, IdxControlCfgNodeRegistryDapp)
177177
178178 let govContract = getContractAddressOrFail(controlCfg, IdxControlCfgGovernanceDapp)
179179
180180 let NeutrinoAssetIdKey = "neutrino_asset_id"
181181
182182 let BondAssetIdKey = "bond_asset_id"
183183
184184 let AuctionContractKey = "auction_contract"
185185
186186 let NsbtStakingContractKey = "nsbtStakingContract"
187187
188188 let LiquidationContractKey = "liquidation_contract"
189189
190190 let RPDContractKey = "rpd_contract"
191191
192192 let ContolContractKey = "control_contract"
193193
194194 let MathContractKey = "math_contract"
195195
196196 let BalanceWavesLockIntervalKey = "balance_waves_lock_interval"
197197
198198 let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval"
199199
200200 func MinTokenSwapAmountKey (assetId) = ("min_outNeutrino_swap_amount_" + assetId)
201201
202202
203203 let MinNeutrinoSwapAmountKey = "min_outMulti_swap_amount"
204204
205+let LegacyMinNeutrinoSwapAmountKey = "min_neutrino_swap_amount"
206+
205207 let NodeOracleProviderPubKeyKey = "node_oracle_provider"
206208
207209 let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart"
208210
209211 let WavesOutFeePartKey = "wavesOut_swap_feePart"
210212
211213 func keyNodeRegistry (address) = ("%s__" + address)
212214
213215
214216 let PriceKey = "price"
215217
216218 let PriceIndexKey = "price_index"
217219
218220 let IsBlockedKey = "is_blocked"
219221
220222 func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block))
221223
222224
223225 func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index))
224226
225227
226228 func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP))
227229
228230
229231 func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx))
230232
231233
232234 func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * MULT8))
233235
234236
235237 func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner)
236238
237239
238240 func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP)
239241
240242
241243 func getLeaseIdByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "id"], SEP)
242244
243245
244246 func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP)
245247
246248
247249 func getLeaseAmountByAddressKey (nodeAddress) = makeString(["%s%s%s", "leaseByAddress", nodeAddress, "amount"], SEP)
248250
249251
250252 func getLeaseGroupNodeListKey (groupNum) = makeString(["%s%d%s", "leaseGroup", toString(groupNum), "nodeList"], SEP)
251253
252254
253255 func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount")
254256
255257
256258 func totalLockedKEY (swapType,assetId) = makeString(["%s%s%s", "balanceLock", swapType, assetId], SEP)
257259
258260
259261 func totalLockedByUserKEY (swapType,owner,assetId) = makeString(["%s%s%s%s", "balanceLock", swapType, owner, assetId], "_")
260262
261263
262264 func balanceLockIntervalKEY (swapType) = if ((swapType == "outMulti"))
263265 then BalanceNeutrinoLockIntervalKey
264266 else BalanceWavesLockIntervalKey
265267
266268
267269 func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval"
268270
269271
270272 func swapsTimeframeKEY () = "swaps_timeframe"
271273
272274
273275 func brProtectedKEY () = "min_BR_protection_level"
274276
275277
276278 func basketAssetsKey () = "%s%s__common__basketAssets"
277279
278280
279281 func basketDKey () = "%s%s__common__basketD"
280282
281283
282284 func basketKKey () = "%s%s__common__basketK"
283285
284286
285287 func basketBKey () = "%s%s__common__basketB"
286288
287289
288290 func basketLogbDeltaKey () = "%s%s__common__basketLogbDelta"
289291
290292
291293 func basketWeightByAssetKey (assetId) = ("%s%s%s__common__weightByAsset__" + assetId)
292294
293295
294-func minSwapAmountREAD (swapType,assetId) = valueOrElse(if ((swapType == "outMulti"))
295- then getInteger(MinNeutrinoSwapAmountKey)
296- else getInteger(MinTokenSwapAmountKey(assetId)), 0)
296+func keyPriceByAsset (assetId) = ("%s%s%s__common__priceByAsset__" + assetId)
297+
298+
299+func minSwapAmountREAD (swapType,assetId) = if ((swapType == "outMulti"))
300+ then valueOrElse(getInteger(MinNeutrinoSwapAmountKey), getNumberByKey(LegacyMinNeutrinoSwapAmountKey))
301+ else getNumberByKey(MinTokenSwapAmountKey(assetId))
297302
298303
299304 func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440)
300305
301306
302307 func totalLockedREAD (swapType,assetId) = valueOrElse(getInteger(this, totalLockedKEY(swapType, assetId)), 0)
303308
304309
305310 func totalLockedByUserREAD (swapType,owner,assetId) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner, assetId)), 0)
306311
307312
308313 func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440)
309314
310315
311316 func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1)
312317
313318
314319 func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP)
315320
316321
317322 func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP)
318323
319324
320325 func convertNeutrinoToWaves (amount,price) = fraction(amount, MULT8, price)
321326
322327
323-func convertWavesToNeutrino (amount,price) = fraction(amount, price, MULT8)
328+func convertTokenToUsd (amount,price) = fraction(amount, price, MULT8)
324329
325330
326-func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
331+func convertWavesToBond (amount,price) = convertTokenToUsd(amount, price)
327332
328333
329334 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
330335
331336
332337 func convertBasketItemToNeutrino (inAmount,inAsset,basketInfoStr,neutrinoPrice) = {
333- let basketInfo = split(basketInfoStr, "_")
338+ let basketInfo = split_4C(basketInfoStr, "_")
334339 func findItem (acc,item) = {
335340 let bItem = split(item, LISTSEP)
336341 if ((bItem[0] == inAsset))
337342 then bItem
338343 else acc
339344 }
340345
341346 let it = {
342347 let $l = basketInfo
343348 let $s = size($l)
344349 let $acc0 = nil
345350 func $f0_1 ($a,$i) = if (($i >= $s))
346351 then $a
347352 else findItem($a, $l[$i])
348353
349354 func $f0_2 ($a,$i) = if (($i >= $s))
350355 then $a
351356 else throw("List size exceeds 10")
352357
353358 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
354359 }
355360 let dlog6 = valueOrElse(getInteger(basketLogbDeltaKey()), -18820642)
356361 let d6 = valueOrElse(getInteger(basketDKey()), 50000)
357362 let b6 = valueOrElse(getInteger(basketBKey()), 1250000)
358363 let w6 = valueOrElse(getInteger(basketWeightByAssetKey(inAsset)), 166666)
359364 let p6 = ((dlog6 - w6) + parseIntValue(it[1]))
360365 let pp6 = pow(b6, 6, p6, 6, 6, HALFUP)
361366 let outAmountGross = fraction(inAmount, parseIntValue(it[2]), if ((neutrinoPrice == 0))
362367 then MULT8
363368 else (neutrinoPrice * 100))
364369 let multiplier = ((MULT6 + d6) - pp6)
365370 let netAmount = fraction(outAmountGross, multiplier, MULT6)
366371 let feeAmount = if ((netAmount >= outAmountGross))
367372 then 0
368373 else (outAmountGross - netAmount)
369374 [outAmountGross, netAmount, feeAmount]
370375 }
371376
372377
373378 func convertNeutrinoToBasket (amount,basketInfoStr,neutrinoSupply) = {
374- let basketInfo = split(basketInfoStr, "_")
379+ let basketInfo = split_4C(basketInfoStr, "_")
375380 func conv (acc,item) = {
376381 let parts = split(item, LISTSEP)
377382 let assetId = parts[0]
378383 let share = parseIntValue(parts[1])
379384 let price = parseIntValue(parts[2])
380385 let reserv = parseIntValue(parts[3])
381386 if ((neutrinoSupply == 0))
382387 then throw("Attempt to burn neutrino at zero supply")
383388 else {
384389 let outAmount = fraction(amount, reserv, neutrinoSupply)
385390 let wavesTuple = if ((assetId == "WAVES"))
386391 then $Tuple2(outAmount, price)
387392 else $Tuple2(acc._2, acc._3)
388393 $Tuple3((acc._1 :+ $Tuple4(assetId, outAmount, price, share)), wavesTuple._1, wavesTuple._2)
389394 }
390395 }
391396
392397 let $l = basketInfo
393398 let $s = size($l)
394399 let $acc0 = $Tuple3(nil, 0, 0)
395400 func $f0_1 ($a,$i) = if (($i >= $s))
396401 then $a
397402 else conv($a, $l[$i])
398403
399404 func $f0_2 ($a,$i) = if (($i >= $s))
400405 then $a
401406 else throw("List size exceeds 10")
402407
403408 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
404409 }
405410
406411
407412 func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount)))
408413
409414
410415 func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
411416
412417
413418 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)))
414419
415420
416421 let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey))
417422
418423 let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey)
419424
420425 let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey)
421426
422427 let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey))
423428
424429 let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z")
425430
426431 let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF")
427432
428433 let neutrinoContract = this
429434
430435 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
431436
432437 func checkIsValidMinSponsoredFee (tx) = {
433438 let MINTRANSFERFEE = 100000
434439 let SponsoredFeeUpperBound = 1000
435- let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice)
440+ let realNeutrinoFee = convertTokenToUsd(MINTRANSFERFEE, currentPrice)
436441 let minNeutrinoFee = (realNeutrinoFee * 2)
437442 let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100)
438443 let inputFee = value(tx.minSponsoredAssetFee)
439444 if (if ((inputFee >= minNeutrinoFee))
440445 then (maxNeutrinoFee >= inputFee)
441446 else false)
442447 then (tx.assetId == neutrinoAssetId)
443448 else false
444449 }
445450
446451
447452 func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block))
448453
449454
450455 func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index))
451456
452457
453458 func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP)
454459
455460
456461 let sIdxSwapType = 1
457462
458463 let sIdxStatus = 2
459464
460465 let sIdxInAmount = 3
461466
462467 let sIdxStartHeight = 7
463468
464469 let sIdxStartTimestamp = 8
465470
466471 let sIdxSelfUnlockHeight = 11
467472
468473 let sIdxMinRand = 15
469474
470475 let sIdxMaxRand = 16
471476
472477 let sIdxInAsset = 20
473478
474479 func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP)
475480
476481
477-func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br,basketData,inAsset) = makeString(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d%s%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br, basketData, inAsset], SEP)
482+func strSwapDATA (swapType,status,inAmount,price,outNetAmount,outFeeAmount,startHeight,startTimestamp,endHeight,endTimestamp,selfUnlockHeight,randUnlockHeight,index,withdrawTxId,randMin,randMax,outSurfAmt,br,basketData,inAsset) = makeString_2C(["%s%s%d%d%d%d%d%d%d%d%d%d%d%s%d%d%d%d%s%s", swapType, status, inAmount, price, outNetAmount, outFeeAmount, startHeight, startTimestamp, endHeight, endTimestamp, selfUnlockHeight, randUnlockHeight, index, withdrawTxId, randMin, randMax, outSurfAmt, br, basketData, inAsset], SEP)
478483
479484
480485 func pendingSwapDATA (swapType,inAssetAmount,selfUnlockHeight,inAsset) = strSwapDATA(swapType, "PENDING", toString(inAssetAmount), "0", "0", "0", toString(height), toString(lastBlock.timestamp), "0", "0", toString(selfUnlockHeight), "0", "0", "NULL", "0", "0", "0", "0", "", inAsset)
481486
482487
483488 func finishSwapDATA (dataArray,price,outNetAmount,outFeeAmount,randUnlockHeight,index,withdrawTxId,outSurfAmt,br,basketData,inAsset) = 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), basketData, inAsset)
484489
485490
486491 func swapDataFailOrREAD (userAddress,swapTxId) = {
487492 let swapKey = swapKEY(userAddress, swapTxId)
488493 split_4C(valueOrErrorMessage(getString(swapKey), ("no swap data for " + swapKey)), SEP)
489494 }
490495
491496
492497 func applyFees (amountOutGross,inAmtToSURF,feePart) = {
493498 let feeAmount = fraction(amountOutGross, feePart, MULT6)
494499 [(amountOutGross - feeAmount), feeAmount]
495500 }
496501
497502
498503 func applyFeesBasket (basketOut) = {
499504 let k6 = valueOrElse(getInteger(basketKKey()), MULT6)
500505 let d6 = valueOrElse(getInteger(basketDKey()), 50000)
501506 let feePart = fraction(k6, d6, MULT6)
502507 func feeApplier (acc,item) = {
503508 let feeAmount = fraction(item._2, feePart, MULT6)
504509 (acc :+ makeString([item._1, toString(item._3), toString((item._2 - feeAmount)), toString(feeAmount), toString(item._4)], LISTSEP))
505510 }
506511
507512 let a = {
508513 let $l = basketOut
509514 let $s = size($l)
510515 let $acc0 = nil
511516 func $f0_1 ($a,$i) = if (($i >= $s))
512517 then $a
513518 else feeApplier($a, $l[$i])
514519
515520 func $f0_2 ($a,$i) = if (($i >= $s))
516521 then $a
517522 else throw("List size exceeds 10")
518523
519524 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
520525 }
521- makeString(a, "_")
526+ makeString_2C(a, "_")
522527 }
523528
524529
525530 func abs (x) = if ((0 > x))
526531 then -(x)
527532 else x
528533
529534
530535 func selectNode (unleaseAmount) = {
531536 let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship())
532537 let oldLeased0 = getNumberByKey(getLeaseAmountKey(0))
533538 let oldLeased1 = getNumberByKey(getLeaseAmountKey(1))
534539 let newLeased0 = (amountToLease + oldLeased0)
535540 let newLeased1 = (amountToLease + oldLeased1)
536541 if (if ((newLeased0 > 0))
537542 then true
538543 else (newLeased1 > 0))
539544 then {
540545 let delta0 = abs((newLeased0 - oldLeased1))
541546 let delta1 = abs((newLeased1 - oldLeased0))
542547 if ((delta1 >= delta0))
543548 then $Tuple2(0, newLeased0)
544549 else $Tuple2(1, newLeased1)
545550 }
546551 else $Tuple2(-1, 0)
547552 }
548553
549554
550555 func thisOnly (i) = if ((i.caller != this))
551556 then throw("Permission denied: this contract only allowed")
552557 else true
553558
554559
555560 func prepareUnleaseAndLease (unleaseAmount) = {
556561 let nodeTuple = selectNode(unleaseAmount)
557562 let nodeIndex = nodeTuple._1
558563 let newLeaseAmount = nodeTuple._2
559564 if ((newLeaseAmount > 0))
560565 then {
561566 let leaseIdKey = getLeaseIdKey(nodeIndex)
562567 let oldLease = getBinary(this, leaseIdKey)
563568 let unleaseOrEmpty = if (isDefined(oldLease))
564569 then [LeaseCancel(value(oldLease))]
565570 else nil
566571 let leaseAmountKey = getLeaseAmountKey(nodeIndex)
567572 let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount)
568573 (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, lcalc(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)])
569574 }
570575 else nil
571576 }
572577
573578
574579 func readNodeInfo (nodeIdx) = {
575580 let nodeAddress = getStakingNodeAddressByIndex(nodeIdx)
576581 let leasedAmtKEY = getLeaseAmountKey(nodeIdx)
577582 let leasedAmt = getNumberByKey(leasedAmtKEY)
578583 let leaseIdKEY = getLeaseIdKey(nodeIdx)
579584 let leaseId = value(getBinary(this, leaseIdKEY))
580585 $Tuple5(nodeAddress, leasedAmtKEY, leasedAmt, leaseIdKEY, leaseId)
581586 }
582587
583588
584589 func commonSwap (swapType,pmtAmount,inAsset,userAddressStr,txId58) = {
585590 let swapParamsSTRUCT = asSwapParamsSTRUCT(invoke(this, "swapParamsByUserSYSREADONLY", [userAddressStr, 0], nil))
591+ let tokenSwapLimitUsd = swapParamsSTRUCT._1
586592 let swapLimitSpent = swapParamsSTRUCT._2
587593 let blcks2LmtReset = swapParamsSTRUCT._3
588- let wavesSwapLimitMax = swapParamsSTRUCT._6
589594 let usdnSwapLimitMax = swapParamsSTRUCT._7
590595 let minSwapAmount = minSwapAmountREAD(swapType, inAsset)
591596 let totalLocked = totalLockedREAD(swapType, inAsset)
592597 let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr, inAsset)
593598 let nodeAddress = getStakingNodeByIndex(0)
594- let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
595599 let isSwapByNode = (nodeAddress == userAddressStr)
596600 let balanceLockMaxInterval = if (isSwapByNode)
597601 then nodeBalanceLockIntervalREAD()
598602 else balanceLockIntervalREAD(swapType)
599603 let selfUnlockHeight = (height + balanceLockMaxInterval)
604+ let pr = valueOrElse(getInteger(controlContract, keyPriceByAsset(inAsset)), MULT6)
600605 let swapUsdnVolume = if ((swapType == "outNeutrino"))
601- then convertWavesToNeutrino(pmtAmount, priceByIndex)
606+ then convertTokenToUsd(pmtAmount, pr)
602607 else pmtAmount
603608 let swapLimitMax = if ((swapType == "outNeutrino"))
604- then convertWavesToNeutrino(wavesSwapLimitMax, priceByIndex)
609+ then tokenSwapLimitUsd
605610 else usdnSwapLimitMax
606611 if ((minSwapAmount > pmtAmount))
607612 then minSwapAmountFAIL(swapType, minSwapAmount)
608613 else if (if (!(isSwapByNode))
609614 then (swapLimitSpent > 0)
610615 else false)
611616 then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((height + blcks2LmtReset))))
612617 else if (if (!(isSwapByNode))
613618 then (swapUsdnVolume > swapLimitMax)
614619 else false)
615620 then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimitMax)))
616621 else if (isBlocked)
617622 then emergencyShutdownFAIL()
618623 else {
619624 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
620625 let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo])
621626 let weightedPrice = asInt(neutrinoMetrics[nMetricWeightedPrice])
622627 let out = convertBasketItemToNeutrino(pmtAmount, inAsset, basketInfo, weightedPrice)
623628 if (if ((swapType == "outNeutrino"))
624629 then (0 >= out[1])
625630 else false)
626631 then throw((((((("Net amount is non-positive, cannot swap. (gross, net, fee) = (" + toString(out[0])) + ", ") + toString(out[1])) + ", ") + toString(out[2])) + ")"))
627632 else {
628633 let leasePart = if (if ((swapType == "outNeutrino"))
629634 then (inAsset == "WAVES")
630635 else false)
631636 then prepareUnleaseAndLease(0)
632637 else nil
633638 $Tuple2(([IntegerEntry(keySwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastSwapHeight(userAddressStr), height), IntegerEntry(totalLockedByUserKEY(swapType, userAddressStr, inAsset), (totalLockedByUser + pmtAmount)), IntegerEntry(getBalanceUnlockBlockKey(userAddressStr), selfUnlockHeight), IntegerEntry(totalLockedKEY(swapType, inAsset), (totalLocked + pmtAmount)), StringEntry(swapKEY(userAddressStr, txId58), pendingSwapDATA(swapType, pmtAmount, selfUnlockHeight, inAsset))] ++ leasePart), unit)
634639 }
635640 }
636641 }
637642
638643
639644 let bFuncIdxSurf = 0
640645
641646 let bFuncIdxWaves = 1
642647
643648 let bFuncIdxUsdn = 2
644649
645650 let bFuncIdxReserveStart = 3
646651
647652 let bFuncIdxSupplyStart = 4
648653
649654 let bFuncIdxBRStart = 5
650655
651656 let bFuncIdxReserveEnd = 6
652657
653658 let bFuncIdxSupplyEnd = 7
654659
655660 let bFuncIdxBREnd = 8
656661
657662 let bFuncIdxRest = 9
658663
659664 let bFuncIdxWavesPrice = 10
660665
661666 func calcWithdrawT2U (inAmount,inAsset,basketInfo,weightedPrice) = {
662667 let outAmt = convertBasketItemToNeutrino(inAmount, inAsset, basketInfo, weightedPrice)
663668 $Tuple12(outAmt[0], neutrinoAssetId, 0, inAsset, 0, weightedPrice, inAmount, 0, 0, 0, nil, [outAmt[1], outAmt[2]])
664669 }
665670
666671
667672 func calcWithdrawU2Basket (usdnIn,basketInfo,neutrinoSupply) = {
668673 let outAmtGross = convertNeutrinoToBasket(usdnIn, basketInfo, neutrinoSupply)
669674 $Tuple12(outAmtGross._2, unit, 0, neutrinoAssetId, outAmtGross._2, outAmtGross._3, usdnIn, neutrinoSupply, usdnIn, 0, outAmtGross._1, nil)
670675 }
671676
672677
673678 func calcWithdraw (swapType,inAmount,price,neutrinoMetrics,inAsset) = {
674679 let neutrinoSupply = asInt(neutrinoMetrics[nMetricIdxUsdnSupply])
675680 let basketInfo = asString(neutrinoMetrics[nMetricBasketInfo])
676681 let weightedPrice = asInt(neutrinoMetrics[nMetricWeightedPrice])
677682 let outDataTuple = if ((swapType == "outNeutrino"))
678683 then calcWithdrawT2U(inAmount, inAsset, basketInfo, weightedPrice)
679684 else if ((swapType == "outMulti"))
680685 then calcWithdrawU2Basket(inAmount, basketInfo, neutrinoSupply)
681686 else throw(("Unsupported swap type " + swapType))
682687 let outAmtGross = outDataTuple._1
683688 let outAssetId = outDataTuple._2
684689 let inAmtToSurfPart = outDataTuple._3
685690 let inAssetId = outDataTuple._4
686691 let unleaseAmt = outDataTuple._5
687692 let withdrawPrice = outDataTuple._6
688693 let basketData = outDataTuple._11
689694 let netFeeData = outDataTuple._12
690695 let outNetAmt = if ((swapType == "outNeutrino"))
691696 then netFeeData[0]
692697 else 0
693698 let outFeeAmt = if ((swapType == "outNeutrino"))
694699 then netFeeData[1]
695700 else 0
696701 let outSurfAmt = if ((0 >= inAmtToSurfPart))
697702 then 0
698703 else asInt(asAnyList(invoke(mathContract, "surfFunctionREADONLY", [inAmtToSurfPart, inAssetId], nil))[bFuncIdxSurf])
699704 let withdrawBasket = if ((swapType == "outMulti"))
700705 then applyFeesBasket(basketData)
701706 else ""
702707 $Tuple9(outNetAmt, outAssetId, outSurfAmt, inAmtToSurfPart, unleaseAmt, outFeeAmt, outAmtGross, withdrawPrice, withdrawBasket)
703708 }
704709
705710
706711 func keyApplyInProgress () = "%s__applyInProgress"
707712
708713
709714 func keyProposalDataById (proposalId) = ("%s%d__proposalData__" + toString(proposalId))
710715
711716
712717 let govIdxTxIds = 9
713718
714719 func validateUpdate (tx) = match tx {
715720 case o: Order =>
716721 throw("Orders aren't allowed")
717722 case t: DataTransaction|SponsorFeeTransaction|SetScriptTransaction|CreateAliasTransaction|LeaseCancelTransaction|LeaseTransaction|IssueTransaction|InvokeExpressionTransaction|UpdateAssetInfoTransaction|InvokeScriptTransaction|SetAssetScriptTransaction|TransferTransaction|ExchangeTransaction|MassTransferTransaction|BurnTransaction|ReissueTransaction =>
718723 let txId = toBase58String(t.id)
719724 let proposalId = valueOrErrorMessage(getInteger(govContract, keyApplyInProgress()), "Apply is not happening")
720725 let txList = split(split(getStringOrFail(govContract, keyProposalDataById(proposalId)), SEP)[govIdxTxIds], LISTSEP)
721726 if (!(isDefined(indexOf(txList, txId))))
722727 then throw(((("Unknown txId: " + txId) + " for proposalId=") + toString(proposalId)))
723728 else true
724729 case _ =>
725730 throw("Match error")
726731 }
727732
728733
729734 @Callable(i)
730735 func constructorV1 (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = {
731736 let checkCaller = thisOnly(i)
732737 if ((checkCaller == checkCaller))
733738 then if ((size(i.payments) != 0))
734739 then throw("no payments allowed")
735740 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(MinTokenSwapAmountKey("WAVES"), minWavesSwapAmountPrm), IntegerEntry(MinNeutrinoSwapAmountKey, minNeutrinoSwapAmountPrm), IntegerEntry(NeutrinoOutFeePartKey, neutrinoOutFeePartPrm), IntegerEntry(WavesOutFeePartKey, wavesOutFeePartPrm)]
736741 else throw("Strict value is not equal to itself.")
737742 }
738743
739744
740745
741746 @Callable(i)
742747 func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = {
743748 let checkCaller = thisOnly(i)
744749 if ((checkCaller == checkCaller))
745750 then if ((size(i.payments) != 0))
746751 then throw("no payments allowed")
747752 else [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)]
748753 else throw("Strict value is not equal to itself.")
749754 }
750755
751756
752757
753758 @Callable(i)
754759 func constructorV3 (assetsWeightsMins,dParam,kParam,bParam,deltaParam) = {
755760 let checkCaller = thisOnly(i)
756761 if ((checkCaller == checkCaller))
757762 then if ((size(i.payments) != 0))
758763 then throw("no payments allowed")
759764 else {
760765 func prepare (acc,item) = {
761766 let parts = split(item, "_")
762767 let assetId = parts[0]
763768 let weight = parseIntValue(parts[1])
764769 let minVal = parseIntValue(parts[2])
765770 $Tuple2((acc._1 :+ assetId), ((acc._2 :+ IntegerEntry(basketWeightByAssetKey(assetId), weight)) :+ IntegerEntry(MinTokenSwapAmountKey(assetId), minVal)))
766771 }
767772
768773 let r = {
769774 let $l = assetsWeightsMins
770775 let $s = size($l)
771776 let $acc0 = $Tuple2(nil, nil)
772777 func $f0_1 ($a,$i) = if (($i >= $s))
773778 then $a
774779 else prepare($a, $l[$i])
775780
776781 func $f0_2 ($a,$i) = if (($i >= $s))
777782 then $a
778783 else throw("List size exceeds 10")
779784
780785 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
781786 }
782787 (((((r._2 :+ IntegerEntry(basketDKey(), dParam)) :+ IntegerEntry(basketKKey(), kParam)) :+ IntegerEntry(basketBKey(), bParam)) :+ IntegerEntry(basketLogbDeltaKey(), log(deltaParam, 6, bParam, 6, 6, HALFUP))) :+ StringEntry(basketAssetsKey(), makeString(r._1, SEP)))
783788 }
784789 else throw("Strict value is not equal to itself.")
785790 }
786791
787792
788793
789794 @Callable(i)
790795 func swapTokenToNeutrino () = if ((size(i.payments) != 1))
791796 then throw("swapTokenToNeutrino require only one payment")
792797 else {
793798 let pmt = value(i.payments[0])
794799 let basketAssets = valueOrElse(getString(basketAssetsKey()), "WAVES")
795800 let pmtAssetIdStr = toBase58String(valueOrElse(pmt.assetId, WAVESID))
796801 if (!(contains(basketAssets, pmtAssetIdStr)))
797802 then throw(((pmtAssetIdStr + " is not one of basket tokens:") + basketAssets))
798803 else {
799804 let userAddress = toString(i.caller)
800805 let txId58 = toBase58String(i.transactionId)
801806 commonSwap("outNeutrino", pmt.amount, pmtAssetIdStr, userAddress, txId58)
802807 }
803808 }
804809
805810
806811
807812 @Callable(i)
808813 func swapNeutrinoToBasket () = if ((size(i.payments) != 1))
809814 then throw("swapNeutrinoToBasket require only one payment")
810815 else {
811816 let pmt = value(i.payments[0])
812817 if ((pmt.assetId != neutrinoAssetId))
813818 then throw("Only appropriate Neutrino tokens are allowed for swapping.")
814819 else {
815820 let userAddress = toString(i.caller)
816821 let txId58 = toBase58String(i.transactionId)
817822 commonSwap("outMulti", pmt.amount, toBase58String(neutrinoAssetId), userAddress, txId58)
818823 }
819824 }
820825
821826
822827
823828 @Callable(i)
824829 func withdraw (account,index,swapTxId) = {
825830 let txId = toBase58String(i.transactionId)
826831 if ((size(i.payments) != 0))
827832 then throw("no payments allowed")
828833 else {
829834 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
830835 let BR = asInt(neutrinoMetrics[nMetricIdxBR])
831836 let userAddress = addressFromStringValue(account)
832837 let dataArray = swapDataFailOrREAD(account, swapTxId)
833838 let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight])
834839 let swapType = dataArray[sIdxSwapType]
835840 let inAmount = parseIntValue(dataArray[sIdxInAmount])
836841 let swapStatus = dataArray[sIdxStatus]
837842 let startHeight = parseIntValue(dataArray[sIdxStartHeight])
838843 let inAsset = dataArray[sIdxInAsset]
839844 let totalLocked = totalLockedREAD(swapType, inAsset)
840845 let totalLockedByUser = totalLockedByUserREAD(swapType, account, inAsset)
841846 let unlockHeight = selfUnlockHeight
842847 let indexHeight = getHeightPriceByIndex(index)
843848 let prevIndexHeight = getHeightPriceByIndex((index - 1))
844849 let priceByIndex = getPriceHistory(indexHeight)
845850 if (isBlocked)
846851 then emergencyShutdownFAIL()
847852 else if ((swapStatus != "PENDING"))
848853 then throw("swap has been already processed")
849854 else if ((unlockHeight > height))
850855 then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds"))
851856 else if (if (if ((index > priceIndex))
852857 then true
853858 else (unlockHeight > indexHeight))
854859 then true
855860 else if ((prevIndexHeight != 0))
856861 then (prevIndexHeight >= unlockHeight)
857862 else false)
858863 then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight)
859864 else {
860865 let withdrawTuple = calcWithdraw(swapType, inAmount, priceByIndex, neutrinoMetrics, inAsset)
861866 let outNetAmount = withdrawTuple._1
862867 let outAssetId = withdrawTuple._2
863868 let outSurfAmt = withdrawTuple._3
864869 let unleaseAmt = withdrawTuple._5
865870 let outFeeAmount = withdrawTuple._6
866871 let outAmtGross = withdrawTuple._7
867872 let withdrawPrice = withdrawTuple._8
868873 let withdrawBasket = withdrawTuple._9
869874 if (if ((swapType == "outNeutrino"))
870875 then (0 >= outAmtGross)
871876 else false)
872877 then throw("balance equals zero")
873878 else {
874879 let surfCondition = if ((outSurfAmt > 0))
875880 then {
876881 let issueResult = invoke(auctionContract, "issueSurf", [outSurfAmt, account], nil)
877882 if ((issueResult == issueResult))
878883 then 0
879884 else throw("Strict value is not equal to itself.")
880885 }
881886 else 0
882887 if ((surfCondition == surfCondition))
883888 then {
884889 let unleaseInvOrEmpty = invoke(this, "internalUnleaseAndLease", [unleaseAmt], nil)
885890 if ((unleaseInvOrEmpty == unleaseInvOrEmpty))
886891 then {
887892 let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", ["", 0, 0], nil))
888893 let gnsbtAmtTotal = asInt(gnsbtData[1])
889894 let gnsbtAmtFromSurfTotal = asInt(asAnyList(gnsbtData[3])[3])
890895 let commonActions = [IntegerEntry(totalLockedByUserKEY(swapType, account, inAsset), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType, inAsset), (totalLocked - inAmount)), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, withdrawPrice, outNetAmount, outFeeAmount, unlockHeight, index, txId, outSurfAmt, BR, withdrawBasket, inAsset))]
891- if ((swapType == "outMulti"))
896+ func deposits (surfFees,nsbtFees,surfPayments,nsbtPayments) = {
897+ let surfDeposit = if ((surfFees > 0))
898+ then asInt(invoke(surfStakingContract, "deposit", nil, surfPayments))
899+ else 0
900+ let nsbtDeposit = if ((nsbtFees > 0))
901+ then asInt(invoke(nsbtStakingContract, "deposit", nil, nsbtPayments))
902+ else 0
903+ (surfDeposit + nsbtDeposit)
904+ }
905+
906+ func divideFees (feeAmount) = {
907+ let surfAmt1 = if ((gnsbtAmtTotal != 0))
908+ then fraction(feeAmount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
909+ else 0
910+ let surfAmt2 = if ((gnsbtAmtTotal != 0))
911+ then fraction(feeAmount, (MULT6 - BR), MULT6)
912+ else 0
913+ let surfAmt = max([surfAmt1, surfAmt2])
914+ let nsbtAmt = (feeAmount - surfAmt)
915+[surfAmt, nsbtAmt]
916+ }
917+
918+ let transfers = if ((swapType == "outMulti"))
892919 then {
893- let basket = split(withdrawBasket, "_")
920+ let basket = split_4C(withdrawBasket, "_")
894921 func looper (acc,item) = {
895922 let it = split(item, LISTSEP)
896923 let tempAssetId = fromBase58String(it[0])
897924 let assetId = if ((tempAssetId == WAVESID))
898925 then unit
899926 else tempAssetId
900927 let netAmount = parseIntValue(it[2])
901928 let feeAmount = parseIntValue(it[3])
902- let surfAmt1 = if ((gnsbtAmtTotal != 0))
903- then fraction(feeAmount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
904- else 0
905- let surfAmt2 = if ((gnsbtAmtTotal != 0))
906- then fraction(feeAmount, (MULT6 - BR), MULT6)
907- else 0
908- let surfAmt = max([surfAmt1, surfAmt2])
909- let nsbtAmt = (feeAmount - surfAmt)
910- $Tuple5((acc._1 :+ ScriptTransfer(userAddress, netAmount, assetId)), (acc._2 :+ AttachedPayment(assetId, surfAmt)), (acc._3 :+ AttachedPayment(assetId, nsbtAmt)), (acc._4 + surfAmt), (acc._5 + nsbtAmt))
929+ let fees = divideFees(feeAmount)
930+ $Tuple5((acc._1 :+ ScriptTransfer(userAddress, netAmount, assetId)), (acc._2 :+ AttachedPayment(assetId, fees[0])), (acc._3 :+ AttachedPayment(assetId, fees[1])), (acc._4 + fees[0]), (acc._5 + fees[1]))
911931 }
912932
913933 let r = {
914934 let $l = basket
915935 let $s = size($l)
916936 let $acc0 = $Tuple5(nil, nil, nil, 0, 0)
917937 func $f0_1 ($a,$i) = if (($i >= $s))
918938 then $a
919939 else looper($a, $l[$i])
920940
921941 func $f0_2 ($a,$i) = if (($i >= $s))
922942 then $a
923943 else throw("List size exceeds 10")
924944
925945 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
926946 }
927- let surfDeposit = if ((r._4 > 0))
928- then {
929- let surfInv = invoke(surfStakingContract, "deposit", nil, r._2)
930- if ((surfInv == surfInv))
931- then 0
932- else throw("Strict value is not equal to itself.")
933- }
934- else 0
935- if ((surfDeposit == surfDeposit))
936- then {
937- let nsbtDeposit = if ((r._5 > 0))
938- then {
939- let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, r._3)
940- if ((nsbtInv == nsbtInv))
941- then 0
942- else throw("Strict value is not equal to itself.")
943- }
944- else 0
945- if ((nsbtDeposit == nsbtDeposit))
946- then (commonActions ++ r._1)
947- else throw("Strict value is not equal to itself.")
948- }
949- else throw("Strict value is not equal to itself.")
947+ let depoResult = deposits(r._4, r._5, r._2, r._3)
948+ $Tuple2(r._1, depoResult)
950949 }
951950 else {
952- let fee = AttachedPayment(outAssetId, outFeeAmount)
953- let surfFeeAmt1 = if ((gnsbtAmtTotal != 0))
954- then fraction(fee.amount, gnsbtAmtFromSurfTotal, gnsbtAmtTotal)
955- else 0
956- let surfFeeAmt2 = if ((gnsbtAmtTotal != 0))
957- then fraction(fee.amount, (MULT6 - BR), MULT6)
958- else 0
959- let surfFeeAmt = max([surfFeeAmt1, surfFeeAmt2])
960- let nsbtFeeAmt = (fee.amount - surfFeeAmt)
961- let surfDeposit = if ((surfFeeAmt > 0))
962- then {
963- let surfInv = invoke(surfStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, surfFeeAmt)])
964- if ((surfInv == surfInv))
965- then nil
966- else throw("Strict value is not equal to itself.")
967- }
968- else nil
969- if ((surfDeposit == surfDeposit))
970- then {
971- let nsbtDeposit = if ((nsbtFeeAmt > 0))
972- then {
973- let nsbtInv = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(fee.assetId, nsbtFeeAmt)])
974- if ((nsbtInv == nsbtInv))
975- then nil
976- else throw("Strict value is not equal to itself.")
977- }
978- else nil
979- if ((nsbtDeposit == nsbtDeposit))
980- then (commonActions :+ ScriptTransfer(userAddress, outNetAmount, outAssetId))
981- else throw("Strict value is not equal to itself.")
982- }
983- else throw("Strict value is not equal to itself.")
951+ let fees = divideFees(outFeeAmount)
952+ let depoResult = deposits(fees[0], fees[1], [AttachedPayment(outAssetId, fees[0])], [AttachedPayment(outAssetId, fees[1])])
953+ $Tuple2([ScriptTransfer(userAddress, outNetAmount, outAssetId)], depoResult)
984954 }
955+ $Tuple2((commonActions ++ transfers._1), transfers._2)
985956 }
986957 else throw("Strict value is not equal to itself.")
987958 }
988959 else throw("Strict value is not equal to itself.")
989960 }
990961 }
991962 }
992963 }
993964
994965
995966
996967 @Callable(i)
997968 func internalUnleaseAndLease (unleaseAmount) = if ((i.caller != this))
998969 then throw("internalUnleaseAndLease is not public method")
999970 else prepareUnleaseAndLease(unleaseAmount)
1000971
1001972
1002973
1003974 @Callable(i)
1004975 func transferUsdnToUser (amount,addr) = if ((i.caller != auctionContract))
1005976 then throw("Only auction contract is authorized")
1006977 else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)]
1007978
1008979
1009980
1010981 @Callable(i)
1011982 func acceptWaves () = if (if ((i.caller != auctionContract))
1012983 then (i.caller != govContract)
1013984 else false)
1014985 then throw("Currently only auction and governance contracts are allowed to call")
1015986 else $Tuple2(prepareUnleaseAndLease(0), "success")
1016987
1017988
1018989
1019990 @Callable(i)
1020991 func approveLeasings (nListS,groupNum,lAmt) = {
1021992 let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7]
1022993 let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur")
1023994 let mngPub = fromBase58String(mngPubS)
1024995 let nodeRegAddrStr = valueOrElse(getString("%s%s__cfg__nodesRegistryAddress"), "3P9vKqQKjUdmpXAfiWau8krREYAY1Xr69pE")
1025996 let nodeRegAddr = addressFromStringValue(nodeRegAddrStr)
1026997 let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum)
1027998 let lGrNodeOpt = getString(this, lGroupNodeListKEY)
1028999 if (isDefined(lGrNodeOpt))
10291000 then throw((("group " + toString(groupNum)) + " already initialized"))
10301001 else {
10311002 let nList = split(nListS, SEP)
10321003 let expCount = size(nIdxs)
10331004 if ((i.callerPublicKey != mngPub))
10341005 then throw("approveLeasings not authorized")
10351006 else {
1036- let $t04308643148 = readNodeInfo(0)
1037- let nAddr0 = $t04308643148._1
1038- let lAmtKEY0 = $t04308643148._2
1039- let lAmt0 = $t04308643148._3
1040- let lIdKEY0 = $t04308643148._4
1041- let lId0 = $t04308643148._5
1007+ let $t04360243664 = readNodeInfo(0)
1008+ let nAddr0 = $t04360243664._1
1009+ let lAmtKEY0 = $t04360243664._2
1010+ let lAmt0 = $t04360243664._3
1011+ let lIdKEY0 = $t04360243664._4
1012+ let lId0 = $t04360243664._5
10421013 let newL0 = Lease(nAddr0, (lAmt0 - (lAmt * expCount)))
10431014 let validation = invoke(nodeRegAddr, "validateAndApproveLeasings", [nListS], nil)
10441015 if ((validation == validation))
10451016 then {
10461017 func forEachNodeValidateAndGenerateLease (a,i) = {
10471018 let node = nList[i]
10481019 let la = Lease(addressFromStringValue(node), lAmt)
10491020 (a ++ [la, BinaryEntry(getLeaseIdByAddressKey(node), lcalc(la)), IntegerEntry(getLeaseAmountByAddressKey(node), lAmt)])
10501021 }
10511022
10521023 ([StringEntry(lGroupNodeListKEY, nListS), BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0] ++ {
10531024 let $l = nIdxs
10541025 let $s = size($l)
10551026 let $acc0 = nil
10561027 func $f0_1 ($a,$i) = if (($i >= $s))
10571028 then $a
10581029 else forEachNodeValidateAndGenerateLease($a, $l[$i])
10591030
10601031 func $f0_2 ($a,$i) = if (($i >= $s))
10611032 then $a
10621033 else throw("List size exceeds 8")
10631034
10641035 $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)
10651036 })
10661037 }
10671038 else throw("Strict value is not equal to itself.")
10681039 }
10691040 }
10701041 }
10711042
10721043
10731044
10741045 @Callable(i)
10751046 func rebalanceLeasings (amount,groupNum) = {
10761047 let nIdxs = [0, 1, 2, 3, 4, 5, 6, 7]
10771048 let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur")
10781049 let mngPub = fromBase58String(mngPubS)
10791050 let lGroupNodeListKEY = getLeaseGroupNodeListKey(groupNum)
10801051 let nListS = getStringOrFail(this, lGroupNodeListKEY)
10811052 let nList = split(nListS, SEP)
10821053 if ((i.callerPublicKey != mngPub))
10831054 then throw("rebalanceLeasings not authorized")
10841055 else {
10851056 let unleaseAmt = ((amount / size(nList)) + 1)
1086- let $t04438844450 = readNodeInfo(0)
1087- let nAddr0 = $t04438844450._1
1088- let lAmtKEY0 = $t04438844450._2
1089- let lAmt0 = $t04438844450._3
1090- let lIdKEY0 = $t04438844450._4
1091- let lId0 = $t04438844450._5
1057+ let $t04490444966 = readNodeInfo(0)
1058+ let nAddr0 = $t04490444966._1
1059+ let lAmtKEY0 = $t04490444966._2
1060+ let lAmt0 = $t04490444966._3
1061+ let lIdKEY0 = $t04490444966._4
1062+ let lId0 = $t04490444966._5
10921063 let newL0 = Lease(nAddr0, (lAmt0 + (unleaseAmt * size(nList))))
10931064 func forEachNodeDoUnlease (a,i) = {
10941065 let node = nList[i]
10951066 let lIdKEY = getLeaseIdByAddressKey(node)
10961067 let lId = getBinaryValue(this, lIdKEY)
10971068 let lAmtKEY = getLeaseAmountByAddressKey(node)
10981069 let lAmt = getIntegerValue(this, lAmtKEY)
10991070 let ula = LeaseCancel(value(lId))
11001071 let la = Lease(addressFromStringValue(node), (lAmt - unleaseAmt))
11011072 (a ++ [LeaseCancel(value(lId)), la, BinaryEntry(lIdKEY, lcalc(la)), IntegerEntry(lAmtKEY, la.amount)])
11021073 }
11031074
11041075 ({
11051076 let $l = nIdxs
11061077 let $s = size($l)
11071078 let $acc0 = nil
11081079 func $f0_1 ($a,$i) = if (($i >= $s))
11091080 then $a
11101081 else forEachNodeDoUnlease($a, $l[$i])
11111082
11121083 func $f0_2 ($a,$i) = if (($i >= $s))
11131084 then $a
11141085 else throw("List size exceeds 8")
11151086
11161087 $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)
11171088 } ++ [BinaryEntry(lIdKEY0, lcalc(newL0)), IntegerEntry(lAmtKEY0, newL0.amount), LeaseCancel(lId0), newL0])
11181089 }
11191090 }
11201091
11211092
11221093
11231094 @Callable(i)
11241095 func swapParamsByUserSYSREADONLY (userAddressStr,gnsbtDiff) = {
11251096 let gnsbtData = asAnyList(invoke(gnsbtControllerContract, "gnsbtInfoSYSREADONLY", [userAddressStr, 0, 0], nil))
11261097 let gnsbtAmt = (asInt(gnsbtData[0]) + gnsbtDiff)
11271098 let gnsbtAmtTotal = (asInt(gnsbtData[1]) + gnsbtDiff)
11281099 let swapLimitData = asAnyList(invoke(mathContract, "calcSwapLimitREADONLY", [gnsbtAmt], nil))
1129- let wavesSwapLimitInUsdnMax = asInt(swapLimitData[0])
1130- let wavesSwapLimitMax = asInt(swapLimitData[1])
1100+ let tokenSwapLimitInUsdMax = asInt(swapLimitData[0])
11311101 let usdnSwapLimitMax = asInt(swapLimitData[2])
11321102 let lastSwapHeight = valueOrElse(getInteger(this, keyUserLastSwapHeight(userAddressStr)), 0)
11331103 let swapLimitTimelifeBlocks = swapsTimeframeREAD()
11341104 let passedBlocksAfterLastSwap = (height - lastSwapHeight)
11351105 let isSwapTimelifeNew = (passedBlocksAfterLastSwap >= swapLimitTimelifeBlocks)
11361106 let swapLimitSpentInUsdn = if (isSwapTimelifeNew)
11371107 then 0
11381108 else valueOrElse(getInteger(this, keySwapUserSpentInPeriod(userAddressStr)), 0)
11391109 let blcks2LmtReset = if (isSwapTimelifeNew)
11401110 then 0
11411111 else (swapLimitTimelifeBlocks - passedBlocksAfterLastSwap)
1142- $Tuple2(nil, $Tuple7(wavesSwapLimitInUsdnMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, wavesSwapLimitMax, usdnSwapLimitMax))
1112+ $Tuple2(nil, $Tuple7(tokenSwapLimitInUsdMax, swapLimitSpentInUsdn, blcks2LmtReset, gnsbtAmt, gnsbtAmtTotal, 0, usdnSwapLimitMax))
11431113 }
11441114
11451115
11461116
11471117 @Callable(i)
11481118 func calcWithdrawResultSYSREADONLY (swapType,inAmount,price,inAsset) = {
11491119 let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
11501120 $Tuple2(nil, calcWithdraw(swapType, inAmount, price, neutrinoMetrics, inAsset))
11511121 }
11521122
11531123
11541124
11551125 @Callable(i)
11561126 func replaceCommunityNode (oldAddrStr,newAddrStr,groupNum,penaltyAmount) = {
11571127 let mngPubS = valueOrElse(getString("%s%s__cfg__leasingManagerPub"), "7AUMX54ukYMYvPmma7yoFf5NjZhs4Bu5nz3Ez9EV8sur")
11581128 let mngPub = fromBase58String(mngPubS)
11591129 if ((i.callerPublicKey != mngPub))
11601130 then throw("replaceCommunityNode not authorized")
11611131 else {
11621132 let groupKey = getLeaseGroupNodeListKey(groupNum)
11631133 let groupNodeListS = getStringOrFail(this, groupKey)
11641134 if (!(contains(groupNodeListS, oldAddrStr)))
11651135 then throw(((("Group " + toString(groupNum)) + " does not contain address ") + oldAddrStr))
11661136 else {
11671137 let doReplace = invoke(nodeRegistryContract, "replaceApprovedNode", [oldAddrStr, newAddrStr, groupNum, penaltyAmount], nil)
11681138 if ((doReplace == doReplace))
11691139 then {
11701140 let oldLeaseIdKey = getLeaseIdByAddressKey(oldAddrStr)
11711141 let oldLeaseAmtKey = getLeaseAmountByAddressKey(oldAddrStr)
11721142 let leaseAmt = getIntegerValue(oldLeaseAmtKey)
11731143 let newLeaseIdKey = getLeaseIdByAddressKey(newAddrStr)
11741144 let newLeaseAmtKey = getLeaseAmountByAddressKey(newAddrStr)
11751145 let newLease = Lease(addressFromStringValue(newAddrStr), leaseAmt)
11761146 let updatedGroupNodeListS = makeString(split(groupNodeListS, oldAddrStr), newAddrStr)
11771147 $Tuple2([LeaseCancel(getBinaryValue(oldLeaseIdKey)), DeleteEntry(oldLeaseIdKey), DeleteEntry(oldLeaseAmtKey), StringEntry(groupKey, updatedGroupNodeListS), newLease, BinaryEntry(newLeaseIdKey, lcalc(newLease)), IntegerEntry(newLeaseAmtKey, leaseAmt)], unit)
11781148 }
11791149 else throw("Strict value is not equal to itself.")
11801150 }
11811151 }
11821152 }
11831153
11841154
1185-
1186-@Callable(i)
1187-func updateReservesAndNeutrinoSupply () = {
1188- func getNumberByKeyInternal (key) = match getInteger(this, key) {
1189- case a: Int =>
1190- a
1191- case _ =>
1192- 0
1193- }
1194-
1195- let nMetrix = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
1196- let idx = getNumberByKeyInternal("updateReservesAndNeutrinoSupplyIdx")
1197- let newIdx = (idx + 1)
1198-[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])))]
1199- }
1200-
1201-
1202-
1203-@Callable(i)
1204-func wavesBalancesVsPayment () = {
1205- let b = wavesBalance(this)
1206-[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)]
1207- }
1208-
1209-
12101155 @Verifier(tx)
12111156 func verify () = {
12121157 let pubKeyAdminsListStr = makeString(["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR"], SEP)
12131158 let pubKeyAdminsList = split(valueOrElse(getString(controlContract, "%s__multisig"), pubKeyAdminsListStr), SEP)
12141159 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
12151160 then 1
12161161 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
12171162 then 1
12181163 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
12191164 then 1
12201165 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
12211166 then 2
12221167 else 0))
12231168 if (if (isBlocked)
12241169 then (getStringValue(controlContract, "is_blocked_caller") == toString(govContract))
12251170 else false)
12261171 then validateUpdate(tx)
12271172 else match tx {
12281173 case sponsorTx: SponsorFeeTransaction =>
12291174 if (checkIsValidMinSponsoredFee(sponsorTx))
12301175 then (count >= 3)
12311176 else false
12321177 case _ =>
12331178 (count >= 3)
12341179 }
12351180 }
12361181

github/deemru/w8io/026f985 
158.93 ms