tx · MvqrafPwemyS2mZG4Y4v8ByfvujrT3FYw4CmwAB6tRG

3N9be2mwrA52WJho6DiesZkk4351GvpnWuj:  -0.01400000 Waves

2022.03.16 11:20 [1966278] smart account 3N9be2mwrA52WJho6DiesZkk4351GvpnWuj > SELF 0.00000000 Waves

{ "type": 13, "id": "MvqrafPwemyS2mZG4Y4v8ByfvujrT3FYw4CmwAB6tRG", "fee": 1400000, "feeAssetId": null, "timestamp": 1647418828181, "version": 1, "sender": "3N9be2mwrA52WJho6DiesZkk4351GvpnWuj", "senderPublicKey": "6mzmbCza9iqbzxMEELcEA4Xc9NeF4CYpbTtz1zMK3C7x", "proofs": [ "2kAda2gxzxKYbh8vdgPMvM5ouxhZP9SFzBLXBBXPeVSEi1vAvRskJse1i8wurCLczfmiKGnAMRgswCep5PT1Goit", "5iQbJZSXWUiv1sNXjfoGoWudyNggvJUMRbTnYMLVhgQNZnx2gnJH1zERyj7Nqh7HaSnbZqibCVkRfpkhZPbcyjLU", "2udhH5jGXeZZ3A8akWo1y1g2TLYEcTQJa75WwSwNFXPNh5iAaAzCCU728YtfbzpA35Kr6LAijXDioCaSphBUMTZB" ], "script": "base64:AAIFAAAAAAAAADYIAhIGCgQIAQgIEg4KDAgICAgICAEBAQEBARIFCgMICAESABIAEgUKAwgBCBIAEgQKAgEIEgAAAABzAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQAAAAAAAAAAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkCAAAAAAEAAAAMZ2V0Qm9vbEJ5S2V5AAAAAQAAAANrZXkJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAEdGhpcwUAAAADa2V5BwEAAAAYZ2V0TnVtYmVyQnlBZGRy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AAAAAAAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAVU3BvbnNvckZlZVRyYW5zYWN0aW9uBAAAAAlzcG9uc29yVHgFAAAAByRtYXRjaDADCQEAAAAbY2hlY2tJc1ZhbGlkTWluU3BvbnNvcmVkRmVlAAAAAQUAAAAJc3BvbnNvclR4CQAAZwAAAAIFAAAABWNvdW50AAAAAAAAAAADBwkAAGcAAAACBQAAAAVjb3VudAAAAAAAAAAAAxrJMsI=", "chainId": 84, "height": 1966278, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FCtNwUX7qPaJ17n29RghudgJwKS9sU8Gb4pgUvZw1mvB Next: G49CKWHdPTtjx4uyWRbooY3bihbp6cBjUkQBenFzeY4j Diff:
OldNewDifferences
9393
9494 let FeesManagerAddressKey = "fees_manager_address"
9595
96-func keyQuickSwapLimitDuration () = "%s__quickSwapLimitDuration"
97-
98-
9996 let PriceKey = "price"
10097
10198 let PriceIndexKey = "price_index"
165162 func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1)
166163
167164
168-func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP)
165+func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP)
169166
170167
171-func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP)
168+func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP)
172169
173170
174171 func feeManagerAddressREAD () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, FeesManagerAddressKey), (FeesManagerAddressKey + " is not specified"))), (FeesManagerAddressKey + " invalid address format"))
356353 }
357354
358355
359-func commonWithdraw (account,index,swapTxId,i) = {
360- let userAddress = addressFromStringValue(account)
361- let feeManagerAddress = feeManagerAddressREAD()
362- let dataArray = swapDataFailOrREAD(account, swapTxId)
363- let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight])
364- let swapType = dataArray[sIdxSwapType]
365- let inAmount = parseIntValue(dataArray[sIdxInAmount])
366- let swapStatus = dataArray[sIdxStatus]
367- let startHeight = parseIntValue(dataArray[sIdxStartHeight])
368- let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE)
356+func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapLimit) = {
357+ let minSwapAmount = minSwapAmountREAD(swapType)
369358 let totalLocked = totalLockedREAD(swapType)
370- let totalLockedByUser = totalLockedByUserREAD(swapType, account)
371- let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType)))
372- let indexHeight = getHeightPriceByIndex(index)
373- let prevIndexHeight = getHeightPriceByIndex((index - 1))
374- let priceByIndex = getPriceHistory(indexHeight)
375- let outAmountGrossTuple = if ((swapType == "waves"))
376- then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId)
377- else if ((swapType == "neutrino"))
378- then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit)
379- else throw(("Unsupported swap type " + swapType))
380- let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart)
381- let outNetAmount = payoutsArray[IdxNetAmount]
382- let outFeeAmount = payoutsArray[IdxFeeAmount]
383- if (isBlocked)
384- then emergencyShutdownFAIL()
385- else if ((swapStatus != "PENDING"))
386- then throw("swap has been already processed")
387- else if ((unlockHeight > height))
388- then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds"))
389- else if (if (if ((index > priceIndex))
390- then true
391- else (unlockHeight > indexHeight))
392- then true
393- else if ((prevIndexHeight != 0))
394- then (prevIndexHeight >= unlockHeight)
395- else false)
396- then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight)
397- else if ((0 >= payoutsArray[IdxGrossAmount]))
398- then throw("balance equals zero")
399- else if (if ((0 > outFeePart))
359+ let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr)
360+ let nodeAddress = getStakingNodeByIndex(0)
361+ let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
362+ let isSwapByNode = (nodeAddress == userAddressStr)
363+ let minBlocksBetweenSwaps = swapsTimeframeREAD()
364+ let amountCheck = if ((minSwapAmount > pmtAmount))
365+ then minSwapAmountFAIL(swapType, minSwapAmount)
366+ else true
367+ if ((amountCheck == amountCheck))
368+ then {
369+ let balanceLockMaxInterval = if (isSwapByNode)
370+ then nodeBalanceLockIntervalREAD()
371+ else balanceLockIntervalREAD(swapType)
372+ let selfUnlockHeight = (height + balanceLockMaxInterval)
373+ let swapUsdnVolume = if ((swapType == "neutrino"))
374+ then pmtAmount
375+ else convertWavesToNeutrino(pmtAmount, priceByIndex)
376+ let validateNodeIsCaller = if (isSwapByNode)
377+ then true
378+ else {
379+ let lastSwapHeight = getNumberByKey(keyUserLastSwapHeight(userAddressStr))
380+ if ((minBlocksBetweenSwaps > (height - lastSwapHeight)))
381+ then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((lastSwapHeight + minBlocksBetweenSwaps))))
382+ else if ((swapUsdnVolume > swapLimit))
383+ then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimit)))
384+ else true
385+ }
386+ if ((validateNodeIsCaller == validateNodeIsCaller))
387+ then if (isBlocked)
388+ then emergencyShutdownFAIL()
389+ else {
390+ let leasePart = if ((swapType == "waves"))
391+ then prepareUnleaseAndLease(0)
392+ else nil
393+ $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)
394+ }
395+ else throw("Strict value is not equal to itself.")
396+ }
397+ else throw("Strict value is not equal to itself.")
398+ }
399+
400+
401+@Callable(i)
402+func commonWithdraw (account,index,swapTxId,withdrawTxId) = {
403+ let checkCaller = thisOnly(i)
404+ if ((checkCaller == checkCaller))
405+ then {
406+ let userAddress = addressFromStringValue(account)
407+ let feeManagerAddress = feeManagerAddressREAD()
408+ let dataArray = swapDataFailOrREAD(account, swapTxId)
409+ let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight])
410+ let swapType = dataArray[sIdxSwapType]
411+ let inAmount = parseIntValue(dataArray[sIdxInAmount])
412+ let swapStatus = dataArray[sIdxStatus]
413+ let startHeight = parseIntValue(dataArray[sIdxStartHeight])
414+ let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE)
415+ let totalLocked = totalLockedREAD(swapType)
416+ let totalLockedByUser = totalLockedByUserREAD(swapType, account)
417+ let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType)))
418+ let indexHeight = getHeightPriceByIndex(index)
419+ let prevIndexHeight = getHeightPriceByIndex((index - 1))
420+ let priceByIndex = getPriceHistory(indexHeight)
421+ let outAmountGrossTuple = if ((swapType == "waves"))
422+ then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId)
423+ else if ((swapType == "neutrino"))
424+ then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit)
425+ else throw(("Unsupported swap type " + swapType))
426+ let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart)
427+ let outNetAmount = payoutsArray[IdxNetAmount]
428+ let outFeeAmount = payoutsArray[IdxFeeAmount]
429+ if (isBlocked)
430+ then emergencyShutdownFAIL()
431+ else if ((swapStatus != "PENDING"))
432+ then throw("swap has been already processed")
433+ else if ((unlockHeight > height))
434+ then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds"))
435+ else if (if (if ((index > priceIndex))
400436 then true
401- else (outFeePart >= PAULI))
402- then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart)))
403- else {
404- let leasePart = if (if ((swapType == "neutrino"))
405- then (outAmountGrossTuple._1 > 0)
406- else false)
407- then prepareUnleaseAndLease(outAmountGrossTuple._1)
408- else nil
409- $Tuple2((leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), ScriptTransfer(feeManagerAddress, outFeeAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, toBase58String(i.transactionId)))]), unit)
410- }
437+ else (unlockHeight > indexHeight))
438+ then true
439+ else if ((prevIndexHeight != 0))
440+ then (prevIndexHeight >= unlockHeight)
441+ else false)
442+ then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight)
443+ else if ((0 >= payoutsArray[IdxGrossAmount]))
444+ then throw("balance equals zero")
445+ else if (if ((0 > outFeePart))
446+ then true
447+ else (outFeePart >= PAULI))
448+ then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart)))
449+ else {
450+ let leasePart = if (if ((swapType == "neutrino"))
451+ then (outAmountGrossTuple._1 > 0)
452+ else false)
453+ then prepareUnleaseAndLease(outAmountGrossTuple._1)
454+ else nil
455+ let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(outAmountGrossTuple._2, outFeeAmount)])
456+ if ((nsbtStakingDeposit == nsbtStakingDeposit))
457+ then $Tuple2((leasePart ++ [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, toBase58String(i.transactionId)))]), unit)
458+ else throw("Strict value is not equal to itself.")
459+ }
460+ }
461+ else throw("Strict value is not equal to itself.")
411462 }
463+
412464
413465
414466 @Callable(i)
432484
433485
434486 @Callable(i)
435-func commonSwap (swapType,pmtAmount,userAddressStr,txId58) = {
436- let checkThisOriginCaller = if ((i.caller != this))
437- then throw("Permission denied. Wrong caller.")
438- else true
439- if ((checkThisOriginCaller == checkThisOriginCaller))
440- then {
441- let checkCaller = if ((i.originCaller != addressFromStringValue(userAddressStr)))
442- then throw("Permission denied. Wrong origin caller.")
443- else true
444- if ((checkCaller == checkCaller))
445- then {
446- let minSwapAmount = minSwapAmountREAD(swapType)
447- let totalLocked = totalLockedREAD(swapType)
448- let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr)
449- let nodeAddress = getStakingNodeByIndex(0)
450- let balanceLockMaxInterval = if ((nodeAddress == userAddressStr))
451- then nodeBalanceLockIntervalREAD()
452- else balanceLockIntervalREAD(swapType)
453- let selfUnlockHeight = (height + balanceLockMaxInterval)
454- let amountCheck = if ((minSwapAmount > pmtAmount))
455- then minSwapAmountFAIL(swapType, minSwapAmount)
456- else true
457- if ((amountCheck == amountCheck))
458- then {
459- let lastSwapHeight = getNumberByKey(keyUserLastQuickSwapHeight(userAddressStr))
460- let swapsTimeframeBlocks = swapsTimeframeREAD()
461- if ((swapsTimeframeBlocks > (height - lastSwapHeight)))
462- then throw(("You have exceeded swap limit for 24h! Next allowed swap height is " + toString((lastSwapHeight + swapsTimeframeBlocks))))
463- else {
464- let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0)
465- let quickSwapLimitTotal = asInt(invoke(mathContract, "calcSwapLimitMATH", [userGNsbtAmount], nil))
466- if ((quickSwapLimitTotal == quickSwapLimitTotal))
467- then {
468- let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
469- let swapUsdnVolume = if ((swapType == "neutrino"))
470- then pmtAmount
471- else convertWavesToNeutrino(pmtAmount, priceByIndex)
472- if ((swapUsdnVolume > quickSwapLimitTotal))
473- then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(quickSwapLimitTotal)))
474- else if (isBlocked)
475- then emergencyShutdownFAIL()
476- else {
477- let leasePart = if ((swapType == "waves"))
478- then prepareUnleaseAndLease(0)
479- else nil
480- $Tuple2(([IntegerEntry(keyQuickSwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastQuickSwapHeight(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)
481- }
482- }
483- else throw("Strict value is not equal to itself.")
484- }
485- }
486- else throw("Strict value is not equal to itself.")
487- }
488- else throw("Strict value is not equal to itself.")
489- }
490- else throw("Strict value is not equal to itself.")
491- }
492-
493-
494-
495-@Callable(i)
496487 func swapWavesToNeutrino () = {
497488 let pmt = value(i.payments[0])
498489 if (isDefined(pmt.assetId))
500491 else {
501492 let userAddress = toString(i.caller)
502493 let txId58 = toBase58String(i.transactionId)
503- let commonSwapInv = invoke(this, "commonSwap", ["waves", pmt.amount, userAddress, txId58], nil)
504- if ((commonSwapInv == commonSwapInv))
505- then nil
506- else throw("Strict value is not equal to itself.")
494+ let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddress)), 0)
495+ let swapLimit = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [userGNsbtAmount], nil))
496+ let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapLimit)
497+ commonSwapResult
507498 }
508499 }
509500
517508 else {
518509 let userAddress = toString(i.caller)
519510 let txId58 = toBase58String(i.transactionId)
520- let commonSwapInv = invoke(this, "commonSwap", ["neutrino", pmt.amount, userAddress, txId58], nil)
521- if ((commonSwapInv == commonSwapInv))
522- then nil
523- else throw("Strict value is not equal to itself.")
511+ let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddress)), 0)
512+ let swapLimitTotal = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [userGNsbtAmount], nil))
513+ let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapLimitTotal)
514+ commonSwapResult
524515 }
525516 }
526517
527518
528519
529520 @Callable(i)
530-func withdraw (account,index,swapTxId) = commonWithdraw(account, index, swapTxId, i)
521+func withdraw (account,index,swapTxId) = {
522+ let commonWithdrawInv = invoke(this, "commonWithdraw", [account, index, swapTxId, toBase58String(i.transactionId)], nil)
523+ if ((commonWithdrawInv == commonWithdrawInv))
524+ then nil
525+ else throw("Strict value is not equal to itself.")
526+ }
531527
532528
533529
534530 @Callable(i)
535531 func transferToAuction () = {
536- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
532+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
537533 let reserve = asInt(neutrinoMetrics[3])
538534 let neutrinoSupply = asInt(neutrinoMetrics[5])
539535 let surplus = asInt(neutrinoMetrics[6])
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getNumberByKey (key) = valueOrElse(getInteger(this, key), 0)
55
66
77 func getStringByKey (key) = valueOrElse(getString(this, key), "")
88
99
1010 func getBoolByKey (key) = valueOrElse(getBoolean(this, key), false)
1111
1212
1313 func getNumberByAddressAndKey (address,key) = valueOrElse(getInteger(addressFromStringValue(address), key), 0)
1414
1515
1616 func getStringByAddressAndKey (address,key) = valueOrElse(getString(addressFromStringValue(address), key), "")
1717
1818
1919 func getBoolByAddressAndKey (address,key) = valueOrElse(getBoolean(addressFromStringValue(address), key), false)
2020
2121
2222 func asAnyList (val) = match val {
2323 case valAnyLyst: List[Any] =>
2424 valAnyLyst
2525 case _ =>
2626 throw("fail to cast into List[Any]")
2727 }
2828
2929
3030 func asString (val) = match val {
3131 case valStr: String =>
3232 valStr
3333 case _ =>
3434 throw("fail to cast into String")
3535 }
3636
3737
3838 func asInt (val) = match val {
3939 case valInt: Int =>
4040 valInt
4141 case _ =>
4242 throw("fail to cast into Int")
4343 }
4444
4545
4646 let pubKeyAdminsList = ["ExtEEK19nmKj9mCpnWyvEEJFYATLMcVEMvohhUHkyHNm", "Ev5py5FfBQX9cZpYKnfQrTB49Byf8QmpZWeDVRim4yV7", "DUuuLjXu98nBwZc7fqwCTjtA3nnRwgTbkMSr5SU2NmDR", "5WRXFSjwcTbNfKcJs8ZqXmSSWYsSVJUtMvMqZj5hH4Nc"]
4747
4848 let SEP = "__"
4949
5050 let WAVELET = 100000000
5151
5252 let PAULI = 1000000
5353
5454 let PRICELET = 1000000
5555
5656 let DEFAULTSWAPFEE = 20000
5757
5858 let IdxNetAmount = 0
5959
6060 let IdxFeeAmount = 1
6161
6262 let IdxGrossAmount = 2
6363
6464 let NeutrinoAssetIdKey = "neutrino_asset_id"
6565
6666 let BondAssetIdKey = "bond_asset_id"
6767
6868 let AuctionContractKey = "auction_contract"
6969
7070 let NsbtStakingContractKey = "nsbtStakingContract"
7171
7272 let LiquidationContractKey = "liquidation_contract"
7373
7474 let RPDContractKey = "rpd_contract"
7575
7676 let ContolContractKey = "control_contract"
7777
7878 let MathContractKey = "math_contract"
7979
8080 let BalanceWavesLockIntervalKey = "balance_waves_lock_interval"
8181
8282 let BalanceNeutrinoLockIntervalKey = "balance_neutrino_lock_interval"
8383
8484 let MinWavesSwapAmountKey = "min_waves_swap_amount"
8585
8686 let MinNeutrinoSwapAmountKey = "min_neutrino_swap_amount"
8787
8888 let NodeOracleProviderPubKeyKey = "node_oracle_provider"
8989
9090 let NeutrinoOutFeePartKey = "neutrinoOut_swap_feePart"
9191
9292 let WavesOutFeePartKey = "wavesOut_swap_feePart"
9393
9494 let FeesManagerAddressKey = "fees_manager_address"
9595
96-func keyQuickSwapLimitDuration () = "%s__quickSwapLimitDuration"
97-
98-
9996 let PriceKey = "price"
10097
10198 let PriceIndexKey = "price_index"
10299
103100 let IsBlockedKey = "is_blocked"
104101
105102 func getPriceHistoryKey (block) = ((PriceKey + "_") + toString(block))
106103
107104
108105 func getHeightPriceByIndexKey (index) = ((PriceIndexKey + "_") + toString(index))
109106
110107
111108 func getStakingNodeByIndex (idx) = getStringByKey(makeString(["%s%d%s", "lease", toString(idx), "nodeAddress"], SEP))
112109
113110
114111 func getStakingNodeAddressByIndex (idx) = addressFromStringValue(getStakingNodeByIndex(idx))
115112
116113
117114 func getReservedAmountForSponsorship () = valueOrElse(getInteger(this, makeString(["%s%s", "lease", "sponsorshipWavesReserve"], SEP)), (1000 * WAVELET))
118115
119116
120117 func getBalanceUnlockBlockKey (owner) = ("balance_unlock_block_" + owner)
121118
122119
123120 func getLeaseIdKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "id"], SEP)
124121
125122
126123 func getLeaseAmountKey (nodeIndex) = makeString(["%s%d%s", "lease", toString(nodeIndex), "amount"], SEP)
127124
128125
129126 func minSwapAmountKEY (swapType) = (("min_" + swapType) + "_swap_amount")
130127
131128
132129 func totalLockedKEY (swapType) = ("balance_lock_" + swapType)
133130
134131
135132 func totalLockedByUserKEY (swapType,owner) = makeString(["balance_lock", swapType, owner], "_")
136133
137134
138135 func balanceLockIntervalKEY (swapType) = (("balance_" + swapType) + "_lock_interval")
139136
140137
141138 func nodeBalanceLockIntervalKEY () = "balance_node_lock_interval"
142139
143140
144141 func outFeePartKEY (swapType) = (swapType + "Out_swap_feePart")
145142
146143
147144 func swapsTimeframeKEY () = "swaps_timeframe"
148145
149146
150147 func minSwapAmountREAD (swapType) = valueOrElse(getInteger(this, minSwapAmountKEY(swapType)), 0)
151148
152149
153150 func swapsTimeframeREAD () = valueOrElse(getInteger(this, swapsTimeframeKEY()), 1440)
154151
155152
156153 func totalLockedREAD (swapType) = valueOrElse(getInteger(this, totalLockedKEY(swapType)), 0)
157154
158155
159156 func totalLockedByUserREAD (swapType,owner) = valueOrElse(getInteger(this, totalLockedByUserKEY(swapType, owner)), 0)
160157
161158
162159 func balanceLockIntervalREAD (swapType) = valueOrElse(getInteger(this, balanceLockIntervalKEY(swapType)), 1440)
163160
164161
165162 func nodeBalanceLockIntervalREAD () = valueOrElse(getInteger(this, nodeBalanceLockIntervalKEY()), 1)
166163
167164
168-func keyQuickSwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "quickSwapUserSpentInPeriod", userAddress], SEP)
165+func keySwapUserSpentInPeriod (userAddress) = makeString(["%s%s", "swapUserSpentInPeriod", userAddress], SEP)
169166
170167
171-func keyUserLastQuickSwapHeight (userAddress) = makeString(["%s%s", "userLastQuickSwapHeight", userAddress], SEP)
168+func keyUserLastSwapHeight (userAddress) = makeString(["%s%s", "userLastSwapHeight", userAddress], SEP)
172169
173170
174171 func feeManagerAddressREAD () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, FeesManagerAddressKey), (FeesManagerAddressKey + " is not specified"))), (FeesManagerAddressKey + " invalid address format"))
175172
176173
177174 func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, PRICELET, price), WAVELET, PAULI)
178175
179176
180177 func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, PRICELET), PAULI, WAVELET)
181178
182179
183180 func convertWavesToBond (amount,price) = convertWavesToNeutrino(amount, price)
184181
185182
186183 func convertJsonArrayToList (jsonArray) = split(jsonArray, ",")
187184
188185
189186 func minSwapAmountFAIL (swapType,minSwapAmount) = throw(((("The specified amount in " + swapType) + " swap is less than the required minimum of ") + toString(minSwapAmount)))
190187
191188
192189 func emergencyShutdownFAIL () = throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
193190
194191
195192 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)))
196193
197194
198195 let liquidationContract = getStringByKey(LiquidationContractKey)
199196
200197 let nsbtStakingContractStr = getStringByKey(NsbtStakingContractKey)
201198
202199 let neutrinoAssetId = fromBase58String(getStringByKey(NeutrinoAssetIdKey))
203200
204201 let auctionContract = getStringByKey(AuctionContractKey)
205202
206203 let rpdContract = getStringByKey(RPDContractKey)
207204
208205 let controlContract = getStringByKey(ContolContractKey)
209206
210207 let mathContractAddress = getStringByKey(MathContractKey)
211208
212209 let priceIndex = getNumberByAddressAndKey(controlContract, PriceIndexKey)
213210
214211 let isBlocked = getBoolByAddressAndKey(controlContract, IsBlockedKey)
215212
216213 let nodeOracleProviderPubKey = fromBase58String(getStringByKey(NodeOracleProviderPubKeyKey))
217214
218215 let bondAssetId = fromBase58String("F3iaxzruFeKujfVfYSZEkejpjh67wmRfPCRHiNmWKp3Z")
219216
220217 let deprecatedBondAssetId = fromBase58String("975akZBfnMj513U7MZaHKzQrmsEx5aE3wdWKTrHBhbjF")
221218
222219 let neutrinoContract = this
223220
224221 let mathContract = addressFromStringValue(mathContractAddress)
225222
226223 let nsbtStakingContract = addressFromStringValue(nsbtStakingContractStr)
227224
228225 let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey)
229226
230227 func checkIsValidMinSponsoredFee (tx) = {
231228 let MINTRANSFERFEE = 100000
232229 let SponsoredFeeUpperBound = 1000
233230 let realNeutrinoFee = convertWavesToNeutrino(MINTRANSFERFEE, currentPrice)
234231 let minNeutrinoFee = (realNeutrinoFee * 2)
235232 let maxNeutrinoFee = fraction(realNeutrinoFee, SponsoredFeeUpperBound, 100)
236233 let inputFee = value(tx.minSponsoredAssetFee)
237234 if (if ((inputFee >= minNeutrinoFee))
238235 then (maxNeutrinoFee >= inputFee)
239236 else false)
240237 then (tx.assetId == neutrinoAssetId)
241238 else false
242239 }
243240
244241
245242 func getPriceHistory (block) = getNumberByAddressAndKey(controlContract, getPriceHistoryKey(block))
246243
247244
248245 func getHeightPriceByIndex (index) = getNumberByAddressAndKey(controlContract, getHeightPriceByIndexKey(index))
249246
250247
251248 func keyLockParamUserAmount (userAddress) = makeString(["%s%s%s", "paramByUser", userAddress, "amount"], SEP)
252249
253250
254251 let sIdxSwapType = 1
255252
256253 let sIdxStatus = 2
257254
258255 let sIdxInAmount = 3
259256
260257 let sIdxPrice = 4
261258
262259 let sIdxOutNetAmount = 5
263260
264261 let sIdxOutFeeAmount = 6
265262
266263 let sIdxStartHeight = 7
267264
268265 let sIdxStartTimestamp = 8
269266
270267 let sIdxEndHeight = 9
271268
272269 let sIdxEndTimestamp = 10
273270
274271 let sIdxSelfUnlockHeight = 11
275272
276273 let sIdxRandUnlockHeight = 12
277274
278275 let sIdxIndex = 13
279276
280277 let sIdxWithdrawTxId = 14
281278
282279 let sIdxMinRand = 15
283280
284281 let sIdxMaxRand = 16
285282
286283 func swapKEY (userAddress,txId) = makeString(["%s%s", userAddress, txId], SEP)
287284
288285
289286 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)
290287
291288
292289 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")
293290
294291
295292 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])
296293
297294
298295 func swapDataFailOrREAD (userAddress,swapTxId) = {
299296 let swapKey = swapKEY(userAddress, swapTxId)
300297 split(valueOrErrorMessage(getString(this, swapKey), ("no swap data for " + swapKey)), SEP)
301298 }
302299
303300
304301 func applyFees (amountGross,feePart) = {
305302 let feeAmount = fraction(amountGross, feePart, PAULI)
306303 [(amountGross - feeAmount), feeAmount, amountGross]
307304 }
308305
309306
310307 func abs (x) = if ((0 > x))
311308 then -(x)
312309 else x
313310
314311
315312 func selectNode (unleaseAmount) = {
316313 let amountToLease = ((wavesBalance(neutrinoContract).available - unleaseAmount) - getReservedAmountForSponsorship())
317314 let oldLeased0 = getNumberByKey(getLeaseAmountKey(0))
318315 let oldLeased1 = getNumberByKey(getLeaseAmountKey(1))
319316 let newLeased0 = (amountToLease + oldLeased0)
320317 let newLeased1 = (amountToLease + oldLeased1)
321318 if (if ((newLeased0 > 0))
322319 then true
323320 else (newLeased1 > 0))
324321 then {
325322 let delta0 = abs((newLeased0 - oldLeased1))
326323 let delta1 = abs((newLeased1 - oldLeased0))
327324 if ((delta1 >= delta0))
328325 then $Tuple2(0, newLeased0)
329326 else $Tuple2(1, newLeased1)
330327 }
331328 else $Tuple2(-1, 0)
332329 }
333330
334331
335332 func thisOnly (i) = if ((i.caller != this))
336333 then throw("Permission denied: this contract only allowed")
337334 else true
338335
339336
340337 func prepareUnleaseAndLease (unleaseAmount) = {
341338 let nodeTuple = selectNode(unleaseAmount)
342339 let nodeIndex = nodeTuple._1
343340 let newLeaseAmount = nodeTuple._2
344341 if ((newLeaseAmount > 0))
345342 then {
346343 let leaseIdKey = getLeaseIdKey(nodeIndex)
347344 let oldLease = getBinary(this, leaseIdKey)
348345 let unleaseOrEmpty = if (isDefined(oldLease))
349346 then [LeaseCancel(value(oldLease))]
350347 else nil
351348 let leaseAmountKey = getLeaseAmountKey(nodeIndex)
352349 let lease = Lease(getStakingNodeAddressByIndex(nodeIndex), newLeaseAmount)
353350 (unleaseOrEmpty ++ [lease, BinaryEntry(leaseIdKey, calculateLeaseId(lease)), IntegerEntry(getLeaseAmountKey(nodeIndex), newLeaseAmount)])
354351 }
355352 else nil
356353 }
357354
358355
359-func commonWithdraw (account,index,swapTxId,i) = {
360- let userAddress = addressFromStringValue(account)
361- let feeManagerAddress = feeManagerAddressREAD()
362- let dataArray = swapDataFailOrREAD(account, swapTxId)
363- let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight])
364- let swapType = dataArray[sIdxSwapType]
365- let inAmount = parseIntValue(dataArray[sIdxInAmount])
366- let swapStatus = dataArray[sIdxStatus]
367- let startHeight = parseIntValue(dataArray[sIdxStartHeight])
368- let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE)
356+func commonSwap (swapType,pmtAmount,userAddressStr,txId58,swapLimit) = {
357+ let minSwapAmount = minSwapAmountREAD(swapType)
369358 let totalLocked = totalLockedREAD(swapType)
370- let totalLockedByUser = totalLockedByUserREAD(swapType, account)
371- let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType)))
372- let indexHeight = getHeightPriceByIndex(index)
373- let prevIndexHeight = getHeightPriceByIndex((index - 1))
374- let priceByIndex = getPriceHistory(indexHeight)
375- let outAmountGrossTuple = if ((swapType == "waves"))
376- then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId)
377- else if ((swapType == "neutrino"))
378- then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit)
379- else throw(("Unsupported swap type " + swapType))
380- let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart)
381- let outNetAmount = payoutsArray[IdxNetAmount]
382- let outFeeAmount = payoutsArray[IdxFeeAmount]
383- if (isBlocked)
384- then emergencyShutdownFAIL()
385- else if ((swapStatus != "PENDING"))
386- then throw("swap has been already processed")
387- else if ((unlockHeight > height))
388- then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds"))
389- else if (if (if ((index > priceIndex))
390- then true
391- else (unlockHeight > indexHeight))
392- then true
393- else if ((prevIndexHeight != 0))
394- then (prevIndexHeight >= unlockHeight)
395- else false)
396- then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight)
397- else if ((0 >= payoutsArray[IdxGrossAmount]))
398- then throw("balance equals zero")
399- else if (if ((0 > outFeePart))
359+ let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr)
360+ let nodeAddress = getStakingNodeByIndex(0)
361+ let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
362+ let isSwapByNode = (nodeAddress == userAddressStr)
363+ let minBlocksBetweenSwaps = swapsTimeframeREAD()
364+ let amountCheck = if ((minSwapAmount > pmtAmount))
365+ then minSwapAmountFAIL(swapType, minSwapAmount)
366+ else true
367+ if ((amountCheck == amountCheck))
368+ then {
369+ let balanceLockMaxInterval = if (isSwapByNode)
370+ then nodeBalanceLockIntervalREAD()
371+ else balanceLockIntervalREAD(swapType)
372+ let selfUnlockHeight = (height + balanceLockMaxInterval)
373+ let swapUsdnVolume = if ((swapType == "neutrino"))
374+ then pmtAmount
375+ else convertWavesToNeutrino(pmtAmount, priceByIndex)
376+ let validateNodeIsCaller = if (isSwapByNode)
377+ then true
378+ else {
379+ let lastSwapHeight = getNumberByKey(keyUserLastSwapHeight(userAddressStr))
380+ if ((minBlocksBetweenSwaps > (height - lastSwapHeight)))
381+ then throw(("You have exceeded swap limit! Next allowed swap height is " + toString((lastSwapHeight + minBlocksBetweenSwaps))))
382+ else if ((swapUsdnVolume > swapLimit))
383+ then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(swapLimit)))
384+ else true
385+ }
386+ if ((validateNodeIsCaller == validateNodeIsCaller))
387+ then if (isBlocked)
388+ then emergencyShutdownFAIL()
389+ else {
390+ let leasePart = if ((swapType == "waves"))
391+ then prepareUnleaseAndLease(0)
392+ else nil
393+ $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)
394+ }
395+ else throw("Strict value is not equal to itself.")
396+ }
397+ else throw("Strict value is not equal to itself.")
398+ }
399+
400+
401+@Callable(i)
402+func commonWithdraw (account,index,swapTxId,withdrawTxId) = {
403+ let checkCaller = thisOnly(i)
404+ if ((checkCaller == checkCaller))
405+ then {
406+ let userAddress = addressFromStringValue(account)
407+ let feeManagerAddress = feeManagerAddressREAD()
408+ let dataArray = swapDataFailOrREAD(account, swapTxId)
409+ let selfUnlockHeight = parseIntValue(dataArray[sIdxSelfUnlockHeight])
410+ let swapType = dataArray[sIdxSwapType]
411+ let inAmount = parseIntValue(dataArray[sIdxInAmount])
412+ let swapStatus = dataArray[sIdxStatus]
413+ let startHeight = parseIntValue(dataArray[sIdxStartHeight])
414+ let outFeePart = valueOrElse(getInteger(this, outFeePartKEY(swapType)), DEFAULTSWAPFEE)
415+ let totalLocked = totalLockedREAD(swapType)
416+ let totalLockedByUser = totalLockedByUserREAD(swapType, account)
417+ let unlockHeight = (startHeight + getIntegerValue(this, balanceLockIntervalKEY(swapType)))
418+ let indexHeight = getHeightPriceByIndex(index)
419+ let prevIndexHeight = getHeightPriceByIndex((index - 1))
420+ let priceByIndex = getPriceHistory(indexHeight)
421+ let outAmountGrossTuple = if ((swapType == "waves"))
422+ then $Tuple2(convertWavesToNeutrino(inAmount, priceByIndex), neutrinoAssetId)
423+ else if ((swapType == "neutrino"))
424+ then $Tuple2(convertNeutrinoToWaves(inAmount, priceByIndex), unit)
425+ else throw(("Unsupported swap type " + swapType))
426+ let payoutsArray = applyFees(outAmountGrossTuple._1, outFeePart)
427+ let outNetAmount = payoutsArray[IdxNetAmount]
428+ let outFeeAmount = payoutsArray[IdxFeeAmount]
429+ if (isBlocked)
430+ then emergencyShutdownFAIL()
431+ else if ((swapStatus != "PENDING"))
432+ then throw("swap has been already processed")
433+ else if ((unlockHeight > height))
434+ then throw((("please wait for: " + toString(unlockHeight)) + " block height to withdraw funds"))
435+ else if (if (if ((index > priceIndex))
400436 then true
401- else (outFeePart >= PAULI))
402- then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart)))
403- else {
404- let leasePart = if (if ((swapType == "neutrino"))
405- then (outAmountGrossTuple._1 > 0)
406- else false)
407- then prepareUnleaseAndLease(outAmountGrossTuple._1)
408- else nil
409- $Tuple2((leasePart ++ [IntegerEntry(totalLockedByUserKEY(swapType, account), (totalLockedByUser - inAmount)), IntegerEntry(totalLockedKEY(swapType), (totalLocked - inAmount)), ScriptTransfer(userAddress, outNetAmount, outAmountGrossTuple._2), ScriptTransfer(feeManagerAddress, outFeeAmount, outAmountGrossTuple._2), StringEntry(swapKEY(account, swapTxId), finishSwapDATA(dataArray, priceByIndex, outNetAmount, outFeeAmount, unlockHeight, index, toBase58String(i.transactionId)))]), unit)
410- }
437+ else (unlockHeight > indexHeight))
438+ then true
439+ else if ((prevIndexHeight != 0))
440+ then (prevIndexHeight >= unlockHeight)
441+ else false)
442+ then priceIndexFAIL(index, priceIndex, indexHeight, unlockHeight, prevIndexHeight)
443+ else if ((0 >= payoutsArray[IdxGrossAmount]))
444+ then throw("balance equals zero")
445+ else if (if ((0 > outFeePart))
446+ then true
447+ else (outFeePart >= PAULI))
448+ then throw(((("invalid outFeePart config for " + swapType) + " swap: outFeePart=") + toString(outFeePart)))
449+ else {
450+ let leasePart = if (if ((swapType == "neutrino"))
451+ then (outAmountGrossTuple._1 > 0)
452+ else false)
453+ then prepareUnleaseAndLease(outAmountGrossTuple._1)
454+ else nil
455+ let nsbtStakingDeposit = invoke(nsbtStakingContract, "deposit", nil, [AttachedPayment(outAmountGrossTuple._2, outFeeAmount)])
456+ if ((nsbtStakingDeposit == nsbtStakingDeposit))
457+ then $Tuple2((leasePart ++ [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, toBase58String(i.transactionId)))]), unit)
458+ else throw("Strict value is not equal to itself.")
459+ }
460+ }
461+ else throw("Strict value is not equal to itself.")
411462 }
463+
412464
413465
414466 @Callable(i)
415467 func constructor (neutrinoAssetIdPrm,bondAssetIdPrm,auctionContractPrm,liquidationContractPrm,rpdContractPrm,nodeOracleProviderPubKeyPrm,balanceWavesLockIntervalPrm,balanceNeutrinoLockIntervalPrm,minWavesSwapAmountPrm,minNeutrinoSwapAmountPrm,neutrinoOutFeePartPrm,wavesOutFeePartPrm) = {
416468 let checkCaller = thisOnly(i)
417469 if ((checkCaller == checkCaller))
418470 then [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)]
419471 else throw("Strict value is not equal to itself.")
420472 }
421473
422474
423475
424476 @Callable(i)
425477 func constructorV2 (mathContract,nsbtStakingContract,swapsTimeframeBlocks) = {
426478 let checkCaller = thisOnly(i)
427479 if ((checkCaller == checkCaller))
428480 then [StringEntry(MathContractKey, mathContract), StringEntry(NsbtStakingContractKey, nsbtStakingContract), IntegerEntry(swapsTimeframeKEY(), swapsTimeframeBlocks)]
429481 else throw("Strict value is not equal to itself.")
430482 }
431483
432484
433485
434486 @Callable(i)
435-func commonSwap (swapType,pmtAmount,userAddressStr,txId58) = {
436- let checkThisOriginCaller = if ((i.caller != this))
437- then throw("Permission denied. Wrong caller.")
438- else true
439- if ((checkThisOriginCaller == checkThisOriginCaller))
440- then {
441- let checkCaller = if ((i.originCaller != addressFromStringValue(userAddressStr)))
442- then throw("Permission denied. Wrong origin caller.")
443- else true
444- if ((checkCaller == checkCaller))
445- then {
446- let minSwapAmount = minSwapAmountREAD(swapType)
447- let totalLocked = totalLockedREAD(swapType)
448- let totalLockedByUser = totalLockedByUserREAD(swapType, userAddressStr)
449- let nodeAddress = getStakingNodeByIndex(0)
450- let balanceLockMaxInterval = if ((nodeAddress == userAddressStr))
451- then nodeBalanceLockIntervalREAD()
452- else balanceLockIntervalREAD(swapType)
453- let selfUnlockHeight = (height + balanceLockMaxInterval)
454- let amountCheck = if ((minSwapAmount > pmtAmount))
455- then minSwapAmountFAIL(swapType, minSwapAmount)
456- else true
457- if ((amountCheck == amountCheck))
458- then {
459- let lastSwapHeight = getNumberByKey(keyUserLastQuickSwapHeight(userAddressStr))
460- let swapsTimeframeBlocks = swapsTimeframeREAD()
461- if ((swapsTimeframeBlocks > (height - lastSwapHeight)))
462- then throw(("You have exceeded swap limit for 24h! Next allowed swap height is " + toString((lastSwapHeight + swapsTimeframeBlocks))))
463- else {
464- let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddressStr)), 0)
465- let quickSwapLimitTotal = asInt(invoke(mathContract, "calcSwapLimitMATH", [userGNsbtAmount], nil))
466- if ((quickSwapLimitTotal == quickSwapLimitTotal))
467- then {
468- let priceByIndex = getPriceHistory(getHeightPriceByIndex(priceIndex))
469- let swapUsdnVolume = if ((swapType == "neutrino"))
470- then pmtAmount
471- else convertWavesToNeutrino(pmtAmount, priceByIndex)
472- if ((swapUsdnVolume > quickSwapLimitTotal))
473- then throw(((("You have exceeded your swap limit! Requested: " + toString(swapUsdnVolume)) + ", available: ") + toString(quickSwapLimitTotal)))
474- else if (isBlocked)
475- then emergencyShutdownFAIL()
476- else {
477- let leasePart = if ((swapType == "waves"))
478- then prepareUnleaseAndLease(0)
479- else nil
480- $Tuple2(([IntegerEntry(keyQuickSwapUserSpentInPeriod(userAddressStr), swapUsdnVolume), IntegerEntry(keyUserLastQuickSwapHeight(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)
481- }
482- }
483- else throw("Strict value is not equal to itself.")
484- }
485- }
486- else throw("Strict value is not equal to itself.")
487- }
488- else throw("Strict value is not equal to itself.")
489- }
490- else throw("Strict value is not equal to itself.")
491- }
492-
493-
494-
495-@Callable(i)
496487 func swapWavesToNeutrino () = {
497488 let pmt = value(i.payments[0])
498489 if (isDefined(pmt.assetId))
499490 then throw("Only Waves token is allowed for swapping.")
500491 else {
501492 let userAddress = toString(i.caller)
502493 let txId58 = toBase58String(i.transactionId)
503- let commonSwapInv = invoke(this, "commonSwap", ["waves", pmt.amount, userAddress, txId58], nil)
504- if ((commonSwapInv == commonSwapInv))
505- then nil
506- else throw("Strict value is not equal to itself.")
494+ let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddress)), 0)
495+ let swapLimit = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [userGNsbtAmount], nil))
496+ let commonSwapResult = commonSwap("waves", pmt.amount, userAddress, txId58, swapLimit)
497+ commonSwapResult
507498 }
508499 }
509500
510501
511502
512503 @Callable(i)
513504 func swapNeutrinoToWaves () = {
514505 let pmt = value(i.payments[0])
515506 if ((pmt.assetId != neutrinoAssetId))
516507 then throw("Only appropriate Neutrino tokens are allowed for swapping.")
517508 else {
518509 let userAddress = toString(i.caller)
519510 let txId58 = toBase58String(i.transactionId)
520- let commonSwapInv = invoke(this, "commonSwap", ["neutrino", pmt.amount, userAddress, txId58], nil)
521- if ((commonSwapInv == commonSwapInv))
522- then nil
523- else throw("Strict value is not equal to itself.")
511+ let userGNsbtAmount = valueOrElse(getInteger(nsbtStakingContract, keyLockParamUserAmount(userAddress)), 0)
512+ let swapLimitTotal = asInt(invoke(mathContract, "calcSwapLimitREADONLY", [userGNsbtAmount], nil))
513+ let commonSwapResult = commonSwap("neutrino", pmt.amount, userAddress, txId58, swapLimitTotal)
514+ commonSwapResult
524515 }
525516 }
526517
527518
528519
529520 @Callable(i)
530-func withdraw (account,index,swapTxId) = commonWithdraw(account, index, swapTxId, i)
521+func withdraw (account,index,swapTxId) = {
522+ let commonWithdrawInv = invoke(this, "commonWithdraw", [account, index, swapTxId, toBase58String(i.transactionId)], nil)
523+ if ((commonWithdrawInv == commonWithdrawInv))
524+ then nil
525+ else throw("Strict value is not equal to itself.")
526+ }
531527
532528
533529
534530 @Callable(i)
535531 func transferToAuction () = {
536- let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsMATH", nil, nil))
532+ let neutrinoMetrics = asAnyList(invoke(mathContract, "calcNeutinoMetricsREADONLY", nil, nil))
537533 let reserve = asInt(neutrinoMetrics[3])
538534 let neutrinoSupply = asInt(neutrinoMetrics[5])
539535 let surplus = asInt(neutrinoMetrics[6])
540536 let nsbtSupply = asInt(neutrinoMetrics[9])
541537 let auctionNBAmount = (neutrinoSupply - assetBalance(addressFromStringValue(auctionContract), bondAssetId))
542538 let surplusWithLiquidation = (surplus - assetBalance(addressFromStringValue(liquidationContract), neutrinoAssetId))
543539 if (isBlocked)
544540 then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles")
545541 else if ((auctionNBAmount > (1 * PAULI)))
546542 then [ScriptTransfer(addressFromStringValue(auctionContract), auctionNBAmount, bondAssetId)]
547543 else if ((surplusWithLiquidation >= (1 * PAULI)))
548544 then [ScriptTransfer(addressFromStringValue(liquidationContract), surplusWithLiquidation, neutrinoAssetId)]
549545 else throw(((((((("bond were generated or do not need it. Deficit:" + toString(auctionNBAmount)) + "|") + toString(0)) + ". Surplus:") + toString(surplusWithLiquidation)) + "|") + toString(surplus)))
550546 }
551547
552548
553549
554550 @Callable(i)
555551 func transferUsdnToUser (amount,addr) = if ((i.caller != addressFromStringValue(auctionContract)))
556552 then throw("Only auction contract is authorized")
557553 else [ScriptTransfer(addressFromStringValue(addr), amount, neutrinoAssetId)]
558554
559555
560556
561557 @Callable(i)
562558 func acceptWaves () = if ((i.caller != addressFromStringValue(auctionContract)))
563559 then throw("Currently only auction contract is allowed to call")
564560 else $Tuple2(prepareUnleaseAndLease(0), "success")
565561
566562
567563 @Verifier(tx)
568564 func verify () = {
569565 let id = toBase58String(tx.id)
570566 let count = ((((if (sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(pubKeyAdminsList[0])))
571567 then 1
572568 else 0) + (if (sigVerify(tx.bodyBytes, tx.proofs[1], fromBase58String(pubKeyAdminsList[1])))
573569 then 1
574570 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[2], fromBase58String(pubKeyAdminsList[2])))
575571 then 1
576572 else 0)) + (if (sigVerify(tx.bodyBytes, tx.proofs[3], fromBase58String(pubKeyAdminsList[3])))
577573 then 2
578574 else 0))
579575 match tx {
580576 case sponsorTx: SponsorFeeTransaction =>
581577 if (checkIsValidMinSponsoredFee(sponsorTx))
582578 then (count >= 3)
583579 else false
584580 case _ =>
585581 (count >= 3)
586582 }
587583 }
588584

github/deemru/w8io/026f985 
71.95 ms