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