diff --git a/ride/factory_v2.ride b/ride/factory_v2.ride index 1a476a255..03b82120f 100644 --- a/ride/factory_v2.ride +++ b/ride/factory_v2.ride @@ -23,10 +23,10 @@ let wavesString = "WAVES" let decimalsMultPrice = 100 * 1000 * 1000 # 10^8 let SEP = "__" let EMPTY = "" -let PoolActive = 1 # ACTIVE, pool without restrictions -let PoolPutDisabled = 2 # PUT DISABLED, pool with put operation disabled -let PoolMatcherDisabled = 3 # MATCHER DISABLED, pool with matcher operations disabled -let PoolShutdown = 4 # SHUTDOWN, pool operations halted +let PoolActive = 1 # ACTIVE, pool without restrictions +let PoolPutDisabled = 2 # PUT DISABLED, pool with put operation disabled +let PoolPutAndMatcherDisabled = 3 # PUT AND MATCHER DISABLED, pool with put and matcher operations disabled +let PoolShutdown = 4 # SHUTDOWN, pool operations halted let idxInternalAssetId = 1 let idxResutActions = 2 diff --git a/ride/lp.ride b/ride/lp.ride index 92621fa5d..c7077603f 100644 --- a/ride/lp.ride +++ b/ride/lp.ride @@ -51,10 +51,10 @@ let big2 = 2.toBigInt() let wavesString = "WAVES" let SEP = "__" -let PoolActive = 1 # ACTIVE, pool without restrictions -let PoolPutDisabled = 2 # PUT DISABLED, pool with put operation disabled -let PoolMatcherDisabled = 3 # MATCHER DISABLED, pool with matcher operations disabled -let PoolShutdown = 4 # SHUTDOWN, pool operations halted +let PoolActive = 1 # ACTIVE, pool without restrictions +let PoolPutDisabled = 2 # PUT DISABLED, pool with put operation disabled +let PoolPutAndMatcherDisabled = 3 # PUT AND MATCHER DISABLED, pool with put and matcher operations disabled +let PoolShutdown = 4 # SHUTDOWN, pool operations halted # data indexes from pool config stored in factory let idxPoolAddress = 1 let idxPoolStatus = 2 @@ -686,7 +686,11 @@ func validateMatcherOrderAllowed(order: Order) = { } # validate status - if (isGlobalShutdown() || cfgPoolStatus == PoolMatcherDisabled || cfgPoolStatus == PoolShutdown) then throw("Exchange operations disabled") else + if ( + isGlobalShutdown() || + cfgPoolStatus == PoolPutAndMatcherDisabled || + cfgPoolStatus == PoolShutdown + ) then throw("Exchange operations disabled") else # validate pairs if (order.assetPair.amountAsset != cfgAmountAssetId || order.assetPair.priceAsset != cfgPriceAssetId) then throw("Wrong order assets.") else @@ -752,7 +756,12 @@ func commonPut(i: Invocation, slippageTolerance: Int, emitLp: Boolean) = { emitLp) let poolStatus = estPut._8.parseIntValue() - if(isGlobalShutdown() || poolStatus == PoolPutDisabled || poolStatus == PoolShutdown) then throw("Put operation is blocked by admin. Status = " + poolStatus.toString()) else + if( + isGlobalShutdown() || + poolStatus == PoolPutDisabled || + poolStatus == PoolPutAndMatcherDisabled || + poolStatus == PoolShutdown + ) then throw("Put operation is blocked by admin. Status = " + poolStatus.toString()) else estPut } @@ -1133,7 +1142,12 @@ func putOneTkn(minOutAmount: Int, autoStake: Boolean) = { [this.toString()], [] ).exactAs[Boolean] - let isPutDisabled = isGlobalShutdown() || cfgPoolStatus == PoolPutDisabled || cfgPoolStatus == PoolShutdown || isPoolOneTokenOperationsDisabled + let isPutDisabled = + isGlobalShutdown() || + cfgPoolStatus == PoolPutDisabled || + cfgPoolStatus == PoolPutAndMatcherDisabled || + cfgPoolStatus == PoolShutdown || + isPoolOneTokenOperationsDisabled strict checks = [ !isPutDisabled || i.isManager() || "put operation is blocked by admin".throwErr(), diff --git a/ride/lp_stable.ride b/ride/lp_stable.ride index 0341f96aa..19aba6bd2 100644 --- a/ride/lp_stable.ride +++ b/ride/lp_stable.ride @@ -56,7 +56,7 @@ let SEP = "__" let EMPTY = "" let PoolActive = 1 # ACTIVE, pool without restrictions let PoolPutDis = 2 # PUT DISABLED, pool with put operation disabled -let PoolMatcherDis = 3 # MATCHER DISABLED, pool with matcher operations disabled +let PoolPutAndMatcherDis = 3 # MATCHER DISABLED, pool with put and matcher operations disabled let PoolShutdown = 4 # SHUTDOWN, pool operations halted # data indexes from pool config stored in factory let idxPoolAddress = 1 @@ -672,7 +672,7 @@ func validateMatcherOrderAllowed(order: Order) = { } # validate status - if (igs() || cfgPoolStatus == PoolMatcherDis || cfgPoolStatus == PoolShutdown) then throw("Admin blocked") else + if (igs() || cfgPoolStatus == PoolPutAndMatcherDis || cfgPoolStatus == PoolShutdown) then throw("Admin blocked") else # validate pairs if (order.assetPair.amountAsset != cfgAmountAssetId || order.assetPair.priceAsset != cfgPriceAssetId) then throw("Wr assets") else @@ -745,7 +745,12 @@ func cp(caller: String, pmtId) let sts = r._8.parseIntValue() - if(igs() || sts == PoolPutDis || sts == PoolShutdown) then throw("Blocked:" + sts.toString()) else + if( + igs() || + sts == PoolPutDis || + sts == PoolPutAndMatcherDis || + sts == PoolShutdown + ) then throw("Blocked:" + sts.toString()) else r } @@ -1171,7 +1176,12 @@ func putOneTknV2(minOutAmount: Int, autoStake: Boolean) = { [this.toString()], [] ).exactAs[Boolean] - let isPutDisabled = igs() || cfgPoolStatus == PoolPutDis || cfgPoolStatus == PoolShutdown || isPoolOneTokenOperationsDisabled + let isPutDisabled = + igs() || + cfgPoolStatus == PoolPutDis || + cfgPoolStatus == PoolPutAndMatcherDis || + cfgPoolStatus == PoolShutdown || + isPoolOneTokenOperationsDisabled strict checks = [ !isPutDisabled || i.isManager() || "put operation is blocked by admin".throwErr(),