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