tx · 2mbizu3bHURTHUkscMagK8sDgfrAAaezopZYNbQaU6mo 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai: -0.02500000 Waves 2023.07.19 11:54 [2672526] smart account 3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai > SELF 0.00000000 Waves
{ "type": 13, "id": "2mbizu3bHURTHUkscMagK8sDgfrAAaezopZYNbQaU6mo", "fee": 2500000, "feeAssetId": null, "timestamp": 1689756848783, "version": 2, "chainId": 84, "sender": "3MsMP2pb2p8MDd6Rxb7XEXqqwEhE8ATfyai", "senderPublicKey": "2JEaBjtjvMoNGKZmL9QxYefa1VkMJM3vMW8rNvTs9R2H", "proofs": [ "4Q3APbsP9V5oEML4EQTSSPXPbKzsTSDcYrpKqoJdZM2f4tTYpLpC2PYpVtvkL9DmRWM1tGU1FCEgLVEhamojeber" ], "script": "base64:BgLZKggCEgASBAoCCAgSBAoCCAgSAwoBCBIKCggICAgICAgIARIDCgEIEgYKBAgICAgSBAoCCBgSAwoBCBIECgIIGBIDCgEYEgoKCAgICAgIAQgIEgQKAggBEgMKAQESAwoBARIECgIIARIGCgQICAgIEgQKAggIEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIEgMKAQgiBlNDQUxFOCIFTVVMVDgiBk1VTFQxMiIHU0NBTEUxOCIGTVVMVDE4Ig5QT09MV0VJR0hUTVVMVCIOR1dYdmlydHVhbFBPT0wiDGxhYmVsUG9vbHNMcCINZGVmYXVsdFNwcmVhZCILd2F2ZXNTdHJpbmciEWRlY2ltYWxzTXVsdFByaWNlIgNTRVAiBUVNUFRZIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biISaWR4SW50ZXJuYWxBc3NldElkIg9pZHhSZXN1dEFjdGlvbnMiIGlkeElmQX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bAkAzAgCBQJlVgkAzAgCBQJlVwkAzAgCBQJlWAUDbmlsAmJ5ARVnZXRQb29sV2VpZ2h0UkVBRE9OTFkBAmJRBAJhYQkBAmFUAQkBAmF5AQUCYlEEAmVZCQELdmFsdWVPckVsc2UCCQCfCAEJAQFaAQUCYWEAAAkAlAoCBQNuaWwFAmVZAQJlWgECZmEABAJmYgQCYmEJAQJidAADCQABAgUCYmECCkJ5dGVWZWN0b3IEAmJBBQJiYQUCYkEDCQABAgUCYmECBFVuaXQIBQJlWg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZVoJYm9keUJ5dGVzCQCRAwIIBQJlWgZwcm9vZnMAAAUCZmKMPpMa", "height": 2672526, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BX1AjNZWyFFvXSMKYZx5cgz4Nut26FrzY5pAkdDshYZT Next: DXaPtP5RHZWHvPmdW9rS7vrvQZZFYDoUVxpGhVjcBdQ9 Diff:
Old | New | Differences | |
---|---|---|---|
20 | 20 | let defaultSpread = 2000000 | |
21 | 21 | ||
22 | 22 | let wavesString = "WAVES" | |
23 | - | ||
24 | - | let contractFilename = "factory_v2.ride" | |
25 | 23 | ||
26 | 24 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
27 | 25 | ||
69 | 67 | ||
70 | 68 | let validPoolLabels = [poolLabelWxEmission] | |
71 | 69 | ||
72 | - | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
73 | - | ||
74 | - | ||
75 | - | func throwErr (msg) = throw(wrapErr(msg)) | |
76 | - | ||
77 | - | ||
78 | 70 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
79 | 71 | ||
80 | 72 | ||
117 | 109 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
118 | 110 | ||
119 | 111 | ||
120 | - | func keyUserPoolsContract () = "%s__userPoolsContract" | |
121 | - | ||
122 | - | ||
123 | 112 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
124 | 113 | ||
125 | 114 | ||
148 | 137 | ||
149 | 138 | ||
150 | 139 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
151 | - | let $ | |
152 | - | let amountAssetInternal = $ | |
153 | - | let priceAssetInternal = $ | |
140 | + | let $t036583720 = assetsInternal | |
141 | + | let amountAssetInternal = $t036583720._1 | |
142 | + | let priceAssetInternal = $t036583720._2 | |
154 | 143 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
155 | 144 | } | |
156 | 145 | ||
309 | 298 | } | |
310 | 299 | ||
311 | 300 | ||
312 | - | let permissionDeniedError = | |
301 | + | let permissionDeniedError = throw("Permission denied") | |
313 | 302 | ||
314 | - | let testError = | |
303 | + | let testError = throw("Test error here") | |
315 | 304 | ||
316 | 305 | func mustThis (i) = if ((i.caller == this)) | |
317 | 306 | then true | |
399 | 388 | } | |
400 | 389 | ||
401 | 390 | ||
402 | - | func getAssetsDataFromPoolAddress (poolContractAddress) = { | |
403 | - | let poolAssets = match getString(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)) { | |
404 | - | case s: String => | |
405 | - | split(s, SEP) | |
406 | - | case _ => | |
407 | - | throwErr(makeString([poolContractAddress, "pool is not found"], " ")) | |
408 | - | } | |
409 | - | let amountAssetInternal = parseIntValue(poolAssets[1]) | |
410 | - | let priceAssetInternal = parseIntValue(poolAssets[2]) | |
411 | - | let amountAssetId = getStringValue(keyMappingsInternal2baseAssetId(amountAssetInternal)) | |
412 | - | let priceAssetId = getStringValue(keyMappingsInternal2baseAssetId(priceAssetInternal)) | |
413 | - | let lpAssetId = getStringValue(keyMappingPoolContractToLPAsset(poolContractAddress)) | |
414 | - | $Tuple5(amountAssetId, priceAssetId, lpAssetId, amountAssetInternal, priceAssetInternal) | |
415 | - | } | |
416 | - | ||
417 | - | ||
418 | - | func getPoolCreator (poolContractAddress) = { | |
419 | - | let $t01516615303 = getAssetsDataFromPoolAddress(poolContractAddress) | |
420 | - | let amountAssetId = $t01516615303._1 | |
421 | - | let priceAssetId = $t01516615303._2 | |
422 | - | let lpAssetId = $t01516615303._3 | |
423 | - | let amountAssetInternal = $t01516615303._4 | |
424 | - | let priceAssetInternal = $t01516615303._5 | |
425 | - | let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract())) | |
426 | - | let poolCreator = invoke(userPoolsContract, "getPoolCreatorREADONLY", [amountAssetId, priceAssetId], nil) | |
427 | - | poolCreator | |
428 | - | } | |
429 | - | ||
430 | - | ||
431 | - | func getAddressBalance (addressString,assetIdString) = { | |
432 | - | let address = addressFromStringValue(addressString) | |
433 | - | if ((assetIdString == "WAVES")) | |
434 | - | then wavesBalance(address).regular | |
435 | - | else { | |
436 | - | let assetId = fromBase58String(assetIdString) | |
437 | - | assetBalance(address, assetId) | |
438 | - | } | |
439 | - | } | |
440 | - | ||
441 | - | ||
442 | - | func isPoolEmpty (poolContractAddress) = { | |
443 | - | let $t01587816015 = getAssetsDataFromPoolAddress(poolContractAddress) | |
444 | - | let amountAssetId = $t01587816015._1 | |
445 | - | let priceAssetId = $t01587816015._2 | |
446 | - | let lpAssetId = $t01587816015._3 | |
447 | - | let amountAssetInternal = $t01587816015._4 | |
448 | - | let priceAssetInternal = $t01587816015._5 | |
449 | - | if ((getAddressBalance(poolContractAddress, amountAssetId) == 0)) | |
450 | - | then (getAddressBalance(poolContractAddress, priceAssetId) == 0) | |
451 | - | else false | |
452 | - | } | |
453 | - | ||
454 | - | ||
455 | 391 | @Callable(i) | |
456 | 392 | func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract())) | |
457 | 393 | ||
459 | 395 | ||
460 | 396 | @Callable(i) | |
461 | 397 | func getPoolLeaseConfigREADONLY (poolAddress,assetId) = { | |
462 | - | let $ | |
398 | + | let $t01430414608 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) { | |
463 | 399 | case r: Int => | |
464 | 400 | $Tuple2(true, min([100, max([0, r])])) | |
465 | 401 | case _ => | |
470 | 406 | $Tuple2(false, 0) | |
471 | 407 | } | |
472 | 408 | } | |
473 | - | let isLeasable = $ | |
474 | - | let leasedRatio = $ | |
409 | + | let isLeasable = $t01430414608._1 | |
410 | + | let leasedRatio = $t01430414608._2 | |
475 | 411 | let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) { | |
476 | 412 | case b: Int => | |
477 | 413 | max([0, b]) | |
483 | 419 | 0 | |
484 | 420 | } | |
485 | 421 | } | |
486 | - | let $ | |
422 | + | let $t01487415098 = if ((assetId == "WAVES")) | |
487 | 423 | then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12) | |
488 | 424 | else $Tuple3("", "", 0) | |
489 | - | let proxyAddress = $ | |
490 | - | let proxyAssetId = $ | |
491 | - | let proxyRateMul = $ | |
425 | + | let proxyAddress = $t01487415098._1 | |
426 | + | let proxyAssetId = $t01487415098._2 | |
427 | + | let proxyRateMul = $t01487415098._3 | |
492 | 428 | let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "") | |
493 | 429 | $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress)) | |
494 | 430 | } | |
602 | 538 | let checkCaller = mustAdmin(i) | |
603 | 539 | if ((checkCaller == checkCaller)) | |
604 | 540 | then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
605 | - | then | |
541 | + | then throw((("Pool address " + poolAddress) + " already registered.")) | |
606 | 542 | else { | |
607 | 543 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
608 | 544 | let internalAmountAssetId = internalAmountAssetData._1 | |
614 | 550 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
615 | 551 | let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr) | |
616 | 552 | if (poolExists) | |
617 | - | then | |
553 | + | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
618 | 554 | else { | |
619 | 555 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
620 | 556 | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
629 | 565 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil) | |
630 | 566 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
631 | 567 | then if ((poolActivateInvokeResult != "success")) | |
632 | - | then | |
568 | + | then throw("Pool initialisation error happened.") | |
633 | 569 | else { | |
634 | 570 | let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract())) | |
635 | 571 | let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil) | |
714 | 650 | let inAmountAssetId = toBase58String(value(payment.assetId)) | |
715 | 651 | let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
716 | 652 | if ((inAmountAssetId != lpAssetRequestedForBurning)) | |
717 | - | then | |
653 | + | then throw("Invalid asset passed.") | |
718 | 654 | else if ((amountToBurn != paymentAmount)) | |
719 | - | then | |
655 | + | then throw("Invalid amount passed.") | |
720 | 656 | else { | |
721 | 657 | let lpAsset = fromBase58String(lpAssetRequestedForBurning) | |
722 | 658 | $Tuple2([Burn(lpAsset, amountToBurn)], "success") | |
780 | 716 | let btcWeightNew = (btcWeight - weightDecrement) | |
781 | 717 | let ethWeightNew = (ethWeight - weightDecrement) | |
782 | 718 | if ((0 >= btcWeightNew)) | |
783 | - | then | |
719 | + | then throw(("invalid btcWeightNew: " + toString(btcWeightNew))) | |
784 | 720 | else if ((0 >= ethWeightNew)) | |
785 | - | then | |
721 | + | then throw(("invalid ethWeightNew: " + toString(ethWeightNew))) | |
786 | 722 | else { | |
787 | 723 | let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress)) | |
788 | 724 | let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress)) | |
859 | 795 | let priceAssets = getPriceAssets() | |
860 | 796 | let checkPriceAssetsSize = if ((size(priceAssets) > 0)) | |
861 | 797 | then true | |
862 | - | else | |
798 | + | else throw("invalid price assets") | |
863 | 799 | if ((checkPriceAssetsSize == checkPriceAssetsSize)) | |
864 | 800 | then { | |
865 | 801 | func cb (acc,priceAsset) = { | |
1003 | 939 | } | |
1004 | 940 | ||
1005 | 941 | ||
1006 | - | ||
1007 | - | @Callable(i) | |
1008 | - | func deletePool (poolContractAddress) = { | |
1009 | - | let poolConfig = getPoolConfig(poolContractAddress) | |
1010 | - | let checkCaller = if ((toString(i.caller) == getPoolCreator(poolContractAddress))) | |
1011 | - | then if (isPoolEmpty(poolContractAddress)) | |
1012 | - | then true | |
1013 | - | else throwErr("Pool is not empty") | |
1014 | - | else mustManager(i) | |
1015 | - | if ((checkCaller == checkCaller)) | |
1016 | - | then { | |
1017 | - | let checkWeight = if ((valueOrElse(getInteger(keyPoolToWeight(poolContractAddress)), 0) == 0)) | |
1018 | - | then true | |
1019 | - | else throwErr("Pool weight is not Zero") | |
1020 | - | if ((checkWeight == checkWeight)) | |
1021 | - | then { | |
1022 | - | let checkStatus = if ((poolConfig[idxPoolStatus] == toString(PoolShutdown))) | |
1023 | - | then true | |
1024 | - | else throwErr("Pool must be SHUTDOWN (4)") | |
1025 | - | if ((checkStatus == checkStatus)) | |
1026 | - | then { | |
1027 | - | let $t03911639253 = getAssetsDataFromPoolAddress(poolContractAddress) | |
1028 | - | let amountAssetId = $t03911639253._1 | |
1029 | - | let priceAssetId = $t03911639253._2 | |
1030 | - | let lpAssetId = $t03911639253._3 | |
1031 | - | let amountAssetInternal = $t03911639253._4 | |
1032 | - | let priceAssetInternal = $t03911639253._5 | |
1033 | - | let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract())) | |
1034 | - | let userPoolsInvoke = invoke(userPoolsContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1035 | - | if ((userPoolsInvoke == userPoolsInvoke)) | |
1036 | - | then { | |
1037 | - | let votingEmissionContract = addressFromStringValue(getStringValue(keyVotingEmissionContract())) | |
1038 | - | let votingEmissionInvoke = invoke(votingEmissionContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1039 | - | if ((votingEmissionInvoke == votingEmissionInvoke)) | |
1040 | - | then { | |
1041 | - | let assetsStoreContract = addressFromStringValue(getStringValue(keyAssetsStoreContract())) | |
1042 | - | let assetsStoreInvoke = invoke(assetsStoreContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1043 | - | if ((assetsStoreInvoke == assetsStoreInvoke)) | |
1044 | - | 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))] | |
1045 | - | else throw("Strict value is not equal to itself.") | |
1046 | - | } | |
1047 | - | else throw("Strict value is not equal to itself.") | |
1048 | - | } | |
1049 | - | else throw("Strict value is not equal to itself.") | |
1050 | - | } | |
1051 | - | else throw("Strict value is not equal to itself.") | |
1052 | - | } | |
1053 | - | else throw("Strict value is not equal to itself.") | |
1054 | - | } | |
1055 | - | else throw("Strict value is not equal to itself.") | |
1056 | - | } | |
1057 | - | ||
1058 | - | ||
1059 | 942 | @Verifier(tx) | |
1060 | 943 | func verify () = { | |
1061 | 944 | let targetPublicKey = match managerPublicKeyOrUnit() { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SCALE8 = 8 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let MULT12 = 1000000000000 | |
9 | 9 | ||
10 | 10 | let SCALE18 = 18 | |
11 | 11 | ||
12 | 12 | let MULT18 = toBigInt(1000000000000000000) | |
13 | 13 | ||
14 | 14 | let POOLWEIGHTMULT = MULT8 | |
15 | 15 | ||
16 | 16 | let GWXvirtualPOOL = "GWXvirtualPOOL" | |
17 | 17 | ||
18 | 18 | let labelPoolsLp = "POOLS_LP" | |
19 | 19 | ||
20 | 20 | let defaultSpread = 2000000 | |
21 | 21 | ||
22 | 22 | let wavesString = "WAVES" | |
23 | - | ||
24 | - | let contractFilename = "factory_v2.ride" | |
25 | 23 | ||
26 | 24 | let decimalsMultPrice = ((100 * 1000) * 1000) | |
27 | 25 | ||
28 | 26 | let SEP = "__" | |
29 | 27 | ||
30 | 28 | let EMPTY = "" | |
31 | 29 | ||
32 | 30 | let PoolActive = 1 | |
33 | 31 | ||
34 | 32 | let PoolPutDisabled = 2 | |
35 | 33 | ||
36 | 34 | let PoolMatcherDisabled = 3 | |
37 | 35 | ||
38 | 36 | let PoolShutdown = 4 | |
39 | 37 | ||
40 | 38 | let idxInternalAssetId = 1 | |
41 | 39 | ||
42 | 40 | let idxResutActions = 2 | |
43 | 41 | ||
44 | 42 | let idxIfAssetIdCalculationPerformed = 3 | |
45 | 43 | ||
46 | 44 | let idxPoolAddress = 1 | |
47 | 45 | ||
48 | 46 | let idxPoolStatus = 2 | |
49 | 47 | ||
50 | 48 | let idxPoolLPAssetId = 3 | |
51 | 49 | ||
52 | 50 | let idxAmtAssetId = 4 | |
53 | 51 | ||
54 | 52 | let idxPriceAssetId = 5 | |
55 | 53 | ||
56 | 54 | let idxAmtAssetDcm = 6 | |
57 | 55 | ||
58 | 56 | let idxPriceAssetDcm = 7 | |
59 | 57 | ||
60 | 58 | let idxIAmtAssetId = 8 | |
61 | 59 | ||
62 | 60 | let idxIPriceAssetId = 9 | |
63 | 61 | ||
64 | 62 | let idxLPAssetDcm = 10 | |
65 | 63 | ||
66 | 64 | let idxPoolType = 11 | |
67 | 65 | ||
68 | 66 | let poolLabelWxEmission = "WX_EMISSION" | |
69 | 67 | ||
70 | 68 | let validPoolLabels = [poolLabelWxEmission] | |
71 | 69 | ||
72 | - | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
73 | - | ||
74 | - | ||
75 | - | func throwErr (msg) = throw(wrapErr(msg)) | |
76 | - | ||
77 | - | ||
78 | 70 | func keyAllowedLpScriptHash () = "%s__allowedLpScriptHash" | |
79 | 71 | ||
80 | 72 | ||
81 | 73 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
82 | 74 | ||
83 | 75 | ||
84 | 76 | func swapContract () = "%s__swapContract" | |
85 | 77 | ||
86 | 78 | ||
87 | 79 | func keyFactoryConfig () = "%s__factoryConfig" | |
88 | 80 | ||
89 | 81 | ||
90 | 82 | func keyLpTokensList () = "%s__lpTokensList" | |
91 | 83 | ||
92 | 84 | ||
93 | 85 | func keyPoolScriptHash () = "%s%s__pool__scriptHash" | |
94 | 86 | ||
95 | 87 | ||
96 | 88 | func keyMatcherPub () = "%s%s__matcher__publicKey" | |
97 | 89 | ||
98 | 90 | ||
99 | 91 | func keyLegacyFactoryContract () = "%s__legacyFactoryContract" | |
100 | 92 | ||
101 | 93 | ||
102 | 94 | func keyLegacyPools () = "%s__legacyPools" | |
103 | 95 | ||
104 | 96 | ||
105 | 97 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
106 | 98 | ||
107 | 99 | ||
108 | 100 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
109 | 101 | ||
110 | 102 | ||
111 | 103 | func keyAdminPubKeys () = "%s__adminPubKeys" | |
112 | 104 | ||
113 | 105 | ||
114 | 106 | func keyAssetsStoreContract () = "%s__assetsStoreContract" | |
115 | 107 | ||
116 | 108 | ||
117 | 109 | func keyVotingEmissionContract () = "%s__votingEmissionContract" | |
118 | 110 | ||
119 | 111 | ||
120 | - | func keyUserPoolsContract () = "%s__userPoolsContract" | |
121 | - | ||
122 | - | ||
123 | 112 | func keyPriceAssets () = makeString(["%s", "priceAssets"], SEP) | |
124 | 113 | ||
125 | 114 | ||
126 | 115 | func keyPriceDecimals () = "%s__priceDecimals" | |
127 | 116 | ||
128 | 117 | ||
129 | 118 | func keyAllPoolsShutdown () = "%s__shutdown" | |
130 | 119 | ||
131 | 120 | ||
132 | 121 | func keyNextInternalAssetId () = "%s__nextInternalAssetId" | |
133 | 122 | ||
134 | 123 | ||
135 | 124 | func keyPoolToWeight (poolAddress) = ("%s%s__poolWeight__" + poolAddress) | |
136 | 125 | ||
137 | 126 | ||
138 | 127 | func keyPoolToWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num)) | |
139 | 128 | ||
140 | 129 | ||
141 | 130 | func keyMappingsInternal2baseAssetId (internalBaseAsset) = ("%s%s%d__mappings__internal2baseAssetId__" + toString(internalBaseAsset)) | |
142 | 131 | ||
143 | 132 | ||
144 | 133 | func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr) | |
145 | 134 | ||
146 | 135 | ||
147 | 136 | func keyPoolConfig (amountAssetInternal,priceAssetInternal) = (((("%d%d%s__" + amountAssetInternal) + "__") + priceAssetInternal) + "__config") | |
148 | 137 | ||
149 | 138 | ||
150 | 139 | func keyPoolOneTokenOperationsDisabled (assetsInternal) = { | |
151 | - | let $ | |
152 | - | let amountAssetInternal = $ | |
153 | - | let priceAssetInternal = $ | |
140 | + | let $t036583720 = assetsInternal | |
141 | + | let amountAssetInternal = $t036583720._1 | |
142 | + | let priceAssetInternal = $t036583720._2 | |
154 | 143 | makeString(["%d%d%s", toString(amountAssetInternal), toString(priceAssetInternal), "oneTokenOperationsDisabled"], SEP) | |
155 | 144 | } | |
156 | 145 | ||
157 | 146 | ||
158 | 147 | func keyAllPoolsOneTokenOperationsDisabled () = makeString(["%s", "oneTokenOperationsDisabled"], SEP) | |
159 | 148 | ||
160 | 149 | ||
161 | 150 | func keyMappingLpAssetToPoolAssets (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2Pool") | |
162 | 151 | ||
163 | 152 | ||
164 | 153 | func keyMappingPoolAssetsToLpasset (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + internalAmountAssetIdStr) + "__") + internalPriceAssetIdStr) + "__mappings__PoolAssets2LpAsset") | |
165 | 154 | ||
166 | 155 | ||
167 | 156 | func keyPoolSpread (poolAddress) = ("%s%s__spread__" + poolAddress) | |
168 | 157 | ||
169 | 158 | ||
170 | 159 | func keyMappingPoolContractAddressToPoolAssets (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2PoolAssets") | |
171 | 160 | ||
172 | 161 | ||
173 | 162 | func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract") | |
174 | 163 | ||
175 | 164 | ||
176 | 165 | func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset") | |
177 | 166 | ||
178 | 167 | ||
179 | 168 | func keyMappingPoolLPAssetToPoolContractAddress (lpAssetStr) = (("%s%s%s__" + lpAssetStr) + "__mappings__lpAsset2PoolContract") | |
180 | 169 | ||
181 | 170 | ||
182 | 171 | func keyWxEmission (amountAssetId,priceAssetId) = ((("%s%s%s__wxEmission__" + amountAssetId) + "__") + priceAssetId) | |
183 | 172 | ||
184 | 173 | ||
185 | 174 | func keyInFee (poolAddress) = ("%s%s__inFee__" + poolAddress) | |
186 | 175 | ||
187 | 176 | ||
188 | 177 | func keyInFeeDefault () = "%s__inFeeDefault" | |
189 | 178 | ||
190 | 179 | ||
191 | 180 | func keyOutFee (poolAddress) = ("%s%s__outFee__" + poolAddress) | |
192 | 181 | ||
193 | 182 | ||
194 | 183 | func keyOutFeeDefault () = "%s__outFeeDefault" | |
195 | 184 | ||
196 | 185 | ||
197 | 186 | func keySkipOrderValidation (poolAddress) = ("%s%s__skipOrderValidation__" + poolAddress) | |
198 | 187 | ||
199 | 188 | ||
200 | 189 | func keyChangeAmpDelay (poolAddress) = ("%s%s__changeAmpDelay__" + poolAddress) | |
201 | 190 | ||
202 | 191 | ||
203 | 192 | func keyChangeAmpDelta (poolAddress) = ("%s%s__changeAmpDelta__" + poolAddress) | |
204 | 193 | ||
205 | 194 | ||
206 | 195 | func keyChangeAmpTarget (poolAddress) = ("%s%s__changeAmpTarget__" + poolAddress) | |
207 | 196 | ||
208 | 197 | ||
209 | 198 | func keySWavesProxyAddress () = "%s__sWavesProxyAddress" | |
210 | 199 | ||
211 | 200 | ||
212 | 201 | func keySWavesAssetId () = "%s__sWavesAssetId" | |
213 | 202 | ||
214 | 203 | ||
215 | 204 | func keyStakingProfitAddress () = "%s__stakingProfitAddress" | |
216 | 205 | ||
217 | 206 | ||
218 | 207 | func keyLeasedRatio (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatio", poolAddress, assetId], SEP) | |
219 | 208 | ||
220 | 209 | ||
221 | 210 | func keyLeasedRatioDefault (assetId) = makeString(["%s%s", "leasedRatioDefault", assetId], SEP) | |
222 | 211 | ||
223 | 212 | ||
224 | 213 | func keyLeasedRatioTolerance (poolAddress,assetId) = makeString(["%s%s%s", "leasedRatioTolerance", poolAddress, assetId], SEP) | |
225 | 214 | ||
226 | 215 | ||
227 | 216 | func keyMinBalance (poolAddress,assetId) = makeString(["%s%s%s", "minBalance", poolAddress, assetId], SEP) | |
228 | 217 | ||
229 | 218 | ||
230 | 219 | func keyMinBalanceDefault (assetId) = makeString(["%s%s", "minBalanceDefault", assetId], SEP) | |
231 | 220 | ||
232 | 221 | ||
233 | 222 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key)) | |
234 | 223 | ||
235 | 224 | ||
236 | 225 | func getBooleanOrFail (key) = valueOrErrorMessage(getBoolean(this, key), ("No data for this.key=" + key)) | |
237 | 226 | ||
238 | 227 | ||
239 | 228 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), ("No data for this.key=" + key)) | |
240 | 229 | ||
241 | 230 | ||
242 | 231 | func parseAssetId (input) = if ((input == wavesString)) | |
243 | 232 | then unit | |
244 | 233 | else fromBase58String(input) | |
245 | 234 | ||
246 | 235 | ||
247 | 236 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
248 | 237 | case s: String => | |
249 | 238 | addressFromStringValue(s) | |
250 | 239 | case _ => | |
251 | 240 | this | |
252 | 241 | } | |
253 | 242 | ||
254 | 243 | ||
255 | 244 | let IdxFactoryCfgStakingDapp = 1 | |
256 | 245 | ||
257 | 246 | let IdxFactoryCfgBoostingDapp = 2 | |
258 | 247 | ||
259 | 248 | let IdxFactoryCfgIdoDapp = 3 | |
260 | 249 | ||
261 | 250 | let IdxFactoryCfgTeamDapp = 4 | |
262 | 251 | ||
263 | 252 | let IdxFactoryCfgEmissionDapp = 5 | |
264 | 253 | ||
265 | 254 | let IdxFactoryCfgRestDapp = 6 | |
266 | 255 | ||
267 | 256 | let IdxFactoryCfgSlippageDapp = 7 | |
268 | 257 | ||
269 | 258 | let IdxFactoryCfgDaoDapp = 8 | |
270 | 259 | ||
271 | 260 | let IdxFactoryCfgMarketingDapp = 9 | |
272 | 261 | ||
273 | 262 | let IdxFactoryCfgGwxRewardDapp = 10 | |
274 | 263 | ||
275 | 264 | let IdxFactoryCfgBirdsDapp = 11 | |
276 | 265 | ||
277 | 266 | func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp]) | |
278 | 267 | ||
279 | 268 | ||
280 | 269 | func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp]) | |
281 | 270 | ||
282 | 271 | ||
283 | 272 | func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp]) | |
284 | 273 | ||
285 | 274 | ||
286 | 275 | func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp]) | |
287 | 276 | ||
288 | 277 | ||
289 | 278 | func getPriceAssets () = match getString(keyPriceAssets()) { | |
290 | 279 | case s: String => | |
291 | 280 | if ((size(s) == 0)) | |
292 | 281 | then nil | |
293 | 282 | else split(s, SEP) | |
294 | 283 | case _ => | |
295 | 284 | nil | |
296 | 285 | } | |
297 | 286 | ||
298 | 287 | ||
299 | 288 | func managerPublicKeyOrUnit () = { | |
300 | 289 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
301 | 290 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
302 | 291 | case s: String => | |
303 | 292 | fromBase58String(s) | |
304 | 293 | case _: Unit => | |
305 | 294 | unit | |
306 | 295 | case _ => | |
307 | 296 | throw("Match error") | |
308 | 297 | } | |
309 | 298 | } | |
310 | 299 | ||
311 | 300 | ||
312 | - | let permissionDeniedError = | |
301 | + | let permissionDeniedError = throw("Permission denied") | |
313 | 302 | ||
314 | - | let testError = | |
303 | + | let testError = throw("Test error here") | |
315 | 304 | ||
316 | 305 | func mustThis (i) = if ((i.caller == this)) | |
317 | 306 | then true | |
318 | 307 | else permissionDeniedError | |
319 | 308 | ||
320 | 309 | ||
321 | 310 | func mustManager (i) = match managerPublicKeyOrUnit() { | |
322 | 311 | case pk: ByteVector => | |
323 | 312 | if ((i.callerPublicKey == pk)) | |
324 | 313 | then true | |
325 | 314 | else permissionDeniedError | |
326 | 315 | case _: Unit => | |
327 | 316 | mustThis(i) | |
328 | 317 | case _ => | |
329 | 318 | throw("Match error") | |
330 | 319 | } | |
331 | 320 | ||
332 | 321 | ||
333 | 322 | 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) | |
334 | 323 | ||
335 | 324 | ||
336 | 325 | func dataFactoryCfg (stakingAddress,boostingAddress,idoContract,teamContract,emissionContract,restContract,slippageContract) = makeString(["%s%s%s%s%s%s", stakingAddress, boostingAddress, idoContract, teamContract, emissionContract, restContract, slippageContract], SEP) | |
337 | 326 | ||
338 | 327 | ||
339 | 328 | 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) | |
340 | 329 | ||
341 | 330 | ||
342 | 331 | func dataMappingPoolAssets (internalAmountAssetStr,internalPriceAssetStr) = makeString(["%d%d", toString(internalAmountAssetStr), toString(internalPriceAssetStr)], SEP) | |
343 | 332 | ||
344 | 333 | ||
345 | 334 | func getPoolConfig (poolAddress) = { | |
346 | 335 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
347 | 336 | let amountAssetInternal = poolAssets[1] | |
348 | 337 | let priceAssetInternal = poolAssets[2] | |
349 | 338 | split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
350 | 339 | } | |
351 | 340 | ||
352 | 341 | ||
353 | 342 | func getInternalAssetIdOrCreate (assetIdStr,incrementor) = { | |
354 | 343 | let internalAssetId = valueOrElse(getInteger(this, keyMappingsBaseAsset2internalId(assetIdStr)), 0) | |
355 | 344 | let currentIndexOfInternalId = valueOrElse(getInteger(this, keyNextInternalAssetId()), 0) | |
356 | 345 | let result = if ((internalAssetId == 0)) | |
357 | 346 | then { | |
358 | 347 | let newInternalAssetId = (currentIndexOfInternalId + incrementor) | |
359 | 348 | $Tuple3(newInternalAssetId, [IntegerEntry(keyNextInternalAssetId(), newInternalAssetId), IntegerEntry(keyMappingsBaseAsset2internalId(assetIdStr), newInternalAssetId), StringEntry(keyMappingsInternal2baseAssetId(newInternalAssetId), assetIdStr)], true) | |
360 | 349 | } | |
361 | 350 | else $Tuple3(internalAssetId, nil, false) | |
362 | 351 | result | |
363 | 352 | } | |
364 | 353 | ||
365 | 354 | ||
366 | 355 | func mustAdmin (i) = { | |
367 | 356 | let adminPKs = split(valueOrElse(getString(keyAdminPubKeys()), EMPTY), SEP) | |
368 | 357 | if (containsElement(adminPKs, toBase58String(i.callerPublicKey))) | |
369 | 358 | then true | |
370 | 359 | else { | |
371 | 360 | let isManager = mustManager(i) | |
372 | 361 | if ((isManager == isManager)) | |
373 | 362 | then true | |
374 | 363 | else throw("Strict value is not equal to itself.") | |
375 | 364 | } | |
376 | 365 | } | |
377 | 366 | ||
378 | 367 | ||
379 | 368 | func intOrDefaultOrFallback (key,keyDefault,valueFallback) = valueOrElse(getInteger(this, key), valueOrElse(getInteger(this, keyDefault), valueFallback)) | |
380 | 369 | ||
381 | 370 | ||
382 | 371 | func poolExistsInternal (amountAssetId,priceAssetId) = { | |
383 | 372 | let amountAssetInternal = getInteger(keyMappingsBaseAsset2internalId(amountAssetId)) | |
384 | 373 | let priceAssetInternal = getInteger(keyMappingsBaseAsset2internalId(priceAssetId)) | |
385 | 374 | if (if ((amountAssetInternal == unit)) | |
386 | 375 | then true | |
387 | 376 | else (priceAssetInternal == unit)) | |
388 | 377 | then false | |
389 | 378 | else { | |
390 | 379 | let amAs = toString(value(amountAssetInternal)) | |
391 | 380 | let prAs = toString(value(priceAssetInternal)) | |
392 | 381 | let cfg = getString(keyPoolConfig(amAs, prAs)) | |
393 | 382 | let cfgReverse = getString(keyPoolConfig(prAs, amAs)) | |
394 | 383 | let exists = if ((cfg != unit)) | |
395 | 384 | then true | |
396 | 385 | else (cfgReverse != unit) | |
397 | 386 | exists | |
398 | 387 | } | |
399 | 388 | } | |
400 | 389 | ||
401 | 390 | ||
402 | - | func getAssetsDataFromPoolAddress (poolContractAddress) = { | |
403 | - | let poolAssets = match getString(keyMappingPoolContractAddressToPoolAssets(poolContractAddress)) { | |
404 | - | case s: String => | |
405 | - | split(s, SEP) | |
406 | - | case _ => | |
407 | - | throwErr(makeString([poolContractAddress, "pool is not found"], " ")) | |
408 | - | } | |
409 | - | let amountAssetInternal = parseIntValue(poolAssets[1]) | |
410 | - | let priceAssetInternal = parseIntValue(poolAssets[2]) | |
411 | - | let amountAssetId = getStringValue(keyMappingsInternal2baseAssetId(amountAssetInternal)) | |
412 | - | let priceAssetId = getStringValue(keyMappingsInternal2baseAssetId(priceAssetInternal)) | |
413 | - | let lpAssetId = getStringValue(keyMappingPoolContractToLPAsset(poolContractAddress)) | |
414 | - | $Tuple5(amountAssetId, priceAssetId, lpAssetId, amountAssetInternal, priceAssetInternal) | |
415 | - | } | |
416 | - | ||
417 | - | ||
418 | - | func getPoolCreator (poolContractAddress) = { | |
419 | - | let $t01516615303 = getAssetsDataFromPoolAddress(poolContractAddress) | |
420 | - | let amountAssetId = $t01516615303._1 | |
421 | - | let priceAssetId = $t01516615303._2 | |
422 | - | let lpAssetId = $t01516615303._3 | |
423 | - | let amountAssetInternal = $t01516615303._4 | |
424 | - | let priceAssetInternal = $t01516615303._5 | |
425 | - | let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract())) | |
426 | - | let poolCreator = invoke(userPoolsContract, "getPoolCreatorREADONLY", [amountAssetId, priceAssetId], nil) | |
427 | - | poolCreator | |
428 | - | } | |
429 | - | ||
430 | - | ||
431 | - | func getAddressBalance (addressString,assetIdString) = { | |
432 | - | let address = addressFromStringValue(addressString) | |
433 | - | if ((assetIdString == "WAVES")) | |
434 | - | then wavesBalance(address).regular | |
435 | - | else { | |
436 | - | let assetId = fromBase58String(assetIdString) | |
437 | - | assetBalance(address, assetId) | |
438 | - | } | |
439 | - | } | |
440 | - | ||
441 | - | ||
442 | - | func isPoolEmpty (poolContractAddress) = { | |
443 | - | let $t01587816015 = getAssetsDataFromPoolAddress(poolContractAddress) | |
444 | - | let amountAssetId = $t01587816015._1 | |
445 | - | let priceAssetId = $t01587816015._2 | |
446 | - | let lpAssetId = $t01587816015._3 | |
447 | - | let amountAssetInternal = $t01587816015._4 | |
448 | - | let priceAssetInternal = $t01587816015._5 | |
449 | - | if ((getAddressBalance(poolContractAddress, amountAssetId) == 0)) | |
450 | - | then (getAddressBalance(poolContractAddress, priceAssetId) == 0) | |
451 | - | else false | |
452 | - | } | |
453 | - | ||
454 | - | ||
455 | 391 | @Callable(i) | |
456 | 392 | func getSwapContractREADONLY () = $Tuple2(nil, getStringOrFail(swapContract())) | |
457 | 393 | ||
458 | 394 | ||
459 | 395 | ||
460 | 396 | @Callable(i) | |
461 | 397 | func getPoolLeaseConfigREADONLY (poolAddress,assetId) = { | |
462 | - | let $ | |
398 | + | let $t01430414608 = match getInteger(this, keyLeasedRatio(poolAddress, assetId)) { | |
463 | 399 | case r: Int => | |
464 | 400 | $Tuple2(true, min([100, max([0, r])])) | |
465 | 401 | case _ => | |
466 | 402 | match getInteger(this, keyLeasedRatioDefault(assetId)) { | |
467 | 403 | case rd: Int => | |
468 | 404 | $Tuple2(true, min([100, max([0, rd])])) | |
469 | 405 | case _ => | |
470 | 406 | $Tuple2(false, 0) | |
471 | 407 | } | |
472 | 408 | } | |
473 | - | let isLeasable = $ | |
474 | - | let leasedRatio = $ | |
409 | + | let isLeasable = $t01430414608._1 | |
410 | + | let leasedRatio = $t01430414608._2 | |
475 | 411 | let minBalance = match getInteger(this, keyMinBalance(poolAddress, assetId)) { | |
476 | 412 | case b: Int => | |
477 | 413 | max([0, b]) | |
478 | 414 | case _ => | |
479 | 415 | match getInteger(this, keyMinBalanceDefault(assetId)) { | |
480 | 416 | case bd: Int => | |
481 | 417 | max([0, bd]) | |
482 | 418 | case _ => | |
483 | 419 | 0 | |
484 | 420 | } | |
485 | 421 | } | |
486 | - | let $ | |
422 | + | let $t01487415098 = if ((assetId == "WAVES")) | |
487 | 423 | then $Tuple3(valueOrElse(getString(this, keySWavesProxyAddress()), ""), getString(this, valueOrElse(keySWavesAssetId(), "")), MULT12) | |
488 | 424 | else $Tuple3("", "", 0) | |
489 | - | let proxyAddress = $ | |
490 | - | let proxyAssetId = $ | |
491 | - | let proxyRateMul = $ | |
425 | + | let proxyAddress = $t01487415098._1 | |
426 | + | let proxyAssetId = $t01487415098._2 | |
427 | + | let proxyRateMul = $t01487415098._3 | |
492 | 428 | let stakingProfitAddress = valueOrElse(getString(this, keyStakingProfitAddress()), "") | |
493 | 429 | $Tuple2(nil, $Tuple7(isLeasable, leasedRatio, minBalance, proxyAddress, proxyAssetId, proxyRateMul, stakingProfitAddress)) | |
494 | 430 | } | |
495 | 431 | ||
496 | 432 | ||
497 | 433 | ||
498 | 434 | @Callable(i) | |
499 | 435 | func getLpAssetFromPoolAssetsREADONLY (asset1,asset2) = if (if ((asset1 == "8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS")) | |
500 | 436 | then (asset2 == "WAVES") | |
501 | 437 | else false) | |
502 | 438 | then $Tuple2(nil, unit) | |
503 | 439 | else { | |
504 | 440 | let assetNum1 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset1))) | |
505 | 441 | let assetNum2 = value(getInteger(this, keyMappingsBaseAsset2internalId(asset2))) | |
506 | 442 | let ee = getString(this, keyMappingPoolAssetsToLpasset(toString(assetNum1), toString(assetNum2))) | |
507 | 443 | let res = if ((ee == unit)) | |
508 | 444 | then unit | |
509 | 445 | else drop(value(ee), 4) | |
510 | 446 | $Tuple2(nil, res) | |
511 | 447 | } | |
512 | 448 | ||
513 | 449 | ||
514 | 450 | ||
515 | 451 | @Callable(i) | |
516 | 452 | func getPoolAddressFromLpAssetREADONLY (lp) = $Tuple2(nil, valueOrElse(getString(this, keyMappingPoolLPAssetToPoolContractAddress(lp)), "")) | |
517 | 453 | ||
518 | 454 | ||
519 | 455 | ||
520 | 456 | @Callable(i) | |
521 | 457 | func constructor (stakingContract,boostingContract,idoContract,teamContract,emissionContract,restContract,slpipageContract,priceDecimals) = { | |
522 | 458 | let checkCaller = mustManager(i) | |
523 | 459 | if ((checkCaller == checkCaller)) | |
524 | 460 | then [StringEntry(keyFactoryConfig(), dataFactoryCfg(stakingContract, boostingContract, idoContract, teamContract, emissionContract, restContract, slpipageContract)), IntegerEntry(keyPriceDecimals(), priceDecimals)] | |
525 | 461 | else throw("Strict value is not equal to itself.") | |
526 | 462 | } | |
527 | 463 | ||
528 | 464 | ||
529 | 465 | ||
530 | 466 | @Callable(i) | |
531 | 467 | func constructorV2 (mathcherPub58Str) = { | |
532 | 468 | let checkCaller = mustManager(i) | |
533 | 469 | if ((checkCaller == checkCaller)) | |
534 | 470 | then { | |
535 | 471 | let mathcerPub = addressFromPublicKey(fromBase58String(mathcherPub58Str)) | |
536 | 472 | if ((mathcerPub == mathcerPub)) | |
537 | 473 | then [StringEntry(keyMatcherPub(), mathcherPub58Str)] | |
538 | 474 | else throw("Strict value is not equal to itself.") | |
539 | 475 | } | |
540 | 476 | else throw("Strict value is not equal to itself.") | |
541 | 477 | } | |
542 | 478 | ||
543 | 479 | ||
544 | 480 | ||
545 | 481 | @Callable(i) | |
546 | 482 | func constructorV3 (daoContract,marketingContract,gwxRewardsContract,birdsContract) = { | |
547 | 483 | let checkCaller = mustManager(i) | |
548 | 484 | if ((checkCaller == checkCaller)) | |
549 | 485 | then { | |
550 | 486 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
551 | 487 | [StringEntry(keyFactoryConfig(), dataFactoryCfgV3(factoryCfg[1], factoryCfg[2], factoryCfg[3], factoryCfg[4], factoryCfg[5], factoryCfg[6], factoryCfg[7], daoContract, marketingContract, gwxRewardsContract, birdsContract))] | |
552 | 488 | } | |
553 | 489 | else throw("Strict value is not equal to itself.") | |
554 | 490 | } | |
555 | 491 | ||
556 | 492 | ||
557 | 493 | ||
558 | 494 | @Callable(i) | |
559 | 495 | func constructorV4 (legacyFactoryContract,legacyPools) = { | |
560 | 496 | let checkCaller = mustManager(i) | |
561 | 497 | if ((checkCaller == checkCaller)) | |
562 | 498 | then [StringEntry(keyLegacyFactoryContract(), legacyFactoryContract), StringEntry(keyLegacyPools(), makeString(legacyPools, SEP))] | |
563 | 499 | else throw("Strict value is not equal to itself.") | |
564 | 500 | } | |
565 | 501 | ||
566 | 502 | ||
567 | 503 | ||
568 | 504 | @Callable(i) | |
569 | 505 | func constructorV5 (assetsStoreContract) = { | |
570 | 506 | let checkCaller = mustManager(i) | |
571 | 507 | if ((checkCaller == checkCaller)) | |
572 | 508 | then [StringEntry(keyAssetsStoreContract(), assetsStoreContract)] | |
573 | 509 | else throw("Strict value is not equal to itself.") | |
574 | 510 | } | |
575 | 511 | ||
576 | 512 | ||
577 | 513 | ||
578 | 514 | @Callable(i) | |
579 | 515 | func constructorV6 (votingEmissionContract,priceAssets) = { | |
580 | 516 | let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit)) | |
581 | 517 | then true | |
582 | 518 | else "invalid voting emission contract address"] | |
583 | 519 | if ((cheks == cheks)) | |
584 | 520 | then [StringEntry(keyVotingEmissionContract(), votingEmissionContract), StringEntry(keyPriceAssets(), makeString(priceAssets, SEP))] | |
585 | 521 | else throw("Strict value is not equal to itself.") | |
586 | 522 | } | |
587 | 523 | ||
588 | 524 | ||
589 | 525 | ||
590 | 526 | @Callable(i) | |
591 | 527 | func setAdmins (adminPubKeys) = { | |
592 | 528 | let checkCaller = mustManager(i) | |
593 | 529 | if ((checkCaller == checkCaller)) | |
594 | 530 | then [StringEntry(keyAdminPubKeys(), makeString(adminPubKeys, SEP))] | |
595 | 531 | else throw("Strict value is not equal to itself.") | |
596 | 532 | } | |
597 | 533 | ||
598 | 534 | ||
599 | 535 | ||
600 | 536 | @Callable(i) | |
601 | 537 | func activateNewPool (poolAddress,amountAssetStr,priceAssetStr,lpAssetName,lpAssetDescr,poolWeight,poolType,logo) = { | |
602 | 538 | let checkCaller = mustAdmin(i) | |
603 | 539 | if ((checkCaller == checkCaller)) | |
604 | 540 | then if (isDefined(getString(keyMappingPoolContractAddressToPoolAssets(poolAddress)))) | |
605 | - | then | |
541 | + | then throw((("Pool address " + poolAddress) + " already registered.")) | |
606 | 542 | else { | |
607 | 543 | let internalAmountAssetData = getInternalAssetIdOrCreate(amountAssetStr, 1) | |
608 | 544 | let internalAmountAssetId = internalAmountAssetData._1 | |
609 | 545 | let internalPriceAssetData = getInternalAssetIdOrCreate(priceAssetStr, if (internalAmountAssetData._3) | |
610 | 546 | then 2 | |
611 | 547 | else 1) | |
612 | 548 | let internalPriceAssetId = internalPriceAssetData._1 | |
613 | 549 | let poolAccountScriptHash = valueOrErrorMessage(scriptHash(addressFromStringValue(poolAddress)), ("No script has been found on pool account " + poolAddress)) | |
614 | 550 | let ethalonPoolAccountScriptHash = getBinaryValue(keyPoolScriptHash()) | |
615 | 551 | let poolExists = poolExistsInternal(amountAssetStr, priceAssetStr) | |
616 | 552 | if (poolExists) | |
617 | - | then | |
553 | + | then throw((((("Pool " + amountAssetStr) + "/") + priceAssetStr) + " has already been activated.")) | |
618 | 554 | else { | |
619 | 555 | let poolConfigValue = value(getString(this, keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)))) | |
620 | 556 | let amountAssetsDecimals = if ((amountAssetStr == "WAVES")) | |
621 | 557 | then decimalsMultPrice | |
622 | 558 | else pow(10, 0, value(assetInfo(fromBase58String(amountAssetStr))).decimals, 0, 0, DOWN) | |
623 | 559 | let priceAssetsDecimals = if ((priceAssetStr == "WAVES")) | |
624 | 560 | then decimalsMultPrice | |
625 | 561 | else pow(10, 0, value(assetInfo(fromBase58String(priceAssetStr))).decimals, 0, 0, DOWN) | |
626 | 562 | let lpAssetIssueAction = Issue(lpAssetName, lpAssetDescr, 1, 8, true) | |
627 | 563 | let lpAssetId = calculateAssetId(lpAssetIssueAction) | |
628 | 564 | let lpAssetIdStr = toBase58String(lpAssetId) | |
629 | 565 | let poolActivateInvokeResult = invoke(addressFromStringValue(poolAddress), "activate", [amountAssetStr, priceAssetStr], nil) | |
630 | 566 | if ((poolActivateInvokeResult == poolActivateInvokeResult)) | |
631 | 567 | then if ((poolActivateInvokeResult != "success")) | |
632 | - | then | |
568 | + | then throw("Pool initialisation error happened.") | |
633 | 569 | else { | |
634 | 570 | let assetsStoreContract = addressFromStringValue(getStringOrFail(keyAssetsStoreContract())) | |
635 | 571 | let createOrUpdateLpAssetInv = invoke(assetsStoreContract, "createOrUpdate", [lpAssetIdStr, lpAssetName, false], nil) | |
636 | 572 | if ((createOrUpdateLpAssetInv == createOrUpdateLpAssetInv)) | |
637 | 573 | then { | |
638 | 574 | let addPoolsLpLabelInv = invoke(assetsStoreContract, "addLabel", [lpAssetIdStr, labelPoolsLp], nil) | |
639 | 575 | if ((addPoolsLpLabelInv == addPoolsLpLabelInv)) | |
640 | 576 | then { | |
641 | 577 | let setLogoInv = invoke(assetsStoreContract, "setLogo", [lpAssetIdStr, logo], nil) | |
642 | 578 | if ((setLogoInv == setLogoInv)) | |
643 | 579 | then { | |
644 | 580 | let addAssetsLinkInv = invoke(assetsStoreContract, "addAssetsLink", [amountAssetStr, priceAssetStr, lpAssetIdStr], nil) | |
645 | 581 | if ((addAssetsLinkInv == addAssetsLinkInv)) | |
646 | 582 | then { | |
647 | 583 | let increaseAssetPoolsNumberInv = invoke(assetsStoreContract, "increaseAssetPoolsNumber", [amountAssetStr], nil) | |
648 | 584 | if ((increaseAssetPoolsNumberInv == increaseAssetPoolsNumberInv)) | |
649 | 585 | 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) | |
650 | 586 | else throw("Strict value is not equal to itself.") | |
651 | 587 | } | |
652 | 588 | else throw("Strict value is not equal to itself.") | |
653 | 589 | } | |
654 | 590 | else throw("Strict value is not equal to itself.") | |
655 | 591 | } | |
656 | 592 | else throw("Strict value is not equal to itself.") | |
657 | 593 | } | |
658 | 594 | else throw("Strict value is not equal to itself.") | |
659 | 595 | } | |
660 | 596 | else throw("Strict value is not equal to itself.") | |
661 | 597 | } | |
662 | 598 | } | |
663 | 599 | else throw("Strict value is not equal to itself.") | |
664 | 600 | } | |
665 | 601 | ||
666 | 602 | ||
667 | 603 | ||
668 | 604 | @Callable(i) | |
669 | 605 | func managePool (poolAddress,newStatus) = { | |
670 | 606 | let checkCaller = mustManager(i) | |
671 | 607 | if ((checkCaller == checkCaller)) | |
672 | 608 | then { | |
673 | 609 | let poolConfig = getPoolConfig(poolAddress) | |
674 | 610 | let poolStatus = poolConfig[idxPoolStatus] | |
675 | 611 | let lpAssetIdStr = poolConfig[idxPoolLPAssetId] | |
676 | 612 | let amountAssetStr = poolConfig[idxAmtAssetId] | |
677 | 613 | let priceAssetStr = poolConfig[idxPriceAssetId] | |
678 | 614 | let amountAssetsDecimals = parseIntValue(poolConfig[idxAmtAssetDcm]) | |
679 | 615 | let priceAssetsDecimals = parseIntValue(poolConfig[idxPriceAssetDcm]) | |
680 | 616 | let internalAmountAssetId = parseIntValue(poolConfig[idxIAmtAssetId]) | |
681 | 617 | let internalPriceAssetId = parseIntValue(poolConfig[idxIPriceAssetId]) | |
682 | 618 | let lpAssetDcm = parseIntValue(poolConfig[idxLPAssetDcm]) | |
683 | 619 | let poolType = poolConfig[idxPoolType] | |
684 | 620 | [StringEntry(keyPoolConfig(toString(internalAmountAssetId), toString(internalPriceAssetId)), dataPoolCfg(poolAddress, toString(newStatus), lpAssetIdStr, amountAssetStr, priceAssetStr, amountAssetsDecimals, priceAssetsDecimals, internalAmountAssetId, internalPriceAssetId, lpAssetDcm, poolType))] | |
685 | 621 | } | |
686 | 622 | else throw("Strict value is not equal to itself.") | |
687 | 623 | } | |
688 | 624 | ||
689 | 625 | ||
690 | 626 | ||
691 | 627 | @Callable(i) | |
692 | 628 | func emit (amountToEmit) = { | |
693 | 629 | let caller = i.caller | |
694 | 630 | let originCaller = i.originCaller | |
695 | 631 | let lpAssetRequested = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
696 | 632 | let lpAsset = fromBase58String(lpAssetRequested) | |
697 | 633 | let legacyPools = split(valueOrElse(getString(keyLegacyPools()), EMPTY), SEP) | |
698 | 634 | let legacyFactoryContract = addressFromStringValue(valueOrErrorMessage(getString(keyLegacyFactoryContract()), "Legacy factory contract does not exists.")) | |
699 | 635 | if ((0 >= amountToEmit)) | |
700 | 636 | then nil | |
701 | 637 | else if (containsElement(legacyPools, toString(caller))) | |
702 | 638 | then $Tuple2(nil, legacyFactoryContract) | |
703 | 639 | else $Tuple2([Reissue(lpAsset, amountToEmit, true), ScriptTransfer(i.caller, amountToEmit, lpAsset)], "success") | |
704 | 640 | } | |
705 | 641 | ||
706 | 642 | ||
707 | 643 | ||
708 | 644 | @Callable(i) | |
709 | 645 | func burn (amountToBurn) = { | |
710 | 646 | let caller = i.caller | |
711 | 647 | let originCaller = i.originCaller | |
712 | 648 | let payment = value(i.payments[0]) | |
713 | 649 | let paymentAmount = value(payment.amount) | |
714 | 650 | let inAmountAssetId = toBase58String(value(payment.assetId)) | |
715 | 651 | let lpAssetRequestedForBurning = valueOrErrorMessage(getString(keyMappingPoolContractToLPAsset(toString(caller))), "Invalid LP address called me.") | |
716 | 652 | if ((inAmountAssetId != lpAssetRequestedForBurning)) | |
717 | - | then | |
653 | + | then throw("Invalid asset passed.") | |
718 | 654 | else if ((amountToBurn != paymentAmount)) | |
719 | - | then | |
655 | + | then throw("Invalid amount passed.") | |
720 | 656 | else { | |
721 | 657 | let lpAsset = fromBase58String(lpAssetRequestedForBurning) | |
722 | 658 | $Tuple2([Burn(lpAsset, amountToBurn)], "success") | |
723 | 659 | } | |
724 | 660 | } | |
725 | 661 | ||
726 | 662 | ||
727 | 663 | ||
728 | 664 | @Callable(i) | |
729 | 665 | func modifyWeight (lpAssetId,share) = { | |
730 | 666 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), ""))) | |
731 | 667 | then true | |
732 | 668 | else mustManager(i) | |
733 | 669 | if ((checkCaller == checkCaller)) | |
734 | 670 | then { | |
735 | 671 | let poolContractAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)) | |
736 | 672 | let poolWeightKey = keyPoolToWeight(poolContractAddress) | |
737 | 673 | let gwxWeightKey = keyPoolToWeight(GWXvirtualPOOL) | |
738 | 674 | let gwxWeight = valueOrElse(getInteger(gwxWeightKey), 0) | |
739 | 675 | let poolWeight = valueOrElse(getInteger(poolWeightKey), 0) | |
740 | 676 | let poolWeightNew = share | |
741 | 677 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
742 | 678 | let stakingContract = getStakingAddressOrFail(factoryCfg) | |
743 | 679 | let onModifyWeightInv = invoke(stakingContract, "onModifyWeight", [lpAssetId, poolContractAddress], nil) | |
744 | 680 | if ((onModifyWeightInv == onModifyWeightInv)) | |
745 | 681 | then { | |
746 | 682 | let gwxVirtualPoolActions = if ((gwxWeight == 0)) | |
747 | 683 | then nil | |
748 | 684 | else [IntegerEntry(gwxWeightKey, 0)] | |
749 | 685 | let poolWeightHistoryKey = keyPoolToWeightHistory(poolContractAddress, 0) | |
750 | 686 | let poolWeightHistoryOrUnit = getInteger(poolWeightHistoryKey) | |
751 | 687 | let poolWeightHistoryActions = if ((poolWeightHistoryOrUnit == unit)) | |
752 | 688 | then nil | |
753 | 689 | else [DeleteEntry(poolWeightHistoryKey)] | |
754 | 690 | (([IntegerEntry(poolWeightKey, poolWeightNew)] ++ gwxVirtualPoolActions) ++ poolWeightHistoryActions) | |
755 | 691 | } | |
756 | 692 | else throw("Strict value is not equal to itself.") | |
757 | 693 | } | |
758 | 694 | else throw("Strict value is not equal to itself.") | |
759 | 695 | } | |
760 | 696 | ||
761 | 697 | ||
762 | 698 | ||
763 | 699 | @Callable(i) | |
764 | 700 | func modifyWeights (btcPoolAddress,ethPoolAddress,ethBtcPoolAddress,usdcUsdtPoolAddress) = { | |
765 | 701 | let checkCaller = mustManager(i) | |
766 | 702 | if ((checkCaller == checkCaller)) | |
767 | 703 | then { | |
768 | 704 | let ethBtcWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
769 | 705 | let usdcUsdtWeightNew = ((5 * POOLWEIGHTMULT) / 100) | |
770 | 706 | let weightDecrement = ((5 * POOLWEIGHTMULT) / 100) | |
771 | 707 | let factoryCfg = split(getStringOrFail(keyFactoryConfig()), SEP) | |
772 | 708 | let stakingDapp = getStakingAddressOrFail(factoryCfg) | |
773 | 709 | let gwxRewardDapp = getGwxRewardAddressOrFail(factoryCfg) | |
774 | 710 | let btcWeightKEY = keyPoolToWeight(btcPoolAddress) | |
775 | 711 | let ethWeightKEY = keyPoolToWeight(ethPoolAddress) | |
776 | 712 | let ethBtcWeightKEY = keyPoolToWeight(ethBtcPoolAddress) | |
777 | 713 | let usdcUsdtWeightKEY = keyPoolToWeight(usdcUsdtPoolAddress) | |
778 | 714 | let btcWeight = getIntOrFail(btcWeightKEY) | |
779 | 715 | let ethWeight = getIntOrFail(ethWeightKEY) | |
780 | 716 | let btcWeightNew = (btcWeight - weightDecrement) | |
781 | 717 | let ethWeightNew = (ethWeight - weightDecrement) | |
782 | 718 | if ((0 >= btcWeightNew)) | |
783 | - | then | |
719 | + | then throw(("invalid btcWeightNew: " + toString(btcWeightNew))) | |
784 | 720 | else if ((0 >= ethWeightNew)) | |
785 | - | then | |
721 | + | then throw(("invalid ethWeightNew: " + toString(ethWeightNew))) | |
786 | 722 | else { | |
787 | 723 | let btcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(btcPoolAddress)) | |
788 | 724 | let ethLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethPoolAddress)) | |
789 | 725 | let ethBtcLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(ethBtcPoolAddress)) | |
790 | 726 | let usdcUsdtLpAssetIdStr = getStringOrFail(keyMappingPoolContractToLPAsset(usdcUsdtPoolAddress)) | |
791 | 727 | let onModifyWeightBtc = invoke(stakingDapp, "onModifyWeight", [btcLpAssetIdStr, btcPoolAddress], nil) | |
792 | 728 | if ((onModifyWeightBtc == onModifyWeightBtc)) | |
793 | 729 | then { | |
794 | 730 | let onModifyWeightEth = invoke(stakingDapp, "onModifyWeight", [ethLpAssetIdStr, ethPoolAddress], nil) | |
795 | 731 | if ((onModifyWeightEth == onModifyWeightEth)) | |
796 | 732 | then { | |
797 | 733 | let onModifyWeightEthBtc = invoke(stakingDapp, "onModifyWeight", [ethBtcLpAssetIdStr, ethBtcPoolAddress], nil) | |
798 | 734 | if ((onModifyWeightEthBtc == onModifyWeightEthBtc)) | |
799 | 735 | then { | |
800 | 736 | let onModifyWeightUsdcUsdt = invoke(stakingDapp, "onModifyWeight", [usdcUsdtLpAssetIdStr, usdcUsdtPoolAddress], nil) | |
801 | 737 | if ((onModifyWeightUsdcUsdt == onModifyWeightUsdcUsdt)) | |
802 | 738 | 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)] | |
803 | 739 | else throw("Strict value is not equal to itself.") | |
804 | 740 | } | |
805 | 741 | else throw("Strict value is not equal to itself.") | |
806 | 742 | } | |
807 | 743 | else throw("Strict value is not equal to itself.") | |
808 | 744 | } | |
809 | 745 | else throw("Strict value is not equal to itself.") | |
810 | 746 | } | |
811 | 747 | } | |
812 | 748 | else throw("Strict value is not equal to itself.") | |
813 | 749 | } | |
814 | 750 | ||
815 | 751 | ||
816 | 752 | ||
817 | 753 | @Callable(i) | |
818 | 754 | func checkWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
819 | 755 | let haveLabel = match getBoolean(keyWxEmission(amountAssetId, priceAssetId)) { | |
820 | 756 | case b: Boolean => | |
821 | 757 | b | |
822 | 758 | case _ => | |
823 | 759 | false | |
824 | 760 | } | |
825 | 761 | $Tuple2(nil, haveLabel) | |
826 | 762 | } | |
827 | 763 | ||
828 | 764 | ||
829 | 765 | ||
830 | 766 | @Callable(i) | |
831 | 767 | func setWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
832 | 768 | let checkCaller = mustAdmin(i) | |
833 | 769 | if ((checkCaller == checkCaller)) | |
834 | 770 | then $Tuple2([BooleanEntry(keyWxEmission(amountAssetId, priceAssetId), true)], unit) | |
835 | 771 | else throw("Strict value is not equal to itself.") | |
836 | 772 | } | |
837 | 773 | ||
838 | 774 | ||
839 | 775 | ||
840 | 776 | @Callable(i) | |
841 | 777 | func deleteWxEmissionPoolLabel (amountAssetId,priceAssetId) = { | |
842 | 778 | let checkCaller = if ((i.caller == this)) | |
843 | 779 | then true | |
844 | 780 | else mustAdmin(i) | |
845 | 781 | if ((checkCaller == checkCaller)) | |
846 | 782 | then $Tuple2([DeleteEntry(keyWxEmission(amountAssetId, priceAssetId))], unit) | |
847 | 783 | else throw("Strict value is not equal to itself.") | |
848 | 784 | } | |
849 | 785 | ||
850 | 786 | ||
851 | 787 | ||
852 | 788 | @Callable(i) | |
853 | 789 | func onVerificationLoss (assetId) = { | |
854 | 790 | let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyAssetsStoreContract()), ""))) | |
855 | 791 | then true | |
856 | 792 | else mustManager(i) | |
857 | 793 | if ((checkCaller == checkCaller)) | |
858 | 794 | then { | |
859 | 795 | let priceAssets = getPriceAssets() | |
860 | 796 | let checkPriceAssetsSize = if ((size(priceAssets) > 0)) | |
861 | 797 | then true | |
862 | - | else | |
798 | + | else throw("invalid price assets") | |
863 | 799 | if ((checkPriceAssetsSize == checkPriceAssetsSize)) | |
864 | 800 | then { | |
865 | 801 | func cb (acc,priceAsset) = { | |
866 | 802 | let r = invoke(this, "deleteWxEmissionPoolLabel", [assetId, priceAsset], nil) | |
867 | 803 | if ((r == r)) | |
868 | 804 | then unit | |
869 | 805 | else throw("Strict value is not equal to itself.") | |
870 | 806 | } | |
871 | 807 | ||
872 | 808 | let actions = { | |
873 | 809 | let $l = priceAssets | |
874 | 810 | let $s = size($l) | |
875 | 811 | let $acc0 = unit | |
876 | 812 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
877 | 813 | then $a | |
878 | 814 | else cb($a, $l[$i]) | |
879 | 815 | ||
880 | 816 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
881 | 817 | then $a | |
882 | 818 | else throw("List size exceeds 11") | |
883 | 819 | ||
884 | 820 | $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) | |
885 | 821 | } | |
886 | 822 | if ((actions == actions)) | |
887 | 823 | then $Tuple2(nil, unit) | |
888 | 824 | else throw("Strict value is not equal to itself.") | |
889 | 825 | } | |
890 | 826 | else throw("Strict value is not equal to itself.") | |
891 | 827 | } | |
892 | 828 | else throw("Strict value is not equal to itself.") | |
893 | 829 | } | |
894 | 830 | ||
895 | 831 | ||
896 | 832 | ||
897 | 833 | @Callable(i) | |
898 | 834 | func isPoolOneTokenOperationsDisabledREADONLY (poolAddress) = { | |
899 | 835 | let poolConfig = getPoolConfig(poolAddress) | |
900 | 836 | let assetsInternal = $Tuple2(parseIntValue(poolConfig[idxIAmtAssetId]), parseIntValue(poolConfig[idxIPriceAssetId])) | |
901 | 837 | let poolOneTokenOperationsDisabled = valueOrElse(getBoolean(keyPoolOneTokenOperationsDisabled(assetsInternal)), false) | |
902 | 838 | let allPoolsOneTokenOperationsDisabled = valueOrElse(getBoolean(keyAllPoolsOneTokenOperationsDisabled()), false) | |
903 | 839 | $Tuple2(nil, if (allPoolsOneTokenOperationsDisabled) | |
904 | 840 | then true | |
905 | 841 | else poolOneTokenOperationsDisabled) | |
906 | 842 | } | |
907 | 843 | ||
908 | 844 | ||
909 | 845 | ||
910 | 846 | @Callable(i) | |
911 | 847 | func getInFeeREADONLY (poolAddress) = { | |
912 | 848 | let fee = intOrDefaultOrFallback(keyInFee(poolAddress), keyInFeeDefault(), 0) | |
913 | 849 | $Tuple2(nil, fee) | |
914 | 850 | } | |
915 | 851 | ||
916 | 852 | ||
917 | 853 | ||
918 | 854 | @Callable(i) | |
919 | 855 | func getOutFeeREADONLY (poolAddress) = { | |
920 | 856 | let fee = intOrDefaultOrFallback(keyOutFee(poolAddress), keyOutFeeDefault(), fraction(10, MULT8, 10000)) | |
921 | 857 | $Tuple2(nil, fee) | |
922 | 858 | } | |
923 | 859 | ||
924 | 860 | ||
925 | 861 | ||
926 | 862 | @Callable(i) | |
927 | 863 | func poolInfoREADONLY (amountAssetIdStr,priceAssetIdStr) = { | |
928 | 864 | let amountAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(amountAssetIdStr)) | |
929 | 865 | let priceAssetInternalIdOption = getInteger(this, keyMappingsBaseAsset2internalId(priceAssetIdStr)) | |
930 | 866 | let poolContractAddressOption = getString(this, keyMappingPoolAssetsToPoolContractAddress(value(amountAssetInternalIdOption), value(priceAssetInternalIdOption))) | |
931 | 867 | let lpAssetIdOption = getString(this, keyMappingPoolContractToLPAsset(value(poolContractAddressOption))) | |
932 | 868 | let poolExists = if (if (isDefined(amountAssetInternalIdOption)) | |
933 | 869 | then isDefined(priceAssetInternalIdOption) | |
934 | 870 | else false) | |
935 | 871 | then isDefined(poolContractAddressOption) | |
936 | 872 | else false | |
937 | 873 | let poolInfo = if (poolExists) | |
938 | 874 | then $Tuple2(addressFromStringValue(value(poolContractAddressOption)), parseAssetId(value(lpAssetIdOption))) | |
939 | 875 | else unit | |
940 | 876 | $Tuple2(nil, poolInfo) | |
941 | 877 | } | |
942 | 878 | ||
943 | 879 | ||
944 | 880 | ||
945 | 881 | @Callable(i) | |
946 | 882 | func getPoolStatusREADONLY (poolAddress) = { | |
947 | 883 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
948 | 884 | let amountAssetInternal = poolAssets[1] | |
949 | 885 | let priceAssetInternal = poolAssets[2] | |
950 | 886 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
951 | 887 | $Tuple2(nil, parseIntValue(cfg[idxPoolStatus])) | |
952 | 888 | } | |
953 | 889 | ||
954 | 890 | ||
955 | 891 | ||
956 | 892 | @Callable(i) | |
957 | 893 | func getPoolConfigREADONLY (poolAddress) = { | |
958 | 894 | let poolAssets = split(getStringOrFail(keyMappingPoolContractAddressToPoolAssets(poolAddress)), SEP) | |
959 | 895 | let amountAssetInternal = poolAssets[1] | |
960 | 896 | let priceAssetInternal = poolAssets[2] | |
961 | 897 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
962 | 898 | $Tuple2(nil, cfg) | |
963 | 899 | } | |
964 | 900 | ||
965 | 901 | ||
966 | 902 | ||
967 | 903 | @Callable(i) | |
968 | 904 | func getPoolConfigByLpAssetIdREADONLY (lpAssetIdStr) = { | |
969 | 905 | let poolAssets = split(getStringOrFail(keyMappingLpAssetToPoolAssets(lpAssetIdStr)), SEP) | |
970 | 906 | let amountAssetInternal = poolAssets[1] | |
971 | 907 | let priceAssetInternal = poolAssets[2] | |
972 | 908 | let cfg = split(getStringOrFail(keyPoolConfig(amountAssetInternal, priceAssetInternal)), SEP) | |
973 | 909 | $Tuple2(nil, cfg) | |
974 | 910 | } | |
975 | 911 | ||
976 | 912 | ||
977 | 913 | ||
978 | 914 | @Callable(i) | |
979 | 915 | func poolExistsREADONLY (amountAssetId,priceAssetId) = $Tuple2(nil, poolExistsInternal(amountAssetId, priceAssetId)) | |
980 | 916 | ||
981 | 917 | ||
982 | 918 | ||
983 | 919 | @Callable(i) | |
984 | 920 | func skipOrderValidationREADONLY (poolAddress) = $Tuple2(nil, valueOrElse(getBoolean(keySkipOrderValidation(poolAddress)), false)) | |
985 | 921 | ||
986 | 922 | ||
987 | 923 | ||
988 | 924 | @Callable(i) | |
989 | 925 | func getChangeAmpConfigREADONLY (poolAddress) = { | |
990 | 926 | let delay = getIntegerValue(keyChangeAmpDelay(poolAddress)) | |
991 | 927 | let delta = getIntegerValue(keyChangeAmpDelta(poolAddress)) | |
992 | 928 | let target = getIntegerValue(keyChangeAmpTarget(poolAddress)) | |
993 | 929 | $Tuple2(nil, [delay, delta, target]) | |
994 | 930 | } | |
995 | 931 | ||
996 | 932 | ||
997 | 933 | ||
998 | 934 | @Callable(i) | |
999 | 935 | func getPoolWeightREADONLY (lpAssetId) = { | |
1000 | 936 | let poolAddress = getStringOrFail(keyMappingPoolLPAssetToPoolContractAddress(lpAssetId)) | |
1001 | 937 | let weight = valueOrElse(getInteger(keyPoolToWeight(poolAddress)), 0) | |
1002 | 938 | $Tuple2(nil, weight) | |
1003 | 939 | } | |
1004 | 940 | ||
1005 | 941 | ||
1006 | - | ||
1007 | - | @Callable(i) | |
1008 | - | func deletePool (poolContractAddress) = { | |
1009 | - | let poolConfig = getPoolConfig(poolContractAddress) | |
1010 | - | let checkCaller = if ((toString(i.caller) == getPoolCreator(poolContractAddress))) | |
1011 | - | then if (isPoolEmpty(poolContractAddress)) | |
1012 | - | then true | |
1013 | - | else throwErr("Pool is not empty") | |
1014 | - | else mustManager(i) | |
1015 | - | if ((checkCaller == checkCaller)) | |
1016 | - | then { | |
1017 | - | let checkWeight = if ((valueOrElse(getInteger(keyPoolToWeight(poolContractAddress)), 0) == 0)) | |
1018 | - | then true | |
1019 | - | else throwErr("Pool weight is not Zero") | |
1020 | - | if ((checkWeight == checkWeight)) | |
1021 | - | then { | |
1022 | - | let checkStatus = if ((poolConfig[idxPoolStatus] == toString(PoolShutdown))) | |
1023 | - | then true | |
1024 | - | else throwErr("Pool must be SHUTDOWN (4)") | |
1025 | - | if ((checkStatus == checkStatus)) | |
1026 | - | then { | |
1027 | - | let $t03911639253 = getAssetsDataFromPoolAddress(poolContractAddress) | |
1028 | - | let amountAssetId = $t03911639253._1 | |
1029 | - | let priceAssetId = $t03911639253._2 | |
1030 | - | let lpAssetId = $t03911639253._3 | |
1031 | - | let amountAssetInternal = $t03911639253._4 | |
1032 | - | let priceAssetInternal = $t03911639253._5 | |
1033 | - | let userPoolsContract = addressFromStringValue(getStringValue(keyUserPoolsContract())) | |
1034 | - | let userPoolsInvoke = invoke(userPoolsContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1035 | - | if ((userPoolsInvoke == userPoolsInvoke)) | |
1036 | - | then { | |
1037 | - | let votingEmissionContract = addressFromStringValue(getStringValue(keyVotingEmissionContract())) | |
1038 | - | let votingEmissionInvoke = invoke(votingEmissionContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1039 | - | if ((votingEmissionInvoke == votingEmissionInvoke)) | |
1040 | - | then { | |
1041 | - | let assetsStoreContract = addressFromStringValue(getStringValue(keyAssetsStoreContract())) | |
1042 | - | let assetsStoreInvoke = invoke(assetsStoreContract, "deletePool", [amountAssetId, priceAssetId], nil) | |
1043 | - | if ((assetsStoreInvoke == assetsStoreInvoke)) | |
1044 | - | 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))] | |
1045 | - | else throw("Strict value is not equal to itself.") | |
1046 | - | } | |
1047 | - | else throw("Strict value is not equal to itself.") | |
1048 | - | } | |
1049 | - | else throw("Strict value is not equal to itself.") | |
1050 | - | } | |
1051 | - | else throw("Strict value is not equal to itself.") | |
1052 | - | } | |
1053 | - | else throw("Strict value is not equal to itself.") | |
1054 | - | } | |
1055 | - | else throw("Strict value is not equal to itself.") | |
1056 | - | } | |
1057 | - | ||
1058 | - | ||
1059 | 942 | @Verifier(tx) | |
1060 | 943 | func verify () = { | |
1061 | 944 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
1062 | 945 | case pk: ByteVector => | |
1063 | 946 | pk | |
1064 | 947 | case _: Unit => | |
1065 | 948 | tx.senderPublicKey | |
1066 | 949 | case _ => | |
1067 | 950 | throw("Match error") | |
1068 | 951 | } | |
1069 | 952 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1070 | 953 | } | |
1071 | 954 |
github/deemru/w8io/026f985 117.66 ms ◑