tx · 4fqMMhfmDYkLB5AgNKBfUefnLTX5cmRyGZJyGErAz2aF 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA: -0.03700000 Waves 2022.12.20 11:05 [2368350] smart account 3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA > SELF 0.00000000 Waves
{ "type": 13, "id": "4fqMMhfmDYkLB5AgNKBfUefnLTX5cmRyGZJyGErAz2aF", "fee": 3700000, "feeAssetId": null, "timestamp": 1671523535034, "version": 1, "sender": "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA", "senderPublicKey": "35yd3qw1gxKDxKwGAykHN9fANbXNWwseaUwbWDj24o3x", "proofs": [ "2cz5tJYYRYBTpWBgCGecERtLNhe3sYEUoPRbwfQ9DEPHWRPjHA9Jc3zfCMqpvwxv42zKB3R2tunAduMUYZUBr5pm" ], "script": "base64:BgL2KAgCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgASBAoCCAESABIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIEYmlnMyIEYmlnNCIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lkIg9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Id": 84, "height": 2368350, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5YqmQs9LJgvf7CqAUrmjmKwzHDu7sfBp3M44qepzouva Next: 5gCUdNqJQU8GRpiae2f7s2UiZDKZ84GKZTGScAVf3Dti Diff:
Old | New | Differences | |
---|---|---|---|
1008 | 1008 | else throw("Strict value is not equal to itself.") | |
1009 | 1009 | } | |
1010 | 1010 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1011 | - | let $ | |
1012 | - | let refreshDLpActions = $ | |
1013 | - | let updatedDLp = $ | |
1014 | - | let | |
1015 | - | if (( | |
1011 | + | let $t03627736342 = refreshDLpInternal(0, 0, 0) | |
1012 | + | let refreshDLpActions = $t03627736342._1 | |
1013 | + | let updatedDLp = $t03627736342._2 | |
1014 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1015 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1016 | 1016 | then { | |
1017 | - | let | |
1017 | + | let check = if ((updatedDLp >= currentDLp)) | |
1018 | 1018 | then true | |
1019 | - | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(emitLpAmt), toString(amDiff), toString(prDiff), toString(lpAssetEmission), toString(lpAssetEmissionAfter)], " ")) | |
1020 | - | if ((error == error)) | |
1021 | - | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1019 | + | else throwErr("updated DLp lower than current DLp") | |
1020 | + | if ((check == check)) | |
1021 | + | then { | |
1022 | + | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
1023 | + | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
1024 | + | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1025 | + | else throw("Strict value is not equal to itself.") | |
1026 | + | } | |
1022 | 1027 | else throw("Strict value is not equal to itself.") | |
1023 | 1028 | } | |
1024 | 1029 | else throw("Strict value is not equal to itself.") | |
1084 | 1089 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1085 | 1090 | if ((currentDLp == currentDLp)) | |
1086 | 1091 | then { | |
1087 | - | let $ | |
1088 | - | if (($ | |
1092 | + | let $t03786438022 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1093 | + | if (($t03786438022 == $t03786438022)) | |
1089 | 1094 | then { | |
1090 | - | let feeAmount = $ | |
1091 | - | let state = $ | |
1092 | - | let estimLP = $ | |
1095 | + | let feeAmount = $t03786438022._3 | |
1096 | + | let state = $t03786438022._2 | |
1097 | + | let estimLP = $t03786438022._1 | |
1093 | 1098 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1094 | 1099 | then (minOutAmount > estimLP) | |
1095 | 1100 | else false) | |
1117 | 1122 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1118 | 1123 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1119 | 1124 | else nil | |
1120 | - | let $ | |
1125 | + | let $t03883739186 = if ((this == feeCollectorAddress)) | |
1121 | 1126 | then $Tuple2(0, 0) | |
1122 | 1127 | else { | |
1123 | 1128 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1127 | 1132 | then $Tuple2(-(feeAmount), 0) | |
1128 | 1133 | else $Tuple2(0, -(feeAmount)) | |
1129 | 1134 | } | |
1130 | - | let amountAssetBalanceDelta = $ | |
1131 | - | let priceAssetBalanceDelta = $ | |
1132 | - | let $ | |
1133 | - | let refreshDLpActions = $ | |
1134 | - | let updatedDLp = $ | |
1135 | + | let amountAssetBalanceDelta = $t03883739186._1 | |
1136 | + | let priceAssetBalanceDelta = $t03883739186._2 | |
1137 | + | let $t03918939297 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1138 | + | let refreshDLpActions = $t03918939297._1 | |
1139 | + | let updatedDLp = $t03918939297._2 | |
1135 | 1140 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1136 | 1141 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1137 | 1142 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1151 | 1156 | ||
1152 | 1157 | ||
1153 | 1158 | @Callable(i) | |
1154 | - | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1155 | - | then throw("Wrong slpg") | |
1156 | - | else if ((size(i.payments) != 2)) | |
1157 | - | then throw("2 pmnts expd") | |
1158 | - | else { | |
1159 | - | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
1160 | - | let state = estPut._9 | |
1161 | - | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1162 | - | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1163 | - | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1164 | - | if ((currentDLp == currentDLp)) | |
1159 | + | func get () = { | |
1160 | + | let aab = toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
1161 | + | if ((aab == aab)) | |
1162 | + | then { | |
1163 | + | let pab = toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
1164 | + | if ((pab == pab)) | |
1165 | 1165 | then { | |
1166 | - | let $t04077340838 = refreshDLpInternal(0, 0, 0) | |
1167 | - | let refreshDLpActions = $t04077340838._1 | |
1168 | - | let updatedDLp = $t04077340838._2 | |
1169 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1170 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1171 | - | then (state ++ refreshDLpActions) | |
1172 | - | else throw("Strict value is not equal to itself.") | |
1173 | - | } | |
1174 | - | else throw("Strict value is not equal to itself.") | |
1175 | - | } | |
1176 | - | ||
1177 | - | ||
1178 | - | ||
1179 | - | @Callable(i) | |
1180 | - | func get () = { | |
1181 | - | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1182 | - | if ((currentDLp == currentDLp)) | |
1183 | - | then { | |
1184 | - | let r = cg(i) | |
1185 | - | let outAmtAmt = r._1 | |
1186 | - | let outPrAmt = r._2 | |
1187 | - | let pmtAmt = r._3 | |
1188 | - | let pmtAssetId = r._4 | |
1189 | - | let state = r._5 | |
1190 | - | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1191 | - | if ((b == b)) | |
1192 | - | then { | |
1193 | - | let $t04162541707 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1194 | - | let refreshDLpActions = $t04162541707._1 | |
1195 | - | let updatedDLp = $t04162541707._2 | |
1196 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1197 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1198 | - | then (state ++ refreshDLpActions) | |
1166 | + | let lae = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
1167 | + | if ((lae == lae)) | |
1168 | + | then { | |
1169 | + | let laea = (lae - toBigInt(value(i.payments[0]).amount)) | |
1170 | + | if ((laea == laea)) | |
1171 | + | then { | |
1172 | + | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1173 | + | if ((currentDLp == currentDLp)) | |
1174 | + | then { | |
1175 | + | let r = cg(i) | |
1176 | + | let outAmtAmt = r._1 | |
1177 | + | let outPrAmt = r._2 | |
1178 | + | let pmtAmt = r._3 | |
1179 | + | let pmtAssetId = r._4 | |
1180 | + | let state = r._5 | |
1181 | + | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1182 | + | if ((b == b)) | |
1183 | + | then { | |
1184 | + | let $t04159541752 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1185 | + | let refreshDLpActions = $t04159541752._1 | |
1186 | + | let updatedDLp = $t04159541752._2 | |
1187 | + | let error = if ((updatedDLp >= currentDLp)) | |
1188 | + | then true | |
1189 | + | else throwErr(makeString(["updated DLp lower than current DLp", toString(aab), toString(pab), toString(currentDLp), toString(updatedDLp), toString(lae), toString(laea)], " ")) | |
1190 | + | if ((error == error)) | |
1191 | + | then (state ++ refreshDLpActions) | |
1192 | + | else throw("Strict value is not equal to itself.") | |
1193 | + | } | |
1194 | + | else throw("Strict value is not equal to itself.") | |
1195 | + | } | |
1196 | + | else throw("Strict value is not equal to itself.") | |
1197 | + | } | |
1198 | + | else throw("Strict value is not equal to itself.") | |
1199 | + | } | |
1199 | 1200 | else throw("Strict value is not equal to itself.") | |
1200 | 1201 | } | |
1201 | 1202 | else throw("Strict value is not equal to itself.") | |
1227 | 1228 | else throwErr("exactly 1 payment are expected")] | |
1228 | 1229 | if ((checks == checks)) | |
1229 | 1230 | then { | |
1230 | - | let $ | |
1231 | - | let state = $ | |
1232 | - | let totalAmount = $ | |
1231 | + | let $t04255142706 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1232 | + | let state = $t04255142706._1 | |
1233 | + | let totalAmount = $t04255142706._2 | |
1233 | 1234 | $Tuple2(state, totalAmount) | |
1234 | 1235 | } | |
1235 | 1236 | else throw("Strict value is not equal to itself.") | |
1246 | 1247 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1247 | 1248 | then { | |
1248 | 1249 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1249 | - | let $ | |
1250 | - | let dLpUpdateActions = $ | |
1251 | - | let updatedDLp = $ | |
1250 | + | let $t04323043294 = refreshDLpInternal(0, 0, 0) | |
1251 | + | let dLpUpdateActions = $t04323043294._1 | |
1252 | + | let updatedDLp = $t04323043294._2 | |
1252 | 1253 | let actions = if ((dLp != updatedDLp)) | |
1253 | 1254 | then dLpUpdateActions | |
1254 | 1255 | else throwErr("nothing to refresh") | |
1277 | 1278 | let newY = getYD(xp, index, D1) | |
1278 | 1279 | let dy = (xp[index] - newY) | |
1279 | 1280 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1280 | - | let $ | |
1281 | - | let totalGet = $ | |
1282 | - | let feeAmount = $ | |
1281 | + | let $t04419444243 = takeFee(totalGetRaw) | |
1282 | + | let totalGet = $t04419444243._1 | |
1283 | + | let feeAmount = $t04419444243._2 | |
1283 | 1284 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1284 | 1285 | } | |
1285 | 1286 | ||
1293 | 1294 | let lpId = poolConfig[idxLPAsId] | |
1294 | 1295 | let amBalance = getAccBalance(amId) | |
1295 | 1296 | let prBalance = getAccBalance(prId) | |
1296 | - | let $ | |
1297 | + | let $t04458844703 = { | |
1297 | 1298 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1298 | 1299 | if ($isInstanceOf(@, "(Int, Int)")) | |
1299 | 1300 | then @ | |
1300 | 1301 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1301 | 1302 | } | |
1302 | - | let totalGet = $ | |
1303 | - | let feeAmount = $ | |
1303 | + | let totalGet = $t04458844703._1 | |
1304 | + | let feeAmount = $t04458844703._2 | |
1304 | 1305 | let r = ego("", lpId, lpAssetAmount, this) | |
1305 | 1306 | let outAmAmt = r._1 | |
1306 | 1307 | let outPrAmt = r._2 | |
1332 | 1333 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1333 | 1334 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1334 | 1335 | then { | |
1335 | - | let $ | |
1336 | - | let refreshDLpActions = $ | |
1337 | - | let updatedDLp = $ | |
1336 | + | let $t04587145952 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1337 | + | let refreshDLpActions = $t04587145952._1 | |
1338 | + | let updatedDLp = $t04587145952._2 | |
1338 | 1339 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1339 | 1340 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1340 | 1341 | then (state ++ refreshDLpActions) | |
1376 | 1377 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1377 | 1378 | if ((burnA == burnA)) | |
1378 | 1379 | then { | |
1379 | - | let $ | |
1380 | - | let refreshDLpActions = $ | |
1381 | - | let updatedDLp = $ | |
1380 | + | let $t04701547096 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1381 | + | let refreshDLpActions = $t04701547096._1 | |
1382 | + | let updatedDLp = $t04701547096._2 | |
1382 | 1383 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1383 | 1384 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1384 | 1385 | then (state ++ refreshDLpActions) | |
1425 | 1426 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1426 | 1427 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1427 | 1428 | then { | |
1428 | - | let $ | |
1429 | - | let refreshDLpActions = $ | |
1430 | - | let updatedDLp = $ | |
1429 | + | let $t04834448425 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1430 | + | let refreshDLpActions = $t04834448425._1 | |
1431 | + | let updatedDLp = $t04834448425._2 | |
1431 | 1432 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1432 | 1433 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1433 | 1434 | then (state ++ refreshDLpActions) | |
1473 | 1474 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1474 | 1475 | if ((unstakeInv == unstakeInv)) | |
1475 | 1476 | then { | |
1476 | - | let $ | |
1477 | - | let state = $ | |
1478 | - | let totalAmount = $ | |
1477 | + | let $t04935949547 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1478 | + | let state = $t04935949547._1 | |
1479 | + | let totalAmount = $t04935949547._2 | |
1479 | 1480 | $Tuple2(state, totalAmount) | |
1480 | 1481 | } | |
1481 | 1482 | else throw("Strict value is not equal to itself.") | |
1491 | 1492 | let amId = poolConfig[idxAmAsId] | |
1492 | 1493 | let prId = poolConfig[idxPrAsId] | |
1493 | 1494 | let lpId = poolConfig[idxLPAsId] | |
1494 | - | let $ | |
1495 | - | let lpAmount = $ | |
1496 | - | let state = $ | |
1497 | - | let feeAmount = $ | |
1498 | - | let bonus = $ | |
1495 | + | let $t04980649909 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1496 | + | let lpAmount = $t04980649909._1 | |
1497 | + | let state = $t04980649909._2 | |
1498 | + | let feeAmount = $t04980649909._3 | |
1499 | + | let bonus = $t04980649909._4 | |
1499 | 1500 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1500 | 1501 | } | |
1501 | 1502 | ||
1507 | 1508 | let amId = poolConfig[idxAmAsId] | |
1508 | 1509 | let prId = poolConfig[idxPrAsId] | |
1509 | 1510 | let lpId = poolConfig[idxLPAsId] | |
1510 | - | let $ | |
1511 | - | let lpAmount = $ | |
1512 | - | let state = $ | |
1513 | - | let feeAmount = $ | |
1514 | - | let bonus = $ | |
1511 | + | let $t05018850292 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1512 | + | let lpAmount = $t05018850292._1 | |
1513 | + | let state = $t05018850292._2 | |
1514 | + | let feeAmount = $t05018850292._3 | |
1515 | + | let bonus = $t05018850292._4 | |
1515 | 1516 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1516 | 1517 | } | |
1517 | 1518 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | 22 | let slippage4D = toBigInt((scale8 - ((scale8 * 1) / scale8))) | |
23 | 23 | ||
24 | 24 | let wavesString = "WAVES" | |
25 | 25 | ||
26 | 26 | let Amult = "100" | |
27 | 27 | ||
28 | 28 | let Dconv = "1" | |
29 | 29 | ||
30 | 30 | let SEP = "__" | |
31 | 31 | ||
32 | 32 | let EMPTY = "" | |
33 | 33 | ||
34 | 34 | let PoolActive = 1 | |
35 | 35 | ||
36 | 36 | let PoolPutDis = 2 | |
37 | 37 | ||
38 | 38 | let PoolMatcherDis = 3 | |
39 | 39 | ||
40 | 40 | let PoolShutdown = 4 | |
41 | 41 | ||
42 | 42 | let idxPoolAddress = 1 | |
43 | 43 | ||
44 | 44 | let idxPoolSt = 2 | |
45 | 45 | ||
46 | 46 | let idxLPAsId = 3 | |
47 | 47 | ||
48 | 48 | let idxAmAsId = 4 | |
49 | 49 | ||
50 | 50 | let idxPrAsId = 5 | |
51 | 51 | ||
52 | 52 | let idxAmtAsDcm = 6 | |
53 | 53 | ||
54 | 54 | let idxPriceAsDcm = 7 | |
55 | 55 | ||
56 | 56 | let idxIAmtAsId = 8 | |
57 | 57 | ||
58 | 58 | let idxIPriceAsId = 9 | |
59 | 59 | ||
60 | 60 | let idxFactStakCntr = 1 | |
61 | 61 | ||
62 | 62 | let idxFactoryRestCntr = 6 | |
63 | 63 | ||
64 | 64 | let idxFactSlippCntr = 7 | |
65 | 65 | ||
66 | 66 | let idxFactGwxRewCntr = 10 | |
67 | 67 | ||
68 | 68 | let feeDefault = fraction(10, scale8, 10000) | |
69 | 69 | ||
70 | 70 | func t1 (origVal,origScaleMult) = fraction(toBigInt(origVal), scale18, toBigInt(origScaleMult)) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func f1 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), scale18)) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func fromX18Round (val,resultScaleMult,round) = toInt(fraction(val, toBigInt(resultScaleMult), scale18, round)) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func ts (amt,resScale,curScale) = fraction(amt, resScale, curScale) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func abs (val) = if ((zeroBigInt > val)) | |
83 | 83 | then -(val) | |
84 | 84 | else val | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func absBigInt (val) = if ((zeroBigInt > val)) | |
88 | 88 | then -(val) | |
89 | 89 | else val | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func fc () = "%s__factoryContract" | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func mpk () = "%s__managerPublicKey" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func pmpk () = "%s__pendingManagerPublicKey" | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func pl () = "%s%s__price__last" | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func ph (h,t) = makeString(["%s%s%d%d__price__history", toString(h), toString(t)], SEP) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func pau (ua,txId) = ((("%s%s%s__P__" + ua) + "__") + txId) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func gau (ua,txId) = ((("%s%s%s__G__" + ua) + "__") + txId) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func aa () = "%s__amountAsset" | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func pa () = "%s__priceAsset" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func amp () = "%s__amp" | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func ada () = "%s__addonAddr" | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | let keyFee = "%s__fee" | |
126 | 126 | ||
127 | 127 | let fee = valueOrElse(getInteger(this, keyFee), feeDefault) | |
128 | 128 | ||
129 | 129 | let keyDLp = makeString(["%s", "dLp"], SEP) | |
130 | 130 | ||
131 | 131 | let keyDLpRefreshedHeight = makeString(["%s", "dLpRefreshedHeight"], SEP) | |
132 | 132 | ||
133 | 133 | let keyDLpRefreshDelay = makeString(["%s", "refreshDLpDelay"], SEP) | |
134 | 134 | ||
135 | 135 | let dLpRefreshDelayDefault = 1 | |
136 | 136 | ||
137 | 137 | let dLpRefreshDelay = valueOrElse(getInteger(this, keyDLpRefreshDelay), dLpRefreshDelayDefault) | |
138 | 138 | ||
139 | 139 | func fcfg () = "%s__factoryConfig" | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func mtpk () = "%s%s__matcher__publicKey" | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func pc (iAmtAs,iPrAs) = (((("%d%d%s__" + iAmtAs) + "__") + iPrAs) + "__config") | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func mba (bAStr) = ("%s%s%s__mappings__baseAsset2internalId__" + bAStr) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func aps () = "%s__shutdown" | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func keyAllowedLpStableScriptHash () = "%s__allowedLpStableScriptHash" | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func keyFeeCollectorAddress () = "%s__feeCollectorAddress" | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func toe (orV,sendrV,matchV) = throw(((((("Failed: ordValid=" + toString(orV)) + " sndrValid=") + toString(sendrV)) + " mtchrValid=") + toString(matchV))) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func str (val) = match val { | |
164 | 164 | case valStr: String => | |
165 | 165 | valStr | |
166 | 166 | case _ => | |
167 | 167 | throw("fail cast to String") | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func strf (addr,key) = valueOrErrorMessage(getString(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func intf (addr,key) = valueOrErrorMessage(getInteger(addr, key), makeString(["mandatory ", toString(addr), ".", key, " not defined"], "")) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func throwErr (msg) = throw(makeString(["lp_stable.ride:", msg], " ")) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func fmtErr (msg) = makeString(["lp_stable.ride:", msg], " ") | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | let fca = addressFromStringValue(strf(this, fc())) | |
184 | 184 | ||
185 | 185 | let A = strf(this, amp()) | |
186 | 186 | ||
187 | 187 | func igs () = valueOrElse(getBoolean(fca, aps()), false) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | func mp () = fromBase58String(strf(fca, mtpk())) | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | let feeCollectorAddress = addressFromStringValue(strf(fca, keyFeeCollectorAddress())) | |
194 | 194 | ||
195 | 195 | func gpc () = { | |
196 | 196 | let amtAs = strf(this, aa()) | |
197 | 197 | let priceAs = strf(this, pa()) | |
198 | 198 | let iPriceAs = intf(fca, mba(priceAs)) | |
199 | 199 | let iAmtAs = intf(fca, mba(amtAs)) | |
200 | 200 | split(strf(fca, pc(toString(iAmtAs), toString(iPriceAs))), SEP) | |
201 | 201 | } | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func parseAssetId (input) = if ((input == wavesString)) | |
205 | 205 | then unit | |
206 | 206 | else fromBase58String(input) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func assetIdToString (input) = if ((input == unit)) | |
210 | 210 | then wavesString | |
211 | 211 | else toBase58String(value(input)) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func parsePoolConfig (poolConfig) = $Tuple7(addressFromStringValue(poolConfig[idxPoolAddress]), parseIntValue(poolConfig[idxPoolSt]), fromBase58String(poolConfig[idxLPAsId]), parseAssetId(poolConfig[idxAmAsId]), parseAssetId(poolConfig[idxPrAsId]), parseIntValue(poolConfig[idxAmtAsDcm]), parseIntValue(poolConfig[idxPriceAsDcm])) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | let poolConfigParsed = parsePoolConfig(gpc()) | |
218 | 218 | ||
219 | 219 | let $t074067592 = poolConfigParsed | |
220 | 220 | ||
221 | 221 | let cfgPoolAddress = $t074067592._1 | |
222 | 222 | ||
223 | 223 | let cfgPoolStatus = $t074067592._2 | |
224 | 224 | ||
225 | 225 | let cfgLpAssetId = $t074067592._3 | |
226 | 226 | ||
227 | 227 | let cfgAmountAssetId = $t074067592._4 | |
228 | 228 | ||
229 | 229 | let cfgPriceAssetId = $t074067592._5 | |
230 | 230 | ||
231 | 231 | let cfgAmountAssetDecimals = $t074067592._6 | |
232 | 232 | ||
233 | 233 | let cfgPriceAssetDecimals = $t074067592._7 | |
234 | 234 | ||
235 | 235 | func gfc () = split(strf(fca, fcfg()), SEP) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | let factoryConfig = gfc() | |
239 | 239 | ||
240 | 240 | let stakingContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactStakCntr]), "Invalid staking contract address") | |
241 | 241 | ||
242 | 242 | let slipageContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactSlippCntr]), "Invalid slipage contract address") | |
243 | 243 | ||
244 | 244 | let gwxContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactGwxRewCntr]), "Invalid gwx contract address") | |
245 | 245 | ||
246 | 246 | let restContract = valueOrErrorMessage(addressFromString(factoryConfig[idxFactoryRestCntr]), "Invalid gwx contract address") | |
247 | 247 | ||
248 | 248 | func dataPutActionInfo (inAmtAssetAmt,inPriceAssetAmt,outLpAmt,price,slipByUser,slippageReal,txHeight,txTimestamp,slipageAmAmt,slipagePrAmt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(inAmtAssetAmt), toString(inPriceAssetAmt), toString(outLpAmt), toString(price), toString(slipByUser), toString(slippageReal), toString(txHeight), toString(txTimestamp), toString(slipageAmAmt), toString(slipagePrAmt)], SEP) | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func dataGetActionInfo (outAmtAssetAmt,outPriceAssetAmt,inLpAmt,price,txHeight,txTimestamp) = makeString(["%d%d%d%d%d%d", toString(outAmtAssetAmt), toString(outPriceAssetAmt), toString(inLpAmt), toString(price), toString(txHeight), toString(txTimestamp)], SEP) | |
252 | 252 | ||
253 | 253 | ||
254 | 254 | func getAccBalance (assetId) = if ((assetId == "WAVES")) | |
255 | 255 | then wavesBalance(this).available | |
256 | 256 | else assetBalance(this, fromBase58String(assetId)) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func cpbi (prAmtX18,amAmtX18) = fraction(prAmtX18, scale18, amAmtX18) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func vad (A1,A2,slippage) = { | |
263 | 263 | let diff = fraction((A1 - A2), scale8BigInt, A2) | |
264 | 264 | let pass = ((slippage - abs(diff)) > zeroBigInt) | |
265 | 265 | if (!(pass)) | |
266 | 266 | then throw(("Big slpg: " + toString(diff))) | |
267 | 267 | else $Tuple2(pass, min([A1, A2])) | |
268 | 268 | } | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func vd (D1,D0,slpg) = { | |
272 | 272 | let diff = fraction(D0, scale8BigInt, D1) | |
273 | 273 | let fail = (slpg > diff) | |
274 | 274 | if (if (fail) | |
275 | 275 | then true | |
276 | 276 | else (D0 > D1)) | |
277 | 277 | then throw(((((((toString(D0) + " ") + toString(D1)) + " ") + toString(diff)) + " ") + toString(slpg))) | |
278 | 278 | else fail | |
279 | 279 | } | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func pcp (amAssetDcm,prAssetDcm,amAmt,prAmt) = { | |
283 | 283 | let amtAsAmtX18 = t1(amAmt, amAssetDcm) | |
284 | 284 | let prAsAmtX18 = t1(prAmt, prAssetDcm) | |
285 | 285 | cpbi(prAsAmtX18, amtAsAmtX18) | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func calcPrices (amAmt,prAmt,lpAmt) = { | |
290 | 290 | let cfg = gpc() | |
291 | 291 | let amtAsDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
292 | 292 | let prAsDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
293 | 293 | let priceX18 = pcp(amtAsDcm, prAsDcm, amAmt, prAmt) | |
294 | 294 | let amAmtX18 = t1(amAmt, amtAsDcm) | |
295 | 295 | let prAmtX18 = t1(prAmt, prAsDcm) | |
296 | 296 | let lpAmtX18 = t1(lpAmt, scale8) | |
297 | 297 | let lpPrInAmAsX18 = cpbi(amAmtX18, lpAmtX18) | |
298 | 298 | let lpPrInPrAsX18 = cpbi(prAmtX18, lpAmtX18) | |
299 | 299 | [priceX18, lpPrInAmAsX18, lpPrInPrAsX18] | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | func calculatePrices (amAmt,prAmt,lpAmt) = { | |
304 | 304 | let p = calcPrices(amAmt, prAmt, lpAmt) | |
305 | 305 | [f1(p[0], scale8), f1(p[1], scale8), f1(p[2], scale8)] | |
306 | 306 | } | |
307 | 307 | ||
308 | 308 | ||
309 | 309 | func takeFee (amount) = { | |
310 | 310 | let feeAmount = fraction(amount, fee, scale8) | |
311 | 311 | $Tuple2((amount - feeAmount), feeAmount) | |
312 | 312 | } | |
313 | 313 | ||
314 | 314 | ||
315 | 315 | func ego (txId58,pmtAssetId,pmtLpAmt,userAddress) = { | |
316 | 316 | let cfg = gpc() | |
317 | 317 | let lpId = cfg[idxLPAsId] | |
318 | 318 | let amId = cfg[idxAmAsId] | |
319 | 319 | let prId = cfg[idxPrAsId] | |
320 | 320 | let amDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
321 | 321 | let prDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
322 | 322 | let sts = cfg[idxPoolSt] | |
323 | 323 | let lpEmiss = valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "Wrong LP id").quantity | |
324 | 324 | if ((lpId != pmtAssetId)) | |
325 | 325 | then throw("Wrong pmt asset") | |
326 | 326 | else { | |
327 | 327 | let amBalance = getAccBalance(amId) | |
328 | 328 | let amBalanceX18 = t1(amBalance, amDcm) | |
329 | 329 | let prBalance = getAccBalance(prId) | |
330 | 330 | let prBalanceX18 = t1(prBalance, prDcm) | |
331 | 331 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
332 | 332 | let curPrice = f1(curPriceX18, scale8) | |
333 | 333 | let pmtLpAmtX18 = t1(pmtLpAmt, scale8) | |
334 | 334 | let lpEmissX18 = t1(lpEmiss, scale8) | |
335 | 335 | let outAmAmtX18 = fraction(amBalanceX18, pmtLpAmtX18, lpEmissX18) | |
336 | 336 | let outPrAmtX18 = fraction(prBalanceX18, pmtLpAmtX18, lpEmissX18) | |
337 | 337 | let outAmAmt = fromX18Round(outAmAmtX18, amDcm, FLOOR) | |
338 | 338 | let outPrAmt = fromX18Round(outPrAmtX18, prDcm, FLOOR) | |
339 | 339 | let state = if ((txId58 == "")) | |
340 | 340 | then nil | |
341 | 341 | else [ScriptTransfer(userAddress, outAmAmt, if ((amId == "WAVES")) | |
342 | 342 | then unit | |
343 | 343 | else fromBase58String(amId)), ScriptTransfer(userAddress, outPrAmt, if ((prId == "WAVES")) | |
344 | 344 | then unit | |
345 | 345 | else fromBase58String(prId)), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAmAmt, outPrAmt, pmtLpAmt, curPrice, height, lastBlock.timestamp)), IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice)] | |
346 | 346 | $Tuple10(outAmAmt, outPrAmt, amId, prId, amBalance, prBalance, lpEmiss, curPriceX18, sts, state) | |
347 | 347 | } | |
348 | 348 | } | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | func epo (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,userAddress,isEval,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
352 | 352 | let cfg = gpc() | |
353 | 353 | let lpId = fromBase58String(cfg[idxLPAsId]) | |
354 | 354 | let amIdStr = cfg[idxAmAsId] | |
355 | 355 | let prIdStr = cfg[idxPrAsId] | |
356 | 356 | let inAmIdStr = cfg[idxIAmtAsId] | |
357 | 357 | let inPrIdStr = cfg[idxIPriceAsId] | |
358 | 358 | let amtDcm = parseIntValue(cfg[idxAmtAsDcm]) | |
359 | 359 | let priceDcm = parseIntValue(cfg[idxPriceAsDcm]) | |
360 | 360 | let sts = cfg[idxPoolSt] | |
361 | 361 | let lpEm = valueOrErrorMessage(assetInfo(lpId), "Wr lp as").quantity | |
362 | 362 | let amBalance = if (isEval) | |
363 | 363 | then getAccBalance(amIdStr) | |
364 | 364 | else if (if (isOneAsset) | |
365 | 365 | then (pmtId == amIdStr) | |
366 | 366 | else false) | |
367 | 367 | then (getAccBalance(amIdStr) - pmtAmt) | |
368 | 368 | else if (isOneAsset) | |
369 | 369 | then getAccBalance(amIdStr) | |
370 | 370 | else (getAccBalance(amIdStr) - inAmAmt) | |
371 | 371 | let prBalance = if (isEval) | |
372 | 372 | then getAccBalance(prIdStr) | |
373 | 373 | else if (if (isOneAsset) | |
374 | 374 | then (pmtId == prIdStr) | |
375 | 375 | else false) | |
376 | 376 | then (getAccBalance(prIdStr) - pmtAmt) | |
377 | 377 | else if (isOneAsset) | |
378 | 378 | then getAccBalance(prIdStr) | |
379 | 379 | else (getAccBalance(prIdStr) - inPrAmt) | |
380 | 380 | let inAmAssetAmtX18 = t1(inAmAmt, amtDcm) | |
381 | 381 | let inPrAssetAmtX18 = t1(inPrAmt, priceDcm) | |
382 | 382 | let userPriceX18 = cpbi(inPrAssetAmtX18, inAmAssetAmtX18) | |
383 | 383 | let amBalanceX18 = t1(amBalance, amtDcm) | |
384 | 384 | let prBalanceX18 = t1(prBalance, priceDcm) | |
385 | 385 | let r = if ((lpEm == 0)) | |
386 | 386 | then { | |
387 | 387 | let curPriceX18 = zeroBigInt | |
388 | 388 | let slippageX18 = zeroBigInt | |
389 | 389 | let lpAmtX18 = pow((inAmAssetAmtX18 * inPrAssetAmtX18), 0, toBigInt(5), 1, 0, DOWN) | |
390 | 390 | $Tuple5(f1(lpAmtX18, scale8), f1(inAmAssetAmtX18, amtDcm), f1(inPrAssetAmtX18, priceDcm), cpbi((prBalanceX18 + inPrAssetAmtX18), (amBalanceX18 + inAmAssetAmtX18)), slippageX18) | |
391 | 391 | } | |
392 | 392 | else { | |
393 | 393 | let curPriceX18 = cpbi(prBalanceX18, amBalanceX18) | |
394 | 394 | let slippageRealX18 = fraction(abs((curPriceX18 - userPriceX18)), scale18, curPriceX18) | |
395 | 395 | let slippageX18 = t1(slippage, scale8) | |
396 | 396 | if (if (if (validateSlippage) | |
397 | 397 | then (curPriceX18 != zeroBigInt) | |
398 | 398 | else false) | |
399 | 399 | then (slippageRealX18 > slippageX18) | |
400 | 400 | else false) | |
401 | 401 | then throw(((("Price slippage " + toString(slippageRealX18)) + " > ") + toString(slippageX18))) | |
402 | 402 | else { | |
403 | 403 | let lpEmissionX18 = t1(lpEm, scale8) | |
404 | 404 | let prViaAmX18 = fraction(inAmAssetAmtX18, curPriceX18, scale18) | |
405 | 405 | let amViaPrX18 = fraction(inPrAssetAmtX18, scale18, curPriceX18) | |
406 | 406 | let expectedAmts = if ((prViaAmX18 > inPrAssetAmtX18)) | |
407 | 407 | then $Tuple2(amViaPrX18, inPrAssetAmtX18) | |
408 | 408 | else $Tuple2(inAmAssetAmtX18, prViaAmX18) | |
409 | 409 | let expAmtAssetAmtX18 = expectedAmts._1 | |
410 | 410 | let expPriceAssetAmtX18 = expectedAmts._2 | |
411 | 411 | let lpAmtX18 = fraction(lpEmissionX18, expPriceAssetAmtX18, prBalanceX18) | |
412 | 412 | $Tuple5(fromX18Round(lpAmtX18, scale8, FLOOR), fromX18Round(expAmtAssetAmtX18, amtDcm, CEILING), fromX18Round(expPriceAssetAmtX18, priceDcm, CEILING), curPriceX18, slippageX18) | |
413 | 413 | } | |
414 | 414 | } | |
415 | 415 | let calcLpAmt = r._1 | |
416 | 416 | let calcAmAssetPmt = r._2 | |
417 | 417 | let calcPrAssetPmt = r._3 | |
418 | 418 | let curPrice = f1(r._4, scale8) | |
419 | 419 | let slippageCalc = f1(r._5, scale8) | |
420 | 420 | if ((0 >= calcLpAmt)) | |
421 | 421 | then throw("LP <= 0") | |
422 | 422 | else { | |
423 | 423 | let emitLpAmt = if (!(emitLp)) | |
424 | 424 | then 0 | |
425 | 425 | else calcLpAmt | |
426 | 426 | let amDiff = (inAmAmt - calcAmAssetPmt) | |
427 | 427 | let prDiff = (inPrAmt - calcPrAssetPmt) | |
428 | 428 | let $t01811218457 = if (if (isOneAsset) | |
429 | 429 | then (pmtId == amIdStr) | |
430 | 430 | else false) | |
431 | 431 | then $Tuple2(pmtAmt, 0) | |
432 | 432 | else if (if (isOneAsset) | |
433 | 433 | then (pmtId == prIdStr) | |
434 | 434 | else false) | |
435 | 435 | then $Tuple2(0, pmtAmt) | |
436 | 436 | else $Tuple2(calcAmAssetPmt, calcPrAssetPmt) | |
437 | 437 | let writeAmAmt = $t01811218457._1 | |
438 | 438 | let writePrAmt = $t01811218457._2 | |
439 | 439 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId58), dataPutActionInfo(writeAmAmt, writePrAmt, emitLpAmt, curPrice, slippage, slippageCalc, height, lastBlock.timestamp, amDiff, prDiff))] | |
440 | 440 | $Tuple13(calcLpAmt, emitLpAmt, curPrice, amBalance, prBalance, lpEm, lpId, sts, commonState, amDiff, prDiff, inAmId, inPrId) | |
441 | 441 | } | |
442 | 442 | } | |
443 | 443 | ||
444 | 444 | ||
445 | 445 | func getD (xp) = { | |
446 | 446 | let xp0 = xp[0] | |
447 | 447 | let xp1 = xp[1] | |
448 | 448 | let s = (xp0 + xp1) | |
449 | 449 | if ((s == big0)) | |
450 | 450 | then big0 | |
451 | 451 | else { | |
452 | 452 | let a = parseIntValue(A) | |
453 | 453 | let ann = (a * 2) | |
454 | 454 | let p = fraction(xp0, xp1, big1) | |
455 | 455 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
456 | 456 | let ann_s = fraction(toBigInt(ann), s, big1) | |
457 | 457 | let ann_1 = toBigInt((ann - 1)) | |
458 | 458 | func calcDNext (d) = { | |
459 | 459 | let dd = fraction(d, d, big1) | |
460 | 460 | let ddd = fraction(dd, d, big1) | |
461 | 461 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
462 | 462 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)), CEILING) | |
463 | 463 | } | |
464 | 464 | ||
465 | 465 | func calc (acc,i) = if (acc._2) | |
466 | 466 | then acc | |
467 | 467 | else { | |
468 | 468 | let d = acc._1 | |
469 | 469 | let dNext = calcDNext(d) | |
470 | 470 | let dDiffRaw = toInt((dNext - value(d))) | |
471 | 471 | let dDiff = if ((0 > dDiffRaw)) | |
472 | 472 | then -(dDiffRaw) | |
473 | 473 | else dDiffRaw | |
474 | 474 | if ((1 >= dDiff)) | |
475 | 475 | then $Tuple2(dNext, true) | |
476 | 476 | else $Tuple2(dNext, false) | |
477 | 477 | } | |
478 | 478 | ||
479 | 479 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
480 | 480 | let $t02038520433 = { | |
481 | 481 | let $l = arr | |
482 | 482 | let $s = size($l) | |
483 | 483 | let $acc0 = $Tuple2(s, false) | |
484 | 484 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
485 | 485 | then $a | |
486 | 486 | else calc($a, $l[$i]) | |
487 | 487 | ||
488 | 488 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
489 | 489 | then $a | |
490 | 490 | else throw("List size exceeds 15") | |
491 | 491 | ||
492 | 492 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
493 | 493 | } | |
494 | 494 | let d = $t02038520433._1 | |
495 | 495 | let found = $t02038520433._2 | |
496 | 496 | if (found) | |
497 | 497 | then d | |
498 | 498 | else throw(("D calculation error, D = " + toString(d))) | |
499 | 499 | } | |
500 | 500 | } | |
501 | 501 | ||
502 | 502 | ||
503 | 503 | func getDOld (xp) = { | |
504 | 504 | let n = big2 | |
505 | 505 | let xp0 = xp[0] | |
506 | 506 | let xp1 = xp[1] | |
507 | 507 | let aPrecision = parseBigIntValue(Amult) | |
508 | 508 | let a = (parseBigIntValue(A) * aPrecision) | |
509 | 509 | let s = (xp0 + xp1) | |
510 | 510 | if ((s == big0)) | |
511 | 511 | then big0 | |
512 | 512 | else { | |
513 | 513 | let ann = (a * n) | |
514 | 514 | let xp0_xp1_n_n = (((xp0 * xp1) * n) * n) | |
515 | 515 | let ann_s_aPrecision = ((ann * s) / aPrecision) | |
516 | 516 | let ann_aPrecision = (ann - aPrecision) | |
517 | 517 | let n1 = (n + big1) | |
518 | 518 | func calc (acc,cur) = { | |
519 | 519 | let $t02106221082 = acc | |
520 | 520 | let d = $t02106221082._1 | |
521 | 521 | let found = $t02106221082._2 | |
522 | 522 | if ((found != unit)) | |
523 | 523 | then acc | |
524 | 524 | else { | |
525 | 525 | let dp = (((d * d) * d) / xp0_xp1_n_n) | |
526 | 526 | let dNext = (((ann_s_aPrecision + (dp * n)) * d) / (((ann_aPrecision * d) / aPrecision) + (n1 * dp))) | |
527 | 527 | let dDiff = absBigInt((dNext - value(d))) | |
528 | 528 | if ((big1 >= dDiff)) | |
529 | 529 | then $Tuple2(dNext, cur) | |
530 | 530 | else $Tuple2(dNext, unit) | |
531 | 531 | } | |
532 | 532 | } | |
533 | 533 | ||
534 | 534 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
535 | 535 | let $t02150321550 = { | |
536 | 536 | let $l = arr | |
537 | 537 | let $s = size($l) | |
538 | 538 | let $acc0 = $Tuple2(s, unit) | |
539 | 539 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
540 | 540 | then $a | |
541 | 541 | else calc($a, $l[$i]) | |
542 | 542 | ||
543 | 543 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
544 | 544 | then $a | |
545 | 545 | else throw("List size exceeds 15") | |
546 | 546 | ||
547 | 547 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
548 | 548 | } | |
549 | 549 | let d = $t02150321550._1 | |
550 | 550 | let found = $t02150321550._2 | |
551 | 551 | if ((found != unit)) | |
552 | 552 | then d | |
553 | 553 | else throw(("D calculation error, D = " + toString(d))) | |
554 | 554 | } | |
555 | 555 | } | |
556 | 556 | ||
557 | 557 | ||
558 | 558 | func getYD (xp,i,D) = { | |
559 | 559 | let n = big2 | |
560 | 560 | let x = xp[if ((i == 0)) | |
561 | 561 | then 1 | |
562 | 562 | else 0] | |
563 | 563 | let aPrecision = parseBigIntValue(Amult) | |
564 | 564 | let a = (parseBigIntValue(A) * aPrecision) | |
565 | 565 | let s = x | |
566 | 566 | let ann = (a * n) | |
567 | 567 | let c = (((((D * D) / (x * n)) * D) * aPrecision) / (ann * n)) | |
568 | 568 | let b = ((s + ((D * aPrecision) / ann)) - D) | |
569 | 569 | func calc (acc,cur) = { | |
570 | 570 | let $t02205022070 = acc | |
571 | 571 | let y = $t02205022070._1 | |
572 | 572 | let found = $t02205022070._2 | |
573 | 573 | if ((found != unit)) | |
574 | 574 | then acc | |
575 | 575 | else { | |
576 | 576 | let yNext = (((y * y) + c) / ((big2 * y) + b)) | |
577 | 577 | let yDiff = absBigInt((yNext - value(y))) | |
578 | 578 | if ((big1 >= yDiff)) | |
579 | 579 | then $Tuple2(yNext, cur) | |
580 | 580 | else $Tuple2(yNext, unit) | |
581 | 581 | } | |
582 | 582 | } | |
583 | 583 | ||
584 | 584 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
585 | 585 | let $t02237722424 = { | |
586 | 586 | let $l = arr | |
587 | 587 | let $s = size($l) | |
588 | 588 | let $acc0 = $Tuple2(D, unit) | |
589 | 589 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
590 | 590 | then $a | |
591 | 591 | else calc($a, $l[$i]) | |
592 | 592 | ||
593 | 593 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
594 | 594 | then $a | |
595 | 595 | else throw("List size exceeds 15") | |
596 | 596 | ||
597 | 597 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
598 | 598 | } | |
599 | 599 | let y = $t02237722424._1 | |
600 | 600 | let found = $t02237722424._2 | |
601 | 601 | if ((found != unit)) | |
602 | 602 | then y | |
603 | 603 | else throw(("Y calculation error, Y = " + toString(y))) | |
604 | 604 | } | |
605 | 605 | ||
606 | 606 | ||
607 | 607 | func calcDLp (amountBalance,priceBalance,lpEmission) = { | |
608 | 608 | let updatedDLp = fraction(getD([amountBalance, priceBalance]), scale18, lpEmission) | |
609 | 609 | if ((lpEmission == big0)) | |
610 | 610 | then big0 | |
611 | 611 | else updatedDLp | |
612 | 612 | } | |
613 | 613 | ||
614 | 614 | ||
615 | 615 | func calcCurrentDLp (amountAssetDelta,priceAssetDelta,lpAssetEmissionDelta) = { | |
616 | 616 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amountAssetDelta) | |
617 | 617 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - priceAssetDelta) | |
618 | 618 | let lpAssetEmission = (toBigInt(value(assetInfo(cfgLpAssetId)).quantity) - lpAssetEmissionDelta) | |
619 | 619 | let currentDLp = calcDLp(amountAssetBalance, priceAssetBalance, lpAssetEmission) | |
620 | 620 | currentDLp | |
621 | 621 | } | |
622 | 622 | ||
623 | 623 | ||
624 | 624 | func refreshDLpInternal (amountAssetBalanceDelta,priceAssetBalanceDelta,lpAssetEmissionDelta) = { | |
625 | 625 | let amountAssetBalance = (getAccBalance(assetIdToString(cfgAmountAssetId)) + amountAssetBalanceDelta) | |
626 | 626 | let priceAssetBalance = (getAccBalance(assetIdToString(cfgPriceAssetId)) + priceAssetBalanceDelta) | |
627 | 627 | let lpAssetEmission = (value(assetInfo(cfgLpAssetId)).quantity + lpAssetEmissionDelta) | |
628 | 628 | let updatedDLp = calcDLp(toBigInt(amountAssetBalance), toBigInt(priceAssetBalance), toBigInt(lpAssetEmission)) | |
629 | 629 | let actions = [IntegerEntry(keyDLpRefreshedHeight, height), StringEntry(keyDLp, toString(updatedDLp))] | |
630 | 630 | $Tuple2(actions, updatedDLp) | |
631 | 631 | } | |
632 | 632 | ||
633 | 633 | ||
634 | 634 | func validateUpdatedDLp (oldDLp,updatedDLp) = if ((updatedDLp >= oldDLp)) | |
635 | 635 | then true | |
636 | 636 | else throwErr("updated DLp lower than current DLp") | |
637 | 637 | ||
638 | 638 | ||
639 | 639 | func validateMatcherOrderAllowed (order) = { | |
640 | 640 | let amountAssetAmount = order.amount | |
641 | 641 | let priceAssetAmount = fraction(order.amount, order.price, scale8, FLOOR) | |
642 | 642 | let $t02436324575 = if ((order.orderType == Buy)) | |
643 | 643 | then $Tuple2(amountAssetAmount, -(priceAssetAmount)) | |
644 | 644 | else $Tuple2(-(amountAssetAmount), priceAssetAmount) | |
645 | 645 | let amountAssetBalanceDelta = $t02436324575._1 | |
646 | 646 | let priceAssetBalanceDelta = $t02436324575._2 | |
647 | 647 | if (if (if (igs()) | |
648 | 648 | then true | |
649 | 649 | else (cfgPoolStatus == PoolMatcherDis)) | |
650 | 650 | then true | |
651 | 651 | else (cfgPoolStatus == PoolShutdown)) | |
652 | 652 | then throw("Admin blocked") | |
653 | 653 | else if (if ((order.assetPair.amountAsset != cfgAmountAssetId)) | |
654 | 654 | then true | |
655 | 655 | else (order.assetPair.priceAsset != cfgPriceAssetId)) | |
656 | 656 | then throw("Wr assets") | |
657 | 657 | else { | |
658 | 658 | let dLp = parseBigIntValue(getStringValue(this, keyDLp)) | |
659 | 659 | let $t02490525005 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
660 | 660 | let unusedActions = $t02490525005._1 | |
661 | 661 | let dLpNew = $t02490525005._2 | |
662 | 662 | let isOrderValid = (dLpNew >= dLp) | |
663 | 663 | isOrderValid | |
664 | 664 | } | |
665 | 665 | } | |
666 | 666 | ||
667 | 667 | ||
668 | 668 | func cg (i) = if ((size(i.payments) != 1)) | |
669 | 669 | then throw("1 pmnt exp") | |
670 | 670 | else { | |
671 | 671 | let pmt = value(i.payments[0]) | |
672 | 672 | let pmtAssetId = value(pmt.assetId) | |
673 | 673 | let pmtAmt = pmt.amount | |
674 | 674 | let r = ego(toBase58String(i.transactionId), toBase58String(pmtAssetId), pmtAmt, i.caller) | |
675 | 675 | let outAmAmt = r._1 | |
676 | 676 | let outPrAmt = r._2 | |
677 | 677 | let sts = parseIntValue(r._9) | |
678 | 678 | let state = r._10 | |
679 | 679 | if (if (igs()) | |
680 | 680 | then true | |
681 | 681 | else (sts == PoolShutdown)) | |
682 | 682 | then throw(("Admin blocked: " + toString(sts))) | |
683 | 683 | else $Tuple5(outAmAmt, outPrAmt, pmtAmt, pmtAssetId, state) | |
684 | 684 | } | |
685 | 685 | ||
686 | 686 | ||
687 | 687 | func cp (caller,txId,amAsPmt,prAsPmt,slippage,emitLp,isOneAsset,validateSlippage,pmtAmt,pmtId) = { | |
688 | 688 | let r = epo(txId, slippage, value(amAsPmt).amount, value(amAsPmt).assetId, value(prAsPmt).amount, value(prAsPmt).assetId, caller, (txId == ""), emitLp, isOneAsset, validateSlippage, pmtAmt, pmtId) | |
689 | 689 | let sts = parseIntValue(r._8) | |
690 | 690 | if (if (if (igs()) | |
691 | 691 | then true | |
692 | 692 | else (sts == PoolPutDis)) | |
693 | 693 | then true | |
694 | 694 | else (sts == PoolShutdown)) | |
695 | 695 | then throw(("Blocked:" + toString(sts))) | |
696 | 696 | else r | |
697 | 697 | } | |
698 | 698 | ||
699 | 699 | ||
700 | 700 | func calcPutOneTkn (pmtAmtRaw,pmtAssetId,userAddress,txId,withTakeFee) = { | |
701 | 701 | let poolConfig = gpc() | |
702 | 702 | let amId = poolConfig[idxAmAsId] | |
703 | 703 | let prId = poolConfig[idxPrAsId] | |
704 | 704 | let lpId = poolConfig[idxLPAsId] | |
705 | 705 | let amtDcm = parseIntValue(poolConfig[idxAmtAsDcm]) | |
706 | 706 | let priceDcm = parseIntValue(poolConfig[idxPriceAsDcm]) | |
707 | 707 | let lpAssetEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
708 | 708 | let chechEmission = if ((lpAssetEmission > big0)) | |
709 | 709 | then true | |
710 | 710 | else throw("initial deposit requires all coins") | |
711 | 711 | if ((chechEmission == chechEmission)) | |
712 | 712 | then { | |
713 | 713 | let amBalance = getAccBalance(amId) | |
714 | 714 | let prBalance = getAccBalance(prId) | |
715 | 715 | let $t02732227784 = if ((txId == "")) | |
716 | 716 | then $Tuple2(amBalance, prBalance) | |
717 | 717 | else if ((pmtAssetId == amId)) | |
718 | 718 | then if ((pmtAmtRaw > amBalance)) | |
719 | 719 | then throw("invalid payment amount") | |
720 | 720 | else $Tuple2((amBalance - pmtAmtRaw), prBalance) | |
721 | 721 | else if ((pmtAssetId == prId)) | |
722 | 722 | then if ((pmtAmtRaw > prBalance)) | |
723 | 723 | then throw("invalid payment amount") | |
724 | 724 | else $Tuple2(amBalance, (prBalance - pmtAmtRaw)) | |
725 | 725 | else throw("wrong pmtAssetId") | |
726 | 726 | let amBalanceOld = $t02732227784._1 | |
727 | 727 | let prBalanceOld = $t02732227784._2 | |
728 | 728 | let $t02779027966 = if ((pmtAssetId == amId)) | |
729 | 729 | then $Tuple2(pmtAmtRaw, 0) | |
730 | 730 | else if ((pmtAssetId == prId)) | |
731 | 731 | then $Tuple2(0, pmtAmtRaw) | |
732 | 732 | else throw("invalid payment") | |
733 | 733 | let amAmountRaw = $t02779027966._1 | |
734 | 734 | let prAmountRaw = $t02779027966._2 | |
735 | 735 | let $t02797028209 = if (withTakeFee) | |
736 | 736 | then $Tuple3(takeFee(amAmountRaw)._1, takeFee(prAmountRaw)._1, takeFee(pmtAmtRaw)._2) | |
737 | 737 | else $Tuple3(amAmountRaw, prAmountRaw, 0) | |
738 | 738 | let amAmount = $t02797028209._1 | |
739 | 739 | let prAmount = $t02797028209._2 | |
740 | 740 | let feeAmount = $t02797028209._3 | |
741 | 741 | let amBalanceNew = (amBalanceOld + amAmount) | |
742 | 742 | let prBalanceNew = (prBalanceOld + prAmount) | |
743 | 743 | let D0 = getD([toBigInt(amBalanceOld), toBigInt(prBalanceOld)]) | |
744 | 744 | let D1 = getD([toBigInt(amBalanceNew), toBigInt(prBalanceNew)]) | |
745 | 745 | let checkD = if ((D1 > D0)) | |
746 | 746 | then true | |
747 | 747 | else throw() | |
748 | 748 | if ((checkD == checkD)) | |
749 | 749 | then { | |
750 | 750 | let lpAmount = fraction(lpAssetEmission, (D1 - D0), D0, FLOOR) | |
751 | 751 | let curPrice = f1(cpbi(t1(prBalanceNew, priceDcm), t1(amBalanceNew, amtDcm)), scale8) | |
752 | 752 | let commonState = [IntegerEntry(pl(), curPrice), IntegerEntry(ph(height, lastBlock.timestamp), curPrice), StringEntry(pau(userAddress, txId), dataPutActionInfo(amAmountRaw, prAmountRaw, toInt(lpAmount), curPrice, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
753 | 753 | let poolProportion = fraction(prBalanceOld, scale8, amBalanceOld) | |
754 | 754 | let amountAssetPart = fraction(pmtAmtRaw, scale8, (poolProportion + scale8)) | |
755 | 755 | let priceAssetPart = (pmtAmtRaw - amountAssetPart) | |
756 | 756 | let lpAmtBoth = fraction(lpAssetEmission, toBigInt(priceAssetPart), toBigInt(prBalanceOld)) | |
757 | 757 | let bonus = toInt(fraction((lpAmount - lpAmtBoth), scale8BigInt, lpAmtBoth)) | |
758 | 758 | $Tuple4(toInt(lpAmount), commonState, feeAmount, bonus) | |
759 | 759 | } | |
760 | 760 | else throw("Strict value is not equal to itself.") | |
761 | 761 | } | |
762 | 762 | else throw("Strict value is not equal to itself.") | |
763 | 763 | } | |
764 | 764 | ||
765 | 765 | ||
766 | 766 | func getOneTknV2Internal (outAssetId,minOutAmount,payments,caller,originCaller,transactionId) = { | |
767 | 767 | let poolConfig = gpc() | |
768 | 768 | let lpId = poolConfig[idxLPAsId] | |
769 | 769 | let amId = poolConfig[idxAmAsId] | |
770 | 770 | let prId = poolConfig[idxPrAsId] | |
771 | 771 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
772 | 772 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
773 | 773 | let poolStatus = poolConfig[idxPoolSt] | |
774 | 774 | let userAddress = if ((caller == restContract)) | |
775 | 775 | then originCaller | |
776 | 776 | else caller | |
777 | 777 | let pmt = value(payments[0]) | |
778 | 778 | let pmtAssetId = value(pmt.assetId) | |
779 | 779 | let pmtAmt = pmt.amount | |
780 | 780 | let currentDLp = calcCurrentDLp(big0, big0, big0) | |
781 | 781 | if ((currentDLp == currentDLp)) | |
782 | 782 | then { | |
783 | 783 | let txId58 = toBase58String(transactionId) | |
784 | 784 | if ((lpId != toBase58String(pmtAssetId))) | |
785 | 785 | then throw("Wrong LP") | |
786 | 786 | else { | |
787 | 787 | let amBalance = getAccBalance(amId) | |
788 | 788 | let prBalance = getAccBalance(prId) | |
789 | 789 | let $t03027430385 = { | |
790 | 790 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, pmtAmt], nil) | |
791 | 791 | if ($isInstanceOf(@, "(Int, Int)")) | |
792 | 792 | then @ | |
793 | 793 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
794 | 794 | } | |
795 | 795 | if (($t03027430385 == $t03027430385)) | |
796 | 796 | then { | |
797 | 797 | let feeAmount = $t03027430385._2 | |
798 | 798 | let totalGet = $t03027430385._1 | |
799 | 799 | let totalAmount = if (if ((minOutAmount > 0)) | |
800 | 800 | then (minOutAmount > totalGet) | |
801 | 801 | else false) | |
802 | 802 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
803 | 803 | else totalGet | |
804 | 804 | let $t03057530882 = if ((outAssetId == amId)) | |
805 | 805 | then $Tuple4(totalAmount, 0, ((amBalance - totalAmount) - feeAmount), prBalance) | |
806 | 806 | else if ((outAssetId == prId)) | |
807 | 807 | then $Tuple4(0, totalAmount, amBalance, ((prBalance - totalAmount) - feeAmount)) | |
808 | 808 | else throw("invalid out asset id") | |
809 | 809 | let outAm = $t03057530882._1 | |
810 | 810 | let outPr = $t03057530882._2 | |
811 | 811 | let amBalanceNew = $t03057530882._3 | |
812 | 812 | let prBalanceNew = $t03057530882._4 | |
813 | 813 | let curPrX18 = cpbi(t1(prBalanceNew, prDecimals), t1(amBalanceNew, amDecimals)) | |
814 | 814 | let curPr = f1(curPrX18, scale8) | |
815 | 815 | let outAssetIdOrWaves = if ((outAssetId == "WAVES")) | |
816 | 816 | then unit | |
817 | 817 | else fromBase58String(outAssetId) | |
818 | 818 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
819 | 819 | then [ScriptTransfer(feeCollectorAddress, feeAmount, outAssetIdOrWaves)] | |
820 | 820 | else nil | |
821 | 821 | let state = ([ScriptTransfer(userAddress, totalAmount, outAssetIdOrWaves), StringEntry(gau(toString(userAddress), txId58), dataGetActionInfo(outAm, outPr, pmtAmt, curPr, height, lastBlock.timestamp)), IntegerEntry(pl(), curPr), IntegerEntry(ph(height, lastBlock.timestamp), curPr)] ++ sendFeeToMatcher) | |
822 | 822 | if ((state == state)) | |
823 | 823 | then { | |
824 | 824 | let burn = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
825 | 825 | if ((burn == burn)) | |
826 | 826 | then { | |
827 | 827 | let $t03166732017 = { | |
828 | 828 | let feeAmountForCalc = if ((this == feeCollectorAddress)) | |
829 | 829 | then 0 | |
830 | 830 | else feeAmount | |
831 | 831 | let outInAmountAsset = if ((parseAssetId(outAssetId) == cfgAmountAssetId)) | |
832 | 832 | then true | |
833 | 833 | else false | |
834 | 834 | if (outInAmountAsset) | |
835 | 835 | then $Tuple2(-((totalGet + feeAmountForCalc)), 0) | |
836 | 836 | else $Tuple2(0, -((totalGet + feeAmountForCalc))) | |
837 | 837 | } | |
838 | 838 | let amountAssetBalanceDelta = $t03166732017._1 | |
839 | 839 | let priceAssetBalanceDelta = $t03166732017._2 | |
840 | 840 | let $t03202032128 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
841 | 841 | let refreshDLpActions = $t03202032128._1 | |
842 | 842 | let updatedDLp = $t03202032128._2 | |
843 | 843 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
844 | 844 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
845 | 845 | then $Tuple2((state ++ refreshDLpActions), totalAmount) | |
846 | 846 | else throw("Strict value is not equal to itself.") | |
847 | 847 | } | |
848 | 848 | else throw("Strict value is not equal to itself.") | |
849 | 849 | } | |
850 | 850 | else throw("Strict value is not equal to itself.") | |
851 | 851 | } | |
852 | 852 | else throw("Strict value is not equal to itself.") | |
853 | 853 | } | |
854 | 854 | } | |
855 | 855 | else throw("Strict value is not equal to itself.") | |
856 | 856 | } | |
857 | 857 | ||
858 | 858 | ||
859 | 859 | func m () = match getString(mpk()) { | |
860 | 860 | case s: String => | |
861 | 861 | fromBase58String(s) | |
862 | 862 | case _: Unit => | |
863 | 863 | unit | |
864 | 864 | case _ => | |
865 | 865 | throw("Match error") | |
866 | 866 | } | |
867 | 867 | ||
868 | 868 | ||
869 | 869 | func pm () = match getString(pmpk()) { | |
870 | 870 | case s: String => | |
871 | 871 | fromBase58String(s) | |
872 | 872 | case _: Unit => | |
873 | 873 | unit | |
874 | 874 | case _ => | |
875 | 875 | throw("Match error") | |
876 | 876 | } | |
877 | 877 | ||
878 | 878 | ||
879 | 879 | let pd = throw("Permission denied") | |
880 | 880 | ||
881 | 881 | func isManager (i) = match m() { | |
882 | 882 | case pk: ByteVector => | |
883 | 883 | (i.callerPublicKey == pk) | |
884 | 884 | case _: Unit => | |
885 | 885 | (i.caller == this) | |
886 | 886 | case _ => | |
887 | 887 | throw("Match error") | |
888 | 888 | } | |
889 | 889 | ||
890 | 890 | ||
891 | 891 | func mm (i) = match m() { | |
892 | 892 | case pk: ByteVector => | |
893 | 893 | if ((i.callerPublicKey == pk)) | |
894 | 894 | then true | |
895 | 895 | else pd | |
896 | 896 | case _: Unit => | |
897 | 897 | if ((i.caller == this)) | |
898 | 898 | then true | |
899 | 899 | else pd | |
900 | 900 | case _ => | |
901 | 901 | throw("Match error") | |
902 | 902 | } | |
903 | 903 | ||
904 | 904 | ||
905 | 905 | @Callable(i) | |
906 | 906 | func constructor (fc) = { | |
907 | 907 | let c = mm(i) | |
908 | 908 | if ((c == c)) | |
909 | 909 | then [StringEntry(fc(), fc)] | |
910 | 910 | else throw("Strict value is not equal to itself.") | |
911 | 911 | } | |
912 | 912 | ||
913 | 913 | ||
914 | 914 | ||
915 | 915 | @Callable(i) | |
916 | 916 | func setManager (pendingManagerPublicKey) = { | |
917 | 917 | let c = mm(i) | |
918 | 918 | if ((c == c)) | |
919 | 919 | then { | |
920 | 920 | let cm = fromBase58String(pendingManagerPublicKey) | |
921 | 921 | if ((cm == cm)) | |
922 | 922 | then [StringEntry(pmpk(), pendingManagerPublicKey)] | |
923 | 923 | else throw("Strict value is not equal to itself.") | |
924 | 924 | } | |
925 | 925 | else throw("Strict value is not equal to itself.") | |
926 | 926 | } | |
927 | 927 | ||
928 | 928 | ||
929 | 929 | ||
930 | 930 | @Callable(i) | |
931 | 931 | func confirmManager () = { | |
932 | 932 | let p = pm() | |
933 | 933 | let hpm = if (isDefined(p)) | |
934 | 934 | then true | |
935 | 935 | else throw("No pending manager") | |
936 | 936 | if ((hpm == hpm)) | |
937 | 937 | then { | |
938 | 938 | let cpm = if ((i.callerPublicKey == value(p))) | |
939 | 939 | then true | |
940 | 940 | else throw("You are not pending manager") | |
941 | 941 | if ((cpm == cpm)) | |
942 | 942 | then [StringEntry(mpk(), toBase58String(value(p))), DeleteEntry(pmpk())] | |
943 | 943 | else throw("Strict value is not equal to itself.") | |
944 | 944 | } | |
945 | 945 | else throw("Strict value is not equal to itself.") | |
946 | 946 | } | |
947 | 947 | ||
948 | 948 | ||
949 | 949 | ||
950 | 950 | @Callable(i) | |
951 | 951 | func put (slip,autoStake) = { | |
952 | 952 | let factCfg = gfc() | |
953 | 953 | let stakingCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactStakCntr]), "Wr st addr") | |
954 | 954 | let slipCntr = valueOrErrorMessage(addressFromString(factCfg[idxFactSlippCntr]), "Wr sl addr") | |
955 | 955 | if ((0 > slip)) | |
956 | 956 | then throw("Wrong slippage") | |
957 | 957 | else if ((size(i.payments) != 2)) | |
958 | 958 | then throw("2 pmnts expd") | |
959 | 959 | else { | |
960 | 960 | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
961 | 961 | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
962 | 962 | let amountAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) - amAssetPmt) | |
963 | 963 | if ((amountAssetBalance == amountAssetBalance)) | |
964 | 964 | then { | |
965 | 965 | let priceAssetBalance = (toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) - prAssetPmt) | |
966 | 966 | if ((priceAssetBalance == priceAssetBalance)) | |
967 | 967 | then { | |
968 | 968 | let lpAssetEmission = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
969 | 969 | if ((lpAssetEmission == lpAssetEmission)) | |
970 | 970 | then { | |
971 | 971 | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
972 | 972 | if ((currentDLp == currentDLp)) | |
973 | 973 | then { | |
974 | 974 | let e = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], slip, true, false, true, 0, "") | |
975 | 975 | let emitLpAmt = e._2 | |
976 | 976 | let lpAssetId = e._7 | |
977 | 977 | let state = e._9 | |
978 | 978 | let amDiff = e._10 | |
979 | 979 | let prDiff = e._11 | |
980 | 980 | let amId = e._12 | |
981 | 981 | let prId = e._13 | |
982 | 982 | let r = invoke(fca, "emit", [emitLpAmt], nil) | |
983 | 983 | if ((r == r)) | |
984 | 984 | then { | |
985 | 985 | let el = match r { | |
986 | 986 | case legacy: Address => | |
987 | 987 | invoke(legacy, "emit", [emitLpAmt], nil) | |
988 | 988 | case _ => | |
989 | 989 | unit | |
990 | 990 | } | |
991 | 991 | if ((el == el)) | |
992 | 992 | then { | |
993 | 993 | let sa = if ((amDiff > 0)) | |
994 | 994 | then invoke(slipCntr, "put", nil, [AttachedPayment(amId, amDiff)]) | |
995 | 995 | else nil | |
996 | 996 | if ((sa == sa)) | |
997 | 997 | then { | |
998 | 998 | let sp = if ((prDiff > 0)) | |
999 | 999 | then invoke(slipCntr, "put", nil, [AttachedPayment(prId, prDiff)]) | |
1000 | 1000 | else nil | |
1001 | 1001 | if ((sp == sp)) | |
1002 | 1002 | then { | |
1003 | 1003 | let lpTrnsfr = if (autoStake) | |
1004 | 1004 | then { | |
1005 | 1005 | let ss = invoke(stakingCntr, "stake", nil, [AttachedPayment(lpAssetId, emitLpAmt)]) | |
1006 | 1006 | if ((ss == ss)) | |
1007 | 1007 | then nil | |
1008 | 1008 | else throw("Strict value is not equal to itself.") | |
1009 | 1009 | } | |
1010 | 1010 | else [ScriptTransfer(i.caller, emitLpAmt, lpAssetId)] | |
1011 | - | let $ | |
1012 | - | let refreshDLpActions = $ | |
1013 | - | let updatedDLp = $ | |
1014 | - | let | |
1015 | - | if (( | |
1011 | + | let $t03627736342 = refreshDLpInternal(0, 0, 0) | |
1012 | + | let refreshDLpActions = $t03627736342._1 | |
1013 | + | let updatedDLp = $t03627736342._2 | |
1014 | + | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1015 | + | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1016 | 1016 | then { | |
1017 | - | let | |
1017 | + | let check = if ((updatedDLp >= currentDLp)) | |
1018 | 1018 | then true | |
1019 | - | else throwErr(makeString(["updated DLp lower than current DLp", toString(amountAssetBalance), toString(priceAssetBalance), toString(lpAssetEmission), toString(currentDLp), toString(updatedDLp), toString(emitLpAmt), toString(amDiff), toString(prDiff), toString(lpAssetEmission), toString(lpAssetEmissionAfter)], " ")) | |
1020 | - | if ((error == error)) | |
1021 | - | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1019 | + | else throwErr("updated DLp lower than current DLp") | |
1020 | + | if ((check == check)) | |
1021 | + | then { | |
1022 | + | let lpAssetEmissionAfter = value(assetInfo(cfgLpAssetId)).quantity | |
1023 | + | if ((lpAssetEmissionAfter == lpAssetEmissionAfter)) | |
1024 | + | then ((state ++ lpTrnsfr) ++ refreshDLpActions) | |
1025 | + | else throw("Strict value is not equal to itself.") | |
1026 | + | } | |
1022 | 1027 | else throw("Strict value is not equal to itself.") | |
1023 | 1028 | } | |
1024 | 1029 | else throw("Strict value is not equal to itself.") | |
1025 | 1030 | } | |
1026 | 1031 | else throw("Strict value is not equal to itself.") | |
1027 | 1032 | } | |
1028 | 1033 | else throw("Strict value is not equal to itself.") | |
1029 | 1034 | } | |
1030 | 1035 | else throw("Strict value is not equal to itself.") | |
1031 | 1036 | } | |
1032 | 1037 | else throw("Strict value is not equal to itself.") | |
1033 | 1038 | } | |
1034 | 1039 | else throw("Strict value is not equal to itself.") | |
1035 | 1040 | } | |
1036 | 1041 | else throw("Strict value is not equal to itself.") | |
1037 | 1042 | } | |
1038 | 1043 | else throw("Strict value is not equal to itself.") | |
1039 | 1044 | } | |
1040 | 1045 | else throw("Strict value is not equal to itself.") | |
1041 | 1046 | } | |
1042 | 1047 | } | |
1043 | 1048 | ||
1044 | 1049 | ||
1045 | 1050 | ||
1046 | 1051 | @Callable(i) | |
1047 | 1052 | func putOneTknV2 (minOutAmount,autoStake) = { | |
1048 | 1053 | let isPoolOneTokenOperationsDisabled = { | |
1049 | 1054 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1050 | 1055 | if ($isInstanceOf(@, "Boolean")) | |
1051 | 1056 | then @ | |
1052 | 1057 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1053 | 1058 | } | |
1054 | 1059 | let isPutDisabled = if (if (if (igs()) | |
1055 | 1060 | then true | |
1056 | 1061 | else (cfgPoolStatus == PoolPutDis)) | |
1057 | 1062 | then true | |
1058 | 1063 | else (cfgPoolStatus == PoolShutdown)) | |
1059 | 1064 | then true | |
1060 | 1065 | else isPoolOneTokenOperationsDisabled | |
1061 | 1066 | let checks = [if (if (!(isPutDisabled)) | |
1062 | 1067 | then true | |
1063 | 1068 | else isManager(i)) | |
1064 | 1069 | then true | |
1065 | 1070 | else throwErr("put operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1066 | 1071 | then true | |
1067 | 1072 | else throwErr("exactly 1 payment are expected")] | |
1068 | 1073 | if ((checks == checks)) | |
1069 | 1074 | then { | |
1070 | 1075 | let poolConfig = gpc() | |
1071 | 1076 | let amId = poolConfig[idxAmAsId] | |
1072 | 1077 | let prId = poolConfig[idxPrAsId] | |
1073 | 1078 | let lpId = fromBase58String(poolConfig[idxLPAsId]) | |
1074 | 1079 | let amDecimals = parseIntValue(poolConfig[idxAmtAsDcm]) | |
1075 | 1080 | let prDecimals = parseIntValue(poolConfig[idxPriceAsDcm]) | |
1076 | 1081 | let userAddress = if ((i.caller == this)) | |
1077 | 1082 | then i.originCaller | |
1078 | 1083 | else i.caller | |
1079 | 1084 | let pmt = value(i.payments[0]) | |
1080 | 1085 | let pmtAssetId = toBase58String(value(pmt.assetId)) | |
1081 | 1086 | let pmtAmt = pmt.amount | |
1082 | 1087 | let currentDLp = if ((pmt.assetId == cfgAmountAssetId)) | |
1083 | 1088 | then calcCurrentDLp(toBigInt(pmtAmt), toBigInt(0), toBigInt(0)) | |
1084 | 1089 | else calcCurrentDLp(toBigInt(0), toBigInt(pmtAmt), toBigInt(0)) | |
1085 | 1090 | if ((currentDLp == currentDLp)) | |
1086 | 1091 | then { | |
1087 | - | let $ | |
1088 | - | if (($ | |
1092 | + | let $t03786438022 = calcPutOneTkn(pmtAmt, pmtAssetId, toString(userAddress), toBase58String(i.transactionId), true) | |
1093 | + | if (($t03786438022 == $t03786438022)) | |
1089 | 1094 | then { | |
1090 | - | let feeAmount = $ | |
1091 | - | let state = $ | |
1092 | - | let estimLP = $ | |
1095 | + | let feeAmount = $t03786438022._3 | |
1096 | + | let state = $t03786438022._2 | |
1097 | + | let estimLP = $t03786438022._1 | |
1093 | 1098 | let emitLpAmt = if (if ((minOutAmount > 0)) | |
1094 | 1099 | then (minOutAmount > estimLP) | |
1095 | 1100 | else false) | |
1096 | 1101 | then throwErr(makeString(["amount to receive is less than ", toString(minOutAmount)], "")) | |
1097 | 1102 | else estimLP | |
1098 | 1103 | let e = invoke(fca, "emit", [emitLpAmt], nil) | |
1099 | 1104 | if ((e == e)) | |
1100 | 1105 | then { | |
1101 | 1106 | let el = match e { | |
1102 | 1107 | case legacy: Address => | |
1103 | 1108 | invoke(legacy, "emit", [emitLpAmt], nil) | |
1104 | 1109 | case _ => | |
1105 | 1110 | unit | |
1106 | 1111 | } | |
1107 | 1112 | if ((el == el)) | |
1108 | 1113 | then { | |
1109 | 1114 | let lpTrnsfr = if (autoStake) | |
1110 | 1115 | then { | |
1111 | 1116 | let ss = invoke(stakingContract, "stake", nil, [AttachedPayment(lpId, emitLpAmt)]) | |
1112 | 1117 | if ((ss == ss)) | |
1113 | 1118 | then nil | |
1114 | 1119 | else throw("Strict value is not equal to itself.") | |
1115 | 1120 | } | |
1116 | 1121 | else [ScriptTransfer(i.caller, emitLpAmt, lpId)] | |
1117 | 1122 | let sendFeeToMatcher = if ((feeAmount > 0)) | |
1118 | 1123 | then [ScriptTransfer(feeCollectorAddress, feeAmount, fromBase58String(pmtAssetId))] | |
1119 | 1124 | else nil | |
1120 | - | let $ | |
1125 | + | let $t03883739186 = if ((this == feeCollectorAddress)) | |
1121 | 1126 | then $Tuple2(0, 0) | |
1122 | 1127 | else { | |
1123 | 1128 | let paymentInAmountAsset = if ((pmt.assetId == cfgAmountAssetId)) | |
1124 | 1129 | then true | |
1125 | 1130 | else false | |
1126 | 1131 | if (paymentInAmountAsset) | |
1127 | 1132 | then $Tuple2(-(feeAmount), 0) | |
1128 | 1133 | else $Tuple2(0, -(feeAmount)) | |
1129 | 1134 | } | |
1130 | - | let amountAssetBalanceDelta = $ | |
1131 | - | let priceAssetBalanceDelta = $ | |
1132 | - | let $ | |
1133 | - | let refreshDLpActions = $ | |
1134 | - | let updatedDLp = $ | |
1135 | + | let amountAssetBalanceDelta = $t03883739186._1 | |
1136 | + | let priceAssetBalanceDelta = $t03883739186._2 | |
1137 | + | let $t03918939297 = refreshDLpInternal(amountAssetBalanceDelta, priceAssetBalanceDelta, 0) | |
1138 | + | let refreshDLpActions = $t03918939297._1 | |
1139 | + | let updatedDLp = $t03918939297._2 | |
1135 | 1140 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1136 | 1141 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1137 | 1142 | then $Tuple2((((state ++ lpTrnsfr) ++ sendFeeToMatcher) ++ refreshDLpActions), emitLpAmt) | |
1138 | 1143 | else throw("Strict value is not equal to itself.") | |
1139 | 1144 | } | |
1140 | 1145 | else throw("Strict value is not equal to itself.") | |
1141 | 1146 | } | |
1142 | 1147 | else throw("Strict value is not equal to itself.") | |
1143 | 1148 | } | |
1144 | 1149 | else throw("Strict value is not equal to itself.") | |
1145 | 1150 | } | |
1146 | 1151 | else throw("Strict value is not equal to itself.") | |
1147 | 1152 | } | |
1148 | 1153 | else throw("Strict value is not equal to itself.") | |
1149 | 1154 | } | |
1150 | 1155 | ||
1151 | 1156 | ||
1152 | 1157 | ||
1153 | 1158 | @Callable(i) | |
1154 | - | func putForFree (maxSlpg) = if ((0 > maxSlpg)) | |
1155 | - | then throw("Wrong slpg") | |
1156 | - | else if ((size(i.payments) != 2)) | |
1157 | - | then throw("2 pmnts expd") | |
1158 | - | else { | |
1159 | - | let estPut = cp(toString(i.caller), toBase58String(i.transactionId), AttachedPayment(value(i.payments[0]).assetId, value(i.payments[0]).amount), i.payments[1], maxSlpg, false, false, true, 0, "") | |
1160 | - | let state = estPut._9 | |
1161 | - | let amAssetPmt = toBigInt(value(i.payments[0]).amount) | |
1162 | - | let prAssetPmt = toBigInt(value(i.payments[1]).amount) | |
1163 | - | let currentDLp = calcCurrentDLp(amAssetPmt, prAssetPmt, toBigInt(0)) | |
1164 | - | if ((currentDLp == currentDLp)) | |
1159 | + | func get () = { | |
1160 | + | let aab = toBigInt(getAccBalance(assetIdToString(cfgAmountAssetId))) | |
1161 | + | if ((aab == aab)) | |
1162 | + | then { | |
1163 | + | let pab = toBigInt(getAccBalance(assetIdToString(cfgPriceAssetId))) | |
1164 | + | if ((pab == pab)) | |
1165 | 1165 | then { | |
1166 | - | let $t04077340838 = refreshDLpInternal(0, 0, 0) | |
1167 | - | let refreshDLpActions = $t04077340838._1 | |
1168 | - | let updatedDLp = $t04077340838._2 | |
1169 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1170 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1171 | - | then (state ++ refreshDLpActions) | |
1172 | - | else throw("Strict value is not equal to itself.") | |
1173 | - | } | |
1174 | - | else throw("Strict value is not equal to itself.") | |
1175 | - | } | |
1176 | - | ||
1177 | - | ||
1178 | - | ||
1179 | - | @Callable(i) | |
1180 | - | func get () = { | |
1181 | - | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1182 | - | if ((currentDLp == currentDLp)) | |
1183 | - | then { | |
1184 | - | let r = cg(i) | |
1185 | - | let outAmtAmt = r._1 | |
1186 | - | let outPrAmt = r._2 | |
1187 | - | let pmtAmt = r._3 | |
1188 | - | let pmtAssetId = r._4 | |
1189 | - | let state = r._5 | |
1190 | - | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1191 | - | if ((b == b)) | |
1192 | - | then { | |
1193 | - | let $t04162541707 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1194 | - | let refreshDLpActions = $t04162541707._1 | |
1195 | - | let updatedDLp = $t04162541707._2 | |
1196 | - | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1197 | - | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1198 | - | then (state ++ refreshDLpActions) | |
1166 | + | let lae = toBigInt(value(assetInfo(cfgLpAssetId)).quantity) | |
1167 | + | if ((lae == lae)) | |
1168 | + | then { | |
1169 | + | let laea = (lae - toBigInt(value(i.payments[0]).amount)) | |
1170 | + | if ((laea == laea)) | |
1171 | + | then { | |
1172 | + | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1173 | + | if ((currentDLp == currentDLp)) | |
1174 | + | then { | |
1175 | + | let r = cg(i) | |
1176 | + | let outAmtAmt = r._1 | |
1177 | + | let outPrAmt = r._2 | |
1178 | + | let pmtAmt = r._3 | |
1179 | + | let pmtAssetId = r._4 | |
1180 | + | let state = r._5 | |
1181 | + | let b = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1182 | + | if ((b == b)) | |
1183 | + | then { | |
1184 | + | let $t04159541752 = refreshDLpInternal(-(outAmtAmt), -(outPrAmt), 0) | |
1185 | + | let refreshDLpActions = $t04159541752._1 | |
1186 | + | let updatedDLp = $t04159541752._2 | |
1187 | + | let error = if ((updatedDLp >= currentDLp)) | |
1188 | + | then true | |
1189 | + | else throwErr(makeString(["updated DLp lower than current DLp", toString(aab), toString(pab), toString(currentDLp), toString(updatedDLp), toString(lae), toString(laea)], " ")) | |
1190 | + | if ((error == error)) | |
1191 | + | then (state ++ refreshDLpActions) | |
1192 | + | else throw("Strict value is not equal to itself.") | |
1193 | + | } | |
1194 | + | else throw("Strict value is not equal to itself.") | |
1195 | + | } | |
1196 | + | else throw("Strict value is not equal to itself.") | |
1197 | + | } | |
1198 | + | else throw("Strict value is not equal to itself.") | |
1199 | + | } | |
1199 | 1200 | else throw("Strict value is not equal to itself.") | |
1200 | 1201 | } | |
1201 | 1202 | else throw("Strict value is not equal to itself.") | |
1202 | 1203 | } | |
1203 | 1204 | else throw("Strict value is not equal to itself.") | |
1204 | 1205 | } | |
1205 | 1206 | ||
1206 | 1207 | ||
1207 | 1208 | ||
1208 | 1209 | @Callable(i) | |
1209 | 1210 | func getOneTknV2 (outAssetId,minOutAmount) = { | |
1210 | 1211 | let isPoolOneTokenOperationsDisabled = { | |
1211 | 1212 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1212 | 1213 | if ($isInstanceOf(@, "Boolean")) | |
1213 | 1214 | then @ | |
1214 | 1215 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1215 | 1216 | } | |
1216 | 1217 | let isGetDisabled = if (if (igs()) | |
1217 | 1218 | then true | |
1218 | 1219 | else (cfgPoolStatus == PoolShutdown)) | |
1219 | 1220 | then true | |
1220 | 1221 | else isPoolOneTokenOperationsDisabled | |
1221 | 1222 | let checks = [if (if (!(isGetDisabled)) | |
1222 | 1223 | then true | |
1223 | 1224 | else isManager(i)) | |
1224 | 1225 | then true | |
1225 | 1226 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 1)) | |
1226 | 1227 | then true | |
1227 | 1228 | else throwErr("exactly 1 payment are expected")] | |
1228 | 1229 | if ((checks == checks)) | |
1229 | 1230 | then { | |
1230 | - | let $ | |
1231 | - | let state = $ | |
1232 | - | let totalAmount = $ | |
1231 | + | let $t04255142706 = getOneTknV2Internal(outAssetId, minOutAmount, i.payments, i.caller, i.originCaller, i.transactionId) | |
1232 | + | let state = $t04255142706._1 | |
1233 | + | let totalAmount = $t04255142706._2 | |
1233 | 1234 | $Tuple2(state, totalAmount) | |
1234 | 1235 | } | |
1235 | 1236 | else throw("Strict value is not equal to itself.") | |
1236 | 1237 | } | |
1237 | 1238 | ||
1238 | 1239 | ||
1239 | 1240 | ||
1240 | 1241 | @Callable(i) | |
1241 | 1242 | func refreshDLp () = { | |
1242 | 1243 | let lastRefreshedBlockHeight = valueOrElse(getInteger(keyDLpRefreshedHeight), 0) | |
1243 | 1244 | let checkLastRefreshedBlockHeight = if (((height - lastRefreshedBlockHeight) >= dLpRefreshDelay)) | |
1244 | 1245 | then unit | |
1245 | 1246 | else throwErr(makeString([toString(dLpRefreshDelay), " blocks have not passed since the previous call"], "")) | |
1246 | 1247 | if ((checkLastRefreshedBlockHeight == checkLastRefreshedBlockHeight)) | |
1247 | 1248 | then { | |
1248 | 1249 | let dLp = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, keyDLp), "0")), fmtErr("invalid dLp")) | |
1249 | - | let $ | |
1250 | - | let dLpUpdateActions = $ | |
1251 | - | let updatedDLp = $ | |
1250 | + | let $t04323043294 = refreshDLpInternal(0, 0, 0) | |
1251 | + | let dLpUpdateActions = $t04323043294._1 | |
1252 | + | let updatedDLp = $t04323043294._2 | |
1252 | 1253 | let actions = if ((dLp != updatedDLp)) | |
1253 | 1254 | then dLpUpdateActions | |
1254 | 1255 | else throwErr("nothing to refresh") | |
1255 | 1256 | $Tuple2(actions, toString(updatedDLp)) | |
1256 | 1257 | } | |
1257 | 1258 | else throw("Strict value is not equal to itself.") | |
1258 | 1259 | } | |
1259 | 1260 | ||
1260 | 1261 | ||
1261 | 1262 | ||
1262 | 1263 | @Callable(i) | |
1263 | 1264 | func getOneTknV2READONLY (outAssetId,lpAssetAmount) = { | |
1264 | 1265 | let poolConfig = gpc() | |
1265 | 1266 | let amId = poolConfig[idxAmAsId] | |
1266 | 1267 | let prId = poolConfig[idxPrAsId] | |
1267 | 1268 | let lpId = poolConfig[idxLPAsId] | |
1268 | 1269 | let xp = [toBigInt(getAccBalance(amId)), toBigInt(getAccBalance(prId))] | |
1269 | 1270 | let lpEmission = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(lpId)), "invalid lp asset").quantity) | |
1270 | 1271 | let D0 = getD(xp) | |
1271 | 1272 | let D1 = (D0 - fraction(toBigInt(lpAssetAmount), D0, lpEmission)) | |
1272 | 1273 | let index = if ((outAssetId == amId)) | |
1273 | 1274 | then 0 | |
1274 | 1275 | else if ((outAssetId == prId)) | |
1275 | 1276 | then 1 | |
1276 | 1277 | else throw("invalid out asset id") | |
1277 | 1278 | let newY = getYD(xp, index, D1) | |
1278 | 1279 | let dy = (xp[index] - newY) | |
1279 | 1280 | let totalGetRaw = max([0, toInt((dy - big1))]) | |
1280 | - | let $ | |
1281 | - | let totalGet = $ | |
1282 | - | let feeAmount = $ | |
1281 | + | let $t04419444243 = takeFee(totalGetRaw) | |
1282 | + | let totalGet = $t04419444243._1 | |
1283 | + | let feeAmount = $t04419444243._2 | |
1283 | 1284 | $Tuple2(nil, $Tuple2(totalGet, feeAmount)) | |
1284 | 1285 | } | |
1285 | 1286 | ||
1286 | 1287 | ||
1287 | 1288 | ||
1288 | 1289 | @Callable(i) | |
1289 | 1290 | func getOneTknV2WithBonusREADONLY (outAssetId,lpAssetAmount) = { | |
1290 | 1291 | let poolConfig = gpc() | |
1291 | 1292 | let amId = poolConfig[idxAmAsId] | |
1292 | 1293 | let prId = poolConfig[idxPrAsId] | |
1293 | 1294 | let lpId = poolConfig[idxLPAsId] | |
1294 | 1295 | let amBalance = getAccBalance(amId) | |
1295 | 1296 | let prBalance = getAccBalance(prId) | |
1296 | - | let $ | |
1297 | + | let $t04458844703 = { | |
1297 | 1298 | let @ = invoke(this, "getOneTknV2READONLY", [outAssetId, lpAssetAmount], nil) | |
1298 | 1299 | if ($isInstanceOf(@, "(Int, Int)")) | |
1299 | 1300 | then @ | |
1300 | 1301 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")) | |
1301 | 1302 | } | |
1302 | - | let totalGet = $ | |
1303 | - | let feeAmount = $ | |
1303 | + | let totalGet = $t04458844703._1 | |
1304 | + | let feeAmount = $t04458844703._2 | |
1304 | 1305 | let r = ego("", lpId, lpAssetAmount, this) | |
1305 | 1306 | let outAmAmt = r._1 | |
1306 | 1307 | let outPrAmt = r._2 | |
1307 | 1308 | let sumOfGetAssets = (outAmAmt + outPrAmt) | |
1308 | 1309 | let bonus = if ((sumOfGetAssets == 0)) | |
1309 | 1310 | then if ((totalGet == 0)) | |
1310 | 1311 | then 0 | |
1311 | 1312 | else throw("bonus calculation error") | |
1312 | 1313 | else fraction((totalGet - sumOfGetAssets), scale8, sumOfGetAssets) | |
1313 | 1314 | $Tuple2(nil, $Tuple3(totalGet, feeAmount, bonus)) | |
1314 | 1315 | } | |
1315 | 1316 | ||
1316 | 1317 | ||
1317 | 1318 | ||
1318 | 1319 | @Callable(i) | |
1319 | 1320 | func getNoLess (noLessThenAmtAsset,noLessThenPriceAsset) = { | |
1320 | 1321 | let r = cg(i) | |
1321 | 1322 | let outAmAmt = r._1 | |
1322 | 1323 | let outPrAmt = r._2 | |
1323 | 1324 | let pmtAmt = r._3 | |
1324 | 1325 | let pmtAssetId = r._4 | |
1325 | 1326 | let state = r._5 | |
1326 | 1327 | if ((noLessThenAmtAsset > outAmAmt)) | |
1327 | 1328 | then throw(((("Failed: " + toString(outAmAmt)) + " < ") + toString(noLessThenAmtAsset))) | |
1328 | 1329 | else if ((noLessThenPriceAsset > outPrAmt)) | |
1329 | 1330 | then throw(((("Failed: " + toString(outPrAmt)) + " < ") + toString(noLessThenPriceAsset))) | |
1330 | 1331 | else { | |
1331 | 1332 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(pmtAmt)) | |
1332 | 1333 | let burnLPAssetOnFactory = invoke(fca, "burn", [pmtAmt], [AttachedPayment(pmtAssetId, pmtAmt)]) | |
1333 | 1334 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1334 | 1335 | then { | |
1335 | - | let $ | |
1336 | - | let refreshDLpActions = $ | |
1337 | - | let updatedDLp = $ | |
1336 | + | let $t04587145952 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1337 | + | let refreshDLpActions = $t04587145952._1 | |
1338 | + | let updatedDLp = $t04587145952._2 | |
1338 | 1339 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1339 | 1340 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1340 | 1341 | then (state ++ refreshDLpActions) | |
1341 | 1342 | else throw("Strict value is not equal to itself.") | |
1342 | 1343 | } | |
1343 | 1344 | else throw("Strict value is not equal to itself.") | |
1344 | 1345 | } | |
1345 | 1346 | } | |
1346 | 1347 | ||
1347 | 1348 | ||
1348 | 1349 | ||
1349 | 1350 | @Callable(i) | |
1350 | 1351 | func unstakeAndGet (amount) = { | |
1351 | 1352 | let checkPayments = if ((size(i.payments) != 0)) | |
1352 | 1353 | then throw("No pmnts expd") | |
1353 | 1354 | else true | |
1354 | 1355 | if ((checkPayments == checkPayments)) | |
1355 | 1356 | then { | |
1356 | 1357 | let cfg = gpc() | |
1357 | 1358 | let factoryCfg = gfc() | |
1358 | 1359 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1359 | 1360 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1360 | 1361 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1361 | 1362 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), amount], nil) | |
1362 | 1363 | if ((unstakeInv == unstakeInv)) | |
1363 | 1364 | then { | |
1364 | 1365 | let r = ego(toBase58String(i.transactionId), toBase58String(lpAssetId), amount, i.caller) | |
1365 | 1366 | let outAmAmt = r._1 | |
1366 | 1367 | let outPrAmt = r._2 | |
1367 | 1368 | let sts = parseIntValue(r._9) | |
1368 | 1369 | let state = r._10 | |
1369 | 1370 | let v = if (if (igs()) | |
1370 | 1371 | then true | |
1371 | 1372 | else (sts == PoolShutdown)) | |
1372 | 1373 | then throw(("Blocked: " + toString(sts))) | |
1373 | 1374 | else true | |
1374 | 1375 | if ((v == v)) | |
1375 | 1376 | then { | |
1376 | 1377 | let burnA = invoke(fca, "burn", [amount], [AttachedPayment(lpAssetId, amount)]) | |
1377 | 1378 | if ((burnA == burnA)) | |
1378 | 1379 | then { | |
1379 | - | let $ | |
1380 | - | let refreshDLpActions = $ | |
1381 | - | let updatedDLp = $ | |
1380 | + | let $t04701547096 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1381 | + | let refreshDLpActions = $t04701547096._1 | |
1382 | + | let updatedDLp = $t04701547096._2 | |
1382 | 1383 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1383 | 1384 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1384 | 1385 | then (state ++ refreshDLpActions) | |
1385 | 1386 | else throw("Strict value is not equal to itself.") | |
1386 | 1387 | } | |
1387 | 1388 | else throw("Strict value is not equal to itself.") | |
1388 | 1389 | } | |
1389 | 1390 | else throw("Strict value is not equal to itself.") | |
1390 | 1391 | } | |
1391 | 1392 | else throw("Strict value is not equal to itself.") | |
1392 | 1393 | } | |
1393 | 1394 | else throw("Strict value is not equal to itself.") | |
1394 | 1395 | } | |
1395 | 1396 | ||
1396 | 1397 | ||
1397 | 1398 | ||
1398 | 1399 | @Callable(i) | |
1399 | 1400 | func unstakeAndGetNoLess (unstakeAmount,noLessThenAmountAsset,noLessThenPriceAsset) = { | |
1400 | 1401 | let isGetDisabled = if (igs()) | |
1401 | 1402 | then true | |
1402 | 1403 | else (cfgPoolStatus == PoolShutdown) | |
1403 | 1404 | let checks = [if (!(isGetDisabled)) | |
1404 | 1405 | then true | |
1405 | 1406 | else throw("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1406 | 1407 | then true | |
1407 | 1408 | else throw("no payments are expected")] | |
1408 | 1409 | if ((checks == checks)) | |
1409 | 1410 | then { | |
1410 | 1411 | let currentDLp = calcCurrentDLp(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1411 | 1412 | let unstakeInv = invoke(stakingContract, "unstake", [toBase58String(cfgLpAssetId), unstakeAmount], nil) | |
1412 | 1413 | if ((unstakeInv == unstakeInv)) | |
1413 | 1414 | then { | |
1414 | 1415 | let res = ego(toBase58String(i.transactionId), toBase58String(cfgLpAssetId), unstakeAmount, i.caller) | |
1415 | 1416 | let outAmAmt = res._1 | |
1416 | 1417 | let outPrAmt = res._2 | |
1417 | 1418 | let state = res._10 | |
1418 | 1419 | let checkAmounts = [if ((outAmAmt >= noLessThenAmountAsset)) | |
1419 | 1420 | then true | |
1420 | 1421 | else throw(makeString(["amount asset amount to receive is less than ", toString(noLessThenAmountAsset)], "")), if ((outPrAmt >= noLessThenPriceAsset)) | |
1421 | 1422 | then true | |
1422 | 1423 | else throw(makeString(["price asset amount to receive is less than ", toString(noLessThenPriceAsset)], ""))] | |
1423 | 1424 | if ((checkAmounts == checkAmounts)) | |
1424 | 1425 | then { | |
1425 | 1426 | let burnLPAssetOnFactory = invoke(fca, "burn", [unstakeAmount], [AttachedPayment(cfgLpAssetId, unstakeAmount)]) | |
1426 | 1427 | if ((burnLPAssetOnFactory == burnLPAssetOnFactory)) | |
1427 | 1428 | then { | |
1428 | - | let $ | |
1429 | - | let refreshDLpActions = $ | |
1430 | - | let updatedDLp = $ | |
1429 | + | let $t04834448425 = refreshDLpInternal(-(outAmAmt), -(outPrAmt), 0) | |
1430 | + | let refreshDLpActions = $t04834448425._1 | |
1431 | + | let updatedDLp = $t04834448425._2 | |
1431 | 1432 | let isUpdatedDLpValid = validateUpdatedDLp(currentDLp, updatedDLp) | |
1432 | 1433 | if ((isUpdatedDLpValid == isUpdatedDLpValid)) | |
1433 | 1434 | then (state ++ refreshDLpActions) | |
1434 | 1435 | else throw("Strict value is not equal to itself.") | |
1435 | 1436 | } | |
1436 | 1437 | else throw("Strict value is not equal to itself.") | |
1437 | 1438 | } | |
1438 | 1439 | else throw("Strict value is not equal to itself.") | |
1439 | 1440 | } | |
1440 | 1441 | else throw("Strict value is not equal to itself.") | |
1441 | 1442 | } | |
1442 | 1443 | else throw("Strict value is not equal to itself.") | |
1443 | 1444 | } | |
1444 | 1445 | ||
1445 | 1446 | ||
1446 | 1447 | ||
1447 | 1448 | @Callable(i) | |
1448 | 1449 | func unstakeAndGetOneTknV2 (unstakeAmount,outAssetId,minOutAmount) = { | |
1449 | 1450 | let isPoolOneTokenOperationsDisabled = { | |
1450 | 1451 | let @ = invoke(fca, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1451 | 1452 | if ($isInstanceOf(@, "Boolean")) | |
1452 | 1453 | then @ | |
1453 | 1454 | else throw(($getType(@) + " couldn't be cast to Boolean")) | |
1454 | 1455 | } | |
1455 | 1456 | let isGetDisabled = if (if (igs()) | |
1456 | 1457 | then true | |
1457 | 1458 | else (cfgPoolStatus == PoolShutdown)) | |
1458 | 1459 | then true | |
1459 | 1460 | else isPoolOneTokenOperationsDisabled | |
1460 | 1461 | let checks = [if (if (!(isGetDisabled)) | |
1461 | 1462 | then true | |
1462 | 1463 | else isManager(i)) | |
1463 | 1464 | then true | |
1464 | 1465 | else throwErr("get operation is blocked by admin"), if ((size(i.payments) == 0)) | |
1465 | 1466 | then true | |
1466 | 1467 | else throwErr("no payments are expected")] | |
1467 | 1468 | if ((checks == checks)) | |
1468 | 1469 | then { | |
1469 | 1470 | let cfg = gpc() | |
1470 | 1471 | let factoryCfg = gfc() | |
1471 | 1472 | let lpAssetId = fromBase58String(cfg[idxLPAsId]) | |
1472 | 1473 | let staking = valueOrErrorMessage(addressFromString(factoryCfg[idxFactStakCntr]), "Wr st addr") | |
1473 | 1474 | let unstakeInv = invoke(staking, "unstake", [toBase58String(lpAssetId), unstakeAmount], nil) | |
1474 | 1475 | if ((unstakeInv == unstakeInv)) | |
1475 | 1476 | then { | |
1476 | - | let $ | |
1477 | - | let state = $ | |
1478 | - | let totalAmount = $ | |
1477 | + | let $t04935949547 = getOneTknV2Internal(outAssetId, minOutAmount, [AttachedPayment(lpAssetId, unstakeAmount)], i.caller, i.originCaller, i.transactionId) | |
1478 | + | let state = $t04935949547._1 | |
1479 | + | let totalAmount = $t04935949547._2 | |
1479 | 1480 | $Tuple2(state, totalAmount) | |
1480 | 1481 | } | |
1481 | 1482 | else throw("Strict value is not equal to itself.") | |
1482 | 1483 | } | |
1483 | 1484 | else throw("Strict value is not equal to itself.") | |
1484 | 1485 | } | |
1485 | 1486 | ||
1486 | 1487 | ||
1487 | 1488 | ||
1488 | 1489 | @Callable(i) | |
1489 | 1490 | func putOneTknV2WithBonusREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1490 | 1491 | let poolConfig = gpc() | |
1491 | 1492 | let amId = poolConfig[idxAmAsId] | |
1492 | 1493 | let prId = poolConfig[idxPrAsId] | |
1493 | 1494 | let lpId = poolConfig[idxLPAsId] | |
1494 | - | let $ | |
1495 | - | let lpAmount = $ | |
1496 | - | let state = $ | |
1497 | - | let feeAmount = $ | |
1498 | - | let bonus = $ | |
1495 | + | let $t04980649909 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", true) | |
1496 | + | let lpAmount = $t04980649909._1 | |
1497 | + | let state = $t04980649909._2 | |
1498 | + | let feeAmount = $t04980649909._3 | |
1499 | + | let bonus = $t04980649909._4 | |
1499 | 1500 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1500 | 1501 | } | |
1501 | 1502 | ||
1502 | 1503 | ||
1503 | 1504 | ||
1504 | 1505 | @Callable(i) | |
1505 | 1506 | func putOneTknV2WithoutTakeFeeREADONLY (paymentAmountRaw,paymentAssetId) = { | |
1506 | 1507 | let poolConfig = gpc() | |
1507 | 1508 | let amId = poolConfig[idxAmAsId] | |
1508 | 1509 | let prId = poolConfig[idxPrAsId] | |
1509 | 1510 | let lpId = poolConfig[idxLPAsId] | |
1510 | - | let $ | |
1511 | - | let lpAmount = $ | |
1512 | - | let state = $ | |
1513 | - | let feeAmount = $ | |
1514 | - | let bonus = $ | |
1511 | + | let $t05018850292 = calcPutOneTkn(paymentAmountRaw, paymentAssetId, "", "", false) | |
1512 | + | let lpAmount = $t05018850292._1 | |
1513 | + | let state = $t05018850292._2 | |
1514 | + | let feeAmount = $t05018850292._3 | |
1515 | + | let bonus = $t05018850292._4 | |
1515 | 1516 | $Tuple2(nil, $Tuple3(lpAmount, feeAmount, bonus)) | |
1516 | 1517 | } | |
1517 | 1518 | ||
1518 | 1519 | ||
1519 | 1520 | ||
1520 | 1521 | @Callable(i) | |
1521 | 1522 | func activate (amtAsStr,prAsStr) = if ((toString(i.caller) != toString(fca))) | |
1522 | 1523 | then throw("denied") | |
1523 | 1524 | else $Tuple2([StringEntry(aa(), amtAsStr), StringEntry(pa(), prAsStr)], "success") | |
1524 | 1525 | ||
1525 | 1526 | ||
1526 | 1527 | ||
1527 | 1528 | @Callable(i) | |
1528 | 1529 | func setS (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1529 | 1530 | then pd | |
1530 | 1531 | else [StringEntry(k, v)] | |
1531 | 1532 | ||
1532 | 1533 | ||
1533 | 1534 | ||
1534 | 1535 | @Callable(i) | |
1535 | 1536 | func setI (k,v) = if ((toString(i.caller) != strf(this, ada()))) | |
1536 | 1537 | then pd | |
1537 | 1538 | else [IntegerEntry(k, v)] | |
1538 | 1539 | ||
1539 | 1540 | ||
1540 | 1541 | ||
1541 | 1542 | @Callable(i) | |
1542 | 1543 | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, gpc()) | |
1543 | 1544 | ||
1544 | 1545 | ||
1545 | 1546 | ||
1546 | 1547 | @Callable(i) | |
1547 | 1548 | func getAccBalanceWrapperREADONLY (assetId) = $Tuple2(nil, getAccBalance(assetId)) | |
1548 | 1549 | ||
1549 | 1550 | ||
1550 | 1551 | ||
1551 | 1552 | @Callable(i) | |
1552 | 1553 | func calcPricesWrapperREADONLY (amAmt,prAmt,lpAmt) = { | |
1553 | 1554 | let pr = calcPrices(amAmt, prAmt, lpAmt) | |
1554 | 1555 | $Tuple2(nil, [toString(pr[0]), toString(pr[1]), toString(pr[2])]) | |
1555 | 1556 | } | |
1556 | 1557 | ||
1557 | 1558 | ||
1558 | 1559 | ||
1559 | 1560 | @Callable(i) | |
1560 | 1561 | func fromX18WrapperREADONLY (val,resScaleMult) = $Tuple2(nil, f1(parseBigIntValue(val), resScaleMult)) | |
1561 | 1562 | ||
1562 | 1563 | ||
1563 | 1564 | ||
1564 | 1565 | @Callable(i) | |
1565 | 1566 | func toX18WrapperREADONLY (origVal,origScaleMult) = $Tuple2(nil, toString(t1(origVal, origScaleMult))) | |
1566 | 1567 | ||
1567 | 1568 | ||
1568 | 1569 | ||
1569 | 1570 | @Callable(i) | |
1570 | 1571 | func calcPriceBigIntWrapperREADONLY (prAmtX18,amAmtX18) = $Tuple2(nil, toString(cpbi(parseBigIntValue(prAmtX18), parseBigIntValue(amAmtX18)))) | |
1571 | 1572 | ||
1572 | 1573 | ||
1573 | 1574 | ||
1574 | 1575 | @Callable(i) | |
1575 | 1576 | func estimatePutOperationWrapperREADONLY (txId58,slippage,inAmAmt,inAmId,inPrAmt,inPrId,usrAddr,isEval,emitLp) = $Tuple2(nil, epo(txId58, slippage, inAmAmt, inAmId, inPrAmt, inPrId, usrAddr, isEval, emitLp, true, false, 0, "")) | |
1576 | 1577 | ||
1577 | 1578 | ||
1578 | 1579 | ||
1579 | 1580 | @Callable(i) | |
1580 | 1581 | func estimateGetOperationWrapperREADONLY (txId58,pmtAsId,pmtLpAmt,usrAddr) = { | |
1581 | 1582 | let r = ego(txId58, pmtAsId, pmtLpAmt, addressFromStringValue(usrAddr)) | |
1582 | 1583 | $Tuple2(nil, $Tuple10(r._1, r._2, r._3, r._4, r._5, r._6, r._7, toString(r._8), r._9, r._10)) | |
1583 | 1584 | } | |
1584 | 1585 | ||
1585 | 1586 | ||
1586 | 1587 | ||
1587 | 1588 | @Callable(i) | |
1588 | 1589 | func getFeeREADONLY () = $Tuple2(nil, fee) | |
1589 | 1590 | ||
1590 | 1591 | ||
1591 | 1592 | @Verifier(tx) | |
1592 | 1593 | func verify () = { | |
1593 | 1594 | let targetPublicKey = match m() { | |
1594 | 1595 | case pk: ByteVector => | |
1595 | 1596 | pk | |
1596 | 1597 | case _: Unit => | |
1597 | 1598 | tx.senderPublicKey | |
1598 | 1599 | case _ => | |
1599 | 1600 | throw("Match error") | |
1600 | 1601 | } | |
1601 | 1602 | match tx { | |
1602 | 1603 | case order: Order => | |
1603 | 1604 | let matcherPub = mp() | |
1604 | 1605 | let orderValid = validateMatcherOrderAllowed(order) | |
1605 | 1606 | let senderValid = sigVerify(order.bodyBytes, order.proofs[0], order.senderPublicKey) | |
1606 | 1607 | let matcherValid = sigVerify(order.bodyBytes, order.proofs[1], matcherPub) | |
1607 | 1608 | if (if (if (orderValid) | |
1608 | 1609 | then senderValid | |
1609 | 1610 | else false) | |
1610 | 1611 | then matcherValid | |
1611 | 1612 | else false) | |
1612 | 1613 | then true | |
1613 | 1614 | else toe(orderValid, senderValid, matcherValid) | |
1614 | 1615 | case s: SetScriptTransaction => | |
1615 | 1616 | let newHash = blake2b256(value(s.script)) | |
1616 | 1617 | let allowedHash = fromBase64String(value(getString(fca, keyAllowedLpStableScriptHash()))) | |
1617 | 1618 | let currentHash = scriptHash(this) | |
1618 | 1619 | if (if ((allowedHash == newHash)) | |
1619 | 1620 | then (currentHash != newHash) | |
1620 | 1621 | else false) | |
1621 | 1622 | then true | |
1622 | 1623 | else sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1623 | 1624 | case _ => | |
1624 | 1625 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
1625 | 1626 | } | |
1626 | 1627 | } | |
1627 | 1628 |
github/deemru/w8io/169f3d6 200.01 ms ◑