tx · Ax73N5XmJCkQPjF5YJ4VKpfrhe53RoanVWVxbNSVX2pQ

3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai:  -0.02700000 Waves

2023.06.14 11:44 [2622109] smart account 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai > SELF 0.00000000 Waves

{ "type": 13, "id": "Ax73N5XmJCkQPjF5YJ4VKpfrhe53RoanVWVxbNSVX2pQ", "fee": 2700000, "feeAssetId": null, "timestamp": 1686732266744, "version": 2, "chainId": 84, "sender": "3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai", "senderPublicKey": "2JEaBjtjvMoNGKZmL9QxYefa1VkMJM3vMW8rNvTs9R2H", "proofs": [ "34LKsqA2ccSmnaJmfdzMCXjw8xjGVUdbqWWUDQCk81nuJtXKB9ZNRPgFz1AbH8yv4LMoafE9SjvnUrs5zavtXgDQ" ], "script": "base64:BgLYKwgCEgASBAoCCAgSBAoCCAgSAwoBCBIKCggICAgICAgIARIDCgEIEgYKBAgICAgSBAoCCBgSAwoBCBIECgIIGBIDCgEYEgoKCAgICAgIAQgIEgQKAggBEgMKAQESAwoBARIECgIIARIGCgQICAgIEgQKAggIEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIEgMKAQgSAwoBCCIGU0NBTEU4IgVNVUxUOCIGTVVMVDEyIgdTQ0FMRTE4IgZNVUxUMTgiDlBPT0xXRUlHSFRNVUxUIg5HV1h2aXJ0dWFsUE9PTCIMbGFiZWxQb29sc0xwIg1kZWZhdWx0U3ByZWFkIgt3YXZlc1N0cmluZyIQY29udHJhY3RGaWxlbmFtZSIRZGVjaW1hbHNNdWx0UHJpY2UiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiD1Bvb2xQdXREaXNhYmxlZCITUG9vbE1hdGNoZXJEaXNhYmxlZCIMUG9vbFNodXRkb3duIhJpZHhJbnR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AQIFAmJmAgpCeXRlVmVjdG9yBAJiRgUCYmYFAmJGAwkAAQIFAmJmAgRVbml0CAUCZmgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmZoCWJvZHlCeXRlcwkAkQMCCAUCZmgGcHJvb2ZzAAAFAmZqseEcMw==", "height": 2622109, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 86yDnP5hEHbqfyoitPje6Mep6aU1itX7xFjKXAfAaL48 Next: 37DqwX9n5E8Z3eewpmJjkKLRag6cPQPiogiFf2t3sWaF Diff:
OldNewDifferences
2020 let defaultSpread = 2000000
2121
2222 let wavesString = "WAVES"
23+
24+let contractFilename = "factory_v2.ride"
2325
2426 let decimalsMultPrice = ((100 * 1000) * 1000)
2527
6769
6870 let validPoolLabels = [poolLabelWxEmission]
6971
72+func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
73+
74+
75+func throwErr (msg) = throw(wrapErr(msg))
76+
77+
7078 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
7179
7280
109117 func keyVotingEmissionContract () = "%s__votingEmissionContract"
110118
111119
120+func keyUserPoolsContract () = "%s__userPoolsContract"
121+
122+
112123 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
113124
114125
137148
138149
139150 func keyPoolOneTokenOperationsDisabled (assetsInternal) = {
140- let $t036583720 = assetsInternal
141- let amountAssetInternal = $t036583720._1
142- let priceAssetInternal = $t036583720._2
151+ let $t038783940 = assetsInternal
152+ let amountAssetInternal = $t038783940._1
153+ let priceAssetInternal = $t038783940._2
143154 makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP)
144155 }
145156
298309 }
299310
300311
301-let permissionDeniedError = throw("Permission denied")
312+let permissionDeniedError = throwErr("Permission denied")
302313
303-let testError = throw("Test error here")
314+let testError = throwErr("Test error here")
304315
305316 func mustThis (i) = if ((i.caller == this))
306317 then true
395406
396407 @Callable(i)
397408 func getPoolLeaseConfigREADONLY (poolAddress,assetId) = {
398- let $t01430414608 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) {
409+ let $t01453014834 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) {
399410 case r: Int =>
400411 $Tuple2(true, min([100, max([0, r])]))
401412 case _ =>
406417 $Tuple2(false, 0)
407418 }
408419 }
409- let isLeasable = $t01430414608._1
410- let leasedRatio = $t01430414608._2
420+ let isLeasable = $t01453014834._1
421+ let leasedRatio = $t01453014834._2
411422 let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) {
412423 case b: Int =>
413424 max([0, b])
419430 0
420431 }
421432 }
422- let $t01487415098 = if ((assetId == "WAVES"))
433+ let $t01510015324 = if ((assetId == "WAVES"))
423434 then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12)
424435 else $Tuple3("", "", 0)
425- let proxyAddress = $t01487415098._1
426- let proxyAssetId = $t01487415098._2
427- let proxyRateMul = $t01487415098._3
436+ let proxyAddress = $t01510015324._1
437+ let proxyAssetId = $t01510015324._2
438+ let proxyRateMul = $t01510015324._3
428439 let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "")
429440 $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress))
430441 }
538549 let checkCaller = mustAdmin(i)
539550 if ((checkCaller == checkCaller))
540551 then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress))))
541- then throw((("Pool address " + poolAddress) + " already registered."))
552+ then throwErr((("Pool address " + poolAddress) + " already registered."))
542553 else {
543554 let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1)
544555 let internalAmountAssetId = internalAmountAssetData._1
550561 let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash())
551562 let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr)
552563 if (poolExists)
553- then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated."))
564+ then throwErr((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated."))
554565 else {
555566 let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId))))
556567 let amountAssetsDecimals = if ((amountAssetStr == "WAVES"))
565576 let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil)
566577 if ((poolActivateInvokeResult == poolActivateInvokeResult))
567578 then if ((poolActivateInvokeResult != "success"))
568- then throw("Pool initialisation error happened.")
579+ then throwErr("Pool initialisation error happened.")
569580 else {
570581 let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract()))
571582 let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil)
650661 let inAmountAssetId = toBase58String(value(payment.assetId))
651662 let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.")
652663 if ((inAmountAssetId != lpAssetRequestedForBurning))
653- then throw("Invalid asset passed.")
664+ then throwErr("Invalid asset passed.")
654665 else if ((amountToBurn != paymentAmount))
655- then throw("Invalid amount passed.")
666+ then throwErr("Invalid amount passed.")
656667 else {
657668 let lpAsset = fromBase58String(lpAssetRequestedForBurning)
658669 $Tuple2([Burn(lpAsset, amountToBurn)], "success")
716727 let btcWeightNew = (btcWeight - weightDecrement)
717728 let ethWeightNew = (ethWeight - weightDecrement)
718729 if ((0 >= btcWeightNew))
719- then throw(("invalid btcWeightNew: " + toString(btcWeightNew)))
730+ then throwErr(("invalid btcWeightNew: " + toString(btcWeightNew)))
720731 else if ((0 >= ethWeightNew))
721- then throw(("invalid ethWeightNew: " + toString(ethWeightNew)))
732+ then throwErr(("invalid ethWeightNew: " + toString(ethWeightNew)))
722733 else {
723734 let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress))
724735 let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress))
795806 let priceAssets = getPriceAssets()
796807 let checkPriceAssetsSize = if ((size(priceAssets) > 0))
797808 then true
798- else throw("invalid price assets")
809+ else throwErr("invalid price assets")
799810 if ((checkPriceAssetsSize == checkPriceAssetsSize))
800811 then {
801812 func cb (acc,priceAsset) = {
939950 }
940951
941952
953+
954+@Callable(i)
955+func deletePool (poolContractAddress) = {
956+ let checkCaller = if (mustManager(i))
957+ then true
958+ else permissionDeniedError
959+ if ((checkCaller == checkCaller))
960+ then {
961+ let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)), SEP)
962+ let amountAssetInternal = parseIntValue(poolAssets[1])
963+ let priceAssetInternal = parseIntValue(poolAssets[2])
964+ let amountAssetId = getStringValue(keyMappingsInternal2baseAssetId(amountAssetInternal))
965+ let priceAssetId = getStringValue(keyMappingsInternal2baseAssetId(priceAssetInternal))
966+ let lpAssetId = getStringOrFail(keyMappingPoolContractToLPAsset(poolContractAddress))
967+ let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract()))
968+ let userPoolsInvoke = invoke(userPoolsContract, "deletePool", [amountAssetId, priceAssetId], nil)
969+ if ((userPoolsInvoke == userPoolsInvoke))
970+ then {
971+ let votingEmissionContract = addressFromStringValue(getStringValue(keyVotingEmissionContract()))
972+ let votingEmissionInvoke = invoke(votingEmissionContract, "deletePool", [amountAssetId, priceAssetId], nil)
973+ if ((votingEmissionInvoke == votingEmissionInvoke))
974+ then [DeleteEntry(keyMappingPoolContractToLPAsset(poolContractAddress)), DeleteEntry(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)), DeleteEntry(keyMappingPoolAssetsToLpasset(toString(amountAssetInternal), toString(priceAssetInternal))), DeleteEntry(keyMappingPoolAssetsToPoolContractAddress(amountAssetInternal, priceAssetInternal)), DeleteEntry(keyPoolConfig(toString(amountAssetInternal), toString(priceAssetInternal))), DeleteEntry(keyMappingLpAssetToPoolAssets(lpAssetId)), DeleteEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)), DeleteEntry(keyWxEmission(amountAssetId, priceAssetId)), DeleteEntry(keyPoolToWeight(poolContractAddress)), DeleteEntry(keyPoolSpread(poolContractAddress)), DeleteEntry(keyInFee(poolContractAddress)), DeleteEntry(keyOutFee(poolContractAddress)), DeleteEntry(keySkipOrderValidation(poolContractAddress)), DeleteEntry(keyChangeAmpDelay(poolContractAddress)), DeleteEntry(keyChangeAmpDelta(poolContractAddress)), DeleteEntry(keyChangeAmpTarget(poolContractAddress))]
975+ else throw("Strict value is not equal to itself.")
976+ }
977+ else throw("Strict value is not equal to itself.")
978+ }
979+ else throw("Strict value is not equal to itself.")
980+ }
981+
982+
942983 @Verifier(tx)
943984 func verify () = {
944985 let targetPublicKey = match managerPublicKeyOrUnit() {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let MULT12 = 1000000000000
99
1010 let SCALE18 = 18
1111
1212 let MULT18 = toBigInt(1000000000000000000)
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 let GWXvirtualPOOL = "GWXvirtualPOOL"
1717
1818 let labelPoolsLp = "POOLS_LP"
1919
2020 let defaultSpread = 2000000
2121
2222 let wavesString = "WAVES"
23+
24+let contractFilename = "factory_v2.ride"
2325
2426 let decimalsMultPrice = ((100 * 1000) * 1000)
2527
2628 let SEP = "__"
2729
2830 let EMPTY = ""
2931
3032 let PoolActive = 1
3133
3234 let PoolPutDisabled = 2
3335
3436 let PoolMatcherDisabled = 3
3537
3638 let PoolShutdown = 4
3739
3840 let idxInternalAssetId = 1
3941
4042 let idxResutActions = 2
4143
4244 let idxIfAssetIdCalculationPerformed = 3
4345
4446 let idxPoolAddress = 1
4547
4648 let idxPoolStatus = 2
4749
4850 let idxPoolLPAssetId = 3
4951
5052 let idxAmtAssetId = 4
5153
5254 let idxPriceAssetId = 5
5355
5456 let idxAmtAssetDcm = 6
5557
5658 let idxPriceAssetDcm = 7
5759
5860 let idxIAmtAssetId = 8
5961
6062 let idxIPriceAssetId = 9
6163
6264 let idxLPAssetDcm = 10
6365
6466 let idxPoolType = 11
6567
6668 let poolLabelWxEmission = "WX_EMISSION"
6769
6870 let validPoolLabels = [poolLabelWxEmission]
6971
72+func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
73+
74+
75+func throwErr (msg) = throw(wrapErr(msg))
76+
77+
7078 func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash"
7179
7280
7381 func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash"
7482
7583
7684 func swapContract () = "%s__swapContract"
7785
7886
7987 func keyFactoryConfig () = "%s__factoryConfig"
8088
8189
8290 func keyLpTokensList () = "%s__lpTokensList"
8391
8492
8593 func keyPoolScriptHash () = "%s%s__pool__scriptHash"
8694
8795
8896 func keyMatcherPub () = "%s%s__matcher__publicKey"
8997
9098
9199 func keyLegacyFactoryContract () = "%s__legacyFactoryContract"
92100
93101
94102 func keyLegacyPools () = "%s__legacyPools"
95103
96104
97105 func keyManagerPublicKey () = "%s__managerPublicKey"
98106
99107
100108 func keyManagerVaultAddress () = "%s__managerVaultAddress"
101109
102110
103111 func keyAdminPubKeys () = "%s__adminPubKeys"
104112
105113
106114 func keyAssetsStoreContract () = "%s__assetsStoreContract"
107115
108116
109117 func keyVotingEmissionContract () = "%s__votingEmissionContract"
110118
111119
120+func keyUserPoolsContract () = "%s__userPoolsContract"
121+
122+
112123 func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP)
113124
114125
115126 func keyPriceDecimals () = "%s__priceDecimals"
116127
117128
118129 func keyAllPoolsShutdown () = "%s__shutdown"
119130
120131
121132 func keyNextInternalAssetId () = "%s__nextInternalAssetId"
122133
123134
124135 func keyPoolToWeight (poolAddress) = ("%s%s__poolWeight__" + poolAddress)
125136
126137
127138 func keyPoolToWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
128139
129140
130141 func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset))
131142
132143
133144 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
134145
135146
136147 func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config")
137148
138149
139150 func keyPoolOneTokenOperationsDisabled (assetsInternal) = {
140- let $t036583720 = assetsInternal
141- let amountAssetInternal = $t036583720._1
142- let priceAssetInternal = $t036583720._2
151+ let $t038783940 = assetsInternal
152+ let amountAssetInternal = $t038783940._1
153+ let priceAssetInternal = $t038783940._2
143154 makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP)
144155 }
145156
146157
147158 func keyAllPoolsOneTokenOperationsDisabled () = makeString(["%s", "oneTokenOperationsDisabled"], SEP)
148159
149160
150161 func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool")
151162
152163
153164 func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset")
154165
155166
156167 func keyPoolSpread (poolAddress) = ("%s%s__spread__" + poolAddress)
157168
158169
159170 func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2PoolAssets")
160171
161172
162173 func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract")
163174
164175
165176 func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
166177
167178
168179 func keyMappingPoolLPAssetToPoolContractAddress (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2PoolContract")
169180
170181
171182 func keyWxEmission (amountAssetId,priceAssetId) = ((("%s%s%s__wxEmission__" + amountAssetId) + "__") + priceAssetId)
172183
173184
174185 func keyInFee (poolAddress) = ("%s%s__inFee__" + poolAddress)
175186
176187
177188 func keyInFeeDefault () = "%s__inFeeDefault"
178189
179190
180191 func keyOutFee (poolAddress) = ("%s%s__outFee__" + poolAddress)
181192
182193
183194 func keyOutFeeDefault () = "%s__outFeeDefault"
184195
185196
186197 func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress)
187198
188199
189200 func keyChangeAmpDelay (poolAddress) = ("%s%s__changeAmpDelay__" + poolAddress)
190201
191202
192203 func keyChangeAmpDelta (poolAddress) = ("%s%s__changeAmpDelta__" + poolAddress)
193204
194205
195206 func keyChangeAmpTarget (poolAddress) = ("%s%s__changeAmpTarget__" + poolAddress)
196207
197208
198209 func keySWavesProxyAddress () = "%s__sWavesProxyAddress"
199210
200211
201212 func keySWavesAssetId () = "%s__sWavesAssetId"
202213
203214
204215 func keyStakingProfitAddress () = "%s__stakingProfitAddress"
205216
206217
207218 func keyLeasedRatio (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatio", poolAddress, assetId], SEP)
208219
209220
210221 func keyLeasedRatioDefault (assetId) = makeString(["%s%s", "leasedRatioDefault", assetId], SEP)
211222
212223
213224 func keyLeasedRatioTolerance (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatioTolerance", poolAddress, assetId], SEP)
214225
215226
216227 func keyMinBalance (poolAddress,assetId) = makeString(["%s%s%s", "minBalance", poolAddress, assetId], SEP)
217228
218229
219230 func keyMinBalanceDefault (assetId) = makeString(["%s%s", "minBalanceDefault", assetId], SEP)
220231
221232
222233 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key))
223234
224235
225236 func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key))
226237
227238
228239 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key))
229240
230241
231242 func parseAssetId (input) = if ((input == wavesString))
232243 then unit
233244 else fromBase58String(input)
234245
235246
236247 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
237248 case s: String =>
238249 addressFromStringValue(s)
239250 case _ =>
240251 this
241252 }
242253
243254
244255 let IdxFactoryCfgStakingDapp = 1
245256
246257 let IdxFactoryCfgBoostingDapp = 2
247258
248259 let IdxFactoryCfgIdoDapp = 3
249260
250261 let IdxFactoryCfgTeamDapp = 4
251262
252263 let IdxFactoryCfgEmissionDapp = 5
253264
254265 let IdxFactoryCfgRestDapp = 6
255266
256267 let IdxFactoryCfgSlippageDapp = 7
257268
258269 let IdxFactoryCfgDaoDapp = 8
259270
260271 let IdxFactoryCfgMarketingDapp = 9
261272
262273 let IdxFactoryCfgGwxRewardDapp = 10
263274
264275 let IdxFactoryCfgBirdsDapp = 11
265276
266277 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
267278
268279
269280 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
270281
271282
272283 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
273284
274285
275286 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
276287
277288
278289 func getPriceAssets () = match getString(keyPriceAssets()) {
279290 case s: String =>
280291 if ((size(s) == 0))
281292 then nil
282293 else split(s, SEP)
283294 case _ =>
284295 nil
285296 }
286297
287298
288299 func managerPublicKeyOrUnit () = {
289300 let managerVaultAddress = getManagerVaultAddressOrThis()
290301 match getString(managerVaultAddress, keyManagerPublicKey()) {
291302 case s: String =>
292303 fromBase58String(s)
293304 case _: Unit =>
294305 unit
295306 case _ =>
296307 throw("Match error")
297308 }
298309 }
299310
300311
301-let permissionDeniedError = throw("Permission denied")
312+let permissionDeniedError = throwErr("Permission denied")
302313
303-let testError = throw("Test error here")
314+let testError = throwErr("Test error here")
304315
305316 func mustThis (i) = if ((i.caller == this))
306317 then true
307318 else permissionDeniedError
308319
309320
310321 func mustManager (i) = match managerPublicKeyOrUnit() {
311322 case pk: ByteVector =>
312323 if ((i.callerPublicKey == pk))
313324 then true
314325 else permissionDeniedError
315326 case _: Unit =>
316327 mustThis(i)
317328 case _ =>
318329 throw("Match error")
319330 }
320331
321332
322333 func dataFactoryCfgV3 (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract,daoContract,marketingContract,gwxRewardsContract,birdsContract) = makeString(["%s%s%s%s%s%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract, daoContract, marketingContract, gwxRewardsContract, birdsContract], SEP)
323334
324335
325336 func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP)
326337
327338
328339 func dataPoolCfg (poolAddress,poolStatus,lpAssetId,amountAssetStr,priceAssetStr,amountAssetDecimals,priceAssetDecimals,amountAssetInternalId,priceAssetInternalId,lpAssetDecimals,poolType) = makeString(["%s%d%s%s%s%d%d%d%d%d%s", poolAddress, poolStatus, lpAssetId, amountAssetStr, priceAssetStr, toString(amountAssetDecimals), toString(priceAssetDecimals), toString(amountAssetInternalId), toString(priceAssetInternalId), toString(lpAssetDecimals), poolType], SEP)
329340
330341
331342 func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP)
332343
333344
334345 func getPoolConfig (poolAddress) = {
335346 let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP)
336347 let amountAssetInternal = poolAssets[1]
337348 let priceAssetInternal = poolAssets[2]
338349 split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP)
339350 }
340351
341352
342353 func getInternalAssetIdOrCreate (assetIdStr,incrementor) = {
343354 let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0)
344355 let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0)
345356 let result = if ((internalAssetId == 0))
346357 then {
347358 let newInternalAssetId = (currentIndexOfInternalId + incrementor)
348359 $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true)
349360 }
350361 else $Tuple3(internalAssetId, nil, false)
351362 result
352363 }
353364
354365
355366 func mustAdmin (i) = {
356367 let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP)
357368 if (containsElement(adminPKs, toBase58String(i.callerPublicKey)))
358369 then true
359370 else {
360371 let isManager = mustManager(i)
361372 if ((isManager == isManager))
362373 then true
363374 else throw("Strict value is not equal to itself.")
364375 }
365376 }
366377
367378
368379 func intOrDefaultOrFallback (key,keyDefault,valueFallback) = valueOrElse(getInteger(this, key), valueOrElse(getInteger(this, keyDefault), valueFallback))
369380
370381
371382 func poolExistsInternal (amountAssetId,priceAssetId) = {
372383 let amountAssetInternal = getInteger(keyMappingsBaseAsset2internalId(amountAssetId))
373384 let priceAssetInternal = getInteger(keyMappingsBaseAsset2internalId(priceAssetId))
374385 if (if ((amountAssetInternal == unit))
375386 then true
376387 else (priceAssetInternal == unit))
377388 then false
378389 else {
379390 let amAs = toString(value(amountAssetInternal))
380391 let prAs = toString(value(priceAssetInternal))
381392 let cfg = getString(keyPoolConfig(amAs, prAs))
382393 let cfgReverse = getString(keyPoolConfig(prAs, amAs))
383394 let exists = if ((cfg != unit))
384395 then true
385396 else (cfgReverse != unit)
386397 exists
387398 }
388399 }
389400
390401
391402 @Callable(i)
392403 func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract()))
393404
394405
395406
396407 @Callable(i)
397408 func getPoolLeaseConfigREADONLY (poolAddress,assetId) = {
398- let $t01430414608 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) {
409+ let $t01453014834 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) {
399410 case r: Int =>
400411 $Tuple2(true, min([100, max([0, r])]))
401412 case _ =>
402413 match getInteger(this, keyLeasedRatioDefault(assetId)) {
403414 case rd: Int =>
404415 $Tuple2(true, min([100, max([0, rd])]))
405416 case _ =>
406417 $Tuple2(false, 0)
407418 }
408419 }
409- let isLeasable = $t01430414608._1
410- let leasedRatio = $t01430414608._2
420+ let isLeasable = $t01453014834._1
421+ let leasedRatio = $t01453014834._2
411422 let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) {
412423 case b: Int =>
413424 max([0, b])
414425 case _ =>
415426 match getInteger(this, keyMinBalanceDefault(assetId)) {
416427 case bd: Int =>
417428 max([0, bd])
418429 case _ =>
419430 0
420431 }
421432 }
422- let $t01487415098 = if ((assetId == "WAVES"))
433+ let $t01510015324 = if ((assetId == "WAVES"))
423434 then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12)
424435 else $Tuple3("", "", 0)
425- let proxyAddress = $t01487415098._1
426- let proxyAssetId = $t01487415098._2
427- let proxyRateMul = $t01487415098._3
436+ let proxyAddress = $t01510015324._1
437+ let proxyAssetId = $t01510015324._2
438+ let proxyRateMul = $t01510015324._3
428439 let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "")
429440 $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress))
430441 }
431442
432443
433444
434445 @Callable(i)
435446 func getLpAssetFromPoolAssetsREADONLY (asset1,asset2) = if (if ((asset1 == "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS"))
436447 then (asset2 == "WAVES")
437448 else false)
438449 then $Tuple2(nil, unit)
439450 else {
440451 let assetNum1 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset1)))
441452 let assetNum2 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset2)))
442453 let ee = getString(this, keyMappingPoolAssetsToLpasset(toString(assetNum1), toString(assetNum2)))
443454 let res = if ((ee == unit))
444455 then unit
445456 else drop(value(ee), 4)
446457 $Tuple2(nil, res)
447458 }
448459
449460
450461
451462 @Callable(i)
452463 func getPoolAddressFromLpAssetREADONLY (lp) = $Tuple2(nil, valueOrElse(getString(this, keyMappingPoolLPAssetToPoolContractAddress(lp)), ""))
453464
454465
455466
456467 @Callable(i)
457468 func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = {
458469 let checkCaller = mustManager(i)
459470 if ((checkCaller == checkCaller))
460471 then [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)]
461472 else throw("Strict value is not equal to itself.")
462473 }
463474
464475
465476
466477 @Callable(i)
467478 func constructorV2 (mathcherPub58Str) = {
468479 let checkCaller = mustManager(i)
469480 if ((checkCaller == checkCaller))
470481 then {
471482 let mathcerPub = addressFromPublicKey(fromBase58String(mathcherPub58Str))
472483 if ((mathcerPub == mathcerPub))
473484 then [StringEntry(keyMatcherPub(), mathcherPub58Str)]
474485 else throw("Strict value is not equal to itself.")
475486 }
476487 else throw("Strict value is not equal to itself.")
477488 }
478489
479490
480491
481492 @Callable(i)
482493 func constructorV3 (daoContract,marketingContract,gwxRewardsContract,birdsContract) = {
483494 let checkCaller = mustManager(i)
484495 if ((checkCaller == checkCaller))
485496 then {
486497 let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP)
487498 [StringEntry(keyFactoryConfig(), dataFactoryCfgV3(factoryCfg[1], factoryCfg[2], factoryCfg[3], factoryCfg[4], factoryCfg[5], factoryCfg[6], factoryCfg[7], daoContract, marketingContract, gwxRewardsContract, birdsContract))]
488499 }
489500 else throw("Strict value is not equal to itself.")
490501 }
491502
492503
493504
494505 @Callable(i)
495506 func constructorV4 (legacyFactoryContract,legacyPools) = {
496507 let checkCaller = mustManager(i)
497508 if ((checkCaller == checkCaller))
498509 then [StringEntry(keyLegacyFactoryContract(), legacyFactoryContract), StringEntry(keyLegacyPools(), makeString(legacyPools, SEP))]
499510 else throw("Strict value is not equal to itself.")
500511 }
501512
502513
503514
504515 @Callable(i)
505516 func constructorV5 (assetsStoreContract) = {
506517 let checkCaller = mustManager(i)
507518 if ((checkCaller == checkCaller))
508519 then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)]
509520 else throw("Strict value is not equal to itself.")
510521 }
511522
512523
513524
514525 @Callable(i)
515526 func constructorV6 (votingEmissionContract,priceAssets) = {
516527 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
517528 then true
518529 else "invalid voting emission contract address"]
519530 if ((cheks == cheks))
520531 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract), StringEntry(keyPriceAssets(), makeString(priceAssets, SEP))]
521532 else throw("Strict value is not equal to itself.")
522533 }
523534
524535
525536
526537 @Callable(i)
527538 func setAdmins (adminPubKeys) = {
528539 let checkCaller = mustManager(i)
529540 if ((checkCaller == checkCaller))
530541 then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))]
531542 else throw("Strict value is not equal to itself.")
532543 }
533544
534545
535546
536547 @Callable(i)
537548 func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight,poolType,logo) = {
538549 let checkCaller = mustAdmin(i)
539550 if ((checkCaller == checkCaller))
540551 then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress))))
541- then throw((("Pool address " + poolAddress) + " already registered."))
552+ then throwErr((("Pool address " + poolAddress) + " already registered."))
542553 else {
543554 let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1)
544555 let internalAmountAssetId = internalAmountAssetData._1
545556 let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3)
546557 then 2
547558 else 1)
548559 let internalPriceAssetId = internalPriceAssetData._1
549560 let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress))
550561 let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash())
551562 let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr)
552563 if (poolExists)
553- then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated."))
564+ then throwErr((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated."))
554565 else {
555566 let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId))))
556567 let amountAssetsDecimals = if ((amountAssetStr == "WAVES"))
557568 then decimalsMultPrice
558569 else pow(10, 0, value(assetInfo(fromBase58String(amountAssetStr))).decimals, 0, 0, DOWN)
559570 let priceAssetsDecimals = if ((priceAssetStr == "WAVES"))
560571 then decimalsMultPrice
561572 else pow(10, 0, value(assetInfo(fromBase58String(priceAssetStr))).decimals, 0, 0, DOWN)
562573 let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true)
563574 let lpAssetId = calculateAssetId(lpAssetIssueAction)
564575 let lpAssetIdStr = toBase58String(lpAssetId)
565576 let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil)
566577 if ((poolActivateInvokeResult == poolActivateInvokeResult))
567578 then if ((poolActivateInvokeResult != "success"))
568- then throw("Pool initialisation error happened.")
579+ then throwErr("Pool initialisation error happened.")
569580 else {
570581 let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract()))
571582 let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil)
572583 if ((createOrUpdateLpAssetInv == createOrUpdateLpAssetInv))
573584 then {
574585 let addPoolsLpLabelInv = invoke(assetsStoreContract, "addLabel", [lpAssetIdStr, labelPoolsLp], nil)
575586 if ((addPoolsLpLabelInv == addPoolsLpLabelInv))
576587 then {
577588 let setLogoInv = invoke(assetsStoreContract, "setLogo", [lpAssetIdStr, logo], nil)
578589 if ((setLogoInv == setLogoInv))
579590 then {
580591 let addAssetsLinkInv = invoke(assetsStoreContract, "addAssetsLink", [amountAssetStr, priceAssetStr, lpAssetIdStr], nil)
581592 if ((addAssetsLinkInv == addAssetsLinkInv))
582593 then {
583594 let increaseAssetPoolsNumberInv = invoke(assetsStoreContract, "increaseAssetPoolsNumber", [amountAssetStr], nil)
584595 if ((increaseAssetPoolsNumberInv == increaseAssetPoolsNumberInv))
585596 then $Tuple2(((internalAmountAssetData._2 ++ internalPriceAssetData._2) ++ [lpAssetIssueAction, Burn(lpAssetId, 1), StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(PoolActive), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, decimalsMultPrice, poolType)), StringEntry(keyMappingLpAssetToPoolAssets(lpAssetIdStr), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToLpasset(toString(internalAmountAssetId), toString(internalPriceAssetId)), ("%s__" + lpAssetIdStr)), StringEntry(keyMappingPoolContractAddressToPoolAssets(poolAddress), dataMappingPoolAssets(internalAmountAssetId, internalPriceAssetId)), StringEntry(keyMappingPoolAssetsToPoolContractAddress(internalAmountAssetId, internalPriceAssetId), poolAddress), StringEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetIdStr), poolAddress), StringEntry(keyMappingPoolContractToLPAsset(poolAddress), lpAssetIdStr), IntegerEntry(keyPoolToWeight(poolAddress), poolWeight), IntegerEntry(keyPoolSpread(poolAddress), defaultSpread)]), lpAssetIdStr)
586597 else throw("Strict value is not equal to itself.")
587598 }
588599 else throw("Strict value is not equal to itself.")
589600 }
590601 else throw("Strict value is not equal to itself.")
591602 }
592603 else throw("Strict value is not equal to itself.")
593604 }
594605 else throw("Strict value is not equal to itself.")
595606 }
596607 else throw("Strict value is not equal to itself.")
597608 }
598609 }
599610 else throw("Strict value is not equal to itself.")
600611 }
601612
602613
603614
604615 @Callable(i)
605616 func managePool (poolAddress,newStatus) = {
606617 let checkCaller = mustManager(i)
607618 if ((checkCaller == checkCaller))
608619 then {
609620 let poolConfig = getPoolConfig(poolAddress)
610621 let poolStatus = poolConfig[idxPoolStatus]
611622 let lpAssetIdStr = poolConfig[idxPoolLPAssetId]
612623 let amountAssetStr = poolConfig[idxAmtAssetId]
613624 let priceAssetStr = poolConfig[idxPriceAssetId]
614625 let amountAssetsDecimals = parseIntValue(poolConfig[idxAmtAssetDcm])
615626 let priceAssetsDecimals = parseIntValue(poolConfig[idxPriceAssetDcm])
616627 let internalAmountAssetId = parseIntValue(poolConfig[idxIAmtAssetId])
617628 let internalPriceAssetId = parseIntValue(poolConfig[idxIPriceAssetId])
618629 let lpAssetDcm = parseIntValue(poolConfig[idxLPAssetDcm])
619630 let poolType = poolConfig[idxPoolType]
620631 [StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(newStatus), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, lpAssetDcm, poolType))]
621632 }
622633 else throw("Strict value is not equal to itself.")
623634 }
624635
625636
626637
627638 @Callable(i)
628639 func emit (amountToEmit) = {
629640 let caller = i.caller
630641 let originCaller = i.originCaller
631642 let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.")
632643 let lpAsset = fromBase58String(lpAssetRequested)
633644 let legacyPools = split(valueOrElse(getString(keyLegacyPools()), EMPTY), SEP)
634645 let legacyFactoryContract = addressFromStringValue(valueOrErrorMessage(getString(keyLegacyFactoryContract()), "Legacy factory contract does not exists."))
635646 if ((0 >= amountToEmit))
636647 then nil
637648 else if (containsElement(legacyPools, toString(caller)))
638649 then $Tuple2(nil, legacyFactoryContract)
639650 else $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success")
640651 }
641652
642653
643654
644655 @Callable(i)
645656 func burn (amountToBurn) = {
646657 let caller = i.caller
647658 let originCaller = i.originCaller
648659 let payment = value(i.payments[0])
649660 let paymentAmount = value(payment.amount)
650661 let inAmountAssetId = toBase58String(value(payment.assetId))
651662 let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.")
652663 if ((inAmountAssetId != lpAssetRequestedForBurning))
653- then throw("Invalid asset passed.")
664+ then throwErr("Invalid asset passed.")
654665 else if ((amountToBurn != paymentAmount))
655- then throw("Invalid amount passed.")
666+ then throwErr("Invalid amount passed.")
656667 else {
657668 let lpAsset = fromBase58String(lpAssetRequestedForBurning)
658669 $Tuple2([Burn(lpAsset, amountToBurn)], "success")
659670 }
660671 }
661672
662673
663674
664675 @Callable(i)
665676 func modifyWeight (lpAssetId,share) = {
666677 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
667678 then true
668679 else mustManager(i)
669680 if ((checkCaller == checkCaller))
670681 then {
671682 let poolContractAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId))
672683 let poolWeightKey = keyPoolToWeight(poolContractAddress)
673684 let gwxWeightKey = keyPoolToWeight(GWXvirtualPOOL)
674685 let gwxWeight = valueOrElse(getInteger(gwxWeightKey), 0)
675686 let poolWeight = valueOrElse(getInteger(poolWeightKey), 0)
676687 let poolWeightNew = share
677688 let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP)
678689 let stakingContract = getStakingAddressOrFail(factoryCfg)
679690 let onModifyWeightInv = invoke(stakingContract, "onModifyWeight", [lpAssetId, poolContractAddress], nil)
680691 if ((onModifyWeightInv == onModifyWeightInv))
681692 then {
682693 let gwxVirtualPoolActions = if ((gwxWeight == 0))
683694 then nil
684695 else [IntegerEntry(gwxWeightKey, 0)]
685696 let poolWeightHistoryKey = keyPoolToWeightHistory(poolContractAddress, 0)
686697 let poolWeightHistoryOrUnit = getInteger(poolWeightHistoryKey)
687698 let poolWeightHistoryActions = if ((poolWeightHistoryOrUnit == unit))
688699 then nil
689700 else [DeleteEntry(poolWeightHistoryKey)]
690701 (([IntegerEntry(poolWeightKey, poolWeightNew)] ++ gwxVirtualPoolActions) ++ poolWeightHistoryActions)
691702 }
692703 else throw("Strict value is not equal to itself.")
693704 }
694705 else throw("Strict value is not equal to itself.")
695706 }
696707
697708
698709
699710 @Callable(i)
700711 func modifyWeights (btcPoolAddress,ethPoolAddress,ethBtcPoolAddress,usdcUsdtPoolAddress) = {
701712 let checkCaller = mustManager(i)
702713 if ((checkCaller == checkCaller))
703714 then {
704715 let ethBtcWeightNew = ((5 * POOLWEIGHTMULT) / 100)
705716 let usdcUsdtWeightNew = ((5 * POOLWEIGHTMULT) / 100)
706717 let weightDecrement = ((5 * POOLWEIGHTMULT) / 100)
707718 let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP)
708719 let stakingDapp = getStakingAddressOrFail(factoryCfg)
709720 let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg)
710721 let btcWeightKEY = keyPoolToWeight(btcPoolAddress)
711722 let ethWeightKEY = keyPoolToWeight(ethPoolAddress)
712723 let ethBtcWeightKEY = keyPoolToWeight(ethBtcPoolAddress)
713724 let usdcUsdtWeightKEY = keyPoolToWeight(usdcUsdtPoolAddress)
714725 let btcWeight = getIntOrFail(btcWeightKEY)
715726 let ethWeight = getIntOrFail(ethWeightKEY)
716727 let btcWeightNew = (btcWeight - weightDecrement)
717728 let ethWeightNew = (ethWeight - weightDecrement)
718729 if ((0 >= btcWeightNew))
719- then throw(("invalid btcWeightNew: " + toString(btcWeightNew)))
730+ then throwErr(("invalid btcWeightNew: " + toString(btcWeightNew)))
720731 else if ((0 >= ethWeightNew))
721- then throw(("invalid ethWeightNew: " + toString(ethWeightNew)))
732+ then throwErr(("invalid ethWeightNew: " + toString(ethWeightNew)))
722733 else {
723734 let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress))
724735 let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress))
725736 let ethBtcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethBtcPoolAddress))
726737 let usdcUsdtLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(usdcUsdtPoolAddress))
727738 let onModifyWeightBtc = invoke(stakingDapp, "onModifyWeight", [btcLpAssetIdStr, btcPoolAddress], nil)
728739 if ((onModifyWeightBtc == onModifyWeightBtc))
729740 then {
730741 let onModifyWeightEth = invoke(stakingDapp, "onModifyWeight", [ethLpAssetIdStr, ethPoolAddress], nil)
731742 if ((onModifyWeightEth == onModifyWeightEth))
732743 then {
733744 let onModifyWeightEthBtc = invoke(stakingDapp, "onModifyWeight", [ethBtcLpAssetIdStr, ethBtcPoolAddress], nil)
734745 if ((onModifyWeightEthBtc == onModifyWeightEthBtc))
735746 then {
736747 let onModifyWeightUsdcUsdt = invoke(stakingDapp, "onModifyWeight", [usdcUsdtLpAssetIdStr, usdcUsdtPoolAddress], nil)
737748 if ((onModifyWeightUsdcUsdt == onModifyWeightUsdcUsdt))
738749 then [IntegerEntry(btcWeightKEY, btcWeightNew), IntegerEntry(ethWeightKEY, ethWeightNew), IntegerEntry(ethBtcWeightKEY, ethBtcWeightNew), IntegerEntry(usdcUsdtWeightKEY, usdcUsdtWeightNew), IntegerEntry(keyPoolToWeightHistory(btcPoolAddress, 0), btcWeight), IntegerEntry(keyPoolToWeightHistory(ethPoolAddress, 0), ethWeight), IntegerEntry(keyPoolToWeightHistory(ethBtcPoolAddress, 0), ethBtcWeightNew), IntegerEntry(keyPoolToWeightHistory(usdcUsdtPoolAddress, 0), usdcUsdtWeightNew)]
739750 else throw("Strict value is not equal to itself.")
740751 }
741752 else throw("Strict value is not equal to itself.")
742753 }
743754 else throw("Strict value is not equal to itself.")
744755 }
745756 else throw("Strict value is not equal to itself.")
746757 }
747758 }
748759 else throw("Strict value is not equal to itself.")
749760 }
750761
751762
752763
753764 @Callable(i)
754765 func checkWxEmissionPoolLabel (amountAssetId,priceAssetId) = {
755766 let haveLabel = match getBoolean(keyWxEmission(amountAssetId, priceAssetId)) {
756767 case b: Boolean =>
757768 b
758769 case _ =>
759770 false
760771 }
761772 $Tuple2(nil, haveLabel)
762773 }
763774
764775
765776
766777 @Callable(i)
767778 func setWxEmissionPoolLabel (amountAssetId,priceAssetId) = {
768779 let checkCaller = mustAdmin(i)
769780 if ((checkCaller == checkCaller))
770781 then $Tuple2([BooleanEntry(keyWxEmission(amountAssetId, priceAssetId), true)], unit)
771782 else throw("Strict value is not equal to itself.")
772783 }
773784
774785
775786
776787 @Callable(i)
777788 func deleteWxEmissionPoolLabel (amountAssetId,priceAssetId) = {
778789 let checkCaller = if ((i.caller == this))
779790 then true
780791 else mustAdmin(i)
781792 if ((checkCaller == checkCaller))
782793 then $Tuple2([DeleteEntry(keyWxEmission(amountAssetId, priceAssetId))], unit)
783794 else throw("Strict value is not equal to itself.")
784795 }
785796
786797
787798
788799 @Callable(i)
789800 func onVerificationLoss (assetId) = {
790801 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyAssetsStoreContract()), "")))
791802 then true
792803 else mustManager(i)
793804 if ((checkCaller == checkCaller))
794805 then {
795806 let priceAssets = getPriceAssets()
796807 let checkPriceAssetsSize = if ((size(priceAssets) > 0))
797808 then true
798- else throw("invalid price assets")
809+ else throwErr("invalid price assets")
799810 if ((checkPriceAssetsSize == checkPriceAssetsSize))
800811 then {
801812 func cb (acc,priceAsset) = {
802813 let r = invoke(this, "deleteWxEmissionPoolLabel", [assetId, priceAsset], nil)
803814 if ((r == r))
804815 then unit
805816 else throw("Strict value is not equal to itself.")
806817 }
807818
808819 let actions = {
809820 let $l = priceAssets
810821 let $s = size($l)
811822 let $acc0 = unit
812823 func $f0_1 ($a,$i) = if (($i >= $s))
813824 then $a
814825 else cb($a, $l[$i])
815826
816827 func $f0_2 ($a,$i) = if (($i >= $s))
817828 then $a
818829 else throw("List size exceeds 11")
819830
820831 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11)
821832 }
822833 if ((actions == actions))
823834 then $Tuple2(nil, unit)
824835 else throw("Strict value is not equal to itself.")
825836 }
826837 else throw("Strict value is not equal to itself.")
827838 }
828839 else throw("Strict value is not equal to itself.")
829840 }
830841
831842
832843
833844 @Callable(i)
834845 func isPoolOneTokenOperationsDisabledREADONLY (poolAddress) = {
835846 let poolConfig = getPoolConfig(poolAddress)
836847 let assetsInternal = $Tuple2(parseIntValue(poolConfig[idxIAmtAssetId]), parseIntValue(poolConfig[idxIPriceAssetId]))
837848 let poolOneTokenOperationsDisabled = valueOrElse(getBoolean(keyPoolOneTokenOperationsDisabled(assetsInternal)), false)
838849 let allPoolsOneTokenOperationsDisabled = valueOrElse(getBoolean(keyAllPoolsOneTokenOperationsDisabled()), false)
839850 $Tuple2(nil, if (allPoolsOneTokenOperationsDisabled)
840851 then true
841852 else poolOneTokenOperationsDisabled)
842853 }
843854
844855
845856
846857 @Callable(i)
847858 func getInFeeREADONLY (poolAddress) = {
848859 let fee = intOrDefaultOrFallback(keyInFee(poolAddress), keyInFeeDefault(), 0)
849860 $Tuple2(nil, fee)
850861 }
851862
852863
853864
854865 @Callable(i)
855866 func getOutFeeREADONLY (poolAddress) = {
856867 let fee = intOrDefaultOrFallback(keyOutFee(poolAddress), keyOutFeeDefault(), fraction(10, MULT8, 10000))
857868 $Tuple2(nil, fee)
858869 }
859870
860871
861872
862873 @Callable(i)
863874 func poolInfoREADONLY (amountAssetIdStr,priceAssetIdStr) = {
864875 let amountAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(amountAssetIdStr))
865876 let priceAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(priceAssetIdStr))
866877 let poolContractAddressOption = getString(this, keyMappingPoolAssetsToPoolContractAddress(value(amountAssetInternalIdOption), value(priceAssetInternalIdOption)))
867878 let lpAssetIdOption = getString(this, keyMappingPoolContractToLPAsset(value(poolContractAddressOption)))
868879 let poolExists = if (if (isDefined(amountAssetInternalIdOption))
869880 then isDefined(priceAssetInternalIdOption)
870881 else false)
871882 then isDefined(poolContractAddressOption)
872883 else false
873884 let poolInfo = if (poolExists)
874885 then $Tuple2(addressFromStringValue(value(poolContractAddressOption)), parseAssetId(value(lpAssetIdOption)))
875886 else unit
876887 $Tuple2(nil, poolInfo)
877888 }
878889
879890
880891
881892 @Callable(i)
882893 func getPoolStatusREADONLY (poolAddress) = {
883894 let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP)
884895 let amountAssetInternal = poolAssets[1]
885896 let priceAssetInternal = poolAssets[2]
886897 let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP)
887898 $Tuple2(nil, parseIntValue(cfg[idxPoolStatus]))
888899 }
889900
890901
891902
892903 @Callable(i)
893904 func getPoolConfigREADONLY (poolAddress) = {
894905 let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP)
895906 let amountAssetInternal = poolAssets[1]
896907 let priceAssetInternal = poolAssets[2]
897908 let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP)
898909 $Tuple2(nil, cfg)
899910 }
900911
901912
902913
903914 @Callable(i)
904915 func getPoolConfigByLpAssetIdREADONLY (lpAssetIdStr) = {
905916 let poolAssets = split(getStringOrFail(keyMappingLpAssetToPoolAssets(lpAssetIdStr)), SEP)
906917 let amountAssetInternal = poolAssets[1]
907918 let priceAssetInternal = poolAssets[2]
908919 let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP)
909920 $Tuple2(nil, cfg)
910921 }
911922
912923
913924
914925 @Callable(i)
915926 func poolExistsREADONLY (amountAssetId,priceAssetId) = $Tuple2(nil, poolExistsInternal(amountAssetId, priceAssetId))
916927
917928
918929
919930 @Callable(i)
920931 func skipOrderValidationREADONLY (poolAddress) = $Tuple2(nil, valueOrElse(getBoolean(keySkipOrderValidation(poolAddress)), false))
921932
922933
923934
924935 @Callable(i)
925936 func getChangeAmpConfigREADONLY (poolAddress) = {
926937 let delay = getIntegerValue(keyChangeAmpDelay(poolAddress))
927938 let delta = getIntegerValue(keyChangeAmpDelta(poolAddress))
928939 let target = getIntegerValue(keyChangeAmpTarget(poolAddress))
929940 $Tuple2(nil, [delay, delta, target])
930941 }
931942
932943
933944
934945 @Callable(i)
935946 func getPoolWeightREADONLY (lpAssetId) = {
936947 let poolAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId))
937948 let weight = valueOrElse(getInteger(keyPoolToWeight(poolAddress)), 0)
938949 $Tuple2(nil, weight)
939950 }
940951
941952
953+
954+@Callable(i)
955+func deletePool (poolContractAddress) = {
956+ let checkCaller = if (mustManager(i))
957+ then true
958+ else permissionDeniedError
959+ if ((checkCaller == checkCaller))
960+ then {
961+ let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)), SEP)
962+ let amountAssetInternal = parseIntValue(poolAssets[1])
963+ let priceAssetInternal = parseIntValue(poolAssets[2])
964+ let amountAssetId = getStringValue(keyMappingsInternal2baseAssetId(amountAssetInternal))
965+ let priceAssetId = getStringValue(keyMappingsInternal2baseAssetId(priceAssetInternal))
966+ let lpAssetId = getStringOrFail(keyMappingPoolContractToLPAsset(poolContractAddress))
967+ let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract()))
968+ let userPoolsInvoke = invoke(userPoolsContract, "deletePool", [amountAssetId, priceAssetId], nil)
969+ if ((userPoolsInvoke == userPoolsInvoke))
970+ then {
971+ let votingEmissionContract = addressFromStringValue(getStringValue(keyVotingEmissionContract()))
972+ let votingEmissionInvoke = invoke(votingEmissionContract, "deletePool", [amountAssetId, priceAssetId], nil)
973+ if ((votingEmissionInvoke == votingEmissionInvoke))
974+ then [DeleteEntry(keyMappingPoolContractToLPAsset(poolContractAddress)), DeleteEntry(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)), DeleteEntry(keyMappingPoolAssetsToLpasset(toString(amountAssetInternal), toString(priceAssetInternal))), DeleteEntry(keyMappingPoolAssetsToPoolContractAddress(amountAssetInternal, priceAssetInternal)), DeleteEntry(keyPoolConfig(toString(amountAssetInternal), toString(priceAssetInternal))), DeleteEntry(keyMappingLpAssetToPoolAssets(lpAssetId)), DeleteEntry(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)), DeleteEntry(keyWxEmission(amountAssetId, priceAssetId)), DeleteEntry(keyPoolToWeight(poolContractAddress)), DeleteEntry(keyPoolSpread(poolContractAddress)), DeleteEntry(keyInFee(poolContractAddress)), DeleteEntry(keyOutFee(poolContractAddress)), DeleteEntry(keySkipOrderValidation(poolContractAddress)), DeleteEntry(keyChangeAmpDelay(poolContractAddress)), DeleteEntry(keyChangeAmpDelta(poolContractAddress)), DeleteEntry(keyChangeAmpTarget(poolContractAddress))]
975+ else throw("Strict value is not equal to itself.")
976+ }
977+ else throw("Strict value is not equal to itself.")
978+ }
979+ else throw("Strict value is not equal to itself.")
980+ }
981+
982+
942983 @Verifier(tx)
943984 func verify () = {
944985 let targetPublicKey = match managerPublicKeyOrUnit() {
945986 case pk: ByteVector =>
946987 pk
947988 case _: Unit =>
948989 tx.senderPublicKey
949990 case _ =>
950991 throw("Match error")
951992 }
952993 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
953994 }
954995

github/deemru/w8io/fabc49c 
115.22 ms