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