tx · 7EYmVN4bsGkpXRNwu8omCtmm7inQu7pZqWhPjn9m9t5S 3Mw8ZcMK47vENHqhYYhCZTCPDXhff6ZQVwt: -0.06300000 Waves 2023.11.02 16:01 [2825745] smart account 3Mw8ZcMK47vENHqhYYhCZTCPDXhff6ZQVwt > SELF 0.00000000 Waves
{ "type": 13, "id": "7EYmVN4bsGkpXRNwu8omCtmm7inQu7pZqWhPjn9m9t5S", "fee": 6300000, "feeAssetId": null, "timestamp": 1698929898585, "version": 2, "chainId": 84, "sender": "3Mw8ZcMK47vENHqhYYhCZTCPDXhff6ZQVwt", "senderPublicKey": "3fNYAZ872D7hsaic3sPDZd5uAk59U5CiWiA153FUZ6Qv", "proofs": [ "29Vk1SvvW9hQ7qtPJPJXWEcMXx5i1tmWKgdp1gC5ToG3vWityyrjQ6ErNZzypvidmnRM49btbwxNT6D8MbFgUF1m" ], "script": "base64:BgJ3CAISEAoOGBgBAQgIAQEBAQEIAQgSAwoBARIDCgEBEgASBAoCCAESBAoCCAESAwoBARIECgIIARIDCgEBEgQKAggBEgUKAwgIARIDCgEIEgASABIDCgEIEgASAwoBARIDCgEIEgASABIDCgEIEgQKAggBEgMKAQh7AANTRVACAl9fAAVXQVZFUwIFd2F2ZXMAB01BWF9JTlQA//////////9/AAdNQVhfRkVFAMCEPQANTUFYX0FNUExJRklFUgDAhD0AFE1BWF9XRUlHSFRfQU1QTElGSUVSAMCEPQAKTUFYX1dFSUdIVADAhD0AFFNMSVBQQUdFX1JBVEVfRkFDVE9SAMCEPQAPRkVFX1JBVEVfRkFDVE9SAMCEPQALUkFURV9GQUNUT1IAwIQ9AA5QRVJDRU5UX0ZBQ1RPUgkAtgIBAICAkLu61q3wDQAQWkVST19JTlRfTElTVF8xMAkAzAgCAAAJAMwIAgAACQDMCAIAAAkAzAgCAAAJAMwIAgAACQDMCAIAAAkAzAgCAAAJAMwIAgAACQDMCAIAAAkAzAgCAAAFA25pbAAQWkVST19JTlRfTElTVF8xMQkAzQgCBRBaR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NpZ18EA2VycgMJARFfb25seVRoaXNDb250cmFjdAEIBQFpBmNhbGxlcgkBEF92YWxpZGF0ZUFkZHJlc3MCBQltdWx0aXNpZ18CHXNldE11bHRpc2lnOiBpbnZhbGlkIG11bHRpc2lnBwMJAAACBQNlcnIFA2VycgkAlAoCCQENX3NhdmVNdWx0aXNpZwEJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCW11bHRpc2lnXwUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAEByRtYXRjaDAJAKIIAQUMS0VZX01VTFRJU0lHAwkAAQIFByRtYXRjaDACBlN0cmluZwQIbXVsdGlzaWcFByRtYXRjaDAJAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQUIbXVsdGlzaWcJALkJAgkAzAgCBQpLRVlfU1RBVFVTCQDMCAIJAKUIAQUEdGhpcwkAzAgCCQDYBAEIBQJ0eAJpZAUDbmlsBQNTRVAHCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5J4SrIg==", "height": 2825745, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 45EcZ4Gs9aJD2wdXAf97tZHLipSGDFcahParJbc6iX5Q Next: Hf3fvNhNvCyWnakTSnRyHEJT4VV933TgkD6LXrUQcEW2 Diff:
Old | New | Differences | |
---|---|---|---|
68 | 68 | let KEY_TOTAL_LP = "TOTAL_LP" | |
69 | 69 | ||
70 | 70 | let KEY_USER_PROFITS = "USER_PROFITS" | |
71 | + | ||
72 | + | let KEY_WATCHDOG = "WATCHDOG" | |
73 | + | ||
74 | + | let KEY_WATCHDOG_OFFSET = "WATCHDOG_OFFSET" | |
75 | + | ||
76 | + | let KEY_WATCHDOG_HEIGHT = "WATCHDOG_HEIGHT" | |
71 | 77 | ||
72 | 78 | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
73 | 79 | case a: Address => | |
566 | 572 | } | |
567 | 573 | ||
568 | 574 | ||
575 | + | func _loadWatchdog () = match getString(KEY_WATCHDOG) { | |
576 | + | case a: String => | |
577 | + | addressFromStringValue(a) | |
578 | + | case _ => | |
579 | + | Address(base58'') | |
580 | + | } | |
581 | + | ||
582 | + | ||
583 | + | func _saveWatchdog (watchdog_) = [StringEntry(KEY_WATCHDOG, toString(watchdog_))] | |
584 | + | ||
585 | + | ||
586 | + | func _loadWatchdogOffset () = match getInteger(KEY_WATCHDOG_OFFSET) { | |
587 | + | case a: Int => | |
588 | + | a | |
589 | + | case _ => | |
590 | + | 0 | |
591 | + | } | |
592 | + | ||
593 | + | ||
594 | + | func _saveWatchdogOffset (offset_) = [IntegerEntry(KEY_WATCHDOG_OFFSET, offset_)] | |
595 | + | ||
596 | + | ||
569 | 597 | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
570 | 598 | then throw("_onlyThisContract: revert") | |
571 | 599 | else true | |
605 | 633 | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
606 | 634 | then throw("_onlyPauser: revert") | |
607 | 635 | else true | |
636 | + | ||
637 | + | ||
638 | + | func _checkWatchdog () = { | |
639 | + | let wd = match getInteger(_loadWatchdog(), KEY_WATCHDOG_HEIGHT) { | |
640 | + | case a: Int => | |
641 | + | (a + _loadWatchdogOffset()) | |
642 | + | case _ => | |
643 | + | 0 | |
644 | + | } | |
645 | + | if ((height > wd)) | |
646 | + | then throw("_checkWatchdog: revert") | |
647 | + | else true | |
648 | + | } | |
608 | 649 | ||
609 | 650 | ||
610 | 651 | func _getDecimals (assetId_) = match assetInfo(fromBase58String(assetId_)) { | |
926 | 967 | } | |
927 | 968 | ||
928 | 969 | ||
929 | - | func _calculateFee (balances_,assetsTotalSupply_,weights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = { | |
930 | - | func foldFunc (acc,balance) = { | |
931 | - | let index = acc._1 | |
932 | - | let equilibrium = fraction(assetsTotalSupply_, weights_[index], sigmaWeight_) | |
933 | - | $Tuple2((index + 1), (acc._2 + _calculateMicroFee(balance, equilibrium, weightAmplifier_, slippageRate_, feeMaxRate_))) | |
934 | - | } | |
935 | - | ||
936 | - | let result = { | |
937 | - | let $l = balances_ | |
938 | - | let $s = size($l) | |
939 | - | let $acc0 = $Tuple2(0, 0) | |
940 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
941 | - | then $a | |
942 | - | else foldFunc($a, $l[$i]) | |
943 | - | ||
944 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
945 | - | then $a | |
946 | - | else throw("List size exceeds 10") | |
947 | - | ||
948 | - | $f0_2($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) | |
949 | - | } | |
950 | - | result._2 | |
951 | - | } | |
970 | + | func _calculateFee (balances_,assetsTotalSupply_,weights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = 0 | |
952 | 971 | ||
953 | 972 | ||
954 | 973 | func _validateLiquidityInvariant (prevAssetBalances_,prevAssetTotalSupply_,assetBalances_,assetTotalSupply_,prevLpTotalSupply_,lpTotalSupply_,assetWeights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = if (if ((prevLpTotalSupply_ == 0)) | |
1041 | 1060 | $Tuple2((index + 1), (acc._2 :+ profitUpdated)) | |
1042 | 1061 | } | |
1043 | 1062 | ||
1044 | - | let $ | |
1063 | + | let $t02552025593 = { | |
1045 | 1064 | let $l = ZERO_INT_LIST_11 | |
1046 | 1065 | let $s = size($l) | |
1047 | 1066 | let $acc0 = $Tuple2(0, nil) | |
1055 | 1074 | ||
1056 | 1075 | $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) | |
1057 | 1076 | } | |
1058 | - | let idx = $ | |
1059 | - | let profitsUpdated = $ | |
1077 | + | let idx = $t02552025593._1 | |
1078 | + | let profitsUpdated = $t02552025593._2 | |
1060 | 1079 | $Tuple2((_saveUserProfits(user_, profitsUpdated) ++ _saveUserSigmaFeePerLp(user_, sigmaFeePerLp)), profitsUpdated) | |
1061 | 1080 | } | |
1062 | 1081 | ||
1070 | 1089 | $Tuple2((index + 1), (acc._2 :+ sigmaFeePerLpUpdated)) | |
1071 | 1090 | } | |
1072 | 1091 | ||
1073 | - | let $ | |
1092 | + | let $t02624326322 = { | |
1074 | 1093 | let $l = ZERO_INT_LIST_11 | |
1075 | 1094 | let $s = size($l) | |
1076 | 1095 | let $acc0 = $Tuple2(0, nil) | |
1084 | 1103 | ||
1085 | 1104 | $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) | |
1086 | 1105 | } | |
1087 | - | let idx = $ | |
1088 | - | let sigmaFeePerLpUpdated = $ | |
1106 | + | let idx = $t02624326322._1 | |
1107 | + | let sigmaFeePerLpUpdated = $t02624326322._2 | |
1089 | 1108 | sigmaFeePerLpUpdated | |
1090 | 1109 | } | |
1091 | 1110 | ||
1093 | 1112 | func _calculateLpAndProtocolFees (assetIndex_,amount_,lpFeeRate_,protocolFeeRate_) = { | |
1094 | 1113 | let sigmaFeePerLp = _loadSigmaFeePerLp() | |
1095 | 1114 | let totalLp = _loadTotalLp() | |
1096 | - | let $ | |
1115 | + | let $t02654326818 = if ((totalLp == 0)) | |
1097 | 1116 | then $Tuple2(0, fraction(amount_, protocolFeeRate_, MAX_FEE)) | |
1098 | 1117 | else $Tuple2(fraction(amount_, lpFeeRate_, MAX_FEE), fraction(amount_, protocolFeeRate_, MAX_FEE)) | |
1099 | - | let lpFee = $ | |
1100 | - | let protocolFee = $ | |
1118 | + | let lpFee = $t02654326818._1 | |
1119 | + | let protocolFee = $t02654326818._2 | |
1101 | 1120 | let sigmaFeePerLpUpdated = if ((lpFee == 0)) | |
1102 | 1121 | then sigmaFeePerLp | |
1103 | 1122 | else _updateSigmaFeePerLp(sigmaFeePerLp, totalLp, assetIndex_, lpFee) | |
1112 | 1131 | let slippageRate = storage._8 | |
1113 | 1132 | let feeMaxRate = storage._9 | |
1114 | 1133 | let assets = _loadAssets() | |
1115 | - | let $ | |
1116 | - | let assetWeights = $ | |
1117 | - | let sigmaWeight = $ | |
1118 | - | let $ | |
1119 | - | let prevAssetBalances = $ | |
1120 | - | let prevAssetTotalSupply = $ | |
1121 | - | let $ | |
1134 | + | let $t02732727380 = _loadAssetWeights() | |
1135 | + | let assetWeights = $t02732727380._1 | |
1136 | + | let sigmaWeight = $t02732727380._2 | |
1137 | + | let $t02738527453 = _loadAssetBalances() | |
1138 | + | let prevAssetBalances = $t02738527453._1 | |
1139 | + | let prevAssetTotalSupply = $t02738527453._2 | |
1140 | + | let $t02745928689 = if ((prevAssetTotalSupply == 0)) | |
1122 | 1141 | then { | |
1123 | 1142 | func foldFunc (acc,elem) = { | |
1124 | 1143 | let index = acc._1 | |
1126 | 1145 | $Tuple2((index + 1), (acc._2 :+ requiredAmountNormalized)) | |
1127 | 1146 | } | |
1128 | 1147 | ||
1129 | - | let $ | |
1148 | + | let $t02790127975 = { | |
1130 | 1149 | let $l = assets | |
1131 | 1150 | let $s = size($l) | |
1132 | 1151 | let $acc0 = $Tuple2(0, nil) | |
1140 | 1159 | ||
1141 | 1160 | $f0_2($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) | |
1142 | 1161 | } | |
1143 | - | let idx = $ | |
1144 | - | let requiredAmountsNormalized = $ | |
1162 | + | let idx = $t02790127975._1 | |
1163 | + | let requiredAmountsNormalized = $t02790127975._2 | |
1145 | 1164 | $Tuple2(amount_, requiredAmountsNormalized) | |
1146 | 1165 | } | |
1147 | 1166 | else { | |
1152 | 1171 | $Tuple2((index + 1), (acc._2 :+ requiredAmountNormalized)) | |
1153 | 1172 | } | |
1154 | 1173 | ||
1155 | - | let $ | |
1174 | + | let $t02851828593 = { | |
1156 | 1175 | let $l = assets | |
1157 | 1176 | let $s = size($l) | |
1158 | 1177 | let $acc0 = $Tuple2(0, nil) | |
1166 | 1185 | ||
1167 | 1186 | $f0_2($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) | |
1168 | 1187 | } | |
1169 | - | let idx = $ | |
1170 | - | let requiredAmountsNormalized = $ | |
1188 | + | let idx = $t02851828593._1 | |
1189 | + | let requiredAmountsNormalized = $t02851828593._2 | |
1171 | 1190 | $Tuple2(fraction(amount_, lpTotalSupply, prevAssetTotalSupply), requiredAmountsNormalized) | |
1172 | 1191 | } | |
1173 | - | let lpTokensToMint = $ | |
1174 | - | let requiredAmountsNormalized = $ | |
1175 | - | let $ | |
1176 | - | let assetBalances = $ | |
1177 | - | let assetTotalSupply = $ | |
1192 | + | let lpTokensToMint = $t02745928689._1 | |
1193 | + | let requiredAmountsNormalized = $t02745928689._2 | |
1194 | + | let $t02869528808 = _incrementBalancesByAmounts(prevAssetBalances, requiredAmountsNormalized) | |
1195 | + | let assetBalances = $t02869528808._1 | |
1196 | + | let assetTotalSupply = $t02869528808._2 | |
1178 | 1197 | let err2 = _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, assetBalances, assetTotalSupply, lpTotalSupply, (lpTotalSupply + lpTokensToMint), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1179 | 1198 | if ((err2 == err2)) | |
1180 | 1199 | then $Tuple3(lpTokensToMint, requiredAmountsNormalized, assetBalances) | |
1192 | 1211 | let slippageRate = storage._8 | |
1193 | 1212 | let feeMaxRate = storage._9 | |
1194 | 1213 | let assets = _loadAssets() | |
1195 | - | let $ | |
1196 | - | let assetWeights = $ | |
1197 | - | let sigmaWeight = $ | |
1198 | - | let $ | |
1199 | - | let prevAssetBalances = $ | |
1200 | - | let prevAssetTotalSupply = $ | |
1214 | + | let $t02957129624 = _loadAssetWeights() | |
1215 | + | let assetWeights = $t02957129624._1 | |
1216 | + | let sigmaWeight = $t02957129624._2 | |
1217 | + | let $t02962929743 = _loadAssetBalances() | |
1218 | + | let prevAssetBalances = $t02962929743._1 | |
1219 | + | let prevAssetTotalSupply = $t02962929743._2 | |
1201 | 1220 | let assetBalances = _incrementBalanceByIndex(prevAssetBalances, value(indexOf(assets, assetId_)), amount_) | |
1202 | 1221 | let assetTotalSupply = (prevAssetTotalSupply + amount_) | |
1203 | 1222 | let err2 = _validateAllocation(assetBalances, assetTotalSupply, prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, maxAllocAmplifier) | |
1217 | 1236 | then lpTokensToMintInner | |
1218 | 1237 | else throw("Strict value is not equal to itself.") | |
1219 | 1238 | } | |
1220 | - | let $ | |
1221 | - | let lpFee = $ | |
1222 | - | let protocolFee = $ | |
1223 | - | let sigmaFeePerLpUpdated = $ | |
1239 | + | let $t03140531536 = _calculateLpAndProtocolFees(0, lpTokensToMint, (lpFeeRate / 2), (protocolFeeRate / 2)) | |
1240 | + | let lpFee = $t03140531536._1 | |
1241 | + | let protocolFee = $t03140531536._2 | |
1242 | + | let sigmaFeePerLpUpdated = $t03140531536._3 | |
1224 | 1243 | $Tuple5(lpTokensToMint, assetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1225 | 1244 | } | |
1226 | 1245 | else throw("Strict value is not equal to itself.") | |
1234 | 1253 | let weightAmplifier = storage._7 | |
1235 | 1254 | let slippageRate = storage._8 | |
1236 | 1255 | let feeMaxRate = storage._9 | |
1237 | - | let $ | |
1238 | - | let prevAssetBalances = $ | |
1239 | - | let prevAssetTotalSupply = $ | |
1240 | - | let $ | |
1241 | - | let assetWeights = $ | |
1242 | - | let sigmaWeight = $ | |
1256 | + | let $t03187031938 = _loadAssetBalances() | |
1257 | + | let prevAssetBalances = $t03187031938._1 | |
1258 | + | let prevAssetTotalSupply = $t03187031938._2 | |
1259 | + | let $t03194331996 = _loadAssetWeights() | |
1260 | + | let assetWeights = $t03194331996._1 | |
1261 | + | let sigmaWeight = $t03194331996._2 | |
1243 | 1262 | let lpTokensToBurn = amount_ | |
1244 | 1263 | let err = _validateInt(lpTokensToBurn, 0, MAX_INT, "_withdrawAll: lpTokensToBurn less than 0") | |
1245 | 1264 | if ((err == err)) | |
1246 | 1265 | then { | |
1247 | - | let $ | |
1248 | - | let assetBalances = $ | |
1249 | - | let assetTotalSupply = $ | |
1250 | - | let balancesToPay = $ | |
1266 | + | let $t03213832271 = _decrementBalancesByLpAmount(prevAssetBalances, lpTokensToBurn, lpTotalSupply) | |
1267 | + | let assetBalances = $t03213832271._1 | |
1268 | + | let assetTotalSupply = $t03213832271._2 | |
1269 | + | let balancesToPay = $t03213832271._3 | |
1251 | 1270 | let err2 = _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, assetBalances, assetTotalSupply, lpTotalSupply, (lpTotalSupply - lpTokensToBurn), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1252 | 1271 | if ((err2 == err2)) | |
1253 | 1272 | then $Tuple3(lpTokensToBurn, balancesToPay, assetBalances) | |
1268 | 1287 | let feeMaxRate = storage._9 | |
1269 | 1288 | let precision = _loadPrecision() | |
1270 | 1289 | let assets = _loadAssets() | |
1271 | - | let $ | |
1272 | - | let prevAssetBalances = $ | |
1273 | - | let prevAssetTotalSupply = $ | |
1274 | - | let $ | |
1275 | - | let assetWeights = $ | |
1276 | - | let sigmaWeight = $ | |
1290 | + | let $t03306333131 = _loadAssetBalances() | |
1291 | + | let prevAssetBalances = $t03306333131._1 | |
1292 | + | let prevAssetTotalSupply = $t03306333131._2 | |
1293 | + | let $t03313633189 = _loadAssetWeights() | |
1294 | + | let assetWeights = $t03313633189._1 | |
1295 | + | let sigmaWeight = $t03313633189._2 | |
1277 | 1296 | let targetAssetIndex = value(indexOf(assets, assetId_)) | |
1278 | 1297 | let prevFee = _calculateFee(prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1279 | 1298 | let prevUtilValue = (prevAssetTotalSupply - prevFee) | |
1280 | 1299 | let k = fraction(toBigInt((lpTotalSupply - lpAmount_)), PERCENT_FACTOR, toBigInt(lpTotalSupply)) | |
1281 | 1300 | let prevUtilValueWithK = toInt(fraction(toBigInt(prevUtilValue), k, PERCENT_FACTOR)) | |
1301 | + | let prevUtilValueDivLp = fraction(toBigInt(prevUtilValue), PERCENT_FACTOR, toBigInt(lpTotalSupply), CEILING) | |
1282 | 1302 | func foldFunc (acc,elem) = if (acc._1) | |
1283 | 1303 | then acc | |
1284 | 1304 | else { | |
1291 | 1311 | if (if (((utilValue - prevUtilValueWithK) > (-1 * precision))) | |
1292 | 1312 | then (precision > (utilValue - prevUtilValueWithK)) | |
1293 | 1313 | else false) | |
1294 | - | then $ | |
1314 | + | then $Tuple5(true, startInner, stopInner, currentAmount, (utilValue - prevUtilValueWithK)) | |
1295 | 1315 | else if ((0 > (utilValue - prevUtilValueWithK))) | |
1296 | - | then $ | |
1297 | - | else $ | |
1316 | + | then $Tuple5(false, startInner, currentAmount, currentAmount, (utilValue - prevUtilValueWithK)) | |
1317 | + | else $Tuple5(false, currentAmount, stopInner, currentAmount, (utilValue - prevUtilValueWithK)) | |
1298 | 1318 | } | |
1299 | 1319 | ||
1300 | 1320 | let targetAmount = { | |
1301 | - | let $t03380933924 = { | |
1321 | + | let stop = toInt(fraction(toBigInt((lpAmount_ + prevFee)), prevUtilValueDivLp, PERCENT_FACTOR, CEILING)) | |
1322 | + | let $t03505535167 = { | |
1302 | 1323 | let $l = LIST_64 | |
1303 | 1324 | let $s = size($l) | |
1304 | - | let $acc0 = $ | |
1325 | + | let $acc0 = $Tuple5(false, 0, stop, 0, 0) | |
1305 | 1326 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1306 | 1327 | then $a | |
1307 | 1328 | else foldFunc($a, $l[$i]) | |
1312 | 1333 | ||
1313 | 1334 | $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($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($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($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($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), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64) | |
1314 | 1335 | } | |
1315 | - | let success = $t03380933924._1 | |
1316 | - | let startOut = $t03380933924._2 | |
1317 | - | let stopOut = $t03380933924._3 | |
1318 | - | let targetAmountOut = $t03380933924._4 | |
1336 | + | let success = $t03505535167._1 | |
1337 | + | let startOut = $t03505535167._2 | |
1338 | + | let stopOut = $t03505535167._3 | |
1339 | + | let targetAmountOut = $t03505535167._4 | |
1340 | + | let diffOut = $t03505535167._5 | |
1319 | 1341 | if (!(success)) | |
1320 | - | then throw(("_withdraw: can't calculate targetAmount=" + toString(targetAmountOut))) | |
1342 | + | then throw(((("_withdraw: can't calculate targetAmount=" + toString(targetAmountOut)) + ",diff=") + toString(diffOut))) | |
1321 | 1343 | else targetAmountOut | |
1322 | 1344 | } | |
1323 | 1345 | let finalAssetBalances = _decrementBalanceByIndex(prevAssetBalances, targetAssetIndex, targetAmount) | |
1327 | 1349 | else false | |
1328 | 1350 | if ((err1 == err1)) | |
1329 | 1351 | then { | |
1330 | - | let $ | |
1331 | - | let lpFee = $ | |
1332 | - | let protocolFee = $ | |
1333 | - | let sigmaFeePerLpUpdated = $ | |
1352 | + | let $t03615936307 = _calculateLpAndProtocolFees((targetAssetIndex + 1), targetAmount, (lpFeeRate / 2), (protocolFeeRate / 2)) | |
1353 | + | let lpFee = $t03615936307._1 | |
1354 | + | let protocolFee = $t03615936307._2 | |
1355 | + | let sigmaFeePerLpUpdated = $t03615936307._3 | |
1334 | 1356 | $Tuple5(targetAmount, finalAssetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1335 | 1357 | } | |
1336 | 1358 | else throw("Strict value is not equal to itself.") | |
1349 | 1371 | let slippageRate = storage._8 | |
1350 | 1372 | let feeMaxRate = storage._9 | |
1351 | 1373 | let precision = _loadPrecision() | |
1352 | - | let $ | |
1353 | - | let prevAssetBalances = $ | |
1354 | - | let prevAssetTotalSupply = $ | |
1355 | - | let $ | |
1356 | - | let assetWeights = $ | |
1357 | - | let sigmaWeight = $ | |
1374 | + | let $t03688936957 = _loadAssetBalances() | |
1375 | + | let prevAssetBalances = $t03688936957._1 | |
1376 | + | let prevAssetTotalSupply = $t03688936957._2 | |
1377 | + | let $t03696237015 = _loadAssetWeights() | |
1378 | + | let assetWeights = $t03696237015._1 | |
1379 | + | let sigmaWeight = $t03696237015._2 | |
1358 | 1380 | let assetBalances = _incrementBalanceByIndex(prevAssetBalances, sourceAssetIndex_, sourceAmount_) | |
1359 | 1381 | let assetTotalSupply = (prevAssetTotalSupply + sourceAmount_) | |
1360 | 1382 | let prevFee = _calculateFee(prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1371 | 1393 | if (if (((utilValue - prevUtilValue) > (-1 * precision))) | |
1372 | 1394 | then (precision > (utilValue - prevUtilValue)) | |
1373 | 1395 | else false) | |
1374 | - | then $ | |
1396 | + | then $Tuple5(true, startInner, stopInner, currentAmount, (utilValue - prevUtilValue)) | |
1375 | 1397 | else if ((0 > (utilValue - prevUtilValue))) | |
1376 | - | then $ | |
1377 | - | else $ | |
1398 | + | then $Tuple5(false, startInner, currentAmount, currentAmount, (utilValue - prevUtilValue)) | |
1399 | + | else $Tuple5(false, currentAmount, stopInner, currentAmount, (utilValue - prevUtilValue)) | |
1378 | 1400 | } | |
1379 | 1401 | ||
1380 | 1402 | let targetAmount = { | |
1386 | 1408 | if ((feeDiff == 0)) | |
1387 | 1409 | then targetAmount | |
1388 | 1410 | else { | |
1389 | - | let $ | |
1411 | + | let $t03898839119 = { | |
1390 | 1412 | let $l = LIST_64 | |
1391 | 1413 | let $s = size($l) | |
1392 | - | let $acc0 = $ | |
1414 | + | let $acc0 = $Tuple5(false, 0, (sourceAmount_ + prevFee), 0, 0) | |
1393 | 1415 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1394 | 1416 | then $a | |
1395 | 1417 | else foldFunc($a, $l[$i]) | |
1400 | 1422 | ||
1401 | 1423 | $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($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($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($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($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), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64) | |
1402 | 1424 | } | |
1403 | - | let success = $t03762537744._1 | |
1404 | - | let startOut = $t03762537744._2 | |
1405 | - | let stopOut = $t03762537744._3 | |
1406 | - | let targetAmountOut = $t03762537744._4 | |
1425 | + | let success = $t03898839119._1 | |
1426 | + | let startOut = $t03898839119._2 | |
1427 | + | let stopOut = $t03898839119._3 | |
1428 | + | let targetAmountOut = $t03898839119._4 | |
1429 | + | let diffOut = $t03898839119._5 | |
1407 | 1430 | if (!(success)) | |
1408 | - | then throw(("_swap: can't calculate targetAmount=" + toString(targetAmountOut))) | |
1431 | + | then throw(((("_swap: can't calculate targetAmount=" + toString(targetAmountOut)) + ",diff=") + toString(diffOut))) | |
1409 | 1432 | else targetAmountOut | |
1410 | 1433 | } | |
1411 | 1434 | } | |
1416 | 1439 | else false | |
1417 | 1440 | if ((err1 == err1)) | |
1418 | 1441 | then { | |
1419 | - | let $ | |
1420 | - | let lpFee = $ | |
1421 | - | let protocolFee = $ | |
1422 | - | let sigmaFeePerLpUpdated = $ | |
1442 | + | let $t03996640107 = _calculateLpAndProtocolFees((targetAssetIndex_ + 1), targetAmount, lpFeeRate, protocolFeeRate) | |
1443 | + | let lpFee = $t03996640107._1 | |
1444 | + | let protocolFee = $t03996640107._2 | |
1445 | + | let sigmaFeePerLpUpdated = $t03996640107._3 | |
1423 | 1446 | $Tuple5(targetAmount, finalAssetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1424 | 1447 | } | |
1425 | 1448 | else throw("Strict value is not equal to itself.") | |
1465 | 1488 | else false | |
1466 | 1489 | if ((err == err)) | |
1467 | 1490 | then { | |
1468 | - | let $ | |
1469 | - | let assetWeights = $ | |
1470 | - | let sigmaWeight = $ | |
1491 | + | let $t04197042039 = _prepareAssetWeights(assetWeights_) | |
1492 | + | let assetWeights = $t04197042039._1 | |
1493 | + | let sigmaWeight = $t04197042039._2 | |
1471 | 1494 | let assetBalances = _prepareAssetBalances(assets_) | |
1472 | 1495 | let issue = Issue(lpTokenName_, lpTokenDescr_, 0, lpTokenDecimals_, true) | |
1473 | 1496 | let lpAssetId = calculateAssetId(issue) | |
1492 | 1515 | let lpAssetId = storage._1 | |
1493 | 1516 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1494 | 1517 | let assets = _loadAssets() | |
1495 | - | let $ | |
1496 | - | let lpTokensToMint = $ | |
1497 | - | let requiredAmountsNormalized = $ | |
1498 | - | let assetBalances = $ | |
1518 | + | let $t04378943874 = _depositAll(amount_) | |
1519 | + | let lpTokensToMint = $t04378943874._1 | |
1520 | + | let requiredAmountsNormalized = $t04378943874._2 | |
1521 | + | let assetBalances = $t04378943874._3 | |
1499 | 1522 | func foldFunc (acc,elem) = { | |
1500 | 1523 | let index = acc._1 | |
1501 | 1524 | let paymentAssetStr = _assetToStr(i.payments[index].assetId) | |
1519 | 1542 | else throw("Strict value is not equal to itself.") | |
1520 | 1543 | } | |
1521 | 1544 | ||
1522 | - | let $ | |
1545 | + | let $t04501745079 = { | |
1523 | 1546 | let $l = assets | |
1524 | 1547 | let $s = size($l) | |
1525 | 1548 | let $acc0 = $Tuple2(0, nil) | |
1533 | 1556 | ||
1534 | 1557 | $f0_2($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) | |
1535 | 1558 | } | |
1536 | - | let idx = $ | |
1537 | - | let changeActions = $ | |
1559 | + | let idx = $t04501745079._1 | |
1560 | + | let changeActions = $t04501745079._2 | |
1538 | 1561 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 + lpTokensToMint), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1539 | 1562 | $Tuple2(((([Reissue(lpAssetId, lpTokensToMint, true), ScriptTransfer(i.caller, lpTokensToMint, lpAssetId)] ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(assetBalances)) ++ changeActions), unit) | |
1540 | 1563 | } | |
1552 | 1575 | let lpAssetId = storage._1 | |
1553 | 1576 | let lpAssetIdStr = _assetToStr(lpAssetId) | |
1554 | 1577 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1555 | - | let err1 = if (if (if (if (_whenInitialized()) | |
1578 | + | let err1 = if (if (if (if (if (_whenInitialized()) | |
1556 | 1579 | then _whenNotPaused() | |
1580 | + | else false) | |
1581 | + | then _checkWatchdog() | |
1557 | 1582 | else false) | |
1558 | 1583 | then _validateIntEquals(size(i.payments), 1, "deposit: invalid payments size") | |
1559 | 1584 | else false) | |
1566 | 1591 | let assetStr = _assetToStr(i.payments[0].assetId) | |
1567 | 1592 | let assetDecimals = _getDecimals(assetStr) | |
1568 | 1593 | let amountNormalized = _normalizeDecimals(i.payments[0].amount, assetDecimals, lpDecimals, DOWN) | |
1569 | - | let $ | |
1570 | - | let lpTokensToMint = $ | |
1571 | - | let assetBalances = $ | |
1572 | - | let lpFee = $ | |
1573 | - | let protocolFee = $ | |
1574 | - | let sigmaFeePerLpUpdated = $ | |
1594 | + | let $t04651946635 = _deposit(assetStr, amountNormalized) | |
1595 | + | let lpTokensToMint = $t04651946635._1 | |
1596 | + | let assetBalances = $t04651946635._2 | |
1597 | + | let lpFee = $t04651946635._3 | |
1598 | + | let protocolFee = $t04651946635._4 | |
1599 | + | let sigmaFeePerLpUpdated = $t04651946635._5 | |
1575 | 1600 | let lpTokensToSend = ((lpTokensToMint - lpFee) - protocolFee) | |
1576 | 1601 | let err2 = _validateInt(lpTokensToSend, minLpAmount_, MAX_INT, "deposit: less than min") | |
1577 | 1602 | if ((err2 == err2)) | |
1595 | 1620 | let lpAssetIdStr = toBase58String(lpAssetId) | |
1596 | 1621 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1597 | 1622 | let assets = _loadAssets() | |
1598 | - | let err = if (if (if (if (_whenInitialized()) | |
1599 | - | then _whenNotPaused() | |
1600 | - | else false) | |
1623 | + | let err = if (if (if (_whenInitialized()) | |
1601 | 1624 | then _validateIntEquals(size(i.payments), 1, "withdrawAll: invalid payments size") | |
1602 | 1625 | else false) | |
1603 | 1626 | then _validateStringEqual(lpAssetIdStr, _assetToStr(i.payments[0].assetId), "withdrawAll: invalid payment asset") | |
1606 | 1629 | else false | |
1607 | 1630 | if ((err == err)) | |
1608 | 1631 | then { | |
1609 | - | let $ | |
1610 | - | let lpTokensToBurn = $ | |
1611 | - | let balancesToPay = $ | |
1612 | - | let assetBalances = $ | |
1632 | + | let $t04809648183 = _withdrawAll(i.payments[0].amount) | |
1633 | + | let lpTokensToBurn = $t04809648183._1 | |
1634 | + | let balancesToPay = $t04809648183._2 | |
1635 | + | let assetBalances = $t04809648183._3 | |
1613 | 1636 | let paymentActions = _getPaymentsFromBalances(assets, balancesToPay, i.caller, lpDecimals) | |
1614 | 1637 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 - lpTokensToBurn), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1615 | 1638 | $Tuple2(((([Burn(lpAssetId, lpTokensToBurn)] ++ paymentActions) ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(assetBalances)), unit) | |
1626 | 1649 | let lpAssetIdStr = toBase58String(lpAssetId) | |
1627 | 1650 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1628 | 1651 | let assets = _loadAssets() | |
1629 | - | let err = if (if (if (if (if (if (_whenInitialized()) | |
1652 | + | let err = if (if (if (if (if (if (if (_whenInitialized()) | |
1630 | 1653 | then _whenNotPaused() | |
1654 | + | else false) | |
1655 | + | then _checkWatchdog() | |
1631 | 1656 | else false) | |
1632 | 1657 | then _validateIntEquals(size(i.payments), 1, "withdraw: invalid payments size") | |
1633 | 1658 | else false) | |
1641 | 1666 | else false | |
1642 | 1667 | if ((err == err)) | |
1643 | 1668 | then { | |
1644 | - | let $ | |
1645 | - | let targetAmountNormalized = $ | |
1646 | - | let finalAssetBalances = $ | |
1647 | - | let lpFee = $ | |
1648 | - | let protocolFee = $ | |
1649 | - | let sigmaFeePerLpUpdated = $ | |
1669 | + | let $t04953749671 = _withdraw(assetId_, i.payments[0].amount) | |
1670 | + | let targetAmountNormalized = $t04953749671._1 | |
1671 | + | let finalAssetBalances = $t04953749671._2 | |
1672 | + | let lpFee = $t04953749671._3 | |
1673 | + | let protocolFee = $t04953749671._4 | |
1674 | + | let sigmaFeePerLpUpdated = $t04953749671._5 | |
1650 | 1675 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1651 | 1676 | let targetDecimals = _getDecimals(assetId_) | |
1652 | 1677 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1677 | 1702 | let targetAssetIndex = valueOrErrorMessage(indexOf(assets, targetAssetId_), "swap: invalid target asset") | |
1678 | 1703 | if ((targetAssetIndex == targetAssetIndex)) | |
1679 | 1704 | then { | |
1680 | - | let err = if (if (if (if (if (_whenInitialized()) | |
1705 | + | let err = if (if (if (if (if (if (_whenInitialized()) | |
1681 | 1706 | then _whenNotPaused() | |
1707 | + | else false) | |
1708 | + | then _checkWatchdog() | |
1682 | 1709 | else false) | |
1683 | 1710 | then _validateInt(minAmount_, 0, MAX_INT, "swap: invalid min target amount") | |
1684 | 1711 | else false) | |
1690 | 1717 | else false | |
1691 | 1718 | if ((err == err)) | |
1692 | 1719 | then { | |
1693 | - | let $ | |
1694 | - | let targetAmountNormalized = $ | |
1695 | - | let finalAssetBalances = $ | |
1696 | - | let lpFee = $ | |
1697 | - | let protocolFee = $ | |
1698 | - | let sigmaFeePerLpUpdated = $ | |
1720 | + | let $t05178451942 = _swap(sourceAssetIndex, targetAssetIndex, sourceAmountNormalized) | |
1721 | + | let targetAmountNormalized = $t05178451942._1 | |
1722 | + | let finalAssetBalances = $t05178451942._2 | |
1723 | + | let lpFee = $t05178451942._3 | |
1724 | + | let protocolFee = $t05178451942._4 | |
1725 | + | let sigmaFeePerLpUpdated = $t05178451942._5 | |
1699 | 1726 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1700 | 1727 | let targetDecimals = _getDecimals(targetAssetId_) | |
1701 | 1728 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1718 | 1745 | let err = _validateInt(lpAmount_, 1, MAX_INT, "getDepositAll: invalid amount") | |
1719 | 1746 | if ((err == err)) | |
1720 | 1747 | then { | |
1721 | - | let $ | |
1722 | - | let lpTokensToMint = $ | |
1723 | - | let requiredAmountsNormalized = $ | |
1724 | - | let assetBalances = $ | |
1748 | + | let $t05306253149 = _depositAll(lpAmount_) | |
1749 | + | let lpTokensToMint = $t05306253149._1 | |
1750 | + | let requiredAmountsNormalized = $t05306253149._2 | |
1751 | + | let assetBalances = $t05306253149._3 | |
1725 | 1752 | $Tuple2(nil, $Tuple2(lpTokensToMint, requiredAmountsNormalized)) | |
1726 | 1753 | } | |
1727 | 1754 | else throw("Strict value is not equal to itself.") | |
1741 | 1768 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1742 | 1769 | let assetDecimals = _getDecimals(assetId_) | |
1743 | 1770 | let amountNormalized = _normalizeDecimals(amount_, assetDecimals, lpDecimals, DOWN) | |
1744 | - | let $ | |
1745 | - | let lpTokensToMint = $ | |
1746 | - | let assetBalances = $ | |
1747 | - | let lpFee = $ | |
1748 | - | let protocolFee = $ | |
1749 | - | let sigmaFeePerLpUpdated = $ | |
1771 | + | let $t05390854024 = _deposit(assetId_, amountNormalized) | |
1772 | + | let lpTokensToMint = $t05390854024._1 | |
1773 | + | let assetBalances = $t05390854024._2 | |
1774 | + | let lpFee = $t05390854024._3 | |
1775 | + | let protocolFee = $t05390854024._4 | |
1776 | + | let sigmaFeePerLpUpdated = $t05390854024._5 | |
1750 | 1777 | let lpTokensToSend = ((lpTokensToMint - lpFee) - protocolFee) | |
1751 | 1778 | $Tuple2(nil, lpTokensToSend) | |
1752 | 1779 | } | |
1760 | 1787 | let err = _validateInt(lpAmount_, 0, MAX_INT, "getWithdrawAll: invalid amount") | |
1761 | 1788 | if ((err == err)) | |
1762 | 1789 | then { | |
1763 | - | let $ | |
1764 | - | let lpTokensToBurn = $ | |
1765 | - | let balancesToGet = $ | |
1766 | - | let assetBalances = $ | |
1790 | + | let $t05446354539 = _withdrawAll(lpAmount_) | |
1791 | + | let lpTokensToBurn = $t05446354539._1 | |
1792 | + | let balancesToGet = $t05446354539._2 | |
1793 | + | let assetBalances = $t05446354539._3 | |
1767 | 1794 | $Tuple2(nil, balancesToGet) | |
1768 | 1795 | } | |
1769 | 1796 | else throw("Strict value is not equal to itself.") | |
1781 | 1808 | let storage = _loadStorage() | |
1782 | 1809 | let lpAssetId = storage._1 | |
1783 | 1810 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1784 | - | let $ | |
1785 | - | let targetAmountNormalized = $ | |
1786 | - | let assetBalances = $ | |
1787 | - | let lpFee = $ | |
1788 | - | let protocolFee = $ | |
1789 | - | let sigmaFeePerLpUpdated = $ | |
1811 | + | let $t05519055306 = _withdraw(assetId_, amount_) | |
1812 | + | let targetAmountNormalized = $t05519055306._1 | |
1813 | + | let assetBalances = $t05519055306._2 | |
1814 | + | let lpFee = $t05519055306._3 | |
1815 | + | let protocolFee = $t05519055306._4 | |
1816 | + | let sigmaFeePerLpUpdated = $t05519055306._5 | |
1790 | 1817 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1791 | 1818 | let targetDecimals = _getDecimals(assetId_) | |
1792 | 1819 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1815 | 1842 | else false | |
1816 | 1843 | if ((err == err)) | |
1817 | 1844 | then { | |
1818 | - | let $ | |
1819 | - | let targetAmountNormalized = $ | |
1820 | - | let finalAssetBalances = $ | |
1821 | - | let lpFee = $ | |
1822 | - | let protocolFee = $ | |
1823 | - | let sigmaFeePerLpUpdated = $ | |
1845 | + | let $t05671656874 = _swap(sourceAssetIndex, targetAssetIndex, sourceAmountNormalized) | |
1846 | + | let targetAmountNormalized = $t05671656874._1 | |
1847 | + | let finalAssetBalances = $t05671656874._2 | |
1848 | + | let lpFee = $t05671656874._3 | |
1849 | + | let protocolFee = $t05671656874._4 | |
1850 | + | let sigmaFeePerLpUpdated = $t05671656874._5 | |
1824 | 1851 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1825 | 1852 | let targetDecimals = _getDecimals(targetAssetId_) | |
1826 | 1853 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1840 | 1867 | let user = if ((size(user_) > 0)) | |
1841 | 1868 | then valueOrErrorMessage(addressFromString(user_), "getClaim: invalid user") | |
1842 | 1869 | else i.caller | |
1843 | - | let $ | |
1844 | - | let checkpointActions = $ | |
1845 | - | let userProfits = $ | |
1870 | + | let $t05751657572 = _checkpoint(user) | |
1871 | + | let checkpointActions = $t05751657572._1 | |
1872 | + | let userProfits = $t05751657572._2 | |
1846 | 1873 | $Tuple2(nil, userProfits) | |
1847 | 1874 | } | |
1848 | 1875 | ||
1855 | 1882 | let weightAmplifier = storage._7 | |
1856 | 1883 | let slippageRate = storage._8 | |
1857 | 1884 | let feeMaxRate = storage._9 | |
1858 | - | let $ | |
1859 | - | let assetBalances = $ | |
1860 | - | let assetTotalSupply = $ | |
1861 | - | let $ | |
1862 | - | let assetWeights = $ | |
1863 | - | let sigmaWeight = $ | |
1885 | + | let $t05790557965 = _loadAssetBalances() | |
1886 | + | let assetBalances = $t05790557965._1 | |
1887 | + | let assetTotalSupply = $t05790557965._2 | |
1888 | + | let $t05797058023 = _loadAssetWeights() | |
1889 | + | let assetWeights = $t05797058023._1 | |
1890 | + | let sigmaWeight = $t05797058023._2 | |
1864 | 1891 | let fee = _calculateFee(assetBalances, assetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1865 | 1892 | let utilValue = (assetTotalSupply - fee) | |
1866 | 1893 | $Tuple2(nil, $Tuple2(utilValue, lpTotalSupply)) | |
1874 | 1901 | let weightAmplifier = storage._7 | |
1875 | 1902 | let slippageRate = storage._8 | |
1876 | 1903 | let feeMaxRate = storage._9 | |
1877 | - | let $ | |
1878 | - | let assetBalances = $ | |
1879 | - | let assetTotalSupply = $ | |
1880 | - | let $ | |
1881 | - | let assetWeights = $ | |
1882 | - | let sigmaWeight = $ | |
1904 | + | let $t05845558515 = _loadAssetBalances() | |
1905 | + | let assetBalances = $t05845558515._1 | |
1906 | + | let assetTotalSupply = $t05845558515._2 | |
1907 | + | let $t05852058573 = _loadAssetWeights() | |
1908 | + | let assetWeights = $t05852058573._1 | |
1909 | + | let sigmaWeight = $t05852058573._2 | |
1883 | 1910 | let fee = _calculateFee(assetBalances, assetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1884 | 1911 | $Tuple2(nil, fee) | |
1885 | 1912 | } | |
1919 | 1946 | else false | |
1920 | 1947 | if ((err1 == err1)) | |
1921 | 1948 | then { | |
1922 | - | let $ | |
1923 | - | let checkpointActions = $ | |
1924 | - | let userProfits = $ | |
1949 | + | let $t05958159641 = _checkpoint(i.caller) | |
1950 | + | let checkpointActions = $t05958159641._1 | |
1951 | + | let userProfits = $t05958159641._2 | |
1925 | 1952 | $Tuple2(((checkpointActions ++ _saveUserLp(i.caller, (_loadUserLp(i.caller) + i.payments[0].amount))) ++ _saveTotalLp((_loadTotalLp() + i.payments[0].amount))), unit) | |
1926 | 1953 | } | |
1927 | 1954 | else throw("Strict value is not equal to itself.") | |
1944 | 1971 | let err1 = _validateInt(amount_, 0, userLp, "unstake: invalid amount") | |
1945 | 1972 | if ((err1 == err1)) | |
1946 | 1973 | then { | |
1947 | - | let $ | |
1948 | - | let checkpointActions = $ | |
1949 | - | let userProfits = $ | |
1974 | + | let $t06015260212 = _checkpoint(i.caller) | |
1975 | + | let checkpointActions = $t06015260212._1 | |
1976 | + | let userProfits = $t06015260212._2 | |
1950 | 1977 | $Tuple2(((([ScriptTransfer(i.caller, amount_, lpAssetId)] ++ checkpointActions) ++ _saveUserLp(i.caller, (userLp - amount_))) ++ _saveTotalLp((_loadTotalLp() - amount_))), unit) | |
1951 | 1978 | } | |
1952 | 1979 | else throw("Strict value is not equal to itself.") | |
1972 | 1999 | let assets = [lpAssetIdStr, _loadAssets()] | |
1973 | 2000 | let maxIndex = (size(assets) - 1) | |
1974 | 2001 | let userLp = _loadUserLp(user) | |
1975 | - | let $ | |
1976 | - | let checkpointActions = $ | |
1977 | - | let userProfits = $ | |
2002 | + | let $t06093560991 = _checkpoint(user) | |
2003 | + | let checkpointActions = $t06093560991._1 | |
2004 | + | let userProfits = $t06093560991._2 | |
1978 | 2005 | func foldFunc (acc,profit) = { | |
1979 | 2006 | let index = acc._1 | |
1980 | 2007 | if (if ((maxIndex >= index)) | |
1987 | 2014 | else $Tuple3((index + 1), (acc._2 :+ profit), acc._3) | |
1988 | 2015 | } | |
1989 | 2016 | ||
1990 | - | let $ | |
2017 | + | let $t06136961460 = { | |
1991 | 2018 | let $l = userProfits | |
1992 | 2019 | let $s = size($l) | |
1993 | 2020 | let $acc0 = $Tuple3(0, nil, nil) | |
2001 | 2028 | ||
2002 | 2029 | $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) | |
2003 | 2030 | } | |
2004 | - | let idx = $ | |
2005 | - | let userProfitsUpdated = $ | |
2006 | - | let profitActions = $ | |
2031 | + | let idx = $t06136961460._1 | |
2032 | + | let userProfitsUpdated = $t06136961460._2 | |
2033 | + | let profitActions = $t06136961460._3 | |
2007 | 2034 | $Tuple2(((profitActions ++ removeByIndex(checkpointActions, 0)) ++ _saveUserProfits(user, userProfitsUpdated)), unit) | |
2008 | 2035 | } | |
2009 | 2036 | else throw("Strict value is not equal to itself.") | |
2027 | 2054 | ||
2028 | 2055 | @Callable(i) | |
2029 | 2056 | func unpause () = { | |
2030 | - | let err = if (if (_ | |
2057 | + | let err = if (if (_onlyThisContract(i.caller)) | |
2031 | 2058 | then _whenInitialized() | |
2032 | 2059 | else false) | |
2033 | 2060 | then _whenPaused() | |
2048 | 2075 | else false | |
2049 | 2076 | if ((err == err)) | |
2050 | 2077 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
2078 | + | else throw("Strict value is not equal to itself.") | |
2079 | + | } | |
2080 | + | ||
2081 | + | ||
2082 | + | ||
2083 | + | @Callable(i) | |
2084 | + | func updateWatchdog (watchdog_,offset_) = { | |
2085 | + | let err = if (if (if (_onlyThisContract(i.caller)) | |
2086 | + | then _whenInitialized() | |
2087 | + | else false) | |
2088 | + | then _validateAddress(watchdog_, "updateWatchdog: invalid watchdog") | |
2089 | + | else false) | |
2090 | + | then _validateInt(offset_, 0, MAX_INT, "updateWatchdog: invalid offset") | |
2091 | + | else false | |
2092 | + | if ((err == err)) | |
2093 | + | then $Tuple2((_saveWatchdog(addressFromStringValue(watchdog_)) ++ _saveWatchdogOffset(offset_)), unit) | |
2051 | 2094 | else throw("Strict value is not equal to itself.") | |
2052 | 2095 | } | |
2053 | 2096 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let WAVES = "waves" | |
7 | 7 | ||
8 | 8 | let MAX_INT = 9223372036854775807 | |
9 | 9 | ||
10 | 10 | let MAX_FEE = 1000000 | |
11 | 11 | ||
12 | 12 | let MAX_AMPLIFIER = 1000000 | |
13 | 13 | ||
14 | 14 | let MAX_WEIGHT_AMPLIFIER = 1000000 | |
15 | 15 | ||
16 | 16 | let MAX_WEIGHT = 1000000 | |
17 | 17 | ||
18 | 18 | let SLIPPAGE_RATE_FACTOR = 1000000 | |
19 | 19 | ||
20 | 20 | let FEE_RATE_FACTOR = 1000000 | |
21 | 21 | ||
22 | 22 | let RATE_FACTOR = 1000000 | |
23 | 23 | ||
24 | 24 | let PERCENT_FACTOR = toBigInt(1000000000000000000) | |
25 | 25 | ||
26 | 26 | let ZERO_INT_LIST_10 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] | |
27 | 27 | ||
28 | 28 | let ZERO_INT_LIST_11 = (ZERO_INT_LIST_10 :+ 0) | |
29 | 29 | ||
30 | 30 | let ZERO_BIGINT = toBigInt(0) | |
31 | 31 | ||
32 | 32 | let ZERO_BIGINT_LIST_11 = [ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT, ZERO_BIGINT] | |
33 | 33 | ||
34 | 34 | let INT_DECIMALS = 8 | |
35 | 35 | ||
36 | 36 | let BIGINT_DECIMALS = 18 | |
37 | 37 | ||
38 | 38 | let LIST_64 = split_51C("0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0_0", "_") | |
39 | 39 | ||
40 | 40 | let KEY_MULTISIG = "MULTISIG" | |
41 | 41 | ||
42 | 42 | let KEY_STATUS = "STATUS" | |
43 | 43 | ||
44 | 44 | let KEY_PAUSED = "PAUSED" | |
45 | 45 | ||
46 | 46 | let KEY_PAUSER = "PAUSER" | |
47 | 47 | ||
48 | 48 | let KEY_STORAGE = "STORAGE" | |
49 | 49 | ||
50 | 50 | let KEY_ASSETS = "ASSETS" | |
51 | 51 | ||
52 | 52 | let KEY_ASSET_BALANCES = "ASSET_BALANCES" | |
53 | 53 | ||
54 | 54 | let KEY_ASSET_WEIGHTS = "ASSET_WEIGHTS" | |
55 | 55 | ||
56 | 56 | let KEY_LP_FEE = "LP_FEE" | |
57 | 57 | ||
58 | 58 | let KEY_PROTOCOL_FEE = "PROTOCOL_FEE" | |
59 | 59 | ||
60 | 60 | let KEY_PRECISION = "PRECISION" | |
61 | 61 | ||
62 | 62 | let KEY_SIGMA_FEE_PER_LP = "SIGMA_FEE_PER_LP" | |
63 | 63 | ||
64 | 64 | let KEY_USER_SIGMA_FEE_PER_LP = "USER_SIGMA_FEE_PER_LP" | |
65 | 65 | ||
66 | 66 | let KEY_USER_LP = "USER_LP" | |
67 | 67 | ||
68 | 68 | let KEY_TOTAL_LP = "TOTAL_LP" | |
69 | 69 | ||
70 | 70 | let KEY_USER_PROFITS = "USER_PROFITS" | |
71 | + | ||
72 | + | let KEY_WATCHDOG = "WATCHDOG" | |
73 | + | ||
74 | + | let KEY_WATCHDOG_OFFSET = "WATCHDOG_OFFSET" | |
75 | + | ||
76 | + | let KEY_WATCHDOG_HEIGHT = "WATCHDOG_HEIGHT" | |
71 | 77 | ||
72 | 78 | func _validateAddress (address_,err_) = match addressFromString(address_) { | |
73 | 79 | case a: Address => | |
74 | 80 | true | |
75 | 81 | case _ => | |
76 | 82 | throw(err_) | |
77 | 83 | } | |
78 | 84 | ||
79 | 85 | ||
80 | 86 | func _validateAsset (assetId_,err_) = if ((assetId_ == WAVES)) | |
81 | 87 | then true | |
82 | 88 | else match assetInfo(fromBase58String(assetId_)) { | |
83 | 89 | case a: Asset => | |
84 | 90 | true | |
85 | 91 | case _ => | |
86 | 92 | throw(err_) | |
87 | 93 | } | |
88 | 94 | ||
89 | 95 | ||
90 | 96 | func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_)) | |
91 | 97 | then true | |
92 | 98 | else (val_ > upperBoundary_)) | |
93 | 99 | then throw(err_) | |
94 | 100 | else true | |
95 | 101 | ||
96 | 102 | ||
97 | 103 | func _validateBool (val_,target_,err_) = if ((val_ != target_)) | |
98 | 104 | then throw(err_) | |
99 | 105 | else true | |
100 | 106 | ||
101 | 107 | ||
102 | 108 | func _validateStringEqual (val1_,val2_,err_) = if ((val1_ != val2_)) | |
103 | 109 | then throw(err_) | |
104 | 110 | else true | |
105 | 111 | ||
106 | 112 | ||
107 | 113 | func _validateStringNotEq (val1_,val2_,err_) = if ((val1_ == val2_)) | |
108 | 114 | then throw(err_) | |
109 | 115 | else true | |
110 | 116 | ||
111 | 117 | ||
112 | 118 | func _validateIntList (val_,lowerBoundary_,upperBoundary_,err_) = { | |
113 | 119 | func foldFunc (acc,elem) = match parseInt(elem) { | |
114 | 120 | case a: Int => | |
115 | 121 | if (acc) | |
116 | 122 | then _validateInt(a, lowerBoundary_, upperBoundary_, err_) | |
117 | 123 | else false | |
118 | 124 | case _ => | |
119 | 125 | throw(err_) | |
120 | 126 | } | |
121 | 127 | ||
122 | 128 | let $l = val_ | |
123 | 129 | let $s = size($l) | |
124 | 130 | let $acc0 = true | |
125 | 131 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
126 | 132 | then $a | |
127 | 133 | else foldFunc($a, $l[$i]) | |
128 | 134 | ||
129 | 135 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
130 | 136 | then $a | |
131 | 137 | else throw("List size exceeds 10") | |
132 | 138 | ||
133 | 139 | $f0_2($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) | |
134 | 140 | } | |
135 | 141 | ||
136 | 142 | ||
137 | 143 | func _validateAssets (assets_,err_) = { | |
138 | 144 | func foldFunc (acc,elem) = if (acc) | |
139 | 145 | then _validateAsset(elem, err_) | |
140 | 146 | else false | |
141 | 147 | ||
142 | 148 | let $l = assets_ | |
143 | 149 | let $s = size($l) | |
144 | 150 | let $acc0 = true | |
145 | 151 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
146 | 152 | then $a | |
147 | 153 | else foldFunc($a, $l[$i]) | |
148 | 154 | ||
149 | 155 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
150 | 156 | then $a | |
151 | 157 | else throw("List size exceeds 10") | |
152 | 158 | ||
153 | 159 | $f0_2($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) | |
154 | 160 | } | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func _validateIntEquals (val1_,val2_,err_) = if ((val1_ != val2_)) | |
158 | 164 | then throw(err_) | |
159 | 165 | else true | |
160 | 166 | ||
161 | 167 | ||
162 | 168 | func _validateTokenName (val_,err_) = if (if ((4 > size(val_))) | |
163 | 169 | then true | |
164 | 170 | else (size(val_) > 16)) | |
165 | 171 | then throw(err_) | |
166 | 172 | else true | |
167 | 173 | ||
168 | 174 | ||
169 | 175 | func _validateTokenDescr (val_,err_) = if ((size(val_) > 1000)) | |
170 | 176 | then throw(err_) | |
171 | 177 | else true | |
172 | 178 | ||
173 | 179 | ||
174 | 180 | func _validateDecimals (val_,err_) = if (if ((0 > val_)) | |
175 | 181 | then true | |
176 | 182 | else (val_ > 8)) | |
177 | 183 | then throw(err_) | |
178 | 184 | else true | |
179 | 185 | ||
180 | 186 | ||
181 | 187 | func _validatePayment (payment_,assetId_,requiredAmount_,err_) = match payment_.assetId { | |
182 | 188 | case a: ByteVector => | |
183 | 189 | if ((assetId_ != toBase58String(a))) | |
184 | 190 | then throw((err_ + ": asset")) | |
185 | 191 | else if ((requiredAmount_ > payment_.amount)) | |
186 | 192 | then throw((err_ + ": amount")) | |
187 | 193 | else true | |
188 | 194 | case _ => | |
189 | 195 | throw((err_ + ": asset")) | |
190 | 196 | } | |
191 | 197 | ||
192 | 198 | ||
193 | 199 | func _validateListContains (list_,val_,err_) = if (!(containsElement(list_, val_))) | |
194 | 200 | then throw(err_) | |
195 | 201 | else true | |
196 | 202 | ||
197 | 203 | ||
198 | 204 | func _assetToStr (asset_) = match asset_ { | |
199 | 205 | case a: ByteVector => | |
200 | 206 | toBase58String(a) | |
201 | 207 | case _ => | |
202 | 208 | WAVES | |
203 | 209 | } | |
204 | 210 | ||
205 | 211 | ||
206 | 212 | func _strToAsset (asset_) = if (if ((asset_ == WAVES)) | |
207 | 213 | then true | |
208 | 214 | else (asset_ == "")) | |
209 | 215 | then unit | |
210 | 216 | else fromBase58String(asset_) | |
211 | 217 | ||
212 | 218 | ||
213 | 219 | func _loadPause () = match getBoolean(KEY_PAUSED) { | |
214 | 220 | case a: Boolean => | |
215 | 221 | a | |
216 | 222 | case _ => | |
217 | 223 | false | |
218 | 224 | } | |
219 | 225 | ||
220 | 226 | ||
221 | 227 | func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)] | |
222 | 228 | ||
223 | 229 | ||
224 | 230 | func _loadPauser () = match getString(KEY_PAUSER) { | |
225 | 231 | case a: String => | |
226 | 232 | addressFromStringValue(a) | |
227 | 233 | case _ => | |
228 | 234 | Address(base58'') | |
229 | 235 | } | |
230 | 236 | ||
231 | 237 | ||
232 | 238 | func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))] | |
233 | 239 | ||
234 | 240 | ||
235 | 241 | func _loadMultisig () = match getString(KEY_MULTISIG) { | |
236 | 242 | case a: String => | |
237 | 243 | addressFromStringValue(a) | |
238 | 244 | case _ => | |
239 | 245 | Address(base58'') | |
240 | 246 | } | |
241 | 247 | ||
242 | 248 | ||
243 | 249 | func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))] | |
244 | 250 | ||
245 | 251 | ||
246 | 252 | func _loadStorage () = match getString(KEY_STORAGE) { | |
247 | 253 | case a: String => | |
248 | 254 | let struct = split(a, SEP) | |
249 | 255 | $Tuple10(fromBase58String(struct[0]), (struct[1] == "1"), parseIntValue(struct[2]), parseIntValue(struct[3]), parseIntValue(struct[4]), parseIntValue(struct[5]), parseIntValue(struct[6]), parseIntValue(struct[7]), parseIntValue(struct[8]), addressFromStringValue(struct[9])) | |
250 | 256 | case _ => | |
251 | 257 | $Tuple10(base58'', false, 0, 0, 0, 0, 0, 0, 0, Address(base58'')) | |
252 | 258 | } | |
253 | 259 | ||
254 | 260 | ||
255 | 261 | func _saveStorage (storage_) = [StringEntry(KEY_STORAGE, makeString([toBase58String(storage_._1), if (storage_._2) | |
256 | 262 | then "1" | |
257 | 263 | else "0", toString(storage_._3), toString(storage_._4), toString(storage_._5), toString(storage_._6), toString(storage_._7), toString(storage_._8), toString(storage_._9), toString(storage_._10)], SEP))] | |
258 | 264 | ||
259 | 265 | ||
260 | 266 | func _loadAssets () = match getString(KEY_ASSETS) { | |
261 | 267 | case a: String => | |
262 | 268 | if ((size(a) > 0)) | |
263 | 269 | then split_51C(a, SEP) | |
264 | 270 | else nil | |
265 | 271 | case _ => | |
266 | 272 | nil | |
267 | 273 | } | |
268 | 274 | ||
269 | 275 | ||
270 | 276 | func _saveAssets (assets_) = [StringEntry(KEY_ASSETS, makeString_11C(assets_, SEP))] | |
271 | 277 | ||
272 | 278 | ||
273 | 279 | func _loadAssetBalances () = { | |
274 | 280 | func foldFunc (acc,elem) = { | |
275 | 281 | let balance = parseIntValue(elem) | |
276 | 282 | $Tuple2((acc._1 :+ balance), (acc._2 + balance)) | |
277 | 283 | } | |
278 | 284 | ||
279 | 285 | match getString(KEY_ASSET_BALANCES) { | |
280 | 286 | case a: String => | |
281 | 287 | if ((size(a) > 0)) | |
282 | 288 | then { | |
283 | 289 | let $l = split_51C(a, SEP) | |
284 | 290 | let $s = size($l) | |
285 | 291 | let $acc0 = $Tuple2(nil, 0) | |
286 | 292 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
287 | 293 | then $a | |
288 | 294 | else foldFunc($a, $l[$i]) | |
289 | 295 | ||
290 | 296 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
291 | 297 | then $a | |
292 | 298 | else throw("List size exceeds 10") | |
293 | 299 | ||
294 | 300 | $f0_2($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) | |
295 | 301 | } | |
296 | 302 | else $Tuple2(ZERO_INT_LIST_10, 0) | |
297 | 303 | case _ => | |
298 | 304 | $Tuple2(ZERO_INT_LIST_10, 0) | |
299 | 305 | } | |
300 | 306 | } | |
301 | 307 | ||
302 | 308 | ||
303 | 309 | func _saveAssetBalances (balances_) = { | |
304 | 310 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
305 | 311 | ||
306 | 312 | [StringEntry(KEY_ASSET_BALANCES, makeString_11C({ | |
307 | 313 | let $l = balances_ | |
308 | 314 | let $s = size($l) | |
309 | 315 | let $acc0 = nil | |
310 | 316 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
311 | 317 | then $a | |
312 | 318 | else foldFunc($a, $l[$i]) | |
313 | 319 | ||
314 | 320 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
315 | 321 | then $a | |
316 | 322 | else throw("List size exceeds 10") | |
317 | 323 | ||
318 | 324 | $f0_2($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) | |
319 | 325 | }, SEP))] | |
320 | 326 | } | |
321 | 327 | ||
322 | 328 | ||
323 | 329 | func _loadAssetWeights () = { | |
324 | 330 | func foldFunc (acc,elem) = { | |
325 | 331 | let weight = parseIntValue(elem) | |
326 | 332 | $Tuple2((acc._1 :+ weight), (acc._2 + weight)) | |
327 | 333 | } | |
328 | 334 | ||
329 | 335 | match getString(KEY_ASSET_WEIGHTS) { | |
330 | 336 | case a: String => | |
331 | 337 | if ((size(a) > 0)) | |
332 | 338 | then { | |
333 | 339 | let $l = split_51C(a, SEP) | |
334 | 340 | let $s = size($l) | |
335 | 341 | let $acc0 = $Tuple2(nil, 0) | |
336 | 342 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
337 | 343 | then $a | |
338 | 344 | else foldFunc($a, $l[$i]) | |
339 | 345 | ||
340 | 346 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
341 | 347 | then $a | |
342 | 348 | else throw("List size exceeds 10") | |
343 | 349 | ||
344 | 350 | $f0_2($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) | |
345 | 351 | } | |
346 | 352 | else $Tuple2(ZERO_INT_LIST_10, 0) | |
347 | 353 | case _ => | |
348 | 354 | $Tuple2(ZERO_INT_LIST_10, 0) | |
349 | 355 | } | |
350 | 356 | } | |
351 | 357 | ||
352 | 358 | ||
353 | 359 | func _saveAssetWeights (weights_) = { | |
354 | 360 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
355 | 361 | ||
356 | 362 | [StringEntry(KEY_ASSET_WEIGHTS, makeString_11C({ | |
357 | 363 | let $l = weights_ | |
358 | 364 | let $s = size($l) | |
359 | 365 | let $acc0 = nil | |
360 | 366 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
361 | 367 | then $a | |
362 | 368 | else foldFunc($a, $l[$i]) | |
363 | 369 | ||
364 | 370 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
365 | 371 | then $a | |
366 | 372 | else throw("List size exceeds 10") | |
367 | 373 | ||
368 | 374 | $f0_2($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) | |
369 | 375 | }, SEP))] | |
370 | 376 | } | |
371 | 377 | ||
372 | 378 | ||
373 | 379 | func _loadLpFee (assetId_) = match getInteger(makeString([KEY_LP_FEE, assetId_], SEP)) { | |
374 | 380 | case a: Int => | |
375 | 381 | a | |
376 | 382 | case _ => | |
377 | 383 | 0 | |
378 | 384 | } | |
379 | 385 | ||
380 | 386 | ||
381 | 387 | func _saveLpFee (assetId_,val_) = [IntegerEntry(makeString([KEY_LP_FEE, assetId_], SEP), val_)] | |
382 | 388 | ||
383 | 389 | ||
384 | 390 | func _loadProtocolFee (assetId_) = match getInteger(makeString([KEY_PROTOCOL_FEE, assetId_], SEP)) { | |
385 | 391 | case a: Int => | |
386 | 392 | a | |
387 | 393 | case _ => | |
388 | 394 | 0 | |
389 | 395 | } | |
390 | 396 | ||
391 | 397 | ||
392 | 398 | func _saveProtocolFee (assetId_,val_) = [IntegerEntry(makeString([KEY_PROTOCOL_FEE, assetId_], SEP), val_)] | |
393 | 399 | ||
394 | 400 | ||
395 | 401 | func _loadPrecision () = match getInteger(KEY_PRECISION) { | |
396 | 402 | case a: Int => | |
397 | 403 | a | |
398 | 404 | case _ => | |
399 | 405 | 0 | |
400 | 406 | } | |
401 | 407 | ||
402 | 408 | ||
403 | 409 | func _savePrecision (val_) = [IntegerEntry(KEY_PRECISION, val_)] | |
404 | 410 | ||
405 | 411 | ||
406 | 412 | func _loadSigmaFeePerLp () = { | |
407 | 413 | func foldFunc (acc,elem) = (acc :+ parseBigIntValue(elem)) | |
408 | 414 | ||
409 | 415 | match getString(KEY_SIGMA_FEE_PER_LP) { | |
410 | 416 | case a: String => | |
411 | 417 | if ((size(a) > 0)) | |
412 | 418 | then { | |
413 | 419 | let $l = split_51C(a, SEP) | |
414 | 420 | let $s = size($l) | |
415 | 421 | let $acc0 = nil | |
416 | 422 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
417 | 423 | then $a | |
418 | 424 | else foldFunc($a, $l[$i]) | |
419 | 425 | ||
420 | 426 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
421 | 427 | then $a | |
422 | 428 | else throw("List size exceeds 11") | |
423 | 429 | ||
424 | 430 | $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) | |
425 | 431 | } | |
426 | 432 | else ZERO_BIGINT_LIST_11 | |
427 | 433 | case _ => | |
428 | 434 | ZERO_BIGINT_LIST_11 | |
429 | 435 | } | |
430 | 436 | } | |
431 | 437 | ||
432 | 438 | ||
433 | 439 | func _saveSigmaFeePerLp (val_) = { | |
434 | 440 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
435 | 441 | ||
436 | 442 | [StringEntry(KEY_SIGMA_FEE_PER_LP, makeString_11C({ | |
437 | 443 | let $l = val_ | |
438 | 444 | let $s = size($l) | |
439 | 445 | let $acc0 = nil | |
440 | 446 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
441 | 447 | then $a | |
442 | 448 | else foldFunc($a, $l[$i]) | |
443 | 449 | ||
444 | 450 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
445 | 451 | then $a | |
446 | 452 | else throw("List size exceeds 11") | |
447 | 453 | ||
448 | 454 | $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) | |
449 | 455 | }, SEP))] | |
450 | 456 | } | |
451 | 457 | ||
452 | 458 | ||
453 | 459 | func _loadUserSigmaFeePerLp (user_) = { | |
454 | 460 | func foldFunc (acc,elem) = (acc :+ parseBigIntValue(elem)) | |
455 | 461 | ||
456 | 462 | match getString(makeString([KEY_USER_SIGMA_FEE_PER_LP, toString(user_)], SEP)) { | |
457 | 463 | case a: String => | |
458 | 464 | if ((size(a) > 0)) | |
459 | 465 | then { | |
460 | 466 | let $l = split_51C(a, SEP) | |
461 | 467 | let $s = size($l) | |
462 | 468 | let $acc0 = nil | |
463 | 469 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
464 | 470 | then $a | |
465 | 471 | else foldFunc($a, $l[$i]) | |
466 | 472 | ||
467 | 473 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
468 | 474 | then $a | |
469 | 475 | else throw("List size exceeds 11") | |
470 | 476 | ||
471 | 477 | $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) | |
472 | 478 | } | |
473 | 479 | else ZERO_BIGINT_LIST_11 | |
474 | 480 | case _ => | |
475 | 481 | ZERO_BIGINT_LIST_11 | |
476 | 482 | } | |
477 | 483 | } | |
478 | 484 | ||
479 | 485 | ||
480 | 486 | func _saveUserSigmaFeePerLp (user_,val_) = { | |
481 | 487 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
482 | 488 | ||
483 | 489 | [StringEntry(makeString([KEY_USER_SIGMA_FEE_PER_LP, toString(user_)], SEP), makeString_11C({ | |
484 | 490 | let $l = val_ | |
485 | 491 | let $s = size($l) | |
486 | 492 | let $acc0 = nil | |
487 | 493 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
488 | 494 | then $a | |
489 | 495 | else foldFunc($a, $l[$i]) | |
490 | 496 | ||
491 | 497 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
492 | 498 | then $a | |
493 | 499 | else throw("List size exceeds 11") | |
494 | 500 | ||
495 | 501 | $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) | |
496 | 502 | }, SEP))] | |
497 | 503 | } | |
498 | 504 | ||
499 | 505 | ||
500 | 506 | func _loadUserLp (address_) = match getInteger(makeString([KEY_USER_LP, toString(address_)], SEP)) { | |
501 | 507 | case a: Int => | |
502 | 508 | a | |
503 | 509 | case _ => | |
504 | 510 | 0 | |
505 | 511 | } | |
506 | 512 | ||
507 | 513 | ||
508 | 514 | func _saveUserLp (address_,val_) = [IntegerEntry(makeString([KEY_USER_LP, toString(address_)], SEP), val_)] | |
509 | 515 | ||
510 | 516 | ||
511 | 517 | func _loadTotalLp () = match getInteger(KEY_TOTAL_LP) { | |
512 | 518 | case a: Int => | |
513 | 519 | a | |
514 | 520 | case _ => | |
515 | 521 | 0 | |
516 | 522 | } | |
517 | 523 | ||
518 | 524 | ||
519 | 525 | func _saveTotalLp (val_) = [IntegerEntry(KEY_TOTAL_LP, val_)] | |
520 | 526 | ||
521 | 527 | ||
522 | 528 | func _loadUserProfits (user_) = { | |
523 | 529 | func foldFunc (acc,elem) = (acc :+ parseIntValue(elem)) | |
524 | 530 | ||
525 | 531 | match getString(makeString([KEY_USER_PROFITS, toString(user_)], SEP)) { | |
526 | 532 | case a: String => | |
527 | 533 | if ((size(a) > 0)) | |
528 | 534 | then { | |
529 | 535 | let $l = split_51C(a, SEP) | |
530 | 536 | let $s = size($l) | |
531 | 537 | let $acc0 = nil | |
532 | 538 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
533 | 539 | then $a | |
534 | 540 | else foldFunc($a, $l[$i]) | |
535 | 541 | ||
536 | 542 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
537 | 543 | then $a | |
538 | 544 | else throw("List size exceeds 11") | |
539 | 545 | ||
540 | 546 | $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) | |
541 | 547 | } | |
542 | 548 | else ZERO_INT_LIST_11 | |
543 | 549 | case _ => | |
544 | 550 | ZERO_INT_LIST_11 | |
545 | 551 | } | |
546 | 552 | } | |
547 | 553 | ||
548 | 554 | ||
549 | 555 | func _saveUserProfits (user_,val_) = { | |
550 | 556 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
551 | 557 | ||
552 | 558 | [StringEntry(makeString([KEY_USER_PROFITS, toString(user_)], SEP), makeString_11C({ | |
553 | 559 | let $l = val_ | |
554 | 560 | let $s = size($l) | |
555 | 561 | let $acc0 = nil | |
556 | 562 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
557 | 563 | then $a | |
558 | 564 | else foldFunc($a, $l[$i]) | |
559 | 565 | ||
560 | 566 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
561 | 567 | then $a | |
562 | 568 | else throw("List size exceeds 11") | |
563 | 569 | ||
564 | 570 | $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) | |
565 | 571 | }, SEP))] | |
566 | 572 | } | |
567 | 573 | ||
568 | 574 | ||
575 | + | func _loadWatchdog () = match getString(KEY_WATCHDOG) { | |
576 | + | case a: String => | |
577 | + | addressFromStringValue(a) | |
578 | + | case _ => | |
579 | + | Address(base58'') | |
580 | + | } | |
581 | + | ||
582 | + | ||
583 | + | func _saveWatchdog (watchdog_) = [StringEntry(KEY_WATCHDOG, toString(watchdog_))] | |
584 | + | ||
585 | + | ||
586 | + | func _loadWatchdogOffset () = match getInteger(KEY_WATCHDOG_OFFSET) { | |
587 | + | case a: Int => | |
588 | + | a | |
589 | + | case _ => | |
590 | + | 0 | |
591 | + | } | |
592 | + | ||
593 | + | ||
594 | + | func _saveWatchdogOffset (offset_) = [IntegerEntry(KEY_WATCHDOG_OFFSET, offset_)] | |
595 | + | ||
596 | + | ||
569 | 597 | func _onlyThisContract (caller_) = if ((caller_ != this)) | |
570 | 598 | then throw("_onlyThisContract: revert") | |
571 | 599 | else true | |
572 | 600 | ||
573 | 601 | ||
574 | 602 | func _whenMultisigSet () = if ((_loadMultisig() == Address(base58''))) | |
575 | 603 | then throw("_whenMultisigSet: revert") | |
576 | 604 | else true | |
577 | 605 | ||
578 | 606 | ||
579 | 607 | func _whenNotInitialized () = { | |
580 | 608 | let storage = _loadStorage() | |
581 | 609 | if ((storage._1 != base58'')) | |
582 | 610 | then throw("_whenNotInitialized: revert") | |
583 | 611 | else true | |
584 | 612 | } | |
585 | 613 | ||
586 | 614 | ||
587 | 615 | func _whenInitialized () = { | |
588 | 616 | let storage = _loadStorage() | |
589 | 617 | if ((storage._1 == base58'')) | |
590 | 618 | then throw("_whenInitialized: revert") | |
591 | 619 | else true | |
592 | 620 | } | |
593 | 621 | ||
594 | 622 | ||
595 | 623 | func _whenNotPaused () = if (_loadPause()) | |
596 | 624 | then throw("_whenNotPaused: revert") | |
597 | 625 | else true | |
598 | 626 | ||
599 | 627 | ||
600 | 628 | func _whenPaused () = if (!(_loadPause())) | |
601 | 629 | then throw("_whenPaused: revert") | |
602 | 630 | else true | |
603 | 631 | ||
604 | 632 | ||
605 | 633 | func _onlyPauser (caller_) = if ((caller_ != _loadPauser())) | |
606 | 634 | then throw("_onlyPauser: revert") | |
607 | 635 | else true | |
636 | + | ||
637 | + | ||
638 | + | func _checkWatchdog () = { | |
639 | + | let wd = match getInteger(_loadWatchdog(), KEY_WATCHDOG_HEIGHT) { | |
640 | + | case a: Int => | |
641 | + | (a + _loadWatchdogOffset()) | |
642 | + | case _ => | |
643 | + | 0 | |
644 | + | } | |
645 | + | if ((height > wd)) | |
646 | + | then throw("_checkWatchdog: revert") | |
647 | + | else true | |
648 | + | } | |
608 | 649 | ||
609 | 650 | ||
610 | 651 | func _getDecimals (assetId_) = match assetInfo(fromBase58String(assetId_)) { | |
611 | 652 | case a: Asset => | |
612 | 653 | a.decimals | |
613 | 654 | case _ => | |
614 | 655 | throw(("_getDecimals: no asset=" + assetId_)) | |
615 | 656 | } | |
616 | 657 | ||
617 | 658 | ||
618 | 659 | func _normalizeDecimals (amount_,sourceDecimals_,targetDecimals_,round_) = if ((sourceDecimals_ >= targetDecimals_)) | |
619 | 660 | then fraction(amount_, 1, pow(10, 0, (sourceDecimals_ - targetDecimals_), 0, 0, DOWN), round_) | |
620 | 661 | else (amount_ * pow(10, 0, (targetDecimals_ - sourceDecimals_), 0, 0, DOWN)) | |
621 | 662 | ||
622 | 663 | ||
623 | 664 | func _prepareAssetBalances (assets_) = { | |
624 | 665 | func foldFunc (acc,elem) = (acc :+ 0) | |
625 | 666 | ||
626 | 667 | let $l = assets_ | |
627 | 668 | let $s = size($l) | |
628 | 669 | let $acc0 = nil | |
629 | 670 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
630 | 671 | then $a | |
631 | 672 | else foldFunc($a, $l[$i]) | |
632 | 673 | ||
633 | 674 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
634 | 675 | then $a | |
635 | 676 | else throw("List size exceeds 10") | |
636 | 677 | ||
637 | 678 | $f0_2($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) | |
638 | 679 | } | |
639 | 680 | ||
640 | 681 | ||
641 | 682 | func _prepareAssetWeights (assetWeights_) = { | |
642 | 683 | func foldFunc (acc,elem) = { | |
643 | 684 | let weight = parseIntValue(elem) | |
644 | 685 | $Tuple2((acc._1 :+ weight), (acc._2 + weight)) | |
645 | 686 | } | |
646 | 687 | ||
647 | 688 | let $l = assetWeights_ | |
648 | 689 | let $s = size($l) | |
649 | 690 | let $acc0 = $Tuple2(nil, 0) | |
650 | 691 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
651 | 692 | then $a | |
652 | 693 | else foldFunc($a, $l[$i]) | |
653 | 694 | ||
654 | 695 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
655 | 696 | then $a | |
656 | 697 | else throw("List size exceeds 10") | |
657 | 698 | ||
658 | 699 | $f0_2($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) | |
659 | 700 | } | |
660 | 701 | ||
661 | 702 | ||
662 | 703 | func _getAssetBalances (assets_,decimals_) = { | |
663 | 704 | func foldFunc (acc,elem) = { | |
664 | 705 | let assetDecimals = _getDecimals(elem) | |
665 | 706 | let balance = _normalizeDecimals(assetBalance(this, fromBase58String(elem)), assetDecimals, decimals_, DOWN) | |
666 | 707 | $Tuple2((acc._1 :+ balance), (acc._2 + balance)) | |
667 | 708 | } | |
668 | 709 | ||
669 | 710 | let $l = assets_ | |
670 | 711 | let $s = size($l) | |
671 | 712 | let $acc0 = $Tuple2(nil, 0) | |
672 | 713 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
673 | 714 | then $a | |
674 | 715 | else foldFunc($a, $l[$i]) | |
675 | 716 | ||
676 | 717 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
677 | 718 | then $a | |
678 | 719 | else throw("List size exceeds 10") | |
679 | 720 | ||
680 | 721 | $f0_2($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) | |
681 | 722 | } | |
682 | 723 | ||
683 | 724 | ||
684 | 725 | func _listIntToString (assets_) = { | |
685 | 726 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
686 | 727 | ||
687 | 728 | makeString({ | |
688 | 729 | let $l = assets_ | |
689 | 730 | let $s = size($l) | |
690 | 731 | let $acc0 = nil | |
691 | 732 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
692 | 733 | then $a | |
693 | 734 | else foldFunc($a, $l[$i]) | |
694 | 735 | ||
695 | 736 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
696 | 737 | then $a | |
697 | 738 | else throw("List size exceeds 11") | |
698 | 739 | ||
699 | 740 | $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) | |
700 | 741 | }, SEP) | |
701 | 742 | } | |
702 | 743 | ||
703 | 744 | ||
704 | 745 | func _listBigIntToString (assets_) = { | |
705 | 746 | func foldFunc (acc,elem) = (acc :+ toString(elem)) | |
706 | 747 | ||
707 | 748 | makeString({ | |
708 | 749 | let $l = assets_ | |
709 | 750 | let $s = size($l) | |
710 | 751 | let $acc0 = nil | |
711 | 752 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
712 | 753 | then $a | |
713 | 754 | else foldFunc($a, $l[$i]) | |
714 | 755 | ||
715 | 756 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
716 | 757 | then $a | |
717 | 758 | else throw("List size exceeds 11") | |
718 | 759 | ||
719 | 760 | $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) | |
720 | 761 | }, SEP) | |
721 | 762 | } | |
722 | 763 | ||
723 | 764 | ||
724 | 765 | func _getEquilibriums (sigmaBalances_,weights_,sigmaWeight_) = { | |
725 | 766 | func foldFunc (acc,elem) = (acc :+ fraction(sigmaBalances_, elem, sigmaWeight_)) | |
726 | 767 | ||
727 | 768 | let $l = weights_ | |
728 | 769 | let $s = size($l) | |
729 | 770 | let $acc0 = nil | |
730 | 771 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
731 | 772 | then $a | |
732 | 773 | else foldFunc($a, $l[$i]) | |
733 | 774 | ||
734 | 775 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
735 | 776 | then $a | |
736 | 777 | else throw("List size exceeds 10") | |
737 | 778 | ||
738 | 779 | $f0_2($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) | |
739 | 780 | } | |
740 | 781 | ||
741 | 782 | ||
742 | 783 | func _incrementBalancesByAmounts (balances_,amounts_) = { | |
743 | 784 | func foldFunc (acc,elem) = { | |
744 | 785 | let index = acc._1 | |
745 | 786 | let amount = amounts_[index] | |
746 | 787 | let newBalance = (elem + amount) | |
747 | 788 | $Tuple3((index + 1), (acc._2 :+ newBalance), (acc._3 + newBalance)) | |
748 | 789 | } | |
749 | 790 | ||
750 | 791 | let result = { | |
751 | 792 | let $l = balances_ | |
752 | 793 | let $s = size($l) | |
753 | 794 | let $acc0 = $Tuple3(0, nil, 0) | |
754 | 795 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
755 | 796 | then $a | |
756 | 797 | else foldFunc($a, $l[$i]) | |
757 | 798 | ||
758 | 799 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
759 | 800 | then $a | |
760 | 801 | else throw("List size exceeds 10") | |
761 | 802 | ||
762 | 803 | $f0_2($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) | |
763 | 804 | } | |
764 | 805 | $Tuple2(result._2, result._3) | |
765 | 806 | } | |
766 | 807 | ||
767 | 808 | ||
768 | 809 | func _incrementBalancesByPayments (balances_,payments_,assets_,decimals_,err_) = { | |
769 | 810 | func foldFunc (acc,elem) = { | |
770 | 811 | let index = acc._1 | |
771 | 812 | let payment = payments_[index] | |
772 | 813 | let paymentAssetStr = _assetToStr(payment.assetId) | |
773 | 814 | let err = if ((paymentAssetStr != assets_[index])) | |
774 | 815 | then throw(((err_ + ": index=") + toString(index))) | |
775 | 816 | else unit | |
776 | 817 | if ((err == err)) | |
777 | 818 | then { | |
778 | 819 | let assetDecimals = _getDecimals(paymentAssetStr) | |
779 | 820 | let newBalance = (elem + _normalizeDecimals(payments_[index].amount, assetDecimals, decimals_, DOWN)) | |
780 | 821 | $Tuple3((index + 1), (acc._2 :+ newBalance), (acc._3 + newBalance)) | |
781 | 822 | } | |
782 | 823 | else throw("Strict value is not equal to itself.") | |
783 | 824 | } | |
784 | 825 | ||
785 | 826 | let result = { | |
786 | 827 | let $l = balances_ | |
787 | 828 | let $s = size($l) | |
788 | 829 | let $acc0 = $Tuple3(0, nil, 0) | |
789 | 830 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
790 | 831 | then $a | |
791 | 832 | else foldFunc($a, $l[$i]) | |
792 | 833 | ||
793 | 834 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
794 | 835 | then $a | |
795 | 836 | else throw("List size exceeds 10") | |
796 | 837 | ||
797 | 838 | $f0_2($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) | |
798 | 839 | } | |
799 | 840 | $Tuple2(result._2, result._3) | |
800 | 841 | } | |
801 | 842 | ||
802 | 843 | ||
803 | 844 | func _incrementBalanceByIndex (balances_,index_,amount_) = { | |
804 | 845 | func foldFunc (acc,elem) = { | |
805 | 846 | let index = acc._1 | |
806 | 847 | if ((index == index_)) | |
807 | 848 | then $Tuple2((index + 1), (acc._2 :+ (elem + amount_))) | |
808 | 849 | else $Tuple2((index + 1), (acc._2 :+ elem)) | |
809 | 850 | } | |
810 | 851 | ||
811 | 852 | let result = { | |
812 | 853 | let $l = balances_ | |
813 | 854 | let $s = size($l) | |
814 | 855 | let $acc0 = $Tuple2(0, nil) | |
815 | 856 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
816 | 857 | then $a | |
817 | 858 | else foldFunc($a, $l[$i]) | |
818 | 859 | ||
819 | 860 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
820 | 861 | then $a | |
821 | 862 | else throw("List size exceeds 10") | |
822 | 863 | ||
823 | 864 | $f0_2($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) | |
824 | 865 | } | |
825 | 866 | result._2 | |
826 | 867 | } | |
827 | 868 | ||
828 | 869 | ||
829 | 870 | func _decrementBalanceByIndex (balances_,index_,amount_) = { | |
830 | 871 | func foldFunc (acc,elem) = { | |
831 | 872 | let index = acc._1 | |
832 | 873 | if ((index == index_)) | |
833 | 874 | then $Tuple2((index + 1), (acc._2 :+ (elem - amount_))) | |
834 | 875 | else $Tuple2((index + 1), (acc._2 :+ elem)) | |
835 | 876 | } | |
836 | 877 | ||
837 | 878 | let result = { | |
838 | 879 | let $l = balances_ | |
839 | 880 | let $s = size($l) | |
840 | 881 | let $acc0 = $Tuple2(0, nil) | |
841 | 882 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
842 | 883 | then $a | |
843 | 884 | else foldFunc($a, $l[$i]) | |
844 | 885 | ||
845 | 886 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
846 | 887 | then $a | |
847 | 888 | else throw("List size exceeds 10") | |
848 | 889 | ||
849 | 890 | $f0_2($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) | |
850 | 891 | } | |
851 | 892 | result._2 | |
852 | 893 | } | |
853 | 894 | ||
854 | 895 | ||
855 | 896 | func _decrementBalancesByLpAmount (balances_,amount_,lpTotalSupply_) = { | |
856 | 897 | let rate = fraction((lpTotalSupply_ - amount_), RATE_FACTOR, lpTotalSupply_, CEILING) | |
857 | 898 | func foldFunc (acc,elem) = { | |
858 | 899 | let newBalance = fraction(elem, rate, RATE_FACTOR, CEILING) | |
859 | 900 | let deltaBalance = (elem - newBalance) | |
860 | 901 | $Tuple3((acc._1 :+ newBalance), (acc._2 + newBalance), (acc._3 :+ deltaBalance)) | |
861 | 902 | } | |
862 | 903 | ||
863 | 904 | let $l = balances_ | |
864 | 905 | let $s = size($l) | |
865 | 906 | let $acc0 = $Tuple3(nil, 0, nil) | |
866 | 907 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
867 | 908 | then $a | |
868 | 909 | else foldFunc($a, $l[$i]) | |
869 | 910 | ||
870 | 911 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
871 | 912 | then $a | |
872 | 913 | else throw("List size exceeds 10") | |
873 | 914 | ||
874 | 915 | $f0_2($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) | |
875 | 916 | } | |
876 | 917 | ||
877 | 918 | ||
878 | 919 | func _getPaymentsFromBalances (assets_,balances_,recipient_,sourceDecimals_) = { | |
879 | 920 | func foldFunc (acc,elem) = { | |
880 | 921 | let index = acc._1 | |
881 | 922 | $Tuple2((index + 1), (acc._2 :+ ScriptTransfer(recipient_, _normalizeDecimals(balances_[index], sourceDecimals_, _getDecimals(elem), DOWN), _strToAsset(elem)))) | |
882 | 923 | } | |
883 | 924 | ||
884 | 925 | let result = { | |
885 | 926 | let $l = assets_ | |
886 | 927 | let $s = size($l) | |
887 | 928 | let $acc0 = $Tuple2(0, nil) | |
888 | 929 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
889 | 930 | then $a | |
890 | 931 | else foldFunc($a, $l[$i]) | |
891 | 932 | ||
892 | 933 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
893 | 934 | then $a | |
894 | 935 | else throw("List size exceeds 10") | |
895 | 936 | ||
896 | 937 | $f0_2($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) | |
897 | 938 | } | |
898 | 939 | result._2 | |
899 | 940 | } | |
900 | 941 | ||
901 | 942 | ||
902 | 943 | func _calculateMicroFee (balance_,equilibrium_,weightAmplifier_,slippageRate_,feeMaxRate_) = if ((equilibrium_ > balance_)) | |
903 | 944 | then { | |
904 | 945 | let threshold = fraction(equilibrium_, (MAX_WEIGHT_AMPLIFIER - weightAmplifier_), MAX_WEIGHT_AMPLIFIER) | |
905 | 946 | if ((threshold > balance_)) | |
906 | 947 | then { | |
907 | 948 | let maxDeviation = (threshold - balance_) | |
908 | 949 | let feeRate = fraction(fraction(maxDeviation, slippageRate_, SLIPPAGE_RATE_FACTOR), FEE_RATE_FACTOR, equilibrium_) | |
909 | 950 | if ((feeRate > feeMaxRate_)) | |
910 | 951 | then fraction(maxDeviation, feeMaxRate_, FEE_RATE_FACTOR) | |
911 | 952 | else fraction(maxDeviation, feeRate, FEE_RATE_FACTOR) | |
912 | 953 | } | |
913 | 954 | else 0 | |
914 | 955 | } | |
915 | 956 | else { | |
916 | 957 | let threshold = fraction(equilibrium_, (MAX_WEIGHT_AMPLIFIER + weightAmplifier_), MAX_WEIGHT_AMPLIFIER) | |
917 | 958 | if ((balance_ > threshold)) | |
918 | 959 | then { | |
919 | 960 | let maxDeviation = (balance_ - threshold) | |
920 | 961 | let feeRate = fraction(fraction(maxDeviation, slippageRate_, SLIPPAGE_RATE_FACTOR), FEE_RATE_FACTOR, equilibrium_) | |
921 | 962 | if ((feeRate > feeMaxRate_)) | |
922 | 963 | then fraction(maxDeviation, feeMaxRate_, FEE_RATE_FACTOR) | |
923 | 964 | else fraction(maxDeviation, feeRate, FEE_RATE_FACTOR) | |
924 | 965 | } | |
925 | 966 | else 0 | |
926 | 967 | } | |
927 | 968 | ||
928 | 969 | ||
929 | - | func _calculateFee (balances_,assetsTotalSupply_,weights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = { | |
930 | - | func foldFunc (acc,balance) = { | |
931 | - | let index = acc._1 | |
932 | - | let equilibrium = fraction(assetsTotalSupply_, weights_[index], sigmaWeight_) | |
933 | - | $Tuple2((index + 1), (acc._2 + _calculateMicroFee(balance, equilibrium, weightAmplifier_, slippageRate_, feeMaxRate_))) | |
934 | - | } | |
935 | - | ||
936 | - | let result = { | |
937 | - | let $l = balances_ | |
938 | - | let $s = size($l) | |
939 | - | let $acc0 = $Tuple2(0, 0) | |
940 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
941 | - | then $a | |
942 | - | else foldFunc($a, $l[$i]) | |
943 | - | ||
944 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
945 | - | then $a | |
946 | - | else throw("List size exceeds 10") | |
947 | - | ||
948 | - | $f0_2($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) | |
949 | - | } | |
950 | - | result._2 | |
951 | - | } | |
970 | + | func _calculateFee (balances_,assetsTotalSupply_,weights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = 0 | |
952 | 971 | ||
953 | 972 | ||
954 | 973 | func _validateLiquidityInvariant (prevAssetBalances_,prevAssetTotalSupply_,assetBalances_,assetTotalSupply_,prevLpTotalSupply_,lpTotalSupply_,assetWeights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = if (if ((prevLpTotalSupply_ == 0)) | |
955 | 974 | then true | |
956 | 975 | else (lpTotalSupply_ == 0)) | |
957 | 976 | then true | |
958 | 977 | else { | |
959 | 978 | let prevAssetsRate = fraction((prevAssetTotalSupply_ - _calculateFee(prevAssetBalances_, prevAssetTotalSupply_, assetWeights_, sigmaWeight_, weightAmplifier_, slippageRate_, feeMaxRate_)), RATE_FACTOR, prevLpTotalSupply_) | |
960 | 979 | let newAssetsRate = fraction((assetTotalSupply_ - _calculateFee(assetBalances_, assetTotalSupply_, assetWeights_, sigmaWeight_, weightAmplifier_, slippageRate_, feeMaxRate_)), RATE_FACTOR, lpTotalSupply_) | |
961 | 980 | let diff = (newAssetsRate - prevAssetsRate) | |
962 | 981 | if (if ((0 >= diff)) | |
963 | 982 | then ((-1 * _loadPrecision()) > diff) | |
964 | 983 | else false) | |
965 | 984 | then throw(("_validateLiquidityInvariant: revert: diff=" + toString(diff))) | |
966 | 985 | else true | |
967 | 986 | } | |
968 | 987 | ||
969 | 988 | ||
970 | 989 | func _validateSwapInvariant (prevAssetBalances_,prevAssetTotalSupply_,assetBalances_,assetTotalSupply_,assetWeights_,sigmaWeight_,weightAmplifier_,slippageRate_,feeMaxRate_) = { | |
971 | 990 | let prevUtil = (prevAssetTotalSupply_ - _calculateFee(prevAssetBalances_, prevAssetTotalSupply_, assetWeights_, sigmaWeight_, weightAmplifier_, slippageRate_, feeMaxRate_)) | |
972 | 991 | let newUtil = (assetTotalSupply_ - _calculateFee(assetBalances_, assetTotalSupply_, assetWeights_, sigmaWeight_, weightAmplifier_, slippageRate_, feeMaxRate_)) | |
973 | 992 | let diff = (newUtil - prevUtil) | |
974 | 993 | if (if ((0 >= diff)) | |
975 | 994 | then ((-1 * _loadPrecision()) > diff) | |
976 | 995 | else false) | |
977 | 996 | then throw(("_validateSwapInvariant: revert: diff=" + toString(diff))) | |
978 | 997 | else true | |
979 | 998 | } | |
980 | 999 | ||
981 | 1000 | ||
982 | 1001 | func _validateAssetAllocation (balance_,assetTotalSupply_,prevBalance_,prevAssetTotalSupply_,weight_,sigmaWeight_,maxAllocAmp_) = { | |
983 | 1002 | let equilibrium = fraction(assetTotalSupply_, weight_, sigmaWeight_) | |
984 | 1003 | let maxAllocationAmp = if ((balance_ > equilibrium)) | |
985 | 1004 | then (MAX_AMPLIFIER + maxAllocAmp_) | |
986 | 1005 | else (MAX_AMPLIFIER - maxAllocAmp_) | |
987 | 1006 | let maxAllocation = fraction(equilibrium, maxAllocationAmp, MAX_AMPLIFIER) | |
988 | 1007 | let prevMaxAllocation = fraction(fraction(prevAssetTotalSupply_, weight_, sigmaWeight_), maxAllocationAmp, MAX_AMPLIFIER) | |
989 | 1008 | if ((balance_ > equilibrium)) | |
990 | 1009 | then if ((balance_ > maxAllocation)) | |
991 | 1010 | then if ((prevMaxAllocation > prevBalance_)) | |
992 | 1011 | then throw("_validateAssetAllocation: new up") | |
993 | 1012 | else if (((balance_ - maxAllocation) > (prevBalance_ - prevMaxAllocation))) | |
994 | 1013 | then throw("_validateAssetAllocation: still up") | |
995 | 1014 | else true | |
996 | 1015 | else true | |
997 | 1016 | else if ((maxAllocation > balance_)) | |
998 | 1017 | then if ((prevBalance_ > prevMaxAllocation)) | |
999 | 1018 | then throw("_validateAssetAllocation: new down") | |
1000 | 1019 | else if (((maxAllocation - balance_) > (prevMaxAllocation - prevBalance_))) | |
1001 | 1020 | then throw("_validateAssetAllocation: still down") | |
1002 | 1021 | else true | |
1003 | 1022 | else true | |
1004 | 1023 | } | |
1005 | 1024 | ||
1006 | 1025 | ||
1007 | 1026 | func _validateAllocation (assetBalances_,assetTotalSupply_,prevAssetBalances_,prevAssetTotalSupply_,assetWeights_,sigmaWeight_,maxAllocAmp_) = { | |
1008 | 1027 | func foldFunc (acc,elem) = { | |
1009 | 1028 | let index = acc._1 | |
1010 | 1029 | $Tuple2((index + 1), if (acc._2) | |
1011 | 1030 | then _validateAssetAllocation(elem, assetTotalSupply_, prevAssetBalances_[index], prevAssetTotalSupply_, assetWeights_[index], sigmaWeight_, maxAllocAmp_) | |
1012 | 1031 | else false) | |
1013 | 1032 | } | |
1014 | 1033 | ||
1015 | 1034 | let result = { | |
1016 | 1035 | let $l = assetBalances_ | |
1017 | 1036 | let $s = size($l) | |
1018 | 1037 | let $acc0 = $Tuple2(0, true) | |
1019 | 1038 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1020 | 1039 | then $a | |
1021 | 1040 | else foldFunc($a, $l[$i]) | |
1022 | 1041 | ||
1023 | 1042 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1024 | 1043 | then $a | |
1025 | 1044 | else throw("List size exceeds 10") | |
1026 | 1045 | ||
1027 | 1046 | $f0_2($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) | |
1028 | 1047 | } | |
1029 | 1048 | result._2 | |
1030 | 1049 | } | |
1031 | 1050 | ||
1032 | 1051 | ||
1033 | 1052 | func _checkpoint (user_) = { | |
1034 | 1053 | let userLp = _loadUserLp(user_) | |
1035 | 1054 | let userProfits = _loadUserProfits(user_) | |
1036 | 1055 | let sigmaFeePerLp = _loadSigmaFeePerLp() | |
1037 | 1056 | let userSigmaFeePerLp = _loadUserSigmaFeePerLp(user_) | |
1038 | 1057 | func foldFunc (acc,elem) = { | |
1039 | 1058 | let index = acc._1 | |
1040 | 1059 | let profitUpdated = (userProfits[index] + toInt(fraction(toBigInt(userLp), (sigmaFeePerLp[index] - userSigmaFeePerLp[index]), PERCENT_FACTOR))) | |
1041 | 1060 | $Tuple2((index + 1), (acc._2 :+ profitUpdated)) | |
1042 | 1061 | } | |
1043 | 1062 | ||
1044 | - | let $ | |
1063 | + | let $t02552025593 = { | |
1045 | 1064 | let $l = ZERO_INT_LIST_11 | |
1046 | 1065 | let $s = size($l) | |
1047 | 1066 | let $acc0 = $Tuple2(0, nil) | |
1048 | 1067 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1049 | 1068 | then $a | |
1050 | 1069 | else foldFunc($a, $l[$i]) | |
1051 | 1070 | ||
1052 | 1071 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1053 | 1072 | then $a | |
1054 | 1073 | else throw("List size exceeds 11") | |
1055 | 1074 | ||
1056 | 1075 | $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) | |
1057 | 1076 | } | |
1058 | - | let idx = $ | |
1059 | - | let profitsUpdated = $ | |
1077 | + | let idx = $t02552025593._1 | |
1078 | + | let profitsUpdated = $t02552025593._2 | |
1060 | 1079 | $Tuple2((_saveUserProfits(user_, profitsUpdated) ++ _saveUserSigmaFeePerLp(user_, sigmaFeePerLp)), profitsUpdated) | |
1061 | 1080 | } | |
1062 | 1081 | ||
1063 | 1082 | ||
1064 | 1083 | func _updateSigmaFeePerLp (sigmaFeePerLp_,totalLp_,index_,lpFee_) = { | |
1065 | 1084 | func foldFunc (acc,elem) = { | |
1066 | 1085 | let index = acc._1 | |
1067 | 1086 | let sigmaFeePerLpUpdated = if ((index_ == index)) | |
1068 | 1087 | then (sigmaFeePerLp_[index] + fraction(toBigInt(lpFee_), PERCENT_FACTOR, toBigInt(totalLp_))) | |
1069 | 1088 | else sigmaFeePerLp_[index] | |
1070 | 1089 | $Tuple2((index + 1), (acc._2 :+ sigmaFeePerLpUpdated)) | |
1071 | 1090 | } | |
1072 | 1091 | ||
1073 | - | let $ | |
1092 | + | let $t02624326322 = { | |
1074 | 1093 | let $l = ZERO_INT_LIST_11 | |
1075 | 1094 | let $s = size($l) | |
1076 | 1095 | let $acc0 = $Tuple2(0, nil) | |
1077 | 1096 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1078 | 1097 | then $a | |
1079 | 1098 | else foldFunc($a, $l[$i]) | |
1080 | 1099 | ||
1081 | 1100 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1082 | 1101 | then $a | |
1083 | 1102 | else throw("List size exceeds 11") | |
1084 | 1103 | ||
1085 | 1104 | $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) | |
1086 | 1105 | } | |
1087 | - | let idx = $ | |
1088 | - | let sigmaFeePerLpUpdated = $ | |
1106 | + | let idx = $t02624326322._1 | |
1107 | + | let sigmaFeePerLpUpdated = $t02624326322._2 | |
1089 | 1108 | sigmaFeePerLpUpdated | |
1090 | 1109 | } | |
1091 | 1110 | ||
1092 | 1111 | ||
1093 | 1112 | func _calculateLpAndProtocolFees (assetIndex_,amount_,lpFeeRate_,protocolFeeRate_) = { | |
1094 | 1113 | let sigmaFeePerLp = _loadSigmaFeePerLp() | |
1095 | 1114 | let totalLp = _loadTotalLp() | |
1096 | - | let $ | |
1115 | + | let $t02654326818 = if ((totalLp == 0)) | |
1097 | 1116 | then $Tuple2(0, fraction(amount_, protocolFeeRate_, MAX_FEE)) | |
1098 | 1117 | else $Tuple2(fraction(amount_, lpFeeRate_, MAX_FEE), fraction(amount_, protocolFeeRate_, MAX_FEE)) | |
1099 | - | let lpFee = $ | |
1100 | - | let protocolFee = $ | |
1118 | + | let lpFee = $t02654326818._1 | |
1119 | + | let protocolFee = $t02654326818._2 | |
1101 | 1120 | let sigmaFeePerLpUpdated = if ((lpFee == 0)) | |
1102 | 1121 | then sigmaFeePerLp | |
1103 | 1122 | else _updateSigmaFeePerLp(sigmaFeePerLp, totalLp, assetIndex_, lpFee) | |
1104 | 1123 | $Tuple3(lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1105 | 1124 | } | |
1106 | 1125 | ||
1107 | 1126 | ||
1108 | 1127 | func _depositAll (amount_) = { | |
1109 | 1128 | let storage = _loadStorage() | |
1110 | 1129 | let lpTotalSupply = storage._3 | |
1111 | 1130 | let weightAmplifier = storage._7 | |
1112 | 1131 | let slippageRate = storage._8 | |
1113 | 1132 | let feeMaxRate = storage._9 | |
1114 | 1133 | let assets = _loadAssets() | |
1115 | - | let $ | |
1116 | - | let assetWeights = $ | |
1117 | - | let sigmaWeight = $ | |
1118 | - | let $ | |
1119 | - | let prevAssetBalances = $ | |
1120 | - | let prevAssetTotalSupply = $ | |
1121 | - | let $ | |
1134 | + | let $t02732727380 = _loadAssetWeights() | |
1135 | + | let assetWeights = $t02732727380._1 | |
1136 | + | let sigmaWeight = $t02732727380._2 | |
1137 | + | let $t02738527453 = _loadAssetBalances() | |
1138 | + | let prevAssetBalances = $t02738527453._1 | |
1139 | + | let prevAssetTotalSupply = $t02738527453._2 | |
1140 | + | let $t02745928689 = if ((prevAssetTotalSupply == 0)) | |
1122 | 1141 | then { | |
1123 | 1142 | func foldFunc (acc,elem) = { | |
1124 | 1143 | let index = acc._1 | |
1125 | 1144 | let requiredAmountNormalized = fraction(assetWeights[index], amount_, sigmaWeight) | |
1126 | 1145 | $Tuple2((index + 1), (acc._2 :+ requiredAmountNormalized)) | |
1127 | 1146 | } | |
1128 | 1147 | ||
1129 | - | let $ | |
1148 | + | let $t02790127975 = { | |
1130 | 1149 | let $l = assets | |
1131 | 1150 | let $s = size($l) | |
1132 | 1151 | let $acc0 = $Tuple2(0, nil) | |
1133 | 1152 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1134 | 1153 | then $a | |
1135 | 1154 | else foldFunc($a, $l[$i]) | |
1136 | 1155 | ||
1137 | 1156 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1138 | 1157 | then $a | |
1139 | 1158 | else throw("List size exceeds 10") | |
1140 | 1159 | ||
1141 | 1160 | $f0_2($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) | |
1142 | 1161 | } | |
1143 | - | let idx = $ | |
1144 | - | let requiredAmountsNormalized = $ | |
1162 | + | let idx = $t02790127975._1 | |
1163 | + | let requiredAmountsNormalized = $t02790127975._2 | |
1145 | 1164 | $Tuple2(amount_, requiredAmountsNormalized) | |
1146 | 1165 | } | |
1147 | 1166 | else { | |
1148 | 1167 | let ratio = fraction(toBigInt(amount_), PERCENT_FACTOR, toBigInt(prevAssetTotalSupply)) | |
1149 | 1168 | func foldFunc1 (acc,elem) = { | |
1150 | 1169 | let index = acc._1 | |
1151 | 1170 | let requiredAmountNormalized = toInt(fraction(ratio, toBigInt(prevAssetBalances[index]), PERCENT_FACTOR)) | |
1152 | 1171 | $Tuple2((index + 1), (acc._2 :+ requiredAmountNormalized)) | |
1153 | 1172 | } | |
1154 | 1173 | ||
1155 | - | let $ | |
1174 | + | let $t02851828593 = { | |
1156 | 1175 | let $l = assets | |
1157 | 1176 | let $s = size($l) | |
1158 | 1177 | let $acc0 = $Tuple2(0, nil) | |
1159 | 1178 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1160 | 1179 | then $a | |
1161 | 1180 | else foldFunc1($a, $l[$i]) | |
1162 | 1181 | ||
1163 | 1182 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1164 | 1183 | then $a | |
1165 | 1184 | else throw("List size exceeds 10") | |
1166 | 1185 | ||
1167 | 1186 | $f0_2($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) | |
1168 | 1187 | } | |
1169 | - | let idx = $ | |
1170 | - | let requiredAmountsNormalized = $ | |
1188 | + | let idx = $t02851828593._1 | |
1189 | + | let requiredAmountsNormalized = $t02851828593._2 | |
1171 | 1190 | $Tuple2(fraction(amount_, lpTotalSupply, prevAssetTotalSupply), requiredAmountsNormalized) | |
1172 | 1191 | } | |
1173 | - | let lpTokensToMint = $ | |
1174 | - | let requiredAmountsNormalized = $ | |
1175 | - | let $ | |
1176 | - | let assetBalances = $ | |
1177 | - | let assetTotalSupply = $ | |
1192 | + | let lpTokensToMint = $t02745928689._1 | |
1193 | + | let requiredAmountsNormalized = $t02745928689._2 | |
1194 | + | let $t02869528808 = _incrementBalancesByAmounts(prevAssetBalances, requiredAmountsNormalized) | |
1195 | + | let assetBalances = $t02869528808._1 | |
1196 | + | let assetTotalSupply = $t02869528808._2 | |
1178 | 1197 | let err2 = _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, assetBalances, assetTotalSupply, lpTotalSupply, (lpTotalSupply + lpTokensToMint), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1179 | 1198 | if ((err2 == err2)) | |
1180 | 1199 | then $Tuple3(lpTokensToMint, requiredAmountsNormalized, assetBalances) | |
1181 | 1200 | else throw("Strict value is not equal to itself.") | |
1182 | 1201 | } | |
1183 | 1202 | ||
1184 | 1203 | ||
1185 | 1204 | func _deposit (assetId_,amount_) = { | |
1186 | 1205 | let storage = _loadStorage() | |
1187 | 1206 | let lpTotalSupply = storage._3 | |
1188 | 1207 | let lpFeeRate = storage._4 | |
1189 | 1208 | let protocolFeeRate = storage._5 | |
1190 | 1209 | let maxAllocAmplifier = storage._6 | |
1191 | 1210 | let weightAmplifier = storage._7 | |
1192 | 1211 | let slippageRate = storage._8 | |
1193 | 1212 | let feeMaxRate = storage._9 | |
1194 | 1213 | let assets = _loadAssets() | |
1195 | - | let $ | |
1196 | - | let assetWeights = $ | |
1197 | - | let sigmaWeight = $ | |
1198 | - | let $ | |
1199 | - | let prevAssetBalances = $ | |
1200 | - | let prevAssetTotalSupply = $ | |
1214 | + | let $t02957129624 = _loadAssetWeights() | |
1215 | + | let assetWeights = $t02957129624._1 | |
1216 | + | let sigmaWeight = $t02957129624._2 | |
1217 | + | let $t02962929743 = _loadAssetBalances() | |
1218 | + | let prevAssetBalances = $t02962929743._1 | |
1219 | + | let prevAssetTotalSupply = $t02962929743._2 | |
1201 | 1220 | let assetBalances = _incrementBalanceByIndex(prevAssetBalances, value(indexOf(assets, assetId_)), amount_) | |
1202 | 1221 | let assetTotalSupply = (prevAssetTotalSupply + amount_) | |
1203 | 1222 | let err2 = _validateAllocation(assetBalances, assetTotalSupply, prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, maxAllocAmplifier) | |
1204 | 1223 | if ((err2 == err2)) | |
1205 | 1224 | then { | |
1206 | 1225 | let prevFee = _calculateFee(prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1207 | 1226 | let fee = _calculateFee(assetBalances, assetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1208 | 1227 | let lpTokensToMint = if ((lpTotalSupply == 0)) | |
1209 | 1228 | then throw("_deposit: empty pool") | |
1210 | 1229 | else { | |
1211 | 1230 | let assetDiff = (assetTotalSupply - prevAssetTotalSupply) | |
1212 | 1231 | let feeDiff = (fee - prevFee) | |
1213 | 1232 | let utilityChangeFactor = fraction((assetDiff - feeDiff), RATE_FACTOR, (prevAssetTotalSupply - prevFee)) | |
1214 | 1233 | let lpTokensToMintInner = fraction(lpTotalSupply, utilityChangeFactor, RATE_FACTOR) | |
1215 | 1234 | let err3 = _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, assetBalances, assetTotalSupply, lpTotalSupply, (lpTotalSupply + lpTokensToMintInner), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1216 | 1235 | if ((err3 == err3)) | |
1217 | 1236 | then lpTokensToMintInner | |
1218 | 1237 | else throw("Strict value is not equal to itself.") | |
1219 | 1238 | } | |
1220 | - | let $ | |
1221 | - | let lpFee = $ | |
1222 | - | let protocolFee = $ | |
1223 | - | let sigmaFeePerLpUpdated = $ | |
1239 | + | let $t03140531536 = _calculateLpAndProtocolFees(0, lpTokensToMint, (lpFeeRate / 2), (protocolFeeRate / 2)) | |
1240 | + | let lpFee = $t03140531536._1 | |
1241 | + | let protocolFee = $t03140531536._2 | |
1242 | + | let sigmaFeePerLpUpdated = $t03140531536._3 | |
1224 | 1243 | $Tuple5(lpTokensToMint, assetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1225 | 1244 | } | |
1226 | 1245 | else throw("Strict value is not equal to itself.") | |
1227 | 1246 | } | |
1228 | 1247 | ||
1229 | 1248 | ||
1230 | 1249 | func _withdrawAll (amount_) = { | |
1231 | 1250 | let storage = _loadStorage() | |
1232 | 1251 | let lpTotalSupply = storage._3 | |
1233 | 1252 | let maxAllocAmplifier = storage._6 | |
1234 | 1253 | let weightAmplifier = storage._7 | |
1235 | 1254 | let slippageRate = storage._8 | |
1236 | 1255 | let feeMaxRate = storage._9 | |
1237 | - | let $ | |
1238 | - | let prevAssetBalances = $ | |
1239 | - | let prevAssetTotalSupply = $ | |
1240 | - | let $ | |
1241 | - | let assetWeights = $ | |
1242 | - | let sigmaWeight = $ | |
1256 | + | let $t03187031938 = _loadAssetBalances() | |
1257 | + | let prevAssetBalances = $t03187031938._1 | |
1258 | + | let prevAssetTotalSupply = $t03187031938._2 | |
1259 | + | let $t03194331996 = _loadAssetWeights() | |
1260 | + | let assetWeights = $t03194331996._1 | |
1261 | + | let sigmaWeight = $t03194331996._2 | |
1243 | 1262 | let lpTokensToBurn = amount_ | |
1244 | 1263 | let err = _validateInt(lpTokensToBurn, 0, MAX_INT, "_withdrawAll: lpTokensToBurn less than 0") | |
1245 | 1264 | if ((err == err)) | |
1246 | 1265 | then { | |
1247 | - | let $ | |
1248 | - | let assetBalances = $ | |
1249 | - | let assetTotalSupply = $ | |
1250 | - | let balancesToPay = $ | |
1266 | + | let $t03213832271 = _decrementBalancesByLpAmount(prevAssetBalances, lpTokensToBurn, lpTotalSupply) | |
1267 | + | let assetBalances = $t03213832271._1 | |
1268 | + | let assetTotalSupply = $t03213832271._2 | |
1269 | + | let balancesToPay = $t03213832271._3 | |
1251 | 1270 | let err2 = _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, assetBalances, assetTotalSupply, lpTotalSupply, (lpTotalSupply - lpTokensToBurn), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1252 | 1271 | if ((err2 == err2)) | |
1253 | 1272 | then $Tuple3(lpTokensToBurn, balancesToPay, assetBalances) | |
1254 | 1273 | else throw("Strict value is not equal to itself.") | |
1255 | 1274 | } | |
1256 | 1275 | else throw("Strict value is not equal to itself.") | |
1257 | 1276 | } | |
1258 | 1277 | ||
1259 | 1278 | ||
1260 | 1279 | func _withdraw (assetId_,lpAmount_) = { | |
1261 | 1280 | let storage = _loadStorage() | |
1262 | 1281 | let lpTotalSupply = storage._3 | |
1263 | 1282 | let lpFeeRate = storage._4 | |
1264 | 1283 | let protocolFeeRate = storage._5 | |
1265 | 1284 | let maxAllocAmplifier = storage._6 | |
1266 | 1285 | let weightAmplifier = storage._7 | |
1267 | 1286 | let slippageRate = storage._8 | |
1268 | 1287 | let feeMaxRate = storage._9 | |
1269 | 1288 | let precision = _loadPrecision() | |
1270 | 1289 | let assets = _loadAssets() | |
1271 | - | let $ | |
1272 | - | let prevAssetBalances = $ | |
1273 | - | let prevAssetTotalSupply = $ | |
1274 | - | let $ | |
1275 | - | let assetWeights = $ | |
1276 | - | let sigmaWeight = $ | |
1290 | + | let $t03306333131 = _loadAssetBalances() | |
1291 | + | let prevAssetBalances = $t03306333131._1 | |
1292 | + | let prevAssetTotalSupply = $t03306333131._2 | |
1293 | + | let $t03313633189 = _loadAssetWeights() | |
1294 | + | let assetWeights = $t03313633189._1 | |
1295 | + | let sigmaWeight = $t03313633189._2 | |
1277 | 1296 | let targetAssetIndex = value(indexOf(assets, assetId_)) | |
1278 | 1297 | let prevFee = _calculateFee(prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1279 | 1298 | let prevUtilValue = (prevAssetTotalSupply - prevFee) | |
1280 | 1299 | let k = fraction(toBigInt((lpTotalSupply - lpAmount_)), PERCENT_FACTOR, toBigInt(lpTotalSupply)) | |
1281 | 1300 | let prevUtilValueWithK = toInt(fraction(toBigInt(prevUtilValue), k, PERCENT_FACTOR)) | |
1301 | + | let prevUtilValueDivLp = fraction(toBigInt(prevUtilValue), PERCENT_FACTOR, toBigInt(lpTotalSupply), CEILING) | |
1282 | 1302 | func foldFunc (acc,elem) = if (acc._1) | |
1283 | 1303 | then acc | |
1284 | 1304 | else { | |
1285 | 1305 | let startInner = acc._2 | |
1286 | 1306 | let stopInner = acc._3 | |
1287 | 1307 | let currentAmount = ((stopInner + startInner) / 2) | |
1288 | 1308 | let tempAssetBalances = _decrementBalanceByIndex(prevAssetBalances, targetAssetIndex, currentAmount) | |
1289 | 1309 | let tempAssetTotalSupply = (prevAssetTotalSupply - currentAmount) | |
1290 | 1310 | let utilValue = (tempAssetTotalSupply - _calculateFee(tempAssetBalances, tempAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate)) | |
1291 | 1311 | if (if (((utilValue - prevUtilValueWithK) > (-1 * precision))) | |
1292 | 1312 | then (precision > (utilValue - prevUtilValueWithK)) | |
1293 | 1313 | else false) | |
1294 | - | then $ | |
1314 | + | then $Tuple5(true, startInner, stopInner, currentAmount, (utilValue - prevUtilValueWithK)) | |
1295 | 1315 | else if ((0 > (utilValue - prevUtilValueWithK))) | |
1296 | - | then $ | |
1297 | - | else $ | |
1316 | + | then $Tuple5(false, startInner, currentAmount, currentAmount, (utilValue - prevUtilValueWithK)) | |
1317 | + | else $Tuple5(false, currentAmount, stopInner, currentAmount, (utilValue - prevUtilValueWithK)) | |
1298 | 1318 | } | |
1299 | 1319 | ||
1300 | 1320 | let targetAmount = { | |
1301 | - | let $t03380933924 = { | |
1321 | + | let stop = toInt(fraction(toBigInt((lpAmount_ + prevFee)), prevUtilValueDivLp, PERCENT_FACTOR, CEILING)) | |
1322 | + | let $t03505535167 = { | |
1302 | 1323 | let $l = LIST_64 | |
1303 | 1324 | let $s = size($l) | |
1304 | - | let $acc0 = $ | |
1325 | + | let $acc0 = $Tuple5(false, 0, stop, 0, 0) | |
1305 | 1326 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1306 | 1327 | then $a | |
1307 | 1328 | else foldFunc($a, $l[$i]) | |
1308 | 1329 | ||
1309 | 1330 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1310 | 1331 | then $a | |
1311 | 1332 | else throw("List size exceeds 64") | |
1312 | 1333 | ||
1313 | 1334 | $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($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($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($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($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), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64) | |
1314 | 1335 | } | |
1315 | - | let success = $t03380933924._1 | |
1316 | - | let startOut = $t03380933924._2 | |
1317 | - | let stopOut = $t03380933924._3 | |
1318 | - | let targetAmountOut = $t03380933924._4 | |
1336 | + | let success = $t03505535167._1 | |
1337 | + | let startOut = $t03505535167._2 | |
1338 | + | let stopOut = $t03505535167._3 | |
1339 | + | let targetAmountOut = $t03505535167._4 | |
1340 | + | let diffOut = $t03505535167._5 | |
1319 | 1341 | if (!(success)) | |
1320 | - | then throw(("_withdraw: can't calculate targetAmount=" + toString(targetAmountOut))) | |
1342 | + | then throw(((("_withdraw: can't calculate targetAmount=" + toString(targetAmountOut)) + ",diff=") + toString(diffOut))) | |
1321 | 1343 | else targetAmountOut | |
1322 | 1344 | } | |
1323 | 1345 | let finalAssetBalances = _decrementBalanceByIndex(prevAssetBalances, targetAssetIndex, targetAmount) | |
1324 | 1346 | let finalAssetTotalSupply = (prevAssetTotalSupply - targetAmount) | |
1325 | 1347 | let err1 = if (_validateAllocation(finalAssetBalances, finalAssetTotalSupply, prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, maxAllocAmplifier)) | |
1326 | 1348 | then _validateLiquidityInvariant(prevAssetBalances, prevAssetTotalSupply, finalAssetBalances, finalAssetTotalSupply, lpTotalSupply, (lpTotalSupply - lpAmount_), assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1327 | 1349 | else false | |
1328 | 1350 | if ((err1 == err1)) | |
1329 | 1351 | then { | |
1330 | - | let $ | |
1331 | - | let lpFee = $ | |
1332 | - | let protocolFee = $ | |
1333 | - | let sigmaFeePerLpUpdated = $ | |
1352 | + | let $t03615936307 = _calculateLpAndProtocolFees((targetAssetIndex + 1), targetAmount, (lpFeeRate / 2), (protocolFeeRate / 2)) | |
1353 | + | let lpFee = $t03615936307._1 | |
1354 | + | let protocolFee = $t03615936307._2 | |
1355 | + | let sigmaFeePerLpUpdated = $t03615936307._3 | |
1334 | 1356 | $Tuple5(targetAmount, finalAssetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1335 | 1357 | } | |
1336 | 1358 | else throw("Strict value is not equal to itself.") | |
1337 | 1359 | } | |
1338 | 1360 | ||
1339 | 1361 | ||
1340 | 1362 | func _swap (sourceAssetIndex_,targetAssetIndex_,sourceAmount_) = { | |
1341 | 1363 | let storage = _loadStorage() | |
1342 | 1364 | let lpAssetId = storage._1 | |
1343 | 1365 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1344 | 1366 | let lpTotalSupply = storage._3 | |
1345 | 1367 | let lpFeeRate = storage._4 | |
1346 | 1368 | let protocolFeeRate = storage._5 | |
1347 | 1369 | let maxAllocAmplifier = storage._6 | |
1348 | 1370 | let weightAmplifier = storage._7 | |
1349 | 1371 | let slippageRate = storage._8 | |
1350 | 1372 | let feeMaxRate = storage._9 | |
1351 | 1373 | let precision = _loadPrecision() | |
1352 | - | let $ | |
1353 | - | let prevAssetBalances = $ | |
1354 | - | let prevAssetTotalSupply = $ | |
1355 | - | let $ | |
1356 | - | let assetWeights = $ | |
1357 | - | let sigmaWeight = $ | |
1374 | + | let $t03688936957 = _loadAssetBalances() | |
1375 | + | let prevAssetBalances = $t03688936957._1 | |
1376 | + | let prevAssetTotalSupply = $t03688936957._2 | |
1377 | + | let $t03696237015 = _loadAssetWeights() | |
1378 | + | let assetWeights = $t03696237015._1 | |
1379 | + | let sigmaWeight = $t03696237015._2 | |
1358 | 1380 | let assetBalances = _incrementBalanceByIndex(prevAssetBalances, sourceAssetIndex_, sourceAmount_) | |
1359 | 1381 | let assetTotalSupply = (prevAssetTotalSupply + sourceAmount_) | |
1360 | 1382 | let prevFee = _calculateFee(prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1361 | 1383 | let prevUtilValue = (prevAssetTotalSupply - prevFee) | |
1362 | 1384 | func foldFunc (acc,elem) = if (acc._1) | |
1363 | 1385 | then acc | |
1364 | 1386 | else { | |
1365 | 1387 | let startInner = acc._2 | |
1366 | 1388 | let stopInner = acc._3 | |
1367 | 1389 | let currentAmount = ((stopInner + startInner) / 2) | |
1368 | 1390 | let tempAssetBalances = _decrementBalanceByIndex(assetBalances, targetAssetIndex_, currentAmount) | |
1369 | 1391 | let tempAssetTotalSupply = (assetTotalSupply - currentAmount) | |
1370 | 1392 | let utilValue = (tempAssetTotalSupply - _calculateFee(tempAssetBalances, tempAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate)) | |
1371 | 1393 | if (if (((utilValue - prevUtilValue) > (-1 * precision))) | |
1372 | 1394 | then (precision > (utilValue - prevUtilValue)) | |
1373 | 1395 | else false) | |
1374 | - | then $ | |
1396 | + | then $Tuple5(true, startInner, stopInner, currentAmount, (utilValue - prevUtilValue)) | |
1375 | 1397 | else if ((0 > (utilValue - prevUtilValue))) | |
1376 | - | then $ | |
1377 | - | else $ | |
1398 | + | then $Tuple5(false, startInner, currentAmount, currentAmount, (utilValue - prevUtilValue)) | |
1399 | + | else $Tuple5(false, currentAmount, stopInner, currentAmount, (utilValue - prevUtilValue)) | |
1378 | 1400 | } | |
1379 | 1401 | ||
1380 | 1402 | let targetAmount = { | |
1381 | 1403 | let targetAmount = sourceAmount_ | |
1382 | 1404 | let tempAssetBalances = _decrementBalanceByIndex(assetBalances, targetAssetIndex_, targetAmount) | |
1383 | 1405 | let tempAssetTotalSupply = (assetTotalSupply - targetAmount) | |
1384 | 1406 | let fee = _calculateFee(tempAssetBalances, tempAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1385 | 1407 | let feeDiff = (fee - prevFee) | |
1386 | 1408 | if ((feeDiff == 0)) | |
1387 | 1409 | then targetAmount | |
1388 | 1410 | else { | |
1389 | - | let $ | |
1411 | + | let $t03898839119 = { | |
1390 | 1412 | let $l = LIST_64 | |
1391 | 1413 | let $s = size($l) | |
1392 | - | let $acc0 = $ | |
1414 | + | let $acc0 = $Tuple5(false, 0, (sourceAmount_ + prevFee), 0, 0) | |
1393 | 1415 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1394 | 1416 | then $a | |
1395 | 1417 | else foldFunc($a, $l[$i]) | |
1396 | 1418 | ||
1397 | 1419 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1398 | 1420 | then $a | |
1399 | 1421 | else throw("List size exceeds 64") | |
1400 | 1422 | ||
1401 | 1423 | $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($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($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($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($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), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64) | |
1402 | 1424 | } | |
1403 | - | let success = $t03762537744._1 | |
1404 | - | let startOut = $t03762537744._2 | |
1405 | - | let stopOut = $t03762537744._3 | |
1406 | - | let targetAmountOut = $t03762537744._4 | |
1425 | + | let success = $t03898839119._1 | |
1426 | + | let startOut = $t03898839119._2 | |
1427 | + | let stopOut = $t03898839119._3 | |
1428 | + | let targetAmountOut = $t03898839119._4 | |
1429 | + | let diffOut = $t03898839119._5 | |
1407 | 1430 | if (!(success)) | |
1408 | - | then throw(("_swap: can't calculate targetAmount=" + toString(targetAmountOut))) | |
1431 | + | then throw(((("_swap: can't calculate targetAmount=" + toString(targetAmountOut)) + ",diff=") + toString(diffOut))) | |
1409 | 1432 | else targetAmountOut | |
1410 | 1433 | } | |
1411 | 1434 | } | |
1412 | 1435 | let finalAssetBalances = _decrementBalanceByIndex(assetBalances, targetAssetIndex_, targetAmount) | |
1413 | 1436 | let finalAssetTotalSupply = (assetTotalSupply - targetAmount) | |
1414 | 1437 | let err1 = if (_validateAllocation(finalAssetBalances, finalAssetTotalSupply, prevAssetBalances, prevAssetTotalSupply, assetWeights, sigmaWeight, maxAllocAmplifier)) | |
1415 | 1438 | then _validateSwapInvariant(prevAssetBalances, prevAssetTotalSupply, finalAssetBalances, finalAssetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1416 | 1439 | else false | |
1417 | 1440 | if ((err1 == err1)) | |
1418 | 1441 | then { | |
1419 | - | let $ | |
1420 | - | let lpFee = $ | |
1421 | - | let protocolFee = $ | |
1422 | - | let sigmaFeePerLpUpdated = $ | |
1442 | + | let $t03996640107 = _calculateLpAndProtocolFees((targetAssetIndex_ + 1), targetAmount, lpFeeRate, protocolFeeRate) | |
1443 | + | let lpFee = $t03996640107._1 | |
1444 | + | let protocolFee = $t03996640107._2 | |
1445 | + | let sigmaFeePerLpUpdated = $t03996640107._3 | |
1423 | 1446 | $Tuple5(targetAmount, finalAssetBalances, lpFee, protocolFee, sigmaFeePerLpUpdated) | |
1424 | 1447 | } | |
1425 | 1448 | else throw("Strict value is not equal to itself.") | |
1426 | 1449 | } | |
1427 | 1450 | ||
1428 | 1451 | ||
1429 | 1452 | @Callable(i) | |
1430 | 1453 | func init (assets_,assetWeights_,lpFeeRate_,protocolFeeRate_,lpTokenName_,lpTokenDescr_,lpTokenDecimals_,maxAllocationAmplifier_,weightAmplifier_,slippageRate_,feeMaxRate_,protocolFeeContract_,precision_,pauser_) = { | |
1431 | 1454 | let err = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (_onlyThisContract(i.caller)) | |
1432 | 1455 | then _whenNotInitialized() | |
1433 | 1456 | else false) | |
1434 | 1457 | then _whenMultisigSet() | |
1435 | 1458 | else false) | |
1436 | 1459 | then _validateAssets(assets_, "init: invalid assets") | |
1437 | 1460 | else false) | |
1438 | 1461 | then _validateIntList(assetWeights_, 1, MAX_WEIGHT, "init: invalid assetWeights") | |
1439 | 1462 | else false) | |
1440 | 1463 | then _validateIntEquals(size(assets_), size(assetWeights_), "init: invalid assetWeights size") | |
1441 | 1464 | else false) | |
1442 | 1465 | then _validateInt(lpFeeRate_, 0, MAX_FEE, "init: invalid lp fee") | |
1443 | 1466 | else false) | |
1444 | 1467 | then _validateInt(protocolFeeRate_, 0, MAX_FEE, "init: invalid protocol fee") | |
1445 | 1468 | else false) | |
1446 | 1469 | then _validateTokenName(lpTokenName_, "init: invalid name") | |
1447 | 1470 | else false) | |
1448 | 1471 | then _validateTokenDescr(lpTokenDescr_, "init: invalid descr") | |
1449 | 1472 | else false) | |
1450 | 1473 | then _validateDecimals(lpTokenDecimals_, "init: invalid decimals") | |
1451 | 1474 | else false) | |
1452 | 1475 | then _validateInt(maxAllocationAmplifier_, 0, MAX_AMPLIFIER, "init: invalid maxAllocationAmplifier") | |
1453 | 1476 | else false) | |
1454 | 1477 | then _validateInt(weightAmplifier_, 0, maxAllocationAmplifier_, "init: invalid weightAmplifier") | |
1455 | 1478 | else false) | |
1456 | 1479 | then _validateInt(slippageRate_, 0, MAX_INT, "init: invalid slippageRate") | |
1457 | 1480 | else false) | |
1458 | 1481 | then _validateInt(feeMaxRate_, 0, MAX_INT, "init: invalid feeMaxRate") | |
1459 | 1482 | else false) | |
1460 | 1483 | then _validateAddress(protocolFeeContract_, "init: invalid protocolFeeContract") | |
1461 | 1484 | else false) | |
1462 | 1485 | then _validateInt(precision_, 1, MAX_INT, "init: invalid precision") | |
1463 | 1486 | else false) | |
1464 | 1487 | then _validateAddress(pauser_, "init: invalid pauser") | |
1465 | 1488 | else false | |
1466 | 1489 | if ((err == err)) | |
1467 | 1490 | then { | |
1468 | - | let $ | |
1469 | - | let assetWeights = $ | |
1470 | - | let sigmaWeight = $ | |
1491 | + | let $t04197042039 = _prepareAssetWeights(assetWeights_) | |
1492 | + | let assetWeights = $t04197042039._1 | |
1493 | + | let sigmaWeight = $t04197042039._2 | |
1471 | 1494 | let assetBalances = _prepareAssetBalances(assets_) | |
1472 | 1495 | let issue = Issue(lpTokenName_, lpTokenDescr_, 0, lpTokenDecimals_, true) | |
1473 | 1496 | let lpAssetId = calculateAssetId(issue) | |
1474 | 1497 | let storageUpdated = $Tuple10(lpAssetId, true, 0, lpFeeRate_, protocolFeeRate_, maxAllocationAmplifier_, weightAmplifier_, slippageRate_, feeMaxRate_, addressFromStringValue(protocolFeeContract_)) | |
1475 | 1498 | $Tuple2(((((((([issue] ++ _saveStorage(storageUpdated)) ++ _saveAssets(assets_)) ++ _saveAssetBalances(assetBalances)) ++ _saveAssetWeights(assetWeights)) ++ _savePrecision(precision_)) ++ _saveSigmaFeePerLp(_loadSigmaFeePerLp())) ++ _savePauser(addressFromStringValue(pauser_))), unit) | |
1476 | 1499 | } | |
1477 | 1500 | else throw("Strict value is not equal to itself.") | |
1478 | 1501 | } | |
1479 | 1502 | ||
1480 | 1503 | ||
1481 | 1504 | ||
1482 | 1505 | @Callable(i) | |
1483 | 1506 | func depositAll (amount_) = { | |
1484 | 1507 | let err = if (if (_whenInitialized()) | |
1485 | 1508 | then _whenNotPaused() | |
1486 | 1509 | else false) | |
1487 | 1510 | then _validateInt(amount_, 0, MAX_INT, "depositAll: invalid amount") | |
1488 | 1511 | else false | |
1489 | 1512 | if ((err == err)) | |
1490 | 1513 | then { | |
1491 | 1514 | let storage = _loadStorage() | |
1492 | 1515 | let lpAssetId = storage._1 | |
1493 | 1516 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1494 | 1517 | let assets = _loadAssets() | |
1495 | - | let $ | |
1496 | - | let lpTokensToMint = $ | |
1497 | - | let requiredAmountsNormalized = $ | |
1498 | - | let assetBalances = $ | |
1518 | + | let $t04378943874 = _depositAll(amount_) | |
1519 | + | let lpTokensToMint = $t04378943874._1 | |
1520 | + | let requiredAmountsNormalized = $t04378943874._2 | |
1521 | + | let assetBalances = $t04378943874._3 | |
1499 | 1522 | func foldFunc (acc,elem) = { | |
1500 | 1523 | let index = acc._1 | |
1501 | 1524 | let paymentAssetStr = _assetToStr(i.payments[index].assetId) | |
1502 | 1525 | let paymentAssetDecimals = _getDecimals(paymentAssetStr) | |
1503 | 1526 | let requiredAmountNormalized = requiredAmountsNormalized[index] | |
1504 | 1527 | let requiredAmount = _normalizeDecimals(requiredAmountNormalized, lpDecimals, paymentAssetDecimals, CEILING) | |
1505 | 1528 | let err1 = if ((paymentAssetStr != elem)) | |
1506 | 1529 | then throw(("depositAll: invalid payment: index=" + toString(index))) | |
1507 | 1530 | else if ((0 >= requiredAmount)) | |
1508 | 1531 | then throw("depositAll: too little amount required") | |
1509 | 1532 | else unit | |
1510 | 1533 | if ((err1 == err1)) | |
1511 | 1534 | then { | |
1512 | 1535 | let change = if ((i.payments[index].amount > requiredAmount)) | |
1513 | 1536 | then [ScriptTransfer(i.caller, (i.payments[index].amount - requiredAmount), i.payments[index].assetId)] | |
1514 | 1537 | else if ((requiredAmount > i.payments[index].amount)) | |
1515 | 1538 | then throw(((("depositAll: insufficient payment, index=" + toString(index)) + ", required=") + toString(requiredAmount))) | |
1516 | 1539 | else nil | |
1517 | 1540 | $Tuple2((index + 1), (acc._2 ++ change)) | |
1518 | 1541 | } | |
1519 | 1542 | else throw("Strict value is not equal to itself.") | |
1520 | 1543 | } | |
1521 | 1544 | ||
1522 | - | let $ | |
1545 | + | let $t04501745079 = { | |
1523 | 1546 | let $l = assets | |
1524 | 1547 | let $s = size($l) | |
1525 | 1548 | let $acc0 = $Tuple2(0, nil) | |
1526 | 1549 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1527 | 1550 | then $a | |
1528 | 1551 | else foldFunc($a, $l[$i]) | |
1529 | 1552 | ||
1530 | 1553 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1531 | 1554 | then $a | |
1532 | 1555 | else throw("List size exceeds 10") | |
1533 | 1556 | ||
1534 | 1557 | $f0_2($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) | |
1535 | 1558 | } | |
1536 | - | let idx = $ | |
1537 | - | let changeActions = $ | |
1559 | + | let idx = $t04501745079._1 | |
1560 | + | let changeActions = $t04501745079._2 | |
1538 | 1561 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 + lpTokensToMint), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1539 | 1562 | $Tuple2(((([Reissue(lpAssetId, lpTokensToMint, true), ScriptTransfer(i.caller, lpTokensToMint, lpAssetId)] ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(assetBalances)) ++ changeActions), unit) | |
1540 | 1563 | } | |
1541 | 1564 | else throw("Strict value is not equal to itself.") | |
1542 | 1565 | } | |
1543 | 1566 | ||
1544 | 1567 | ||
1545 | 1568 | ||
1546 | 1569 | @Callable(i) | |
1547 | 1570 | func deposit (minLpAmount_) = { | |
1548 | 1571 | let err = _validateInt(minLpAmount_, 0, MAX_INT, "deposit: invalid min lp amount") | |
1549 | 1572 | if ((err == err)) | |
1550 | 1573 | then { | |
1551 | 1574 | let storage = _loadStorage() | |
1552 | 1575 | let lpAssetId = storage._1 | |
1553 | 1576 | let lpAssetIdStr = _assetToStr(lpAssetId) | |
1554 | 1577 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1555 | - | let err1 = if (if (if (if (_whenInitialized()) | |
1578 | + | let err1 = if (if (if (if (if (_whenInitialized()) | |
1556 | 1579 | then _whenNotPaused() | |
1580 | + | else false) | |
1581 | + | then _checkWatchdog() | |
1557 | 1582 | else false) | |
1558 | 1583 | then _validateIntEquals(size(i.payments), 1, "deposit: invalid payments size") | |
1559 | 1584 | else false) | |
1560 | 1585 | then _validateListContains(_loadAssets(), _assetToStr(i.payments[0].assetId), "deposit: invalid payment asset") | |
1561 | 1586 | else false) | |
1562 | 1587 | then _validateInt(i.payments[0].amount, 1, MAX_INT, "deposit: invalid payment amount") | |
1563 | 1588 | else false | |
1564 | 1589 | if ((err1 == err1)) | |
1565 | 1590 | then { | |
1566 | 1591 | let assetStr = _assetToStr(i.payments[0].assetId) | |
1567 | 1592 | let assetDecimals = _getDecimals(assetStr) | |
1568 | 1593 | let amountNormalized = _normalizeDecimals(i.payments[0].amount, assetDecimals, lpDecimals, DOWN) | |
1569 | - | let $ | |
1570 | - | let lpTokensToMint = $ | |
1571 | - | let assetBalances = $ | |
1572 | - | let lpFee = $ | |
1573 | - | let protocolFee = $ | |
1574 | - | let sigmaFeePerLpUpdated = $ | |
1594 | + | let $t04651946635 = _deposit(assetStr, amountNormalized) | |
1595 | + | let lpTokensToMint = $t04651946635._1 | |
1596 | + | let assetBalances = $t04651946635._2 | |
1597 | + | let lpFee = $t04651946635._3 | |
1598 | + | let protocolFee = $t04651946635._4 | |
1599 | + | let sigmaFeePerLpUpdated = $t04651946635._5 | |
1575 | 1600 | let lpTokensToSend = ((lpTokensToMint - lpFee) - protocolFee) | |
1576 | 1601 | let err2 = _validateInt(lpTokensToSend, minLpAmount_, MAX_INT, "deposit: less than min") | |
1577 | 1602 | if ((err2 == err2)) | |
1578 | 1603 | then { | |
1579 | 1604 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 + lpTokensToMint), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1580 | 1605 | $Tuple2(((((([Reissue(lpAssetId, lpTokensToMint, true), ScriptTransfer(i.caller, lpTokensToSend, lpAssetId)] ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(assetBalances)) ++ _saveLpFee(lpAssetIdStr, (lpFee + _loadLpFee(lpAssetIdStr)))) ++ _saveProtocolFee(lpAssetIdStr, (protocolFee + _loadProtocolFee(lpAssetIdStr)))) ++ _saveSigmaFeePerLp(sigmaFeePerLpUpdated)), unit) | |
1581 | 1606 | } | |
1582 | 1607 | else throw("Strict value is not equal to itself.") | |
1583 | 1608 | } | |
1584 | 1609 | else throw("Strict value is not equal to itself.") | |
1585 | 1610 | } | |
1586 | 1611 | else throw("Strict value is not equal to itself.") | |
1587 | 1612 | } | |
1588 | 1613 | ||
1589 | 1614 | ||
1590 | 1615 | ||
1591 | 1616 | @Callable(i) | |
1592 | 1617 | func withdrawAll () = { | |
1593 | 1618 | let storage = _loadStorage() | |
1594 | 1619 | let lpAssetId = storage._1 | |
1595 | 1620 | let lpAssetIdStr = toBase58String(lpAssetId) | |
1596 | 1621 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1597 | 1622 | let assets = _loadAssets() | |
1598 | - | let err = if (if (if (if (_whenInitialized()) | |
1599 | - | then _whenNotPaused() | |
1600 | - | else false) | |
1623 | + | let err = if (if (if (_whenInitialized()) | |
1601 | 1624 | then _validateIntEquals(size(i.payments), 1, "withdrawAll: invalid payments size") | |
1602 | 1625 | else false) | |
1603 | 1626 | then _validateStringEqual(lpAssetIdStr, _assetToStr(i.payments[0].assetId), "withdrawAll: invalid payment asset") | |
1604 | 1627 | else false) | |
1605 | 1628 | then _validateInt(i.payments[0].amount, 1, MAX_INT, "withdrawAll: invalid payment amount") | |
1606 | 1629 | else false | |
1607 | 1630 | if ((err == err)) | |
1608 | 1631 | then { | |
1609 | - | let $ | |
1610 | - | let lpTokensToBurn = $ | |
1611 | - | let balancesToPay = $ | |
1612 | - | let assetBalances = $ | |
1632 | + | let $t04809648183 = _withdrawAll(i.payments[0].amount) | |
1633 | + | let lpTokensToBurn = $t04809648183._1 | |
1634 | + | let balancesToPay = $t04809648183._2 | |
1635 | + | let assetBalances = $t04809648183._3 | |
1613 | 1636 | let paymentActions = _getPaymentsFromBalances(assets, balancesToPay, i.caller, lpDecimals) | |
1614 | 1637 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 - lpTokensToBurn), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1615 | 1638 | $Tuple2(((([Burn(lpAssetId, lpTokensToBurn)] ++ paymentActions) ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(assetBalances)), unit) | |
1616 | 1639 | } | |
1617 | 1640 | else throw("Strict value is not equal to itself.") | |
1618 | 1641 | } | |
1619 | 1642 | ||
1620 | 1643 | ||
1621 | 1644 | ||
1622 | 1645 | @Callable(i) | |
1623 | 1646 | func withdraw (assetId_,minAmount_) = { | |
1624 | 1647 | let storage = _loadStorage() | |
1625 | 1648 | let lpAssetId = storage._1 | |
1626 | 1649 | let lpAssetIdStr = toBase58String(lpAssetId) | |
1627 | 1650 | let lpDecimals = _getDecimals(lpAssetIdStr) | |
1628 | 1651 | let assets = _loadAssets() | |
1629 | - | let err = if (if (if (if (if (if (_whenInitialized()) | |
1652 | + | let err = if (if (if (if (if (if (if (_whenInitialized()) | |
1630 | 1653 | then _whenNotPaused() | |
1654 | + | else false) | |
1655 | + | then _checkWatchdog() | |
1631 | 1656 | else false) | |
1632 | 1657 | then _validateIntEquals(size(i.payments), 1, "withdraw: invalid payments size") | |
1633 | 1658 | else false) | |
1634 | 1659 | then _validateStringEqual(lpAssetIdStr, _assetToStr(i.payments[0].assetId), "withdraw: invalid payment asset") | |
1635 | 1660 | else false) | |
1636 | 1661 | then _validateInt(i.payments[0].amount, 1, MAX_INT, "withdraw: invalid payment amount") | |
1637 | 1662 | else false) | |
1638 | 1663 | then _validateListContains(assets, assetId_, "withdraw: invalid assetId") | |
1639 | 1664 | else false) | |
1640 | 1665 | then _validateInt(minAmount_, 0, MAX_INT, "withdraw: invalid minAmount") | |
1641 | 1666 | else false | |
1642 | 1667 | if ((err == err)) | |
1643 | 1668 | then { | |
1644 | - | let $ | |
1645 | - | let targetAmountNormalized = $ | |
1646 | - | let finalAssetBalances = $ | |
1647 | - | let lpFee = $ | |
1648 | - | let protocolFee = $ | |
1649 | - | let sigmaFeePerLpUpdated = $ | |
1669 | + | let $t04953749671 = _withdraw(assetId_, i.payments[0].amount) | |
1670 | + | let targetAmountNormalized = $t04953749671._1 | |
1671 | + | let finalAssetBalances = $t04953749671._2 | |
1672 | + | let lpFee = $t04953749671._3 | |
1673 | + | let protocolFee = $t04953749671._4 | |
1674 | + | let sigmaFeePerLpUpdated = $t04953749671._5 | |
1650 | 1675 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1651 | 1676 | let targetDecimals = _getDecimals(assetId_) | |
1652 | 1677 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1653 | 1678 | let err1 = _validateInt(finalAmount, minAmount_, MAX_INT, "withdraw: less than min") | |
1654 | 1679 | if ((err1 == err1)) | |
1655 | 1680 | then { | |
1656 | 1681 | let storageUpdated = $Tuple10(storage._1, storage._2, (storage._3 - i.payments[0].amount), storage._4, storage._5, storage._6, storage._7, storage._8, storage._9, storage._10) | |
1657 | 1682 | $Tuple2(((((([Burn(lpAssetId, i.payments[0].amount), ScriptTransfer(i.caller, finalAmount, _strToAsset(assetId_))] ++ _saveStorage(storageUpdated)) ++ _saveAssetBalances(finalAssetBalances)) ++ _saveLpFee(assetId_, (lpFee + _loadLpFee(assetId_)))) ++ _saveProtocolFee(assetId_, (protocolFee + _loadProtocolFee(assetId_)))) ++ _saveSigmaFeePerLp(sigmaFeePerLpUpdated)), unit) | |
1658 | 1683 | } | |
1659 | 1684 | else throw("Strict value is not equal to itself.") | |
1660 | 1685 | } | |
1661 | 1686 | else throw("Strict value is not equal to itself.") | |
1662 | 1687 | } | |
1663 | 1688 | ||
1664 | 1689 | ||
1665 | 1690 | ||
1666 | 1691 | @Callable(i) | |
1667 | 1692 | func swap (targetAssetId_,minAmount_) = { | |
1668 | 1693 | let storage = _loadStorage() | |
1669 | 1694 | let lpAssetId = storage._1 | |
1670 | 1695 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1671 | 1696 | let assets = _loadAssets() | |
1672 | 1697 | let sourceAssetStr = _assetToStr(i.payments[0].assetId) | |
1673 | 1698 | let sourceAmountNormalized = _normalizeDecimals(i.payments[0].amount, _getDecimals(sourceAssetStr), lpDecimals, DOWN) | |
1674 | 1699 | let sourceAssetIndex = valueOrErrorMessage(indexOf(assets, sourceAssetStr), "swap: invalid source asset") | |
1675 | 1700 | if ((sourceAssetIndex == sourceAssetIndex)) | |
1676 | 1701 | then { | |
1677 | 1702 | let targetAssetIndex = valueOrErrorMessage(indexOf(assets, targetAssetId_), "swap: invalid target asset") | |
1678 | 1703 | if ((targetAssetIndex == targetAssetIndex)) | |
1679 | 1704 | then { | |
1680 | - | let err = if (if (if (if (if (_whenInitialized()) | |
1705 | + | let err = if (if (if (if (if (if (_whenInitialized()) | |
1681 | 1706 | then _whenNotPaused() | |
1707 | + | else false) | |
1708 | + | then _checkWatchdog() | |
1682 | 1709 | else false) | |
1683 | 1710 | then _validateInt(minAmount_, 0, MAX_INT, "swap: invalid min target amount") | |
1684 | 1711 | else false) | |
1685 | 1712 | then _validateInt(sourceAmountNormalized, 1, MAX_INT, "swap: invalid source amount") | |
1686 | 1713 | else false) | |
1687 | 1714 | then _validateStringNotEq(sourceAssetStr, targetAssetId_, "swap: same assets") | |
1688 | 1715 | else false) | |
1689 | 1716 | then _validateIntEquals(size(i.payments), 1, "swap: invalid payments size") | |
1690 | 1717 | else false | |
1691 | 1718 | if ((err == err)) | |
1692 | 1719 | then { | |
1693 | - | let $ | |
1694 | - | let targetAmountNormalized = $ | |
1695 | - | let finalAssetBalances = $ | |
1696 | - | let lpFee = $ | |
1697 | - | let protocolFee = $ | |
1698 | - | let sigmaFeePerLpUpdated = $ | |
1720 | + | let $t05178451942 = _swap(sourceAssetIndex, targetAssetIndex, sourceAmountNormalized) | |
1721 | + | let targetAmountNormalized = $t05178451942._1 | |
1722 | + | let finalAssetBalances = $t05178451942._2 | |
1723 | + | let lpFee = $t05178451942._3 | |
1724 | + | let protocolFee = $t05178451942._4 | |
1725 | + | let sigmaFeePerLpUpdated = $t05178451942._5 | |
1699 | 1726 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1700 | 1727 | let targetDecimals = _getDecimals(targetAssetId_) | |
1701 | 1728 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1702 | 1729 | let err1 = _validateInt(finalAmount, minAmount_, MAX_INT, "swap: less than min") | |
1703 | 1730 | if ((err1 == err1)) | |
1704 | 1731 | then $Tuple2((((([ScriptTransfer(i.caller, finalAmount, _strToAsset(targetAssetId_))] ++ _saveAssetBalances(finalAssetBalances)) ++ _saveLpFee(targetAssetId_, (lpFee + _loadLpFee(targetAssetId_)))) ++ _saveProtocolFee(targetAssetId_, (protocolFee + _loadProtocolFee(targetAssetId_)))) ++ _saveSigmaFeePerLp(sigmaFeePerLpUpdated)), unit) | |
1705 | 1732 | else throw("Strict value is not equal to itself.") | |
1706 | 1733 | } | |
1707 | 1734 | else throw("Strict value is not equal to itself.") | |
1708 | 1735 | } | |
1709 | 1736 | else throw("Strict value is not equal to itself.") | |
1710 | 1737 | } | |
1711 | 1738 | else throw("Strict value is not equal to itself.") | |
1712 | 1739 | } | |
1713 | 1740 | ||
1714 | 1741 | ||
1715 | 1742 | ||
1716 | 1743 | @Callable(i) | |
1717 | 1744 | func getDepositAll (lpAmount_) = { | |
1718 | 1745 | let err = _validateInt(lpAmount_, 1, MAX_INT, "getDepositAll: invalid amount") | |
1719 | 1746 | if ((err == err)) | |
1720 | 1747 | then { | |
1721 | - | let $ | |
1722 | - | let lpTokensToMint = $ | |
1723 | - | let requiredAmountsNormalized = $ | |
1724 | - | let assetBalances = $ | |
1748 | + | let $t05306253149 = _depositAll(lpAmount_) | |
1749 | + | let lpTokensToMint = $t05306253149._1 | |
1750 | + | let requiredAmountsNormalized = $t05306253149._2 | |
1751 | + | let assetBalances = $t05306253149._3 | |
1725 | 1752 | $Tuple2(nil, $Tuple2(lpTokensToMint, requiredAmountsNormalized)) | |
1726 | 1753 | } | |
1727 | 1754 | else throw("Strict value is not equal to itself.") | |
1728 | 1755 | } | |
1729 | 1756 | ||
1730 | 1757 | ||
1731 | 1758 | ||
1732 | 1759 | @Callable(i) | |
1733 | 1760 | func getDeposit (assetId_,amount_) = { | |
1734 | 1761 | let err = if (_validateListContains(_loadAssets(), assetId_, "getDeposit: invalid asset")) | |
1735 | 1762 | then _validateInt(amount_, 1, MAX_INT, "getDeposit: invalid amount") | |
1736 | 1763 | else false | |
1737 | 1764 | if ((err == err)) | |
1738 | 1765 | then { | |
1739 | 1766 | let storage = _loadStorage() | |
1740 | 1767 | let lpAssetId = storage._1 | |
1741 | 1768 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1742 | 1769 | let assetDecimals = _getDecimals(assetId_) | |
1743 | 1770 | let amountNormalized = _normalizeDecimals(amount_, assetDecimals, lpDecimals, DOWN) | |
1744 | - | let $ | |
1745 | - | let lpTokensToMint = $ | |
1746 | - | let assetBalances = $ | |
1747 | - | let lpFee = $ | |
1748 | - | let protocolFee = $ | |
1749 | - | let sigmaFeePerLpUpdated = $ | |
1771 | + | let $t05390854024 = _deposit(assetId_, amountNormalized) | |
1772 | + | let lpTokensToMint = $t05390854024._1 | |
1773 | + | let assetBalances = $t05390854024._2 | |
1774 | + | let lpFee = $t05390854024._3 | |
1775 | + | let protocolFee = $t05390854024._4 | |
1776 | + | let sigmaFeePerLpUpdated = $t05390854024._5 | |
1750 | 1777 | let lpTokensToSend = ((lpTokensToMint - lpFee) - protocolFee) | |
1751 | 1778 | $Tuple2(nil, lpTokensToSend) | |
1752 | 1779 | } | |
1753 | 1780 | else throw("Strict value is not equal to itself.") | |
1754 | 1781 | } | |
1755 | 1782 | ||
1756 | 1783 | ||
1757 | 1784 | ||
1758 | 1785 | @Callable(i) | |
1759 | 1786 | func getWithdrawAll (lpAmount_) = { | |
1760 | 1787 | let err = _validateInt(lpAmount_, 0, MAX_INT, "getWithdrawAll: invalid amount") | |
1761 | 1788 | if ((err == err)) | |
1762 | 1789 | then { | |
1763 | - | let $ | |
1764 | - | let lpTokensToBurn = $ | |
1765 | - | let balancesToGet = $ | |
1766 | - | let assetBalances = $ | |
1790 | + | let $t05446354539 = _withdrawAll(lpAmount_) | |
1791 | + | let lpTokensToBurn = $t05446354539._1 | |
1792 | + | let balancesToGet = $t05446354539._2 | |
1793 | + | let assetBalances = $t05446354539._3 | |
1767 | 1794 | $Tuple2(nil, balancesToGet) | |
1768 | 1795 | } | |
1769 | 1796 | else throw("Strict value is not equal to itself.") | |
1770 | 1797 | } | |
1771 | 1798 | ||
1772 | 1799 | ||
1773 | 1800 | ||
1774 | 1801 | @Callable(i) | |
1775 | 1802 | func getWithdraw (assetId_,amount_) = { | |
1776 | 1803 | let err = if (_validateListContains(_loadAssets(), assetId_, "getWithdraw: invalid asset")) | |
1777 | 1804 | then _validateInt(amount_, 1, MAX_INT, "getWithdraw: invalid amount") | |
1778 | 1805 | else false | |
1779 | 1806 | if ((err == err)) | |
1780 | 1807 | then { | |
1781 | 1808 | let storage = _loadStorage() | |
1782 | 1809 | let lpAssetId = storage._1 | |
1783 | 1810 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1784 | - | let $ | |
1785 | - | let targetAmountNormalized = $ | |
1786 | - | let assetBalances = $ | |
1787 | - | let lpFee = $ | |
1788 | - | let protocolFee = $ | |
1789 | - | let sigmaFeePerLpUpdated = $ | |
1811 | + | let $t05519055306 = _withdraw(assetId_, amount_) | |
1812 | + | let targetAmountNormalized = $t05519055306._1 | |
1813 | + | let assetBalances = $t05519055306._2 | |
1814 | + | let lpFee = $t05519055306._3 | |
1815 | + | let protocolFee = $t05519055306._4 | |
1816 | + | let sigmaFeePerLpUpdated = $t05519055306._5 | |
1790 | 1817 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1791 | 1818 | let targetDecimals = _getDecimals(assetId_) | |
1792 | 1819 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1793 | 1820 | $Tuple2(nil, finalAmount) | |
1794 | 1821 | } | |
1795 | 1822 | else throw("Strict value is not equal to itself.") | |
1796 | 1823 | } | |
1797 | 1824 | ||
1798 | 1825 | ||
1799 | 1826 | ||
1800 | 1827 | @Callable(i) | |
1801 | 1828 | func getSwap (sourceAssetId_,targetAssetId_,sourceAmount_) = { | |
1802 | 1829 | let storage = _loadStorage() | |
1803 | 1830 | let lpAssetId = storage._1 | |
1804 | 1831 | let lpDecimals = _getDecimals(toBase58String(lpAssetId)) | |
1805 | 1832 | let assets = _loadAssets() | |
1806 | 1833 | let sourceAssetIndex = valueOrErrorMessage(indexOf(assets, sourceAssetId_), "swap: invalid source asset") | |
1807 | 1834 | if ((sourceAssetIndex == sourceAssetIndex)) | |
1808 | 1835 | then { | |
1809 | 1836 | let targetAssetIndex = valueOrErrorMessage(indexOf(assets, targetAssetId_), "swap: invalid target asset") | |
1810 | 1837 | if ((targetAssetIndex == targetAssetIndex)) | |
1811 | 1838 | then { | |
1812 | 1839 | let sourceAmountNormalized = _normalizeDecimals(sourceAmount_, _getDecimals(sourceAssetId_), lpDecimals, DOWN) | |
1813 | 1840 | let err = if (_validateInt(sourceAmountNormalized, 1, MAX_INT, "swap: invalid source amount")) | |
1814 | 1841 | then _validateStringNotEq(sourceAssetId_, targetAssetId_, "swap: same assets") | |
1815 | 1842 | else false | |
1816 | 1843 | if ((err == err)) | |
1817 | 1844 | then { | |
1818 | - | let $ | |
1819 | - | let targetAmountNormalized = $ | |
1820 | - | let finalAssetBalances = $ | |
1821 | - | let lpFee = $ | |
1822 | - | let protocolFee = $ | |
1823 | - | let sigmaFeePerLpUpdated = $ | |
1845 | + | let $t05671656874 = _swap(sourceAssetIndex, targetAssetIndex, sourceAmountNormalized) | |
1846 | + | let targetAmountNormalized = $t05671656874._1 | |
1847 | + | let finalAssetBalances = $t05671656874._2 | |
1848 | + | let lpFee = $t05671656874._3 | |
1849 | + | let protocolFee = $t05671656874._4 | |
1850 | + | let sigmaFeePerLpUpdated = $t05671656874._5 | |
1824 | 1851 | let finalAmountNormalized = ((targetAmountNormalized - lpFee) - protocolFee) | |
1825 | 1852 | let targetDecimals = _getDecimals(targetAssetId_) | |
1826 | 1853 | let finalAmount = _normalizeDecimals(finalAmountNormalized, lpDecimals, targetDecimals, DOWN) | |
1827 | 1854 | $Tuple2(nil, finalAmount) | |
1828 | 1855 | } | |
1829 | 1856 | else throw("Strict value is not equal to itself.") | |
1830 | 1857 | } | |
1831 | 1858 | else throw("Strict value is not equal to itself.") | |
1832 | 1859 | } | |
1833 | 1860 | else throw("Strict value is not equal to itself.") | |
1834 | 1861 | } | |
1835 | 1862 | ||
1836 | 1863 | ||
1837 | 1864 | ||
1838 | 1865 | @Callable(i) | |
1839 | 1866 | func getClaim (user_) = { | |
1840 | 1867 | let user = if ((size(user_) > 0)) | |
1841 | 1868 | then valueOrErrorMessage(addressFromString(user_), "getClaim: invalid user") | |
1842 | 1869 | else i.caller | |
1843 | - | let $ | |
1844 | - | let checkpointActions = $ | |
1845 | - | let userProfits = $ | |
1870 | + | let $t05751657572 = _checkpoint(user) | |
1871 | + | let checkpointActions = $t05751657572._1 | |
1872 | + | let userProfits = $t05751657572._2 | |
1846 | 1873 | $Tuple2(nil, userProfits) | |
1847 | 1874 | } | |
1848 | 1875 | ||
1849 | 1876 | ||
1850 | 1877 | ||
1851 | 1878 | @Callable(i) | |
1852 | 1879 | func getUtilFunc () = { | |
1853 | 1880 | let storage = _loadStorage() | |
1854 | 1881 | let lpTotalSupply = storage._3 | |
1855 | 1882 | let weightAmplifier = storage._7 | |
1856 | 1883 | let slippageRate = storage._8 | |
1857 | 1884 | let feeMaxRate = storage._9 | |
1858 | - | let $ | |
1859 | - | let assetBalances = $ | |
1860 | - | let assetTotalSupply = $ | |
1861 | - | let $ | |
1862 | - | let assetWeights = $ | |
1863 | - | let sigmaWeight = $ | |
1885 | + | let $t05790557965 = _loadAssetBalances() | |
1886 | + | let assetBalances = $t05790557965._1 | |
1887 | + | let assetTotalSupply = $t05790557965._2 | |
1888 | + | let $t05797058023 = _loadAssetWeights() | |
1889 | + | let assetWeights = $t05797058023._1 | |
1890 | + | let sigmaWeight = $t05797058023._2 | |
1864 | 1891 | let fee = _calculateFee(assetBalances, assetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1865 | 1892 | let utilValue = (assetTotalSupply - fee) | |
1866 | 1893 | $Tuple2(nil, $Tuple2(utilValue, lpTotalSupply)) | |
1867 | 1894 | } | |
1868 | 1895 | ||
1869 | 1896 | ||
1870 | 1897 | ||
1871 | 1898 | @Callable(i) | |
1872 | 1899 | func getFeeFunc () = { | |
1873 | 1900 | let storage = _loadStorage() | |
1874 | 1901 | let weightAmplifier = storage._7 | |
1875 | 1902 | let slippageRate = storage._8 | |
1876 | 1903 | let feeMaxRate = storage._9 | |
1877 | - | let $ | |
1878 | - | let assetBalances = $ | |
1879 | - | let assetTotalSupply = $ | |
1880 | - | let $ | |
1881 | - | let assetWeights = $ | |
1882 | - | let sigmaWeight = $ | |
1904 | + | let $t05845558515 = _loadAssetBalances() | |
1905 | + | let assetBalances = $t05845558515._1 | |
1906 | + | let assetTotalSupply = $t05845558515._2 | |
1907 | + | let $t05852058573 = _loadAssetWeights() | |
1908 | + | let assetWeights = $t05852058573._1 | |
1909 | + | let sigmaWeight = $t05852058573._2 | |
1883 | 1910 | let fee = _calculateFee(assetBalances, assetTotalSupply, assetWeights, sigmaWeight, weightAmplifier, slippageRate, feeMaxRate) | |
1884 | 1911 | $Tuple2(nil, fee) | |
1885 | 1912 | } | |
1886 | 1913 | ||
1887 | 1914 | ||
1888 | 1915 | ||
1889 | 1916 | @Callable(i) | |
1890 | 1917 | func checkpoint (user_) = { | |
1891 | 1918 | let err = if (_whenInitialized()) | |
1892 | 1919 | then _whenNotPaused() | |
1893 | 1920 | else false | |
1894 | 1921 | if ((err == err)) | |
1895 | 1922 | then { | |
1896 | 1923 | let user = if ((size(user_) > 0)) | |
1897 | 1924 | then valueOrErrorMessage(addressFromString(user_), "checkpoint: invalid user") | |
1898 | 1925 | else i.caller | |
1899 | 1926 | _checkpoint(user) | |
1900 | 1927 | } | |
1901 | 1928 | else throw("Strict value is not equal to itself.") | |
1902 | 1929 | } | |
1903 | 1930 | ||
1904 | 1931 | ||
1905 | 1932 | ||
1906 | 1933 | @Callable(i) | |
1907 | 1934 | func stake () = { | |
1908 | 1935 | let err = if (_whenInitialized()) | |
1909 | 1936 | then _whenNotPaused() | |
1910 | 1937 | else false | |
1911 | 1938 | if ((err == err)) | |
1912 | 1939 | then { | |
1913 | 1940 | let storage = _loadStorage() | |
1914 | 1941 | let lpAssetIdStr = _assetToStr(storage._1) | |
1915 | 1942 | let err1 = if (if (_validateIntEquals(size(i.payments), 1, "stake: invalid payments size")) | |
1916 | 1943 | then _validateStringEqual(lpAssetIdStr, _assetToStr(i.payments[0].assetId), "stake: invalid payment asset") | |
1917 | 1944 | else false) | |
1918 | 1945 | then _validateInt(i.payments[0].amount, 0, MAX_INT, "stake: invalid payment amount") | |
1919 | 1946 | else false | |
1920 | 1947 | if ((err1 == err1)) | |
1921 | 1948 | then { | |
1922 | - | let $ | |
1923 | - | let checkpointActions = $ | |
1924 | - | let userProfits = $ | |
1949 | + | let $t05958159641 = _checkpoint(i.caller) | |
1950 | + | let checkpointActions = $t05958159641._1 | |
1951 | + | let userProfits = $t05958159641._2 | |
1925 | 1952 | $Tuple2(((checkpointActions ++ _saveUserLp(i.caller, (_loadUserLp(i.caller) + i.payments[0].amount))) ++ _saveTotalLp((_loadTotalLp() + i.payments[0].amount))), unit) | |
1926 | 1953 | } | |
1927 | 1954 | else throw("Strict value is not equal to itself.") | |
1928 | 1955 | } | |
1929 | 1956 | else throw("Strict value is not equal to itself.") | |
1930 | 1957 | } | |
1931 | 1958 | ||
1932 | 1959 | ||
1933 | 1960 | ||
1934 | 1961 | @Callable(i) | |
1935 | 1962 | func unstake (amount_) = { | |
1936 | 1963 | let err = if (_whenInitialized()) | |
1937 | 1964 | then _whenNotPaused() | |
1938 | 1965 | else false | |
1939 | 1966 | if ((err == err)) | |
1940 | 1967 | then { | |
1941 | 1968 | let storage = _loadStorage() | |
1942 | 1969 | let lpAssetId = storage._1 | |
1943 | 1970 | let userLp = _loadUserLp(i.caller) | |
1944 | 1971 | let err1 = _validateInt(amount_, 0, userLp, "unstake: invalid amount") | |
1945 | 1972 | if ((err1 == err1)) | |
1946 | 1973 | then { | |
1947 | - | let $ | |
1948 | - | let checkpointActions = $ | |
1949 | - | let userProfits = $ | |
1974 | + | let $t06015260212 = _checkpoint(i.caller) | |
1975 | + | let checkpointActions = $t06015260212._1 | |
1976 | + | let userProfits = $t06015260212._2 | |
1950 | 1977 | $Tuple2(((([ScriptTransfer(i.caller, amount_, lpAssetId)] ++ checkpointActions) ++ _saveUserLp(i.caller, (userLp - amount_))) ++ _saveTotalLp((_loadTotalLp() - amount_))), unit) | |
1951 | 1978 | } | |
1952 | 1979 | else throw("Strict value is not equal to itself.") | |
1953 | 1980 | } | |
1954 | 1981 | else throw("Strict value is not equal to itself.") | |
1955 | 1982 | } | |
1956 | 1983 | ||
1957 | 1984 | ||
1958 | 1985 | ||
1959 | 1986 | @Callable(i) | |
1960 | 1987 | func claim (user_) = { | |
1961 | 1988 | let err = if (_whenInitialized()) | |
1962 | 1989 | then _whenNotPaused() | |
1963 | 1990 | else false | |
1964 | 1991 | if ((err == err)) | |
1965 | 1992 | then { | |
1966 | 1993 | let user = if ((size(user_) > 0)) | |
1967 | 1994 | then valueOrErrorMessage(addressFromString(user_), "claim: invalid user") | |
1968 | 1995 | else i.caller | |
1969 | 1996 | let storage = _loadStorage() | |
1970 | 1997 | let lpAssetId = storage._1 | |
1971 | 1998 | let lpAssetIdStr = _assetToStr(lpAssetId) | |
1972 | 1999 | let assets = [lpAssetIdStr, _loadAssets()] | |
1973 | 2000 | let maxIndex = (size(assets) - 1) | |
1974 | 2001 | let userLp = _loadUserLp(user) | |
1975 | - | let $ | |
1976 | - | let checkpointActions = $ | |
1977 | - | let userProfits = $ | |
2002 | + | let $t06093560991 = _checkpoint(user) | |
2003 | + | let checkpointActions = $t06093560991._1 | |
2004 | + | let userProfits = $t06093560991._2 | |
1978 | 2005 | func foldFunc (acc,profit) = { | |
1979 | 2006 | let index = acc._1 | |
1980 | 2007 | if (if ((maxIndex >= index)) | |
1981 | 2008 | then (profit > 0) | |
1982 | 2009 | else false) | |
1983 | 2010 | then { | |
1984 | 2011 | let asset = assets[index] | |
1985 | 2012 | $Tuple3((index + 1), (acc._2 :+ 0), (acc._3 :+ ScriptTransfer(user, profit, _strToAsset(asset)))) | |
1986 | 2013 | } | |
1987 | 2014 | else $Tuple3((index + 1), (acc._2 :+ profit), acc._3) | |
1988 | 2015 | } | |
1989 | 2016 | ||
1990 | - | let $ | |
2017 | + | let $t06136961460 = { | |
1991 | 2018 | let $l = userProfits | |
1992 | 2019 | let $s = size($l) | |
1993 | 2020 | let $acc0 = $Tuple3(0, nil, nil) | |
1994 | 2021 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1995 | 2022 | then $a | |
1996 | 2023 | else foldFunc($a, $l[$i]) | |
1997 | 2024 | ||
1998 | 2025 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1999 | 2026 | then $a | |
2000 | 2027 | else throw("List size exceeds 11") | |
2001 | 2028 | ||
2002 | 2029 | $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) | |
2003 | 2030 | } | |
2004 | - | let idx = $ | |
2005 | - | let userProfitsUpdated = $ | |
2006 | - | let profitActions = $ | |
2031 | + | let idx = $t06136961460._1 | |
2032 | + | let userProfitsUpdated = $t06136961460._2 | |
2033 | + | let profitActions = $t06136961460._3 | |
2007 | 2034 | $Tuple2(((profitActions ++ removeByIndex(checkpointActions, 0)) ++ _saveUserProfits(user, userProfitsUpdated)), unit) | |
2008 | 2035 | } | |
2009 | 2036 | else throw("Strict value is not equal to itself.") | |
2010 | 2037 | } | |
2011 | 2038 | ||
2012 | 2039 | ||
2013 | 2040 | ||
2014 | 2041 | @Callable(i) | |
2015 | 2042 | func pause () = { | |
2016 | 2043 | let err = if (if (_onlyPauser(i.caller)) | |
2017 | 2044 | then _whenInitialized() | |
2018 | 2045 | else false) | |
2019 | 2046 | then _whenNotPaused() | |
2020 | 2047 | else false | |
2021 | 2048 | if ((err == err)) | |
2022 | 2049 | then $Tuple2(_savePause(true), unit) | |
2023 | 2050 | else throw("Strict value is not equal to itself.") | |
2024 | 2051 | } | |
2025 | 2052 | ||
2026 | 2053 | ||
2027 | 2054 | ||
2028 | 2055 | @Callable(i) | |
2029 | 2056 | func unpause () = { | |
2030 | - | let err = if (if (_ | |
2057 | + | let err = if (if (_onlyThisContract(i.caller)) | |
2031 | 2058 | then _whenInitialized() | |
2032 | 2059 | else false) | |
2033 | 2060 | then _whenPaused() | |
2034 | 2061 | else false | |
2035 | 2062 | if ((err == err)) | |
2036 | 2063 | then $Tuple2(_savePause(false), unit) | |
2037 | 2064 | else throw("Strict value is not equal to itself.") | |
2038 | 2065 | } | |
2039 | 2066 | ||
2040 | 2067 | ||
2041 | 2068 | ||
2042 | 2069 | @Callable(i) | |
2043 | 2070 | func updatePauser (pauser_) = { | |
2044 | 2071 | let err = if (if (_onlyThisContract(i.caller)) | |
2045 | 2072 | then _whenInitialized() | |
2046 | 2073 | else false) | |
2047 | 2074 | then _validateAddress(pauser_, "updatePauser: invalid pauser") | |
2048 | 2075 | else false | |
2049 | 2076 | if ((err == err)) | |
2050 | 2077 | then $Tuple2(_savePauser(addressFromStringValue(pauser_)), unit) | |
2078 | + | else throw("Strict value is not equal to itself.") | |
2079 | + | } | |
2080 | + | ||
2081 | + | ||
2082 | + | ||
2083 | + | @Callable(i) | |
2084 | + | func updateWatchdog (watchdog_,offset_) = { | |
2085 | + | let err = if (if (if (_onlyThisContract(i.caller)) | |
2086 | + | then _whenInitialized() | |
2087 | + | else false) | |
2088 | + | then _validateAddress(watchdog_, "updateWatchdog: invalid watchdog") | |
2089 | + | else false) | |
2090 | + | then _validateInt(offset_, 0, MAX_INT, "updateWatchdog: invalid offset") | |
2091 | + | else false | |
2092 | + | if ((err == err)) | |
2093 | + | then $Tuple2((_saveWatchdog(addressFromStringValue(watchdog_)) ++ _saveWatchdogOffset(offset_)), unit) | |
2051 | 2094 | else throw("Strict value is not equal to itself.") | |
2052 | 2095 | } | |
2053 | 2096 | ||
2054 | 2097 | ||
2055 | 2098 | ||
2056 | 2099 | @Callable(i) | |
2057 | 2100 | func setMultisig (multisig_) = { | |
2058 | 2101 | let err = if (_onlyThisContract(i.caller)) | |
2059 | 2102 | then _validateAddress(multisig_, "setMultisig: invalid multisig") | |
2060 | 2103 | else false | |
2061 | 2104 | if ((err == err)) | |
2062 | 2105 | then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit) | |
2063 | 2106 | else throw("Strict value is not equal to itself.") | |
2064 | 2107 | } | |
2065 | 2108 | ||
2066 | 2109 | ||
2067 | 2110 | @Verifier(tx) | |
2068 | 2111 | func verify () = match getString(KEY_MULTISIG) { | |
2069 | 2112 | case multisig: String => | |
2070 | 2113 | valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEP)), false) | |
2071 | 2114 | case _ => | |
2072 | 2115 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
2073 | 2116 | } | |
2074 | 2117 |
github/deemru/w8io/fabc49c 269.07 ms ◑