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