tx · 4DUQpCS4644kBbhWT1ojvuiDemuxV8dMhttmdzEezZXU 3MudYAdb2aRxJGx7YHraAtN7v6dXCVHUFKx: -0.04700000 Waves 2023.08.23 12:49 [2723121] smart account 3MudYAdb2aRxJGx7YHraAtN7v6dXCVHUFKx > SELF 0.00000000 Waves
{ "type": 13, "id": "4DUQpCS4644kBbhWT1ojvuiDemuxV8dMhttmdzEezZXU", "fee": 4700000, "feeAssetId": null, "timestamp": 1692784226021, "version": 2, "chainId": 84, "sender": "3MudYAdb2aRxJGx7YHraAtN7v6dXCVHUFKx", "senderPublicKey": "FGk4k1DFjx16u4CWSy96FFccU9X7X6Q4sw1NhmDv3Vr4", "proofs": [ "4Wzn4DBs6HN7BRXGTJZnhduQQwQH8LFpZ88CjtXyLLzqtAQ5dMU6kFasBb9XM1PJXCbpcLmUpSyv1YSHwei759aM", "5kbborNPvZwFTkdSq4rjU6aAjf4yy9VRy5f9cLN8RcSS5HTnwJ8gMr9VpqyLCm3FxVgPuxFyycW8QLtgqMmgysnS" ], "script": "base64:BgJyCAISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESEgYKBAIYERISBgoEAhgREhIGCgQCGBESVAAHdmVyc2lvbgIFMS4wLjAACGtWZXJzaW9uAgd2ZXJzaW9uAAdrQWN0aXZlAgZhY3RpdmUAC2tEZXByZWNhdGVkAgtkZXByZWNhdGVkXwAJa0Fzc2V0SWRBAgpBX2Fzc2V0X2lkAAlrQXNzZXRJZEICCkJfYXNzZXRfaWQACWtCYWxhbmNlQQIPQV9hc3NldF9iYWxhbmNlAAlrQmFsYW5jZUICD0JfYXNzZXRfYmFsYW5jZQANa0JhbGFuY2VJbml0QQIMQV9hc3NldF9pbml0AA1rQmFsYW5jZUluaXRCAgxCX2Fzc2V0X2luaXQADWtTaGFyZUFzc2V0SWQCDnNoYXJlX2Fzc2V0X2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wIIBQJ0eAZwcm9vZnMAAQUMYWRtaW5QdWJLZXkyAAEAAAQSYWRtaW5QdWJLZXkzU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAgUMYWRtaW5QdWJLZXkzAAEAAAkAZwIJAGQCCQBkAgUSYWRtaW5QdWJLZXkxU2lnbmVkBRJhZG1pblB1YktleTJTaWduZWQFEmFkbWluUHViS2V5M1NpZ25lZAACBRNtdWx0aVNpZ25lZEJ5QWRtaW5zftomcA==", "height": 2723121, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7JHcBzvYYSZh8LWvR9oxWSPdGUtDb7VRH6GfwoxKJ4y7 Next: GU5mAa2zVz3uzSFK36n4ZKRj9UW15QMLV8PYmb99qpX8 Diff:
Old | New | Differences | |
---|---|---|---|
51 | 51 | ||
52 | 52 | let kEURNAssetId = "eurn_asset_id" | |
53 | 53 | ||
54 | - | let kL2MPAssetId = "l2mp_asset_id" | |
55 | - | ||
56 | 54 | let kStakingAssets = "staking_assets" | |
57 | 55 | ||
58 | 56 | let kOracleActive = "active_all_contracts" | |
84 | 82 | let kGovAddress = "governance_address" | |
85 | 83 | ||
86 | 84 | let kFarmingAddress = "farming_address" | |
87 | - | ||
88 | - | let kL2MPAddress = "staking_l2mp_address" | |
89 | 85 | ||
90 | 86 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
91 | 87 | ||
119 | 115 | ||
120 | 116 | let EURN = getBase58FromOracle(kEURNAssetId) | |
121 | 117 | ||
122 | - | let L2MP = getBase58FromOracle(kL2MPAssetId) | |
123 | - | ||
124 | 118 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
125 | 119 | ||
126 | 120 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
127 | 121 | ||
128 | 122 | let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress)) | |
129 | - | ||
130 | - | let stakingL2MPAddress = Address(getBase58FromOracle(kL2MPAddress)) | |
131 | 123 | ||
132 | 124 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
133 | 125 | ||
162 | 154 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(pool))) | |
163 | 155 | else if ((aId == EURN)) | |
164 | 156 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(pool))) | |
165 | - | else if ((aId == L2MP)) | |
166 | - | then { | |
167 | - | let available = { | |
168 | - | let @ = invoke(stakingL2MPAddress, "getUserAssetsREADONLY", [toString(pool)], nil) | |
169 | - | if ($isInstanceOf(@, "(Int, Int, BigInt, Int, Int)")) | |
170 | - | then @ | |
171 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int, BigInt, Int, Int)")) | |
172 | - | } | |
173 | - | if ((available == available)) | |
174 | - | then available._2 | |
175 | - | else throw("Strict value is not equal to itself.") | |
176 | - | } | |
177 | - | else 0 | |
157 | + | else 0 | |
178 | 158 | case _: Unit => | |
179 | 159 | valueOrElse(getInteger(pool, kLeasingAmount), 0) | |
180 | 160 | case _ => | |
191 | 171 | ||
192 | 172 | func getAssetInfo (assetId) = match assetId { | |
193 | 173 | case id: String|ByteVector => | |
194 | - | let $ | |
174 | + | let $t040794251 = match id { | |
195 | 175 | case aId: ByteVector => | |
196 | 176 | $Tuple2(toBase58String(aId), aId) | |
197 | 177 | case aId: String => | |
199 | 179 | case _ => | |
200 | 180 | throw("Match error") | |
201 | 181 | } | |
202 | - | let stringId = $ | |
203 | - | let bytesId = $ | |
182 | + | let stringId = $t040794251._1 | |
183 | + | let bytesId = $t040794251._2 | |
204 | 184 | let info = valueOrErrorMessage(assetInfo(bytesId), (("Asset " + stringId) + " doesn't exist")) | |
205 | 185 | $Tuple3(stringId, info.name, info.decimals) | |
206 | 186 | case waves: Unit => | |
262 | 242 | } | |
263 | 243 | ||
264 | 244 | ||
265 | - | func parsePaymentAsset (assetId) = if ((assetId == base58'')) | |
266 | - | then unit | |
267 | - | else assetId | |
245 | + | func parsePaymentAsset (assetId) = match assetId { | |
246 | + | case id: ByteVector => | |
247 | + | if ((id == base58'')) | |
248 | + | then unit | |
249 | + | else id | |
250 | + | case id: String => | |
251 | + | if (if ((id == "WAVES")) | |
252 | + | then true | |
253 | + | else (id == "")) | |
254 | + | then unit | |
255 | + | else fromBase58String(id) | |
256 | + | case _ => | |
257 | + | throw("Match error") | |
258 | + | } | |
259 | + | ||
260 | + | ||
261 | + | func assetToStr (assetId) = match assetId { | |
262 | + | case id: ByteVector => | |
263 | + | toBase58String(id) | |
264 | + | case waves: Unit => | |
265 | + | "WAVES" | |
266 | + | case _ => | |
267 | + | throw("Match error") | |
268 | + | } | |
268 | 269 | ||
269 | 270 | ||
270 | 271 | func suspendSuspicious (accountBalanceA,accountBalanceB,balanceA,balanceB,assetIdA,assetIdB) = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceA)) + " ") + assetIdA) + ", ") + toString(accountBalanceB)) + " ") + assetIdB) + ". State: ") + toString(balanceA)) + " ") + assetIdA) + ", ") + toString(balanceB)) + " ") + assetIdB)) | |
292 | 293 | let stakedAmountB = stakedAmount(assetIdB, pool) | |
293 | 294 | let accountBalanceA = (accountBalance(assetIdA, pool) + stakedAmountA) | |
294 | 295 | let accountBalanceB = (accountBalance(assetIdB, pool) + stakedAmountB) | |
295 | - | $Tuple6(balanceA, balanceB, accountBalanceA, accountBalanceB, stakedAmountA, stakedAmountB) | |
296 | + | let shareSupply = getIntegerValue(pool, kShareAssetSupply) | |
297 | + | $Tuple5(balanceA, balanceB, accountBalanceA, accountBalanceB, shareSupply) | |
296 | 298 | } | |
297 | - | ||
298 | - | ||
299 | - | func getLpSupply (pool) = getIntegerValue(pool, kShareAssetSupply) | |
300 | 299 | ||
301 | 300 | ||
302 | 301 | func getPoolAssets (pool) = { | |
323 | 322 | ||
324 | 323 | ||
325 | 324 | func calcLPAmountReplensishTwoTokens (pmtA,pmtB,pmtIdA,pmtIdB,balA,balB,shareAssetSupply) = { | |
326 | - | let $ | |
327 | - | let pmtStrAssetIdA = $ | |
328 | - | let pmtAssetNameA = $ | |
329 | - | let pmtDecimalsA = $ | |
330 | - | let $ | |
331 | - | let pmtStrAssetIdB = $ | |
332 | - | let pmtAssetNameB = $ | |
333 | - | let pmtDecimalsB = $ | |
325 | + | let $t098679939 = getAssetInfo(pmtIdA) | |
326 | + | let pmtStrAssetIdA = $t098679939._1 | |
327 | + | let pmtAssetNameA = $t098679939._2 | |
328 | + | let pmtDecimalsA = $t098679939._3 | |
329 | + | let $t0994410016 = getAssetInfo(pmtIdB) | |
330 | + | let pmtStrAssetIdB = $t0994410016._1 | |
331 | + | let pmtAssetNameB = $t0994410016._2 | |
332 | + | let pmtDecimalsB = $t0994410016._3 | |
334 | 333 | let initial = ((balA + balB) == 0) | |
335 | - | let $ | |
334 | + | let $t01005910718 = if (initial) | |
336 | 335 | then $Tuple5(pmtA, pmtB, 0, pmtIdA, toBigInt(1)) | |
337 | 336 | else { | |
338 | 337 | let ratioShareTokensInA = fraction(scale16, toBigInt(pmtA), toBigInt(balA)) | |
347 | 346 | $Tuple5(pmt, pmtB, (pmtA - pmt), pmtIdA, ratioShareTokensInB) | |
348 | 347 | } | |
349 | 348 | } | |
350 | - | let pmtAmountA = $ | |
351 | - | let pmtAmountB = $ | |
352 | - | let change = $ | |
353 | - | let changeAssetId = $ | |
354 | - | let shareTokenRatio = $ | |
349 | + | let pmtAmountA = $t01005910718._1 | |
350 | + | let pmtAmountB = $t01005910718._2 | |
351 | + | let change = $t01005910718._3 | |
352 | + | let changeAssetId = $t01005910718._4 | |
353 | + | let shareTokenRatio = $t01005910718._5 | |
355 | 354 | let shareTokenToPayAmount = if (initial) | |
356 | 355 | then { | |
357 | 356 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
365 | 364 | func calcLPAmountReplenishOneToken (pmtAmount,pmtAssetId,aId,bId,balA,balB,lpSupply,fee,govFee,teamFee,virtGetMinAmount) = if ((pmtAssetId == aId)) | |
366 | 365 | then { | |
367 | 366 | let virtPayAmount = calculateVirtPay(pmtAmount, balA, fee) | |
368 | - | let $ | |
369 | - | let amountWithoutFee = $ | |
370 | - | let amountWithFee = $ | |
371 | - | let governanceReward = $ | |
372 | - | let tReward = $ | |
367 | + | let $t01158211729 = calculateFees(virtPayAmount, virtGetMinAmount, balA, balB, fee, govFee, teamFee) | |
368 | + | let amountWithoutFee = $t01158211729._1 | |
369 | + | let amountWithFee = $t01158211729._2 | |
370 | + | let governanceReward = $t01158211729._3 | |
371 | + | let tReward = $t01158211729._4 | |
373 | 372 | let balanceAVirt = (balA + virtPayAmount) | |
374 | 373 | let balanceBVirt = (((balB + amountWithoutFee) - governanceReward) - tReward) | |
375 | 374 | let newBalanceA = (balA + pmtAmount) | |
383 | 382 | } | |
384 | 383 | else { | |
385 | 384 | let virtPayAmount = calculateVirtPay(pmtAmount, balB, fee) | |
386 | - | let $ | |
387 | - | let amountWithoutFee = $ | |
388 | - | let amountWithFee = $ | |
389 | - | let governanceReward = $ | |
390 | - | let tReward = $ | |
385 | + | let $t01277312920 = calculateFees(virtPayAmount, virtGetMinAmount, balB, balA, fee, govFee, teamFee) | |
386 | + | let amountWithoutFee = $t01277312920._1 | |
387 | + | let amountWithFee = $t01277312920._2 | |
388 | + | let governanceReward = $t01277312920._3 | |
389 | + | let tReward = $t01277312920._4 | |
391 | 390 | let balanceAVirt = (((balA + amountWithoutFee) - governanceReward) - tReward) | |
392 | 391 | let balanceBVirt = (balB + virtPayAmount) | |
393 | 392 | let newBalanceA = ((balA - governanceReward) - tReward) | |
402 | 401 | ||
403 | 402 | ||
404 | 403 | func calcLPReplenishDiffProp (pmtA,pmtB,pmtIdA,pmtIdB,balA,balB,lpSupply,fee,govFee,teamFee,virtGetMinAmount) = { | |
405 | - | let $ | |
406 | - | let lpTwoAmount = $ | |
407 | - | let change = $ | |
408 | - | let changeAssetId = $ | |
409 | - | let pmtAmountA = $ | |
410 | - | let pmtAmountB = $ | |
404 | + | let $t01408714235 = calcLPAmountReplensishTwoTokens(pmtA, pmtB, pmtIdA, pmtIdB, balA, balB, lpSupply) | |
405 | + | let lpTwoAmount = $t01408714235._1 | |
406 | + | let change = $t01408714235._2 | |
407 | + | let changeAssetId = $t01408714235._3 | |
408 | + | let pmtAmountA = $t01408714235._4 | |
409 | + | let pmtAmountB = $t01408714235._5 | |
411 | 410 | if ((change > 0)) | |
412 | 411 | then { | |
413 | - | let $ | |
414 | - | let lpOne = $ | |
415 | - | let newBalanceA = $ | |
416 | - | let newBalanceB = $ | |
417 | - | let governanceReward = $ | |
418 | - | let tReward = $ | |
419 | - | let gId = $ | |
420 | - | let loss = $ | |
412 | + | let $t01426714501 = calcLPAmountReplenishOneToken(change, changeAssetId, pmtIdA, pmtIdB, (balA + pmtAmountA), (balB + pmtAmountB), lpSupply, fee, govFee, teamFee, virtGetMinAmount) | |
413 | + | let lpOne = $t01426714501._1 | |
414 | + | let newBalanceA = $t01426714501._2 | |
415 | + | let newBalanceB = $t01426714501._3 | |
416 | + | let governanceReward = $t01426714501._4 | |
417 | + | let tReward = $t01426714501._5 | |
418 | + | let gId = $t01426714501._6 | |
419 | + | let loss = $t01426714501._7 | |
421 | 420 | $Tuple7((lpTwoAmount + lpOne), loss, newBalanceA, newBalanceB, governanceReward, tReward, gId) | |
422 | 421 | } | |
423 | 422 | else $Tuple7(lpTwoAmount, 0, (balA + pmtAmountA), (balB + pmtAmountB), 0, 0, unit) | |
425 | 424 | ||
426 | 425 | ||
427 | 426 | @Callable(i) | |
427 | + | func howManyYouPayREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
428 | + | let caller = Address(callerBytes) | |
429 | + | let $t01486914953 = $Tuple2(parseIntValue(args[0]), parsePaymentAsset(args[1])) | |
430 | + | let getAmount = $t01486914953._1 | |
431 | + | let getAssetId = $t01486914953._2 | |
432 | + | let $t01496215038 = getPoolAssets(i.caller) | |
433 | + | let strAssetIdA = $t01496215038._1 | |
434 | + | let strAssetIdB = $t01496215038._2 | |
435 | + | let assetIdA = $t01496215038._3 | |
436 | + | let assetIdB = $t01496215038._4 | |
437 | + | let $t01504715153 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
438 | + | let balanceA = $t01504715153._1 | |
439 | + | let balanceB = $t01504715153._2 | |
440 | + | let accountBalanceA = $t01504715153._3 | |
441 | + | let accountBalanceB = $t01504715153._4 | |
442 | + | if (if ((balanceA == 0)) | |
443 | + | then true | |
444 | + | else (balanceB == 0)) | |
445 | + | then throw("Can't exchange with zero balance") | |
446 | + | else if (!(containsElement([assetIdA, assetIdB], getAssetId))) | |
447 | + | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
448 | + | else { | |
449 | + | let $t01544715514 = getFeeParams(i.caller, i.originCaller) | |
450 | + | let fee = $t01544715514._1 | |
451 | + | let govFee = $t01544715514._2 | |
452 | + | let teamFee = $t01544715514._3 | |
453 | + | let $t01552715929 = { | |
454 | + | let amntGetNoFee = fraction(getAmount, feeScale6, (feeScale6 - fee), CEILING) | |
455 | + | if ((getAssetId == assetIdA)) | |
456 | + | then $Tuple2(fraction(amntGetNoFee, balanceB, (balanceA - amntGetNoFee), CEILING), assetIdB) | |
457 | + | else $Tuple2(fraction(amntGetNoFee, balanceA, (balanceB - amntGetNoFee), CEILING), assetIdA) | |
458 | + | } | |
459 | + | let amountToPay = $t01552715929._1 | |
460 | + | let assetToPay = $t01552715929._2 | |
461 | + | $Tuple2(nil, $Tuple2(nil, [amountToPay, assetToStr(assetToPay)])) | |
462 | + | } | |
463 | + | } | |
464 | + | ||
465 | + | ||
466 | + | ||
467 | + | @Callable(i) | |
468 | + | func howManyYouGetREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
469 | + | let caller = Address(callerBytes) | |
470 | + | let $t01618116265 = $Tuple2(parseIntValue(args[0]), parsePaymentAsset(args[1])) | |
471 | + | let pmtAmount = $t01618116265._1 | |
472 | + | let pmtAssetId = $t01618116265._2 | |
473 | + | let $t01627416350 = getPoolAssets(i.caller) | |
474 | + | let strAssetIdA = $t01627416350._1 | |
475 | + | let strAssetIdB = $t01627416350._2 | |
476 | + | let assetIdA = $t01627416350._3 | |
477 | + | let assetIdB = $t01627416350._4 | |
478 | + | let $t01635916465 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
479 | + | let balanceA = $t01635916465._1 | |
480 | + | let balanceB = $t01635916465._2 | |
481 | + | let accountBalanceA = $t01635916465._3 | |
482 | + | let accountBalanceB = $t01635916465._4 | |
483 | + | if (if ((balanceA == 0)) | |
484 | + | then true | |
485 | + | else (balanceB == 0)) | |
486 | + | then throw("Can't exchange with zero balance") | |
487 | + | else if (!(containsElement([assetIdA, assetIdB], pmtAssetId))) | |
488 | + | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
489 | + | else { | |
490 | + | let $t01675916826 = getFeeParams(i.caller, i.originCaller) | |
491 | + | let fee = $t01675916826._1 | |
492 | + | let govFee = $t01675916826._2 | |
493 | + | let teamFee = $t01675916826._3 | |
494 | + | let $t01683917156 = if ((pmtAssetId == assetIdA)) | |
495 | + | then calculateFees(pmtAmount, 0, balanceA, balanceB, fee, govFee, teamFee) | |
496 | + | else calculateFees(pmtAmount, 0, balanceB, balanceA, fee, govFee, teamFee) | |
497 | + | let amountWithoutFee = $t01683917156._1 | |
498 | + | let amountWithFee = $t01683917156._2 | |
499 | + | let governanceReward = $t01683917156._3 | |
500 | + | let teamReward = $t01683917156._4 | |
501 | + | let assetIdSend = if ((pmtAssetId == assetIdA)) | |
502 | + | then assetIdB | |
503 | + | else assetIdA | |
504 | + | $Tuple2(nil, $Tuple2(nil, [amountWithFee, assetToStr(assetIdSend), governanceReward, teamReward])) | |
505 | + | } | |
506 | + | } | |
507 | + | ||
508 | + | ||
509 | + | ||
510 | + | @Callable(i) | |
428 | 511 | func calcLPReplenishDiffPropREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
429 | - | let $ | |
430 | - | let strAssetIdA = $ | |
431 | - | let strAssetIdB = $ | |
432 | - | let assetIdA = $ | |
433 | - | let assetIdB = $ | |
434 | - | let shareAssetId = $ | |
435 | - | let $ | |
436 | - | let balA = $ | |
437 | - | let balB = $ | |
438 | - | let accBalA = $ | |
439 | - | let accBalB = $ | |
440 | - | let lpSupply = | |
512 | + | let $t01749417584 = getPoolAssets(i.caller) | |
513 | + | let strAssetIdA = $t01749417584._1 | |
514 | + | let strAssetIdB = $t01749417584._2 | |
515 | + | let assetIdA = $t01749417584._3 | |
516 | + | let assetIdB = $t01749417584._4 | |
517 | + | let shareAssetId = $t01749417584._5 | |
518 | + | let $t01758917681 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
519 | + | let balA = $t01758917681._1 | |
520 | + | let balB = $t01758917681._2 | |
521 | + | let accBalA = $t01758917681._3 | |
522 | + | let accBalB = $t01758917681._4 | |
523 | + | let lpSupply = $t01758917681._5 | |
441 | 524 | let pmtA = parseIntValue(args[0]) | |
442 | 525 | let pmtB = parseIntValue(args[1]) | |
443 | 526 | let virtGetMinAmount = parseIntValue(args[2]) | |
444 | - | let $ | |
445 | - | let fee = $ | |
446 | - | let govFee = $ | |
447 | - | let teamFee = $ | |
448 | - | let $ | |
449 | - | let lp = $ | |
450 | - | let loss = $ | |
451 | - | let newBalanceA = $ | |
452 | - | let newBalanceB = $ | |
453 | - | let governanceReward = $ | |
454 | - | let tReward = $ | |
455 | - | let aId = $ | |
527 | + | let $t01781517882 = getFeeParams(i.caller, i.originCaller) | |
528 | + | let fee = $t01781517882._1 | |
529 | + | let govFee = $t01781517882._2 | |
530 | + | let teamFee = $t01781517882._3 | |
531 | + | let $t01788718079 = calcLPReplenishDiffProp(pmtA, pmtB, assetIdA, assetIdB, balA, balB, lpSupply, fee, govFee, teamFee, virtGetMinAmount) | |
532 | + | let lp = $t01788718079._1 | |
533 | + | let loss = $t01788718079._2 | |
534 | + | let newBalanceA = $t01788718079._3 | |
535 | + | let newBalanceB = $t01788718079._4 | |
536 | + | let governanceReward = $t01788718079._5 | |
537 | + | let tReward = $t01788718079._6 | |
538 | + | let aId = $t01788718079._7 | |
456 | 539 | $Tuple2(nil, $Tuple2(nil, [lp, loss, newBalanceA, newBalanceB, governanceReward, tReward, aId])) | |
457 | 540 | } | |
458 | 541 | ||
460 | 543 | ||
461 | 544 | @Callable(i) | |
462 | 545 | func calcLPReplenishTwoTokensREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
463 | - | let $ | |
464 | - | let strAssetIdA = $ | |
465 | - | let strAssetIdB = $ | |
466 | - | let assetIdA = $ | |
467 | - | let assetIdB = $ | |
468 | - | let shareAssetId = $ | |
469 | - | let $ | |
470 | - | let balA = $ | |
471 | - | let balB = $ | |
472 | - | let accBalA = $ | |
473 | - | let accBalB = $ | |
474 | - | let lpSupply = | |
546 | + | let $t01832218412 = getPoolAssets(i.caller) | |
547 | + | let strAssetIdA = $t01832218412._1 | |
548 | + | let strAssetIdB = $t01832218412._2 | |
549 | + | let assetIdA = $t01832218412._3 | |
550 | + | let assetIdB = $t01832218412._4 | |
551 | + | let shareAssetId = $t01832218412._5 | |
552 | + | let $t01841718509 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
553 | + | let balA = $t01841718509._1 | |
554 | + | let balB = $t01841718509._2 | |
555 | + | let accBalA = $t01841718509._3 | |
556 | + | let accBalB = $t01841718509._4 | |
557 | + | let lpSupply = $t01841718509._5 | |
475 | 558 | let pmtA = parseIntValue(args[0]) | |
476 | 559 | let pmtB = parseIntValue(args[1]) | |
477 | - | let $ | |
478 | - | let lp = $ | |
479 | - | let change = $ | |
480 | - | let changeAssetId = $ | |
481 | - | let pmtAmountA = $ | |
482 | - | let pmtAmountB = $ | |
560 | + | let $t01859218735 = calcLPAmountReplensishTwoTokens(pmtA, pmtB, assetIdA, assetIdB, balA, balB, lpSupply) | |
561 | + | let lp = $t01859218735._1 | |
562 | + | let change = $t01859218735._2 | |
563 | + | let changeAssetId = $t01859218735._3 | |
564 | + | let pmtAmountA = $t01859218735._4 | |
565 | + | let pmtAmountB = $t01859218735._5 | |
483 | 566 | $Tuple2(nil, $Tuple2(nil, [lp, change, changeAssetId, pmtAmountA, pmtAmountB])) | |
484 | 567 | } | |
485 | 568 | ||
487 | 570 | ||
488 | 571 | @Callable(i) | |
489 | 572 | func withdrawREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
490 | - | let $ | |
491 | - | let strAssetIdA = $ | |
492 | - | let strAssetIdB = $ | |
493 | - | let assetIdA = $ | |
494 | - | let assetIdB = $ | |
495 | - | let shareAssetId = $ | |
496 | - | let $ | |
497 | - | let balanceA = $ | |
498 | - | let balanceB = $ | |
499 | - | let accountBalanceA = $ | |
500 | - | let accountBalanceB = $ | |
501 | - | let shareAssetSupply = | |
573 | + | let $t01894619036 = getPoolAssets(i.caller) | |
574 | + | let strAssetIdA = $t01894619036._1 | |
575 | + | let strAssetIdB = $t01894619036._2 | |
576 | + | let assetIdA = $t01894619036._3 | |
577 | + | let assetIdB = $t01894619036._4 | |
578 | + | let shareAssetId = $t01894619036._5 | |
579 | + | let $t01904119165 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
580 | + | let balanceA = $t01904119165._1 | |
581 | + | let balanceB = $t01904119165._2 | |
582 | + | let accountBalanceA = $t01904119165._3 | |
583 | + | let accountBalanceB = $t01904119165._4 | |
584 | + | let shareAssetSupply = $t01904119165._5 | |
502 | 585 | let withdrawAmount = parseIntValue(args[0]) | |
503 | - | let $ | |
586 | + | let $t01921919381 = if ((size(args) == 3)) | |
504 | 587 | then $Tuple2(parseIntValue(args[1]), parseIntValue(args[2])) | |
505 | 588 | else $Tuple2(balanceA, balanceB) | |
506 | - | let balA = $ | |
507 | - | let balB = $ | |
589 | + | let balA = $t01921919381._1 | |
590 | + | let balB = $t01921919381._2 | |
508 | 591 | let amountToPayA = fraction(withdrawAmount, balA, shareAssetSupply) | |
509 | 592 | let amountToPayB = fraction(withdrawAmount, balB, shareAssetSupply) | |
510 | 593 | $Tuple2(nil, $Tuple2(nil, [amountToPayA, amountToPayB])) | |
515 | 598 | @Callable(i) | |
516 | 599 | func init (callerBytes,args,pAmounts,pAssetIds) = { | |
517 | 600 | let caller = Address(callerBytes) | |
518 | - | let $ | |
519 | - | let pmtAmountA = $ | |
520 | - | let pmtAssetIdA = $ | |
521 | - | let $ | |
522 | - | let pmtAmountB = $ | |
523 | - | let pmtAssetIdB = $ | |
601 | + | let $t01973619814 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
602 | + | let pmtAmountA = $t01973619814._1 | |
603 | + | let pmtAssetIdA = $t01973619814._2 | |
604 | + | let $t01981919897 = $Tuple2(pAmounts[1], parsePaymentAsset(pAssetIds[1])) | |
605 | + | let pmtAmountB = $t01981919897._1 | |
606 | + | let pmtAssetIdB = $t01981919897._2 | |
524 | 607 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
525 | 608 | then throw("Only admin can call this function") | |
526 | 609 | else if ((size(args) != 1)) | |
530 | 613 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
531 | 614 | then throw("Assets must be different") | |
532 | 615 | else { | |
533 | - | let $ | |
534 | - | let pmtStrAssetIdA = $ | |
535 | - | let pmtAssetNameA = $ | |
536 | - | let pmtDecimalsA = $ | |
537 | - | let $ | |
538 | - | let pmtStrAssetIdB = $ | |
539 | - | let pmtAssetNameB = $ | |
540 | - | let pmtDecimalsB = $ | |
616 | + | let $t02033220409 = getAssetInfo(pmtAssetIdA) | |
617 | + | let pmtStrAssetIdA = $t02033220409._1 | |
618 | + | let pmtAssetNameA = $t02033220409._2 | |
619 | + | let pmtDecimalsA = $t02033220409._3 | |
620 | + | let $t02041820495 = getAssetInfo(pmtAssetIdB) | |
621 | + | let pmtStrAssetIdB = $t02041820495._1 | |
622 | + | let pmtAssetNameB = $t02041820495._2 | |
623 | + | let pmtDecimalsB = $t02041820495._3 | |
541 | 624 | let firstHarvest = (args[0] == "true") | |
542 | 625 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
543 | 626 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
574 | 657 | @Callable(i) | |
575 | 658 | func initWithInitRatio (callerBytes,args,pAmounts,pAssetIds) = { | |
576 | 659 | let caller = Address(callerBytes) | |
577 | - | let $ | |
578 | - | let amtAssetA = $ | |
579 | - | let amtAssetB = $ | |
580 | - | let assetIdAStr = $ | |
581 | - | let assetIdBStr = $ | |
582 | - | let firstHarvest = $ | |
660 | + | let $t02271622916 = $Tuple5(parseIntValue(args[0]), parseIntValue(args[1]), args[2], args[3], (args[4] == "true")) | |
661 | + | let amtAssetA = $t02271622916._1 | |
662 | + | let amtAssetB = $t02271622916._2 | |
663 | + | let assetIdAStr = $t02271622916._3 | |
664 | + | let assetIdBStr = $t02271622916._4 | |
665 | + | let firstHarvest = $t02271622916._5 | |
583 | 666 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
584 | 667 | then throw("Only admin can call this function") | |
585 | 668 | else if ((size(args) != 5)) | |
589 | 672 | else if ((assetIdAStr == assetIdBStr)) | |
590 | 673 | then throw("Assets must be different") | |
591 | 674 | else { | |
592 | - | let $ | |
593 | - | let pmtStrAssetIdA = $ | |
594 | - | let pmtAssetNameA = $ | |
595 | - | let pmtDecimalsA = $ | |
596 | - | let $ | |
597 | - | let pmtStrAssetIdB = $ | |
598 | - | let pmtAssetNameB = $ | |
599 | - | let pmtDecimalsB = $ | |
675 | + | let $t02335123428 = getAssetInfo(assetIdAStr) | |
676 | + | let pmtStrAssetIdA = $t02335123428._1 | |
677 | + | let pmtAssetNameA = $t02335123428._2 | |
678 | + | let pmtDecimalsA = $t02335123428._3 | |
679 | + | let $t02343723514 = getAssetInfo(assetIdBStr) | |
680 | + | let pmtStrAssetIdB = $t02343723514._1 | |
681 | + | let pmtAssetNameB = $t02343723514._2 | |
682 | + | let pmtDecimalsB = $t02343723514._3 | |
600 | 683 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
601 | 684 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
602 | 685 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
627 | 710 | @Callable(i) | |
628 | 711 | func exchange (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
629 | 712 | let caller = Address(callerBytes) | |
630 | - | let $ | |
631 | - | let pmtAmount = $ | |
632 | - | let pmtAssetId = $ | |
713 | + | let $t02594026016 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
714 | + | let pmtAmount = $t02594026016._1 | |
715 | + | let pmtAssetId = $t02594026016._2 | |
633 | 716 | let minAmountToReceive = parseIntValue(args[0]) | |
634 | - | let $ | |
635 | - | let strAssetIdA = $ | |
636 | - | let strAssetIdB = $ | |
637 | - | let assetIdA = $ | |
638 | - | let assetIdB = $ | |
639 | - | let $ | |
640 | - | let balanceA = $ | |
641 | - | let balanceB = $ | |
642 | - | let accountBalanceA = $ | |
643 | - | let accountBalanceB = $ | |
717 | + | let $t02608126157 = getPoolAssets(i.caller) | |
718 | + | let strAssetIdA = $t02608126157._1 | |
719 | + | let strAssetIdB = $t02608126157._2 | |
720 | + | let assetIdA = $t02608126157._3 | |
721 | + | let assetIdB = $t02608126157._4 | |
722 | + | let $t02616626272 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
723 | + | let balanceA = $t02616626272._1 | |
724 | + | let balanceB = $t02616626272._2 | |
725 | + | let accountBalanceA = $t02616626272._3 | |
726 | + | let accountBalanceB = $t02616626272._4 | |
644 | 727 | if ((size(args) != 1)) | |
645 | 728 | then throw("Wrong args size") | |
646 | 729 | else if (if ((balanceA == 0)) | |
656 | 739 | else if (if ((balanceA > accountBalanceA)) | |
657 | 740 | then true | |
658 | 741 | else (balanceB > accountBalanceB)) | |
659 | - | then $Tuple2(nil, | |
742 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
660 | 743 | else { | |
661 | - | let $ | |
662 | - | let fee = $ | |
663 | - | let govFee = $ | |
664 | - | let teamFee = $ | |
665 | - | let $ | |
744 | + | let $t02717227239 = getFeeParams(i.caller, i.originCaller) | |
745 | + | let fee = $t02717227239._1 | |
746 | + | let govFee = $t02717227239._2 | |
747 | + | let teamFee = $t02717227239._3 | |
748 | + | let $t02725227603 = if ((pmtAssetId == assetIdA)) | |
666 | 749 | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee, teamFee) | |
667 | 750 | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee, teamFee) | |
668 | - | let amountWithoutFee = $ | |
669 | - | let amountWithFee = $ | |
670 | - | let governanceReward = $ | |
671 | - | let teamReward = $ | |
672 | - | let $ | |
751 | + | let amountWithoutFee = $t02725227603._1 | |
752 | + | let amountWithFee = $t02725227603._2 | |
753 | + | let governanceReward = $t02725227603._3 | |
754 | + | let teamReward = $t02725227603._4 | |
755 | + | let $t02761727952 = if ((pmtAssetId == assetIdA)) | |
673 | 756 | then $Tuple3((balanceA + pmtAmount), (((balanceB - amountWithFee) - governanceReward) - teamReward), assetIdB) | |
674 | 757 | else $Tuple3((((balanceA - amountWithFee) - governanceReward) - teamReward), (balanceB + pmtAmount), assetIdA) | |
675 | - | let newBalanceA = $ | |
676 | - | let newBalanceB = $ | |
677 | - | let assetIdSend = $ | |
678 | - | let $ | |
758 | + | let newBalanceA = $t02761727952._1 | |
759 | + | let newBalanceB = $t02761727952._2 | |
760 | + | let assetIdSend = $t02761727952._3 | |
761 | + | let $t02796628226 = if ((pmtAssetId == assetIdA)) | |
679 | 762 | then $Tuple2(pmtAmount, ((amountWithFee + governanceReward) + teamReward)) | |
680 | 763 | else $Tuple2(((amountWithFee + governanceReward) + teamReward), pmtAmount) | |
681 | - | let stakeAmountA = $ | |
682 | - | let stakeAmountB = $ | |
764 | + | let stakeAmountA = $t02796628226._1 | |
765 | + | let stakeAmountB = $t02796628226._2 | |
683 | 766 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
684 | 767 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdA), stakeAmountA, strAssetIdA], nil) | |
685 | 768 | else 0 | |
705 | 788 | let pmtAssetIdB = parsePaymentAsset(pAssetIds[1]) | |
706 | 789 | let stakeFarming = (args[0] == "true") | |
707 | 790 | let lockType = parseIntValue(args[1]) | |
708 | - | let $ | |
709 | - | let strAssetIdA = $ | |
710 | - | let strAssetIdB = $ | |
711 | - | let assetIdA = $ | |
712 | - | let assetIdB = $ | |
713 | - | let shareAssetId = $ | |
714 | - | let $ | |
715 | - | let balanceA = $ | |
716 | - | let balanceB = $ | |
717 | - | let accountBalanceA = $ | |
718 | - | let accountBalanceB = $ | |
719 | - | let shareAssetSupply = | |
791 | + | let $t02954129631 = getPoolAssets(i.caller) | |
792 | + | let strAssetIdA = $t02954129631._1 | |
793 | + | let strAssetIdB = $t02954129631._2 | |
794 | + | let assetIdA = $t02954129631._3 | |
795 | + | let assetIdB = $t02954129631._4 | |
796 | + | let shareAssetId = $t02954129631._5 | |
797 | + | let $t02964029764 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
798 | + | let balanceA = $t02964029764._1 | |
799 | + | let balanceB = $t02964029764._2 | |
800 | + | let accountBalanceA = $t02964029764._3 | |
801 | + | let accountBalanceB = $t02964029764._4 | |
802 | + | let shareAssetSupply = $t02964029764._5 | |
720 | 803 | if ((size(args) != 2)) | |
721 | 804 | then throw("Wrong args size") | |
722 | 805 | else if (if ((size(pAmounts) != 2)) | |
730 | 813 | else if (if ((balanceA > accountBalanceA)) | |
731 | 814 | then true | |
732 | 815 | else (balanceB > accountBalanceB)) | |
733 | - | then $Tuple2(nil, | |
816 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pAmounts[0], pmtAssetIdA), ScriptTransfer(caller, pAmounts[1], pmtAssetIdB)] ++ (if ((size(pAmounts) == 3)) | |
734 | 817 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
735 | 818 | then unit | |
736 | 819 | else pAssetIds[2], pAmounts[2])] | |
737 | - | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB)))) | |
820 | + | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
738 | 821 | else { | |
739 | - | let $ | |
740 | - | let shareTokenToPayAmount = $ | |
741 | - | let change = $ | |
742 | - | let changeAssetId = $ | |
743 | - | let pmtAmountA = $ | |
744 | - | let pmtAmountB = $ | |
822 | + | let $t03070130899 = calcLPAmountReplensishTwoTokens(pAmounts[0], pAmounts[1], pmtAssetIdA, pmtAssetIdB, balanceA, balanceB, shareAssetSupply) | |
823 | + | let shareTokenToPayAmount = $t03070130899._1 | |
824 | + | let change = $t03070130899._2 | |
825 | + | let changeAssetId = $t03070130899._3 | |
826 | + | let pmtAmountA = $t03070130899._4 | |
827 | + | let pmtAmountB = $t03070130899._5 | |
745 | 828 | if ((shareTokenToPayAmount == 0)) | |
746 | 829 | then throw("Too small amount to replenish") | |
747 | 830 | else if ((0 > change)) | |
794 | 877 | let virtGetMinAmount = parseIntValue(args[0]) | |
795 | 878 | let stakeFarming = (args[1] == "true") | |
796 | 879 | let lockType = parseIntValue(args[2]) | |
797 | - | let $ | |
798 | - | let strAssetIdA = $ | |
799 | - | let strAssetIdB = $ | |
800 | - | let assetIdA = $ | |
801 | - | let assetIdB = $ | |
802 | - | let shareAssetId = $ | |
803 | - | let $ | |
804 | - | let balanceA = $ | |
805 | - | let balanceB = $ | |
806 | - | let accountBalanceA = $ | |
807 | - | let accountBalanceB = $ | |
808 | - | let shareAssetSupply = | |
880 | + | let $t03315833248 = getPoolAssets(i.caller) | |
881 | + | let strAssetIdA = $t03315833248._1 | |
882 | + | let strAssetIdB = $t03315833248._2 | |
883 | + | let assetIdA = $t03315833248._3 | |
884 | + | let assetIdB = $t03315833248._4 | |
885 | + | let shareAssetId = $t03315833248._5 | |
886 | + | let $t03325333377 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
887 | + | let balanceA = $t03325333377._1 | |
888 | + | let balanceB = $t03325333377._2 | |
889 | + | let accountBalanceA = $t03325333377._3 | |
890 | + | let accountBalanceB = $t03325333377._4 | |
891 | + | let shareAssetSupply = $t03325333377._5 | |
809 | 892 | let initial = ((balanceA + balanceB) == 0) | |
810 | 893 | if ((size(args) != 3)) | |
811 | 894 | then throw("Wrong args size") | |
822 | 905 | else if (if ((balanceA > accountBalanceA)) | |
823 | 906 | then true | |
824 | 907 | else (balanceB > accountBalanceB)) | |
825 | - | then $Tuple2(nil, | |
908 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ (if ((size(pAmounts) == 2)) | |
826 | 909 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
827 | 910 | then unit | |
828 | 911 | else pAssetIds[2], pAmounts[2])] | |
829 | - | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB)))) | |
912 | + | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
830 | 913 | else { | |
831 | - | let $ | |
832 | - | let fee = $ | |
833 | - | let govFee = $ | |
834 | - | let teamFee = $ | |
835 | - | let $ | |
836 | - | let pmtAssetIdStr = $ | |
837 | - | let pmtAssetIdName = $ | |
838 | - | let $ | |
839 | - | let shareTokenToPayAmount = $ | |
840 | - | let newBalanceA = $ | |
841 | - | let newBalanceB = $ | |
842 | - | let govReward = $ | |
843 | - | let teamReward = $ | |
844 | - | let govRewardAsset = $ | |
914 | + | let $t03428934356 = getFeeParams(i.caller, i.originCaller) | |
915 | + | let fee = $t03428934356._1 | |
916 | + | let govFee = $t03428934356._2 | |
917 | + | let teamFee = $t03428934356._3 | |
918 | + | let $t03436534427 = getAssetInfo(pmtAssetId) | |
919 | + | let pmtAssetIdStr = $t03436534427._1 | |
920 | + | let pmtAssetIdName = $t03436534427._2 | |
921 | + | let $t03444534690 = calcLPAmountReplenishOneToken(pmtAmount, pmtAssetId, assetIdA, assetIdB, balanceA, balanceB, shareAssetSupply, fee, govFee, teamFee, virtGetMinAmount) | |
922 | + | let shareTokenToPayAmount = $t03444534690._1 | |
923 | + | let newBalanceA = $t03444534690._2 | |
924 | + | let newBalanceB = $t03444534690._3 | |
925 | + | let govReward = $t03444534690._4 | |
926 | + | let teamReward = $t03444534690._5 | |
927 | + | let govRewardAsset = $t03444534690._6 | |
845 | 928 | let govRewardAssetStr = if ((govRewardAsset == assetIdA)) | |
846 | 929 | then strAssetIdA | |
847 | 930 | else strAssetIdB | |
890 | 973 | @Callable(i) | |
891 | 974 | func withdraw (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
892 | 975 | let caller = Address(callerBytes) | |
893 | - | let $ | |
894 | - | let strAssetIdA = $ | |
895 | - | let strAssetIdB = $ | |
896 | - | let assetIdA = $ | |
897 | - | let assetIdB = $ | |
898 | - | let shareAssetId = $ | |
899 | - | let $ | |
900 | - | let balanceA = $ | |
901 | - | let balanceB = $ | |
902 | - | let accountBalanceA = $ | |
903 | - | let accountBalanceB = $ | |
904 | - | let shareAssetSupply = | |
905 | - | let $ | |
976 | + | let $t03675836848 = getPoolAssets(i.caller) | |
977 | + | let strAssetIdA = $t03675836848._1 | |
978 | + | let strAssetIdB = $t03675836848._2 | |
979 | + | let assetIdA = $t03675836848._3 | |
980 | + | let assetIdB = $t03675836848._4 | |
981 | + | let shareAssetId = $t03675836848._5 | |
982 | + | let $t03685736981 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
983 | + | let balanceA = $t03685736981._1 | |
984 | + | let balanceB = $t03685736981._2 | |
985 | + | let accountBalanceA = $t03685736981._3 | |
986 | + | let accountBalanceB = $t03685736981._4 | |
987 | + | let shareAssetSupply = $t03685736981._5 | |
988 | + | let $t03699037370 = if ((size(pAmounts) == 1)) | |
906 | 989 | then { | |
907 | 990 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
908 | 991 | if ((pAsset != shareAssetId)) | |
910 | 993 | else $Tuple2(pAmounts[0], pAsset) | |
911 | 994 | } | |
912 | 995 | else $Tuple2(0, shareAssetId) | |
913 | - | let pmtAmount = $ | |
914 | - | let pmtAssetId = $ | |
996 | + | let pmtAmount = $t03699037370._1 | |
997 | + | let pmtAssetId = $t03699037370._2 | |
915 | 998 | if ((size(args) != 1)) | |
916 | 999 | then throw("Wrong args size") | |
917 | 1000 | else if ((size(pAmounts) > 1)) | |
919 | 1002 | else if (if ((balanceA > accountBalanceA)) | |
920 | 1003 | then true | |
921 | 1004 | else (balanceB > accountBalanceB)) | |
922 | - | then $Tuple2(nil, | |
1005 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
923 | 1006 | else { | |
924 | 1007 | let unlockAmount = parseIntValue(valueOrElse(args[0], "0")) | |
925 | 1008 | let unlock = if ((unlockAmount > 0)) | |
956 | 1039 | let withdrawAsset = if ((args[0] == "")) | |
957 | 1040 | then unit | |
958 | 1041 | else fromBase58String(args[0]) | |
959 | - | let $ | |
960 | - | let strAssetIdA = $ | |
961 | - | let strAssetIdB = $ | |
962 | - | let assetIdA = $ | |
963 | - | let assetIdB = $ | |
964 | - | let shareAssetId = $ | |
965 | - | let $ | |
966 | - | let balanceA = $ | |
967 | - | let balanceB = $ | |
968 | - | let accountBalanceA = $ | |
969 | - | let accountBalanceB = $ | |
970 | - | let shareAssetSupply = | |
971 | - | let $ | |
1042 | + | let $t03958839678 = getPoolAssets(i.caller) | |
1043 | + | let strAssetIdA = $t03958839678._1 | |
1044 | + | let strAssetIdB = $t03958839678._2 | |
1045 | + | let assetIdA = $t03958839678._3 | |
1046 | + | let assetIdB = $t03958839678._4 | |
1047 | + | let shareAssetId = $t03958839678._5 | |
1048 | + | let $t03968739811 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1049 | + | let balanceA = $t03968739811._1 | |
1050 | + | let balanceB = $t03968739811._2 | |
1051 | + | let accountBalanceA = $t03968739811._3 | |
1052 | + | let accountBalanceB = $t03968739811._4 | |
1053 | + | let shareAssetSupply = $t03968739811._5 | |
1054 | + | let $t03982040172 = if ((size(pAmounts) == 1)) | |
972 | 1055 | then { | |
973 | 1056 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
974 | 1057 | if ((pAsset != shareAssetId)) | |
976 | 1059 | else $Tuple2(pAmounts[0], pAsset) | |
977 | 1060 | } | |
978 | 1061 | else $Tuple2(0, shareAssetId) | |
979 | - | let pmtAmount = $ | |
980 | - | let pmtAssetId = $ | |
1062 | + | let pmtAmount = $t03982040172._1 | |
1063 | + | let pmtAssetId = $t03982040172._2 | |
981 | 1064 | let virtMinToRecive = parseIntValue(args[1]) | |
982 | 1065 | if ((size(args) != 3)) | |
983 | 1066 | then throw("Wrong args size") | |
990 | 1073 | else if (if ((balanceA > accountBalanceA)) | |
991 | 1074 | then true | |
992 | 1075 | else (balanceB > accountBalanceB)) | |
993 | - | then $Tuple2(nil, | |
1076 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
994 | 1077 | else { | |
995 | 1078 | let unlockAmount = parseIntValue(valueOrElse(args[2], "0")) | |
996 | 1079 | let unlock = if ((unlockAmount > 0)) | |
1001 | 1084 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1002 | 1085 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
1003 | 1086 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
1004 | - | let $ | |
1005 | - | let fee = $ | |
1006 | - | let govFee = $ | |
1007 | - | let teamFee = $ | |
1008 | - | let $ | |
1087 | + | let $t04143941506 = getFeeParams(i.caller, i.originCaller) | |
1088 | + | let fee = $t04143941506._1 | |
1089 | + | let govFee = $t04143941506._2 | |
1090 | + | let teamFee = $t04143941506._3 | |
1091 | + | let $t04151941933 = if ((withdrawAsset == assetIdA)) | |
1009 | 1092 | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee, teamFee) | |
1010 | 1093 | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee, teamFee) | |
1011 | - | let amountWithoutFee = $ | |
1012 | - | let amountWithFee = $ | |
1013 | - | let governanceReward = $ | |
1014 | - | let teamReward = $ | |
1015 | - | let $ | |
1094 | + | let amountWithoutFee = $t04151941933._1 | |
1095 | + | let amountWithFee = $t04151941933._2 | |
1096 | + | let governanceReward = $t04151941933._3 | |
1097 | + | let teamReward = $t04151941933._4 | |
1098 | + | let $t04194643256 = if ((withdrawAsset == assetIdA)) | |
1016 | 1099 | then { | |
1017 | 1100 | let unstake = if (contains(stakingAssets, strAssetIdA)) | |
1018 | 1101 | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayA + amountWithFee) + governanceReward) + teamReward), strAssetIdA], nil) | |
1029 | 1112 | then $Tuple4(balanceA, ((((balanceB - amountToPayB) - amountWithFee) - governanceReward) - teamReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
1030 | 1113 | else throw("Strict value is not equal to itself.") | |
1031 | 1114 | } | |
1032 | - | let newBalanceA = $ | |
1033 | - | let newBalanceB = $ | |
1034 | - | let govRewardAssetId = $ | |
1035 | - | let userTransfer = $ | |
1115 | + | let newBalanceA = $t04194643256._1 | |
1116 | + | let newBalanceB = $t04194643256._2 | |
1117 | + | let govRewardAssetId = $t04194643256._3 | |
1118 | + | let userTransfer = $t04194643256._4 | |
1036 | 1119 | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId), ScriptTransfer(teamBoxAddress, teamReward, govRewardAssetId)] ++ userTransfer), nil)) | |
1037 | 1120 | } | |
1038 | 1121 | else throw("Strict value is not equal to itself.") | |
1043 | 1126 | ||
1044 | 1127 | @Callable(i) | |
1045 | 1128 | func takeIntoAccountExtraFunds (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
1046 | - | let $ | |
1047 | - | let strAssetIdA = $ | |
1048 | - | let strAssetIdB = $ | |
1049 | - | let assetIdA = $ | |
1050 | - | let assetIdB = $ | |
1129 | + | let $t04401644092 = getPoolAssets(i.caller) | |
1130 | + | let strAssetIdA = $t04401644092._1 | |
1131 | + | let strAssetIdB = $t04401644092._2 | |
1132 | + | let assetIdA = $t04401644092._3 | |
1133 | + | let assetIdB = $t04401644092._4 | |
1051 | 1134 | let claim = if (if ((assetIdA == USDN)) | |
1052 | 1135 | then true | |
1053 | 1136 | else (assetIdB == USDN)) | |
1054 | 1137 | then invoke(i.caller, "claimNetrinoRewards", nil, nil) | |
1055 | - | else | |
1138 | + | else 0 | |
1056 | 1139 | if ((claim == claim)) | |
1057 | 1140 | then { | |
1058 | - | let $t04196942105 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1059 | - | let balanceA = $t04196942105._1 | |
1060 | - | let balanceB = $t04196942105._2 | |
1061 | - | let accountBalanceA = $t04196942105._3 | |
1062 | - | let accountBalanceB = $t04196942105._4 | |
1063 | - | let stakedAmountA = $t04196942105._5 | |
1064 | - | let stakedAmountB = $t04196942105._6 | |
1141 | + | let $t04425244358 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1142 | + | let balanceA = $t04425244358._1 | |
1143 | + | let balanceB = $t04425244358._2 | |
1144 | + | let accountBalanceA = $t04425244358._3 | |
1145 | + | let accountBalanceB = $t04425244358._4 | |
1065 | 1146 | let amountEnrollA = (accountBalanceA - balanceA) | |
1066 | 1147 | let amountEnrollB = (accountBalanceB - balanceB) | |
1067 | - | let $t04222542539 = if ((assetIdA == L2MP)) | |
1068 | - | then $Tuple2((accountBalanceA - stakedAmountA), amountEnrollB) | |
1069 | - | else if ((assetIdB == L2MP)) | |
1070 | - | then $Tuple2(amountEnrollA, (accountBalanceB - stakedAmountB)) | |
1071 | - | else $Tuple2(amountEnrollA, amountEnrollB) | |
1072 | - | let amountToStakeA = $t04222542539._1 | |
1073 | - | let amountToStakeB = $t04222542539._2 | |
1074 | 1148 | if ((size(args) != 0)) | |
1075 | 1149 | then throw("Wrong args size") | |
1076 | 1150 | else if ((moneyBoxAddress != i.originCaller)) | |
1085 | 1159 | then throw("No money to take") | |
1086 | 1160 | else { | |
1087 | 1161 | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
1088 | - | then ( | |
1162 | + | then (amountEnrollA > 0) | |
1089 | 1163 | else false) | |
1090 | - | then invoke(i.caller, "stakeUnstake", [true, | |
1164 | + | then invoke(i.caller, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
1091 | 1165 | else 0 | |
1092 | 1166 | if ((stake1 == stake1)) | |
1093 | 1167 | then { | |
1094 | 1168 | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
1095 | - | then ( | |
1169 | + | then (amountEnrollB > 0) | |
1096 | 1170 | else false) | |
1097 | - | then invoke(i.caller, "stakeUnstake", [true, | |
1171 | + | then invoke(i.caller, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
1098 | 1172 | else 0 | |
1099 | 1173 | if ((stake2 == stake2)) | |
1100 | 1174 | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))], nil)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let kVersion = "version" | |
7 | 7 | ||
8 | 8 | let kActive = "active" | |
9 | 9 | ||
10 | 10 | let kDeprecated = "deprecated_" | |
11 | 11 | ||
12 | 12 | let kAssetIdA = "A_asset_id" | |
13 | 13 | ||
14 | 14 | let kAssetIdB = "B_asset_id" | |
15 | 15 | ||
16 | 16 | let kBalanceA = "A_asset_balance" | |
17 | 17 | ||
18 | 18 | let kBalanceB = "B_asset_balance" | |
19 | 19 | ||
20 | 20 | let kBalanceInitA = "A_asset_init" | |
21 | 21 | ||
22 | 22 | let kBalanceInitB = "B_asset_init" | |
23 | 23 | ||
24 | 24 | let kShareAssetId = "share_asset_id" | |
25 | 25 | ||
26 | 26 | let kShareAssetSupply = "share_asset_supply" | |
27 | 27 | ||
28 | 28 | let kFee = "commission" | |
29 | 29 | ||
30 | 30 | let kCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let kFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | 34 | let kFirstHarvestHeight = "first_harvest_height" | |
35 | 35 | ||
36 | 36 | let kShareLimit = "share_limit_on_first_harvest" | |
37 | 37 | ||
38 | 38 | let kBasePeriod = "base_period" | |
39 | 39 | ||
40 | 40 | let kPeriodLength = "period_length" | |
41 | 41 | ||
42 | 42 | let kStartHeight = "start_height" | |
43 | 43 | ||
44 | 44 | let kUSDNAddress = "staking_usdnnsbt_address" | |
45 | 45 | ||
46 | 46 | let kEURNAddress = "staking_eurn_address" | |
47 | 47 | ||
48 | 48 | let kLeasingAmount = "leasing_amount" | |
49 | 49 | ||
50 | 50 | let kUSDNAssetId = "usdn_asset_id" | |
51 | 51 | ||
52 | 52 | let kEURNAssetId = "eurn_asset_id" | |
53 | 53 | ||
54 | - | let kL2MPAssetId = "l2mp_asset_id" | |
55 | - | ||
56 | 54 | let kStakingAssets = "staking_assets" | |
57 | 55 | ||
58 | 56 | let kOracleActive = "active_all_contracts" | |
59 | 57 | ||
60 | 58 | let kDiscounts = "discounts" | |
61 | 59 | ||
62 | 60 | let kDiscountValues = "discount_values" | |
63 | 61 | ||
64 | 62 | let kUserGSwopInGov = "_GSwop_amount" | |
65 | 63 | ||
66 | 64 | let kUserSwopInGov = "_SWOP_amount" | |
67 | 65 | ||
68 | 66 | let kOraclePool = "pool_" | |
69 | 67 | ||
70 | 68 | let kAdminPubKey1 = "admin_pub_1" | |
71 | 69 | ||
72 | 70 | let kAdminPubKey2 = "admin_pub_2" | |
73 | 71 | ||
74 | 72 | let kAdminPubKey3 = "admin_pub_3" | |
75 | 73 | ||
76 | 74 | let kAdminInvokePubKey = "admin_invoke_pub" | |
77 | 75 | ||
78 | 76 | let kMoneyBoxAddress = "money_box_address" | |
79 | 77 | ||
80 | 78 | let kTeamBoxAddress = "team_box_address" | |
81 | 79 | ||
82 | 80 | let kVotingAddress = "voting_address" | |
83 | 81 | ||
84 | 82 | let kGovAddress = "governance_address" | |
85 | 83 | ||
86 | 84 | let kFarmingAddress = "farming_address" | |
87 | - | ||
88 | - | let kL2MPAddress = "staking_l2mp_address" | |
89 | 85 | ||
90 | 86 | let oracle = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz') | |
91 | 87 | ||
92 | 88 | func getBase58FromOracle (key) = match getString(oracle, key) { | |
93 | 89 | case string: String => | |
94 | 90 | fromBase58String(string) | |
95 | 91 | case nothing => | |
96 | 92 | throw((key + "is empty")) | |
97 | 93 | } | |
98 | 94 | ||
99 | 95 | ||
100 | 96 | let adminPubKey1 = getBase58FromOracle(kAdminPubKey1) | |
101 | 97 | ||
102 | 98 | let adminPubKey2 = getBase58FromOracle(kAdminPubKey2) | |
103 | 99 | ||
104 | 100 | let adminPubKey3 = getBase58FromOracle(kAdminPubKey3) | |
105 | 101 | ||
106 | 102 | let adminInvokePubKey = getBase58FromOracle(kAdminInvokePubKey) | |
107 | 103 | ||
108 | 104 | let moneyBoxAddress = Address(getBase58FromOracle(kMoneyBoxAddress)) | |
109 | 105 | ||
110 | 106 | let teamBoxAddress = Address(getBase58FromOracle(kTeamBoxAddress)) | |
111 | 107 | ||
112 | 108 | let votingAddress = Address(getBase58FromOracle(kVotingAddress)) | |
113 | 109 | ||
114 | 110 | let govAddress = Address(getBase58FromOracle(kGovAddress)) | |
115 | 111 | ||
116 | 112 | let farmingAddress = Address(getBase58FromOracle(kFarmingAddress)) | |
117 | 113 | ||
118 | 114 | let USDN = getBase58FromOracle(kUSDNAssetId) | |
119 | 115 | ||
120 | 116 | let EURN = getBase58FromOracle(kEURNAssetId) | |
121 | 117 | ||
122 | - | let L2MP = getBase58FromOracle(kL2MPAssetId) | |
123 | - | ||
124 | 118 | let stakingAssets = getStringValue(oracle, kStakingAssets) | |
125 | 119 | ||
126 | 120 | let stakingUSDNAddress = Address(getBase58FromOracle(kUSDNAddress)) | |
127 | 121 | ||
128 | 122 | let stakingEURNAddress = Address(getBase58FromOracle(kEURNAddress)) | |
129 | - | ||
130 | - | let stakingL2MPAddress = Address(getBase58FromOracle(kL2MPAddress)) | |
131 | 123 | ||
132 | 124 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
133 | 125 | ||
134 | 126 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
135 | 127 | ||
136 | 128 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
137 | 129 | ||
138 | 130 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
139 | 131 | ||
140 | 132 | let active = getBooleanValue(oracle, kOracleActive) | |
141 | 133 | ||
142 | 134 | let feeScale6 = 1000000 | |
143 | 135 | ||
144 | 136 | let scale8 = 100000000 | |
145 | 137 | ||
146 | 138 | let scale16 = toBigInt(10000000000000000) | |
147 | 139 | ||
148 | 140 | func accountBalance (assetId,pool) = match assetId { | |
149 | 141 | case id: ByteVector => | |
150 | 142 | assetBalance(pool, id) | |
151 | 143 | case waves: Unit => | |
152 | 144 | wavesBalance(pool).available | |
153 | 145 | case _ => | |
154 | 146 | throw("Match error") | |
155 | 147 | } | |
156 | 148 | ||
157 | 149 | ||
158 | 150 | func stakedAmount (assetId,pool) = { | |
159 | 151 | let stakedAmountCalculated = match assetId { | |
160 | 152 | case aId: ByteVector => | |
161 | 153 | if ((aId == USDN)) | |
162 | 154 | then getInteger(stakingUSDNAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(pool))) | |
163 | 155 | else if ((aId == EURN)) | |
164 | 156 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(pool))) | |
165 | - | else if ((aId == L2MP)) | |
166 | - | then { | |
167 | - | let available = { | |
168 | - | let @ = invoke(stakingL2MPAddress, "getUserAssetsREADONLY", [toString(pool)], nil) | |
169 | - | if ($isInstanceOf(@, "(Int, Int, BigInt, Int, Int)")) | |
170 | - | then @ | |
171 | - | else throw(($getType(@) + " couldn't be cast to (Int, Int, BigInt, Int, Int)")) | |
172 | - | } | |
173 | - | if ((available == available)) | |
174 | - | then available._2 | |
175 | - | else throw("Strict value is not equal to itself.") | |
176 | - | } | |
177 | - | else 0 | |
157 | + | else 0 | |
178 | 158 | case _: Unit => | |
179 | 159 | valueOrElse(getInteger(pool, kLeasingAmount), 0) | |
180 | 160 | case _ => | |
181 | 161 | throw("Match error") | |
182 | 162 | } | |
183 | 163 | match stakedAmountCalculated { | |
184 | 164 | case i: Int => | |
185 | 165 | i | |
186 | 166 | case _ => | |
187 | 167 | 0 | |
188 | 168 | } | |
189 | 169 | } | |
190 | 170 | ||
191 | 171 | ||
192 | 172 | func getAssetInfo (assetId) = match assetId { | |
193 | 173 | case id: String|ByteVector => | |
194 | - | let $ | |
174 | + | let $t040794251 = match id { | |
195 | 175 | case aId: ByteVector => | |
196 | 176 | $Tuple2(toBase58String(aId), aId) | |
197 | 177 | case aId: String => | |
198 | 178 | $Tuple2(aId, fromBase58String(aId)) | |
199 | 179 | case _ => | |
200 | 180 | throw("Match error") | |
201 | 181 | } | |
202 | - | let stringId = $ | |
203 | - | let bytesId = $ | |
182 | + | let stringId = $t040794251._1 | |
183 | + | let bytesId = $t040794251._2 | |
204 | 184 | let info = valueOrErrorMessage(assetInfo(bytesId), (("Asset " + stringId) + " doesn't exist")) | |
205 | 185 | $Tuple3(stringId, info.name, info.decimals) | |
206 | 186 | case waves: Unit => | |
207 | 187 | $Tuple3("WAVES", "WAVES", 8) | |
208 | 188 | case _ => | |
209 | 189 | throw("Match error") | |
210 | 190 | } | |
211 | 191 | ||
212 | 192 | ||
213 | 193 | func suspend (cause) = [BooleanEntry(kActive, false), StringEntry(kCause, cause)] | |
214 | 194 | ||
215 | 195 | ||
216 | 196 | func calculateFeeDiscount (userAddr) = { | |
217 | 197 | let swopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserSwopInGov)), 0) | |
218 | 198 | let gSwopAmount = valueOrElse(getInteger(govAddress, (toString(userAddr) + kUserGSwopInGov)), swopAmount) | |
219 | 199 | let discountValues = split(getStringValue(oracle, kDiscountValues), ",") | |
220 | 200 | let discounts = split(getStringValue(oracle, kDiscounts), ",") | |
221 | 201 | if (if ((gSwopAmount >= parseIntValue(discountValues[0]))) | |
222 | 202 | then (parseIntValue(discountValues[1]) > gSwopAmount) | |
223 | 203 | else false) | |
224 | 204 | then (feeScale6 - parseIntValue(discounts[0])) | |
225 | 205 | else if (if ((gSwopAmount >= parseIntValue(discountValues[1]))) | |
226 | 206 | then (parseIntValue(discountValues[2]) > gSwopAmount) | |
227 | 207 | else false) | |
228 | 208 | then (feeScale6 - parseIntValue(discounts[1])) | |
229 | 209 | else if (if ((gSwopAmount >= parseIntValue(discountValues[2]))) | |
230 | 210 | then (parseIntValue(discountValues[3]) > gSwopAmount) | |
231 | 211 | else false) | |
232 | 212 | then (feeScale6 - parseIntValue(discounts[2])) | |
233 | 213 | else if (if ((gSwopAmount >= parseIntValue(discountValues[3]))) | |
234 | 214 | then (parseIntValue(discountValues[4]) > gSwopAmount) | |
235 | 215 | else false) | |
236 | 216 | then (feeScale6 - parseIntValue(discounts[3])) | |
237 | 217 | else if ((gSwopAmount >= parseIntValue(discountValues[4]))) | |
238 | 218 | then (feeScale6 - parseIntValue(discounts[4])) | |
239 | 219 | else feeScale6 | |
240 | 220 | } | |
241 | 221 | ||
242 | 222 | ||
243 | 223 | func calculateFees (pmtAmount,minAmountToReceive,tokenFrom,tokenTo,fee,feeGov,feeTeam) = { | |
244 | 224 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
245 | 225 | let amountWithFee = fraction(amountWithoutFee, (feeScale6 - fee), feeScale6) | |
246 | 226 | let governanceReward = fraction(amountWithoutFee, feeGov, feeScale6) | |
247 | 227 | let teamReward = fraction(amountWithoutFee, feeTeam, feeScale6) | |
248 | 228 | if ((minAmountToReceive > amountWithFee)) | |
249 | 229 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
250 | 230 | else $Tuple4(amountWithoutFee, amountWithFee, governanceReward, teamReward) | |
251 | 231 | } | |
252 | 232 | ||
253 | 233 | ||
254 | 234 | func calculateVirtPay (pmtAmount,balance,fee) = { | |
255 | 235 | let F = (feeScale6 - fee) | |
256 | 236 | let k = fraction(fee, 55, 100) | |
257 | 237 | let a = (scale8 + fraction((F * k), scale8, (feeScale6 * feeScale6))) | |
258 | 238 | let b = ((((balance + fraction(balance, F, feeScale6)) + fraction(pmtAmount, F, feeScale6)) - pmtAmount) - fraction(pmtAmount, (F * k), (feeScale6 * feeScale6))) | |
259 | 239 | let c = (-(toBigInt(balance)) * toBigInt(pmtAmount)) | |
260 | 240 | let D = ((toBigInt(b) * toBigInt(b)) - fraction((toBigInt(4) * c), toBigInt(a), toBigInt(scale8))) | |
261 | 241 | toInt(fraction((-(toBigInt(b)) + sqrtBigInt(D, 0, 0, DOWN)), toBigInt(scale8), toBigInt((2 * a)))) | |
262 | 242 | } | |
263 | 243 | ||
264 | 244 | ||
265 | - | func parsePaymentAsset (assetId) = if ((assetId == base58'')) | |
266 | - | then unit | |
267 | - | else assetId | |
245 | + | func parsePaymentAsset (assetId) = match assetId { | |
246 | + | case id: ByteVector => | |
247 | + | if ((id == base58'')) | |
248 | + | then unit | |
249 | + | else id | |
250 | + | case id: String => | |
251 | + | if (if ((id == "WAVES")) | |
252 | + | then true | |
253 | + | else (id == "")) | |
254 | + | then unit | |
255 | + | else fromBase58String(id) | |
256 | + | case _ => | |
257 | + | throw("Match error") | |
258 | + | } | |
259 | + | ||
260 | + | ||
261 | + | func assetToStr (assetId) = match assetId { | |
262 | + | case id: ByteVector => | |
263 | + | toBase58String(id) | |
264 | + | case waves: Unit => | |
265 | + | "WAVES" | |
266 | + | case _ => | |
267 | + | throw("Match error") | |
268 | + | } | |
268 | 269 | ||
269 | 270 | ||
270 | 271 | func suspendSuspicious (accountBalanceA,accountBalanceB,balanceA,balanceB,assetIdA,assetIdB) = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceA)) + " ") + assetIdA) + ", ") + toString(accountBalanceB)) + " ") + assetIdB) + ". State: ") + toString(balanceA)) + " ") + assetIdA) + ", ") + toString(balanceB)) + " ") + assetIdB)) | |
271 | 272 | ||
272 | 273 | ||
273 | 274 | func isActive () = if (active) | |
274 | 275 | then unit | |
275 | 276 | else throw("DApp is inactive at this moment") | |
276 | 277 | ||
277 | 278 | ||
278 | 279 | func isOraclePool (poolAddress) = if (isDefined(getString(oracle, (kOraclePool + poolAddress)))) | |
279 | 280 | then unit | |
280 | 281 | else throw("DApp is not registered pool") | |
281 | 282 | ||
282 | 283 | ||
283 | 284 | func isDepricated (poolAddress) = if (!(valueOrElse(getBoolean(oracle, (kDeprecated + poolAddress)), false))) | |
284 | 285 | then unit | |
285 | 286 | else throw("Pool is deprecated. Only withdraw action allowed.") | |
286 | 287 | ||
287 | 288 | ||
288 | 289 | func getPoolBalances (pool,assetIdA,assetIdB) = { | |
289 | 290 | let balanceA = getIntegerValue(pool, kBalanceA) | |
290 | 291 | let balanceB = getIntegerValue(pool, kBalanceB) | |
291 | 292 | let stakedAmountA = stakedAmount(assetIdA, pool) | |
292 | 293 | let stakedAmountB = stakedAmount(assetIdB, pool) | |
293 | 294 | let accountBalanceA = (accountBalance(assetIdA, pool) + stakedAmountA) | |
294 | 295 | let accountBalanceB = (accountBalance(assetIdB, pool) + stakedAmountB) | |
295 | - | $Tuple6(balanceA, balanceB, accountBalanceA, accountBalanceB, stakedAmountA, stakedAmountB) | |
296 | + | let shareSupply = getIntegerValue(pool, kShareAssetSupply) | |
297 | + | $Tuple5(balanceA, balanceB, accountBalanceA, accountBalanceB, shareSupply) | |
296 | 298 | } | |
297 | - | ||
298 | - | ||
299 | - | func getLpSupply (pool) = getIntegerValue(pool, kShareAssetSupply) | |
300 | 299 | ||
301 | 300 | ||
302 | 301 | func getPoolAssets (pool) = { | |
303 | 302 | let strAssetIdA = getStringValue(pool, kAssetIdA) | |
304 | 303 | let strAssetIdB = getStringValue(pool, kAssetIdB) | |
305 | 304 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
306 | 305 | then unit | |
307 | 306 | else fromBase58String(strAssetIdA) | |
308 | 307 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
309 | 308 | then unit | |
310 | 309 | else fromBase58String(strAssetIdB) | |
311 | 310 | let shareAssetId = fromBase58String(getStringValue(pool, kShareAssetId)) | |
312 | 311 | $Tuple5(strAssetIdA, strAssetIdB, assetIdA, assetIdB, shareAssetId) | |
313 | 312 | } | |
314 | 313 | ||
315 | 314 | ||
316 | 315 | func getFeeParams (pool,caller) = { | |
317 | 316 | let feeDiscount = calculateFeeDiscount(caller) | |
318 | 317 | let fee = fraction(getIntegerValue(pool, kFee), feeDiscount, feeScale6, CEILING) | |
319 | 318 | let govFee = fraction(fee, 35, 100) | |
320 | 319 | let teamFee = fraction(fee, 10, 100) | |
321 | 320 | $Tuple3(fee, govFee, teamFee) | |
322 | 321 | } | |
323 | 322 | ||
324 | 323 | ||
325 | 324 | func calcLPAmountReplensishTwoTokens (pmtA,pmtB,pmtIdA,pmtIdB,balA,balB,shareAssetSupply) = { | |
326 | - | let $ | |
327 | - | let pmtStrAssetIdA = $ | |
328 | - | let pmtAssetNameA = $ | |
329 | - | let pmtDecimalsA = $ | |
330 | - | let $ | |
331 | - | let pmtStrAssetIdB = $ | |
332 | - | let pmtAssetNameB = $ | |
333 | - | let pmtDecimalsB = $ | |
325 | + | let $t098679939 = getAssetInfo(pmtIdA) | |
326 | + | let pmtStrAssetIdA = $t098679939._1 | |
327 | + | let pmtAssetNameA = $t098679939._2 | |
328 | + | let pmtDecimalsA = $t098679939._3 | |
329 | + | let $t0994410016 = getAssetInfo(pmtIdB) | |
330 | + | let pmtStrAssetIdB = $t0994410016._1 | |
331 | + | let pmtAssetNameB = $t0994410016._2 | |
332 | + | let pmtDecimalsB = $t0994410016._3 | |
334 | 333 | let initial = ((balA + balB) == 0) | |
335 | - | let $ | |
334 | + | let $t01005910718 = if (initial) | |
336 | 335 | then $Tuple5(pmtA, pmtB, 0, pmtIdA, toBigInt(1)) | |
337 | 336 | else { | |
338 | 337 | let ratioShareTokensInA = fraction(scale16, toBigInt(pmtA), toBigInt(balA)) | |
339 | 338 | let ratioShareTokensInB = fraction(scale16, toBigInt(pmtB), toBigInt(balB)) | |
340 | 339 | if ((ratioShareTokensInB > ratioShareTokensInA)) | |
341 | 340 | then { | |
342 | 341 | let pmt = fraction(pmtA, balB, balA) | |
343 | 342 | $Tuple5(pmtA, pmt, (pmtB - pmt), pmtIdB, ratioShareTokensInA) | |
344 | 343 | } | |
345 | 344 | else { | |
346 | 345 | let pmt = fraction(pmtB, balA, balB) | |
347 | 346 | $Tuple5(pmt, pmtB, (pmtA - pmt), pmtIdA, ratioShareTokensInB) | |
348 | 347 | } | |
349 | 348 | } | |
350 | - | let pmtAmountA = $ | |
351 | - | let pmtAmountB = $ | |
352 | - | let change = $ | |
353 | - | let changeAssetId = $ | |
354 | - | let shareTokenRatio = $ | |
349 | + | let pmtAmountA = $t01005910718._1 | |
350 | + | let pmtAmountB = $t01005910718._2 | |
351 | + | let change = $t01005910718._3 | |
352 | + | let changeAssetId = $t01005910718._4 | |
353 | + | let shareTokenRatio = $t01005910718._5 | |
355 | 354 | let shareTokenToPayAmount = if (initial) | |
356 | 355 | then { | |
357 | 356 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
358 | 357 | fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
359 | 358 | } | |
360 | 359 | else toInt(fraction(shareTokenRatio, toBigInt(shareAssetSupply), scale16)) | |
361 | 360 | $Tuple5(shareTokenToPayAmount, change, changeAssetId, pmtAmountA, pmtAmountB) | |
362 | 361 | } | |
363 | 362 | ||
364 | 363 | ||
365 | 364 | func calcLPAmountReplenishOneToken (pmtAmount,pmtAssetId,aId,bId,balA,balB,lpSupply,fee,govFee,teamFee,virtGetMinAmount) = if ((pmtAssetId == aId)) | |
366 | 365 | then { | |
367 | 366 | let virtPayAmount = calculateVirtPay(pmtAmount, balA, fee) | |
368 | - | let $ | |
369 | - | let amountWithoutFee = $ | |
370 | - | let amountWithFee = $ | |
371 | - | let governanceReward = $ | |
372 | - | let tReward = $ | |
367 | + | let $t01158211729 = calculateFees(virtPayAmount, virtGetMinAmount, balA, balB, fee, govFee, teamFee) | |
368 | + | let amountWithoutFee = $t01158211729._1 | |
369 | + | let amountWithFee = $t01158211729._2 | |
370 | + | let governanceReward = $t01158211729._3 | |
371 | + | let tReward = $t01158211729._4 | |
373 | 372 | let balanceAVirt = (balA + virtPayAmount) | |
374 | 373 | let balanceBVirt = (((balB + amountWithoutFee) - governanceReward) - tReward) | |
375 | 374 | let newBalanceA = (balA + pmtAmount) | |
376 | 375 | let newBalanceB = ((balB - governanceReward) - tReward) | |
377 | 376 | let ratioShareTokensInA = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceAVirt)) | |
378 | 377 | let ratioShareTokensInB = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceBVirt)) | |
379 | 378 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(lpSupply), scale16)) | |
380 | 379 | let shareTokenToPayAmountInBoth = toInt(fraction(fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balA)), toBigInt(lpSupply), scale16)) | |
381 | 380 | let loss = fraction((shareTokenToPayAmount - shareTokenToPayAmountInBoth), scale8, shareTokenToPayAmountInBoth) | |
382 | 381 | $Tuple7(shareTokenToPayAmount, newBalanceA, newBalanceB, governanceReward, tReward, bId, loss) | |
383 | 382 | } | |
384 | 383 | else { | |
385 | 384 | let virtPayAmount = calculateVirtPay(pmtAmount, balB, fee) | |
386 | - | let $ | |
387 | - | let amountWithoutFee = $ | |
388 | - | let amountWithFee = $ | |
389 | - | let governanceReward = $ | |
390 | - | let tReward = $ | |
385 | + | let $t01277312920 = calculateFees(virtPayAmount, virtGetMinAmount, balB, balA, fee, govFee, teamFee) | |
386 | + | let amountWithoutFee = $t01277312920._1 | |
387 | + | let amountWithFee = $t01277312920._2 | |
388 | + | let governanceReward = $t01277312920._3 | |
389 | + | let tReward = $t01277312920._4 | |
391 | 390 | let balanceAVirt = (((balA + amountWithoutFee) - governanceReward) - tReward) | |
392 | 391 | let balanceBVirt = (balB + virtPayAmount) | |
393 | 392 | let newBalanceA = ((balA - governanceReward) - tReward) | |
394 | 393 | let newBalanceB = (balB + pmtAmount) | |
395 | 394 | let ratioShareTokensInA = fraction(toBigInt(amountWithFee), scale16, toBigInt(balanceAVirt)) | |
396 | 395 | let ratioShareTokensInB = fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balanceBVirt)) | |
397 | 396 | let shareTokenToPayAmount = toInt(fraction(min([ratioShareTokensInA, ratioShareTokensInB]), toBigInt(lpSupply), scale16)) | |
398 | 397 | let shareTokenToPayAmountInBoth = toInt(fraction(fraction(toBigInt((pmtAmount - virtPayAmount)), scale16, toBigInt(balB)), toBigInt(lpSupply), scale16)) | |
399 | 398 | let loss = fraction((shareTokenToPayAmount - shareTokenToPayAmountInBoth), scale8, shareTokenToPayAmountInBoth) | |
400 | 399 | $Tuple7(shareTokenToPayAmount, newBalanceA, newBalanceB, governanceReward, tReward, aId, loss) | |
401 | 400 | } | |
402 | 401 | ||
403 | 402 | ||
404 | 403 | func calcLPReplenishDiffProp (pmtA,pmtB,pmtIdA,pmtIdB,balA,balB,lpSupply,fee,govFee,teamFee,virtGetMinAmount) = { | |
405 | - | let $ | |
406 | - | let lpTwoAmount = $ | |
407 | - | let change = $ | |
408 | - | let changeAssetId = $ | |
409 | - | let pmtAmountA = $ | |
410 | - | let pmtAmountB = $ | |
404 | + | let $t01408714235 = calcLPAmountReplensishTwoTokens(pmtA, pmtB, pmtIdA, pmtIdB, balA, balB, lpSupply) | |
405 | + | let lpTwoAmount = $t01408714235._1 | |
406 | + | let change = $t01408714235._2 | |
407 | + | let changeAssetId = $t01408714235._3 | |
408 | + | let pmtAmountA = $t01408714235._4 | |
409 | + | let pmtAmountB = $t01408714235._5 | |
411 | 410 | if ((change > 0)) | |
412 | 411 | then { | |
413 | - | let $ | |
414 | - | let lpOne = $ | |
415 | - | let newBalanceA = $ | |
416 | - | let newBalanceB = $ | |
417 | - | let governanceReward = $ | |
418 | - | let tReward = $ | |
419 | - | let gId = $ | |
420 | - | let loss = $ | |
412 | + | let $t01426714501 = calcLPAmountReplenishOneToken(change, changeAssetId, pmtIdA, pmtIdB, (balA + pmtAmountA), (balB + pmtAmountB), lpSupply, fee, govFee, teamFee, virtGetMinAmount) | |
413 | + | let lpOne = $t01426714501._1 | |
414 | + | let newBalanceA = $t01426714501._2 | |
415 | + | let newBalanceB = $t01426714501._3 | |
416 | + | let governanceReward = $t01426714501._4 | |
417 | + | let tReward = $t01426714501._5 | |
418 | + | let gId = $t01426714501._6 | |
419 | + | let loss = $t01426714501._7 | |
421 | 420 | $Tuple7((lpTwoAmount + lpOne), loss, newBalanceA, newBalanceB, governanceReward, tReward, gId) | |
422 | 421 | } | |
423 | 422 | else $Tuple7(lpTwoAmount, 0, (balA + pmtAmountA), (balB + pmtAmountB), 0, 0, unit) | |
424 | 423 | } | |
425 | 424 | ||
426 | 425 | ||
427 | 426 | @Callable(i) | |
427 | + | func howManyYouPayREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
428 | + | let caller = Address(callerBytes) | |
429 | + | let $t01486914953 = $Tuple2(parseIntValue(args[0]), parsePaymentAsset(args[1])) | |
430 | + | let getAmount = $t01486914953._1 | |
431 | + | let getAssetId = $t01486914953._2 | |
432 | + | let $t01496215038 = getPoolAssets(i.caller) | |
433 | + | let strAssetIdA = $t01496215038._1 | |
434 | + | let strAssetIdB = $t01496215038._2 | |
435 | + | let assetIdA = $t01496215038._3 | |
436 | + | let assetIdB = $t01496215038._4 | |
437 | + | let $t01504715153 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
438 | + | let balanceA = $t01504715153._1 | |
439 | + | let balanceB = $t01504715153._2 | |
440 | + | let accountBalanceA = $t01504715153._3 | |
441 | + | let accountBalanceB = $t01504715153._4 | |
442 | + | if (if ((balanceA == 0)) | |
443 | + | then true | |
444 | + | else (balanceB == 0)) | |
445 | + | then throw("Can't exchange with zero balance") | |
446 | + | else if (!(containsElement([assetIdA, assetIdB], getAssetId))) | |
447 | + | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
448 | + | else { | |
449 | + | let $t01544715514 = getFeeParams(i.caller, i.originCaller) | |
450 | + | let fee = $t01544715514._1 | |
451 | + | let govFee = $t01544715514._2 | |
452 | + | let teamFee = $t01544715514._3 | |
453 | + | let $t01552715929 = { | |
454 | + | let amntGetNoFee = fraction(getAmount, feeScale6, (feeScale6 - fee), CEILING) | |
455 | + | if ((getAssetId == assetIdA)) | |
456 | + | then $Tuple2(fraction(amntGetNoFee, balanceB, (balanceA - amntGetNoFee), CEILING), assetIdB) | |
457 | + | else $Tuple2(fraction(amntGetNoFee, balanceA, (balanceB - amntGetNoFee), CEILING), assetIdA) | |
458 | + | } | |
459 | + | let amountToPay = $t01552715929._1 | |
460 | + | let assetToPay = $t01552715929._2 | |
461 | + | $Tuple2(nil, $Tuple2(nil, [amountToPay, assetToStr(assetToPay)])) | |
462 | + | } | |
463 | + | } | |
464 | + | ||
465 | + | ||
466 | + | ||
467 | + | @Callable(i) | |
468 | + | func howManyYouGetREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
469 | + | let caller = Address(callerBytes) | |
470 | + | let $t01618116265 = $Tuple2(parseIntValue(args[0]), parsePaymentAsset(args[1])) | |
471 | + | let pmtAmount = $t01618116265._1 | |
472 | + | let pmtAssetId = $t01618116265._2 | |
473 | + | let $t01627416350 = getPoolAssets(i.caller) | |
474 | + | let strAssetIdA = $t01627416350._1 | |
475 | + | let strAssetIdB = $t01627416350._2 | |
476 | + | let assetIdA = $t01627416350._3 | |
477 | + | let assetIdB = $t01627416350._4 | |
478 | + | let $t01635916465 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
479 | + | let balanceA = $t01635916465._1 | |
480 | + | let balanceB = $t01635916465._2 | |
481 | + | let accountBalanceA = $t01635916465._3 | |
482 | + | let accountBalanceB = $t01635916465._4 | |
483 | + | if (if ((balanceA == 0)) | |
484 | + | then true | |
485 | + | else (balanceB == 0)) | |
486 | + | then throw("Can't exchange with zero balance") | |
487 | + | else if (!(containsElement([assetIdA, assetIdB], pmtAssetId))) | |
488 | + | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
489 | + | else { | |
490 | + | let $t01675916826 = getFeeParams(i.caller, i.originCaller) | |
491 | + | let fee = $t01675916826._1 | |
492 | + | let govFee = $t01675916826._2 | |
493 | + | let teamFee = $t01675916826._3 | |
494 | + | let $t01683917156 = if ((pmtAssetId == assetIdA)) | |
495 | + | then calculateFees(pmtAmount, 0, balanceA, balanceB, fee, govFee, teamFee) | |
496 | + | else calculateFees(pmtAmount, 0, balanceB, balanceA, fee, govFee, teamFee) | |
497 | + | let amountWithoutFee = $t01683917156._1 | |
498 | + | let amountWithFee = $t01683917156._2 | |
499 | + | let governanceReward = $t01683917156._3 | |
500 | + | let teamReward = $t01683917156._4 | |
501 | + | let assetIdSend = if ((pmtAssetId == assetIdA)) | |
502 | + | then assetIdB | |
503 | + | else assetIdA | |
504 | + | $Tuple2(nil, $Tuple2(nil, [amountWithFee, assetToStr(assetIdSend), governanceReward, teamReward])) | |
505 | + | } | |
506 | + | } | |
507 | + | ||
508 | + | ||
509 | + | ||
510 | + | @Callable(i) | |
428 | 511 | func calcLPReplenishDiffPropREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
429 | - | let $ | |
430 | - | let strAssetIdA = $ | |
431 | - | let strAssetIdB = $ | |
432 | - | let assetIdA = $ | |
433 | - | let assetIdB = $ | |
434 | - | let shareAssetId = $ | |
435 | - | let $ | |
436 | - | let balA = $ | |
437 | - | let balB = $ | |
438 | - | let accBalA = $ | |
439 | - | let accBalB = $ | |
440 | - | let lpSupply = | |
512 | + | let $t01749417584 = getPoolAssets(i.caller) | |
513 | + | let strAssetIdA = $t01749417584._1 | |
514 | + | let strAssetIdB = $t01749417584._2 | |
515 | + | let assetIdA = $t01749417584._3 | |
516 | + | let assetIdB = $t01749417584._4 | |
517 | + | let shareAssetId = $t01749417584._5 | |
518 | + | let $t01758917681 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
519 | + | let balA = $t01758917681._1 | |
520 | + | let balB = $t01758917681._2 | |
521 | + | let accBalA = $t01758917681._3 | |
522 | + | let accBalB = $t01758917681._4 | |
523 | + | let lpSupply = $t01758917681._5 | |
441 | 524 | let pmtA = parseIntValue(args[0]) | |
442 | 525 | let pmtB = parseIntValue(args[1]) | |
443 | 526 | let virtGetMinAmount = parseIntValue(args[2]) | |
444 | - | let $ | |
445 | - | let fee = $ | |
446 | - | let govFee = $ | |
447 | - | let teamFee = $ | |
448 | - | let $ | |
449 | - | let lp = $ | |
450 | - | let loss = $ | |
451 | - | let newBalanceA = $ | |
452 | - | let newBalanceB = $ | |
453 | - | let governanceReward = $ | |
454 | - | let tReward = $ | |
455 | - | let aId = $ | |
527 | + | let $t01781517882 = getFeeParams(i.caller, i.originCaller) | |
528 | + | let fee = $t01781517882._1 | |
529 | + | let govFee = $t01781517882._2 | |
530 | + | let teamFee = $t01781517882._3 | |
531 | + | let $t01788718079 = calcLPReplenishDiffProp(pmtA, pmtB, assetIdA, assetIdB, balA, balB, lpSupply, fee, govFee, teamFee, virtGetMinAmount) | |
532 | + | let lp = $t01788718079._1 | |
533 | + | let loss = $t01788718079._2 | |
534 | + | let newBalanceA = $t01788718079._3 | |
535 | + | let newBalanceB = $t01788718079._4 | |
536 | + | let governanceReward = $t01788718079._5 | |
537 | + | let tReward = $t01788718079._6 | |
538 | + | let aId = $t01788718079._7 | |
456 | 539 | $Tuple2(nil, $Tuple2(nil, [lp, loss, newBalanceA, newBalanceB, governanceReward, tReward, aId])) | |
457 | 540 | } | |
458 | 541 | ||
459 | 542 | ||
460 | 543 | ||
461 | 544 | @Callable(i) | |
462 | 545 | func calcLPReplenishTwoTokensREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
463 | - | let $ | |
464 | - | let strAssetIdA = $ | |
465 | - | let strAssetIdB = $ | |
466 | - | let assetIdA = $ | |
467 | - | let assetIdB = $ | |
468 | - | let shareAssetId = $ | |
469 | - | let $ | |
470 | - | let balA = $ | |
471 | - | let balB = $ | |
472 | - | let accBalA = $ | |
473 | - | let accBalB = $ | |
474 | - | let lpSupply = | |
546 | + | let $t01832218412 = getPoolAssets(i.caller) | |
547 | + | let strAssetIdA = $t01832218412._1 | |
548 | + | let strAssetIdB = $t01832218412._2 | |
549 | + | let assetIdA = $t01832218412._3 | |
550 | + | let assetIdB = $t01832218412._4 | |
551 | + | let shareAssetId = $t01832218412._5 | |
552 | + | let $t01841718509 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
553 | + | let balA = $t01841718509._1 | |
554 | + | let balB = $t01841718509._2 | |
555 | + | let accBalA = $t01841718509._3 | |
556 | + | let accBalB = $t01841718509._4 | |
557 | + | let lpSupply = $t01841718509._5 | |
475 | 558 | let pmtA = parseIntValue(args[0]) | |
476 | 559 | let pmtB = parseIntValue(args[1]) | |
477 | - | let $ | |
478 | - | let lp = $ | |
479 | - | let change = $ | |
480 | - | let changeAssetId = $ | |
481 | - | let pmtAmountA = $ | |
482 | - | let pmtAmountB = $ | |
560 | + | let $t01859218735 = calcLPAmountReplensishTwoTokens(pmtA, pmtB, assetIdA, assetIdB, balA, balB, lpSupply) | |
561 | + | let lp = $t01859218735._1 | |
562 | + | let change = $t01859218735._2 | |
563 | + | let changeAssetId = $t01859218735._3 | |
564 | + | let pmtAmountA = $t01859218735._4 | |
565 | + | let pmtAmountB = $t01859218735._5 | |
483 | 566 | $Tuple2(nil, $Tuple2(nil, [lp, change, changeAssetId, pmtAmountA, pmtAmountB])) | |
484 | 567 | } | |
485 | 568 | ||
486 | 569 | ||
487 | 570 | ||
488 | 571 | @Callable(i) | |
489 | 572 | func withdrawREADONLY (callerBytes,args,pAmounts,pAssetIds) = { | |
490 | - | let $ | |
491 | - | let strAssetIdA = $ | |
492 | - | let strAssetIdB = $ | |
493 | - | let assetIdA = $ | |
494 | - | let assetIdB = $ | |
495 | - | let shareAssetId = $ | |
496 | - | let $ | |
497 | - | let balanceA = $ | |
498 | - | let balanceB = $ | |
499 | - | let accountBalanceA = $ | |
500 | - | let accountBalanceB = $ | |
501 | - | let shareAssetSupply = | |
573 | + | let $t01894619036 = getPoolAssets(i.caller) | |
574 | + | let strAssetIdA = $t01894619036._1 | |
575 | + | let strAssetIdB = $t01894619036._2 | |
576 | + | let assetIdA = $t01894619036._3 | |
577 | + | let assetIdB = $t01894619036._4 | |
578 | + | let shareAssetId = $t01894619036._5 | |
579 | + | let $t01904119165 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
580 | + | let balanceA = $t01904119165._1 | |
581 | + | let balanceB = $t01904119165._2 | |
582 | + | let accountBalanceA = $t01904119165._3 | |
583 | + | let accountBalanceB = $t01904119165._4 | |
584 | + | let shareAssetSupply = $t01904119165._5 | |
502 | 585 | let withdrawAmount = parseIntValue(args[0]) | |
503 | - | let $ | |
586 | + | let $t01921919381 = if ((size(args) == 3)) | |
504 | 587 | then $Tuple2(parseIntValue(args[1]), parseIntValue(args[2])) | |
505 | 588 | else $Tuple2(balanceA, balanceB) | |
506 | - | let balA = $ | |
507 | - | let balB = $ | |
589 | + | let balA = $t01921919381._1 | |
590 | + | let balB = $t01921919381._2 | |
508 | 591 | let amountToPayA = fraction(withdrawAmount, balA, shareAssetSupply) | |
509 | 592 | let amountToPayB = fraction(withdrawAmount, balB, shareAssetSupply) | |
510 | 593 | $Tuple2(nil, $Tuple2(nil, [amountToPayA, amountToPayB])) | |
511 | 594 | } | |
512 | 595 | ||
513 | 596 | ||
514 | 597 | ||
515 | 598 | @Callable(i) | |
516 | 599 | func init (callerBytes,args,pAmounts,pAssetIds) = { | |
517 | 600 | let caller = Address(callerBytes) | |
518 | - | let $ | |
519 | - | let pmtAmountA = $ | |
520 | - | let pmtAssetIdA = $ | |
521 | - | let $ | |
522 | - | let pmtAmountB = $ | |
523 | - | let pmtAssetIdB = $ | |
601 | + | let $t01973619814 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
602 | + | let pmtAmountA = $t01973619814._1 | |
603 | + | let pmtAssetIdA = $t01973619814._2 | |
604 | + | let $t01981919897 = $Tuple2(pAmounts[1], parsePaymentAsset(pAssetIds[1])) | |
605 | + | let pmtAmountB = $t01981919897._1 | |
606 | + | let pmtAssetIdB = $t01981919897._2 | |
524 | 607 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
525 | 608 | then throw("Only admin can call this function") | |
526 | 609 | else if ((size(args) != 1)) | |
527 | 610 | then throw("Wrong args size") | |
528 | 611 | else if (isDefined(getBoolean(caller, kActive))) | |
529 | 612 | then throw("DApp is already active") | |
530 | 613 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
531 | 614 | then throw("Assets must be different") | |
532 | 615 | else { | |
533 | - | let $ | |
534 | - | let pmtStrAssetIdA = $ | |
535 | - | let pmtAssetNameA = $ | |
536 | - | let pmtDecimalsA = $ | |
537 | - | let $ | |
538 | - | let pmtStrAssetIdB = $ | |
539 | - | let pmtAssetNameB = $ | |
540 | - | let pmtDecimalsB = $ | |
616 | + | let $t02033220409 = getAssetInfo(pmtAssetIdA) | |
617 | + | let pmtStrAssetIdA = $t02033220409._1 | |
618 | + | let pmtAssetNameA = $t02033220409._2 | |
619 | + | let pmtDecimalsA = $t02033220409._3 | |
620 | + | let $t02041820495 = getAssetInfo(pmtAssetIdB) | |
621 | + | let pmtStrAssetIdB = $t02041820495._1 | |
622 | + | let pmtAssetNameB = $t02041820495._2 | |
623 | + | let pmtDecimalsB = $t02041820495._3 | |
541 | 624 | let firstHarvest = (args[0] == "true") | |
542 | 625 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
543 | 626 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
544 | 627 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
545 | 628 | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
546 | 629 | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
547 | 630 | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
548 | 631 | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
549 | 632 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
550 | 633 | let shareIssueId = calculateAssetId(shareIssue) | |
551 | 634 | let stake1 = if (contains(stakingAssets, pmtStrAssetIdA)) | |
552 | 635 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
553 | 636 | else 0 | |
554 | 637 | if ((stake1 == stake1)) | |
555 | 638 | then { | |
556 | 639 | let stake2 = if (contains(stakingAssets, pmtStrAssetIdB)) | |
557 | 640 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
558 | 641 | else 0 | |
559 | 642 | if ((stake2 == stake2)) | |
560 | 643 | then { | |
561 | 644 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceA, pmtAmountA), IntegerEntry(kBalanceB, pmtAmountB), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_cpmm")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply), ScriptTransfer(caller, shareInitialSupply, shareIssueId)] | |
562 | 645 | if (firstHarvest) | |
563 | 646 | then $Tuple2(nil, $Tuple2((baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]), nil)) | |
564 | 647 | else $Tuple2(nil, $Tuple2(baseEntry, nil)) | |
565 | 648 | } | |
566 | 649 | else throw("Strict value is not equal to itself.") | |
567 | 650 | } | |
568 | 651 | else throw("Strict value is not equal to itself.") | |
569 | 652 | } | |
570 | 653 | } | |
571 | 654 | ||
572 | 655 | ||
573 | 656 | ||
574 | 657 | @Callable(i) | |
575 | 658 | func initWithInitRatio (callerBytes,args,pAmounts,pAssetIds) = { | |
576 | 659 | let caller = Address(callerBytes) | |
577 | - | let $ | |
578 | - | let amtAssetA = $ | |
579 | - | let amtAssetB = $ | |
580 | - | let assetIdAStr = $ | |
581 | - | let assetIdBStr = $ | |
582 | - | let firstHarvest = $ | |
660 | + | let $t02271622916 = $Tuple5(parseIntValue(args[0]), parseIntValue(args[1]), args[2], args[3], (args[4] == "true")) | |
661 | + | let amtAssetA = $t02271622916._1 | |
662 | + | let amtAssetB = $t02271622916._2 | |
663 | + | let assetIdAStr = $t02271622916._3 | |
664 | + | let assetIdBStr = $t02271622916._4 | |
665 | + | let firstHarvest = $t02271622916._5 | |
583 | 666 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
584 | 667 | then throw("Only admin can call this function") | |
585 | 668 | else if ((size(args) != 5)) | |
586 | 669 | then throw("Wrong args size") | |
587 | 670 | else if (isDefined(getBoolean(caller, kActive))) | |
588 | 671 | then throw("DApp is already active") | |
589 | 672 | else if ((assetIdAStr == assetIdBStr)) | |
590 | 673 | then throw("Assets must be different") | |
591 | 674 | else { | |
592 | - | let $ | |
593 | - | let pmtStrAssetIdA = $ | |
594 | - | let pmtAssetNameA = $ | |
595 | - | let pmtDecimalsA = $ | |
596 | - | let $ | |
597 | - | let pmtStrAssetIdB = $ | |
598 | - | let pmtAssetNameB = $ | |
599 | - | let pmtDecimalsB = $ | |
675 | + | let $t02335123428 = getAssetInfo(assetIdAStr) | |
676 | + | let pmtStrAssetIdA = $t02335123428._1 | |
677 | + | let pmtAssetNameA = $t02335123428._2 | |
678 | + | let pmtDecimalsA = $t02335123428._3 | |
679 | + | let $t02343723514 = getAssetInfo(assetIdBStr) | |
680 | + | let pmtStrAssetIdB = $t02343723514._1 | |
681 | + | let pmtAssetNameB = $t02343723514._2 | |
682 | + | let pmtDecimalsB = $t02343723514._3 | |
600 | 683 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
601 | 684 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
602 | 685 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
603 | 686 | let shareInitialSupply = 0 | |
604 | 687 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
605 | 688 | let shareIssueId = calculateAssetId(shareIssue) | |
606 | 689 | let baseEntry = [StringEntry(kVersion, version), BooleanEntry(kActive, true), StringEntry(kAssetIdA, pmtStrAssetIdA), StringEntry(kAssetIdB, pmtStrAssetIdB), IntegerEntry(kBalanceInitA, amtAssetA), IntegerEntry(kBalanceInitB, amtAssetB), IntegerEntry(kBalanceA, 0), IntegerEntry(kBalanceB, 0), IntegerEntry(kFee, getIntegerValue(oracle, "base_fee_cpmm")), shareIssue, StringEntry(kShareAssetId, toBase58String(shareIssueId)), IntegerEntry(kShareAssetSupply, shareInitialSupply)] | |
607 | 690 | if (firstHarvest) | |
608 | 691 | then $Tuple2(nil, $Tuple2((baseEntry ++ [BooleanEntry(kFirstHarvest, firstHarvest), IntegerEntry(kFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]), nil)) | |
609 | 692 | else $Tuple2(nil, $Tuple2(baseEntry, nil)) | |
610 | 693 | } | |
611 | 694 | } | |
612 | 695 | ||
613 | 696 | ||
614 | 697 | ||
615 | 698 | @Callable(i) | |
616 | 699 | func keepLimitForFirstHarvest (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminInvokePubKey], i.originCallerPublicKey))) | |
617 | 700 | then throw("Only admin can call this function") | |
618 | 701 | else if ((size(args) != 1)) | |
619 | 702 | then throw("Wrong args size") | |
620 | 703 | else { | |
621 | 704 | let shareLimit = parseIntValue(args[0]) | |
622 | 705 | $Tuple2(nil, $Tuple2([IntegerEntry(kShareLimit, shareLimit)], nil)) | |
623 | 706 | })) | |
624 | 707 | ||
625 | 708 | ||
626 | 709 | ||
627 | 710 | @Callable(i) | |
628 | 711 | func exchange (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
629 | 712 | let caller = Address(callerBytes) | |
630 | - | let $ | |
631 | - | let pmtAmount = $ | |
632 | - | let pmtAssetId = $ | |
713 | + | let $t02594026016 = $Tuple2(pAmounts[0], parsePaymentAsset(pAssetIds[0])) | |
714 | + | let pmtAmount = $t02594026016._1 | |
715 | + | let pmtAssetId = $t02594026016._2 | |
633 | 716 | let minAmountToReceive = parseIntValue(args[0]) | |
634 | - | let $ | |
635 | - | let strAssetIdA = $ | |
636 | - | let strAssetIdB = $ | |
637 | - | let assetIdA = $ | |
638 | - | let assetIdB = $ | |
639 | - | let $ | |
640 | - | let balanceA = $ | |
641 | - | let balanceB = $ | |
642 | - | let accountBalanceA = $ | |
643 | - | let accountBalanceB = $ | |
717 | + | let $t02608126157 = getPoolAssets(i.caller) | |
718 | + | let strAssetIdA = $t02608126157._1 | |
719 | + | let strAssetIdB = $t02608126157._2 | |
720 | + | let assetIdA = $t02608126157._3 | |
721 | + | let assetIdB = $t02608126157._4 | |
722 | + | let $t02616626272 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
723 | + | let balanceA = $t02616626272._1 | |
724 | + | let balanceB = $t02616626272._2 | |
725 | + | let accountBalanceA = $t02616626272._3 | |
726 | + | let accountBalanceB = $t02616626272._4 | |
644 | 727 | if ((size(args) != 1)) | |
645 | 728 | then throw("Wrong args size") | |
646 | 729 | else if (if ((balanceA == 0)) | |
647 | 730 | then true | |
648 | 731 | else (balanceB == 0)) | |
649 | 732 | then throw("Can't exchange with zero balance") | |
650 | 733 | else if ((0 >= minAmountToReceive)) | |
651 | 734 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
652 | 735 | else if ((size(pAmounts) != 1)) | |
653 | 736 | then throw("One attached payment expected") | |
654 | 737 | else if (!(containsElement([assetIdA, assetIdB], pmtAssetId))) | |
655 | 738 | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
656 | 739 | else if (if ((balanceA > accountBalanceA)) | |
657 | 740 | then true | |
658 | 741 | else (balanceB > accountBalanceB)) | |
659 | - | then $Tuple2(nil, | |
742 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
660 | 743 | else { | |
661 | - | let $ | |
662 | - | let fee = $ | |
663 | - | let govFee = $ | |
664 | - | let teamFee = $ | |
665 | - | let $ | |
744 | + | let $t02717227239 = getFeeParams(i.caller, i.originCaller) | |
745 | + | let fee = $t02717227239._1 | |
746 | + | let govFee = $t02717227239._2 | |
747 | + | let teamFee = $t02717227239._3 | |
748 | + | let $t02725227603 = if ((pmtAssetId == assetIdA)) | |
666 | 749 | then calculateFees(pmtAmount, minAmountToReceive, balanceA, balanceB, fee, govFee, teamFee) | |
667 | 750 | else calculateFees(pmtAmount, minAmountToReceive, balanceB, balanceA, fee, govFee, teamFee) | |
668 | - | let amountWithoutFee = $ | |
669 | - | let amountWithFee = $ | |
670 | - | let governanceReward = $ | |
671 | - | let teamReward = $ | |
672 | - | let $ | |
751 | + | let amountWithoutFee = $t02725227603._1 | |
752 | + | let amountWithFee = $t02725227603._2 | |
753 | + | let governanceReward = $t02725227603._3 | |
754 | + | let teamReward = $t02725227603._4 | |
755 | + | let $t02761727952 = if ((pmtAssetId == assetIdA)) | |
673 | 756 | then $Tuple3((balanceA + pmtAmount), (((balanceB - amountWithFee) - governanceReward) - teamReward), assetIdB) | |
674 | 757 | else $Tuple3((((balanceA - amountWithFee) - governanceReward) - teamReward), (balanceB + pmtAmount), assetIdA) | |
675 | - | let newBalanceA = $ | |
676 | - | let newBalanceB = $ | |
677 | - | let assetIdSend = $ | |
678 | - | let $ | |
758 | + | let newBalanceA = $t02761727952._1 | |
759 | + | let newBalanceB = $t02761727952._2 | |
760 | + | let assetIdSend = $t02761727952._3 | |
761 | + | let $t02796628226 = if ((pmtAssetId == assetIdA)) | |
679 | 762 | then $Tuple2(pmtAmount, ((amountWithFee + governanceReward) + teamReward)) | |
680 | 763 | else $Tuple2(((amountWithFee + governanceReward) + teamReward), pmtAmount) | |
681 | - | let stakeAmountA = $ | |
682 | - | let stakeAmountB = $ | |
764 | + | let stakeAmountA = $t02796628226._1 | |
765 | + | let stakeAmountB = $t02796628226._2 | |
683 | 766 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
684 | 767 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdA), stakeAmountA, strAssetIdA], nil) | |
685 | 768 | else 0 | |
686 | 769 | if ((stake1 == stake1)) | |
687 | 770 | then { | |
688 | 771 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
689 | 772 | then invoke(i.caller, "stakeUnstake", [(pmtAssetId == assetIdB), stakeAmountB, strAssetIdB], nil) | |
690 | 773 | else 0 | |
691 | 774 | if ((stake2 == stake2)) | |
692 | 775 | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), ScriptTransfer(caller, amountWithFee, assetIdSend), ScriptTransfer(moneyBoxAddress, governanceReward, assetIdSend), ScriptTransfer(teamBoxAddress, teamReward, assetIdSend)], [amountWithFee, assetIdSend])) | |
693 | 776 | else throw("Strict value is not equal to itself.") | |
694 | 777 | } | |
695 | 778 | else throw("Strict value is not equal to itself.") | |
696 | 779 | } | |
697 | 780 | }))) | |
698 | 781 | ||
699 | 782 | ||
700 | 783 | ||
701 | 784 | @Callable(i) | |
702 | 785 | func replenishWithTwoTokens (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
703 | 786 | let caller = Address(callerBytes) | |
704 | 787 | let pmtAssetIdA = parsePaymentAsset(pAssetIds[0]) | |
705 | 788 | let pmtAssetIdB = parsePaymentAsset(pAssetIds[1]) | |
706 | 789 | let stakeFarming = (args[0] == "true") | |
707 | 790 | let lockType = parseIntValue(args[1]) | |
708 | - | let $ | |
709 | - | let strAssetIdA = $ | |
710 | - | let strAssetIdB = $ | |
711 | - | let assetIdA = $ | |
712 | - | let assetIdB = $ | |
713 | - | let shareAssetId = $ | |
714 | - | let $ | |
715 | - | let balanceA = $ | |
716 | - | let balanceB = $ | |
717 | - | let accountBalanceA = $ | |
718 | - | let accountBalanceB = $ | |
719 | - | let shareAssetSupply = | |
791 | + | let $t02954129631 = getPoolAssets(i.caller) | |
792 | + | let strAssetIdA = $t02954129631._1 | |
793 | + | let strAssetIdB = $t02954129631._2 | |
794 | + | let assetIdA = $t02954129631._3 | |
795 | + | let assetIdB = $t02954129631._4 | |
796 | + | let shareAssetId = $t02954129631._5 | |
797 | + | let $t02964029764 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
798 | + | let balanceA = $t02964029764._1 | |
799 | + | let balanceB = $t02964029764._2 | |
800 | + | let accountBalanceA = $t02964029764._3 | |
801 | + | let accountBalanceB = $t02964029764._4 | |
802 | + | let shareAssetSupply = $t02964029764._5 | |
720 | 803 | if ((size(args) != 2)) | |
721 | 804 | then throw("Wrong args size") | |
722 | 805 | else if (if ((size(pAmounts) != 2)) | |
723 | 806 | then (size(pAmounts) != 3) | |
724 | 807 | else false) | |
725 | 808 | then throw("Two or three payments expected") | |
726 | 809 | else if (if ((pmtAssetIdA != assetIdA)) | |
727 | 810 | then true | |
728 | 811 | else (pmtAssetIdB != assetIdB)) | |
729 | 812 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
730 | 813 | else if (if ((balanceA > accountBalanceA)) | |
731 | 814 | then true | |
732 | 815 | else (balanceB > accountBalanceB)) | |
733 | - | then $Tuple2(nil, | |
816 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pAmounts[0], pmtAssetIdA), ScriptTransfer(caller, pAmounts[1], pmtAssetIdB)] ++ (if ((size(pAmounts) == 3)) | |
734 | 817 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
735 | 818 | then unit | |
736 | 819 | else pAssetIds[2], pAmounts[2])] | |
737 | - | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB)))) | |
820 | + | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
738 | 821 | else { | |
739 | - | let $ | |
740 | - | let shareTokenToPayAmount = $ | |
741 | - | let change = $ | |
742 | - | let changeAssetId = $ | |
743 | - | let pmtAmountA = $ | |
744 | - | let pmtAmountB = $ | |
822 | + | let $t03070130899 = calcLPAmountReplensishTwoTokens(pAmounts[0], pAmounts[1], pmtAssetIdA, pmtAssetIdB, balanceA, balanceB, shareAssetSupply) | |
823 | + | let shareTokenToPayAmount = $t03070130899._1 | |
824 | + | let change = $t03070130899._2 | |
825 | + | let changeAssetId = $t03070130899._3 | |
826 | + | let pmtAmountA = $t03070130899._4 | |
827 | + | let pmtAmountB = $t03070130899._5 | |
745 | 828 | if ((shareTokenToPayAmount == 0)) | |
746 | 829 | then throw("Too small amount to replenish") | |
747 | 830 | else if ((0 > change)) | |
748 | 831 | then throw("Change < 0") | |
749 | 832 | else { | |
750 | 833 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
751 | 834 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountA, strAssetIdA], nil) | |
752 | 835 | else 0 | |
753 | 836 | if ((stake1 == stake1)) | |
754 | 837 | then { | |
755 | 838 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
756 | 839 | then invoke(i.caller, "stakeUnstake", [true, pmtAmountB, strAssetIdB], nil) | |
757 | 840 | else 0 | |
758 | 841 | if ((stake2 == stake2)) | |
759 | 842 | then { | |
760 | 843 | let shareTokenST = if (stakeFarming) | |
761 | 844 | then { | |
762 | 845 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(pAmounts) == 3)) | |
763 | 846 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
764 | 847 | then unit | |
765 | 848 | else pAssetIds[2], pAmounts[2])] | |
766 | 849 | else nil)) | |
767 | 850 | let reissue = invoke(i.caller, "reissueShareToken", [shareTokenToPayAmount], nil) | |
768 | 851 | if ((reissue == reissue)) | |
769 | 852 | then { | |
770 | 853 | let stake3 = invoke(farmingAddress, "lockShareTokensFromPool", [callerBytes, toString(i.caller), lockType], stPayments) | |
771 | 854 | if ((stake3 == stake3)) | |
772 | 855 | then nil | |
773 | 856 | else throw("Strict value is not equal to itself.") | |
774 | 857 | } | |
775 | 858 | else throw("Strict value is not equal to itself.") | |
776 | 859 | } | |
777 | 860 | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(caller, shareTokenToPayAmount, shareAssetId)] | |
778 | 861 | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, (balanceA + pmtAmountA)), IntegerEntry(kBalanceB, (balanceB + pmtAmountB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(caller, change, changeAssetId)] ++ shareTokenST), nil)) | |
779 | 862 | } | |
780 | 863 | else throw("Strict value is not equal to itself.") | |
781 | 864 | } | |
782 | 865 | else throw("Strict value is not equal to itself.") | |
783 | 866 | } | |
784 | 867 | } | |
785 | 868 | }))) | |
786 | 869 | ||
787 | 870 | ||
788 | 871 | ||
789 | 872 | @Callable(i) | |
790 | 873 | func replenishWithOneToken (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
791 | 874 | let caller = Address(callerBytes) | |
792 | 875 | let pmtAssetId = parsePaymentAsset(pAssetIds[0]) | |
793 | 876 | let pmtAmount = pAmounts[0] | |
794 | 877 | let virtGetMinAmount = parseIntValue(args[0]) | |
795 | 878 | let stakeFarming = (args[1] == "true") | |
796 | 879 | let lockType = parseIntValue(args[2]) | |
797 | - | let $ | |
798 | - | let strAssetIdA = $ | |
799 | - | let strAssetIdB = $ | |
800 | - | let assetIdA = $ | |
801 | - | let assetIdB = $ | |
802 | - | let shareAssetId = $ | |
803 | - | let $ | |
804 | - | let balanceA = $ | |
805 | - | let balanceB = $ | |
806 | - | let accountBalanceA = $ | |
807 | - | let accountBalanceB = $ | |
808 | - | let shareAssetSupply = | |
880 | + | let $t03315833248 = getPoolAssets(i.caller) | |
881 | + | let strAssetIdA = $t03315833248._1 | |
882 | + | let strAssetIdB = $t03315833248._2 | |
883 | + | let assetIdA = $t03315833248._3 | |
884 | + | let assetIdB = $t03315833248._4 | |
885 | + | let shareAssetId = $t03315833248._5 | |
886 | + | let $t03325333377 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
887 | + | let balanceA = $t03325333377._1 | |
888 | + | let balanceB = $t03325333377._2 | |
889 | + | let accountBalanceA = $t03325333377._3 | |
890 | + | let accountBalanceB = $t03325333377._4 | |
891 | + | let shareAssetSupply = $t03325333377._5 | |
809 | 892 | let initial = ((balanceA + balanceB) == 0) | |
810 | 893 | if ((size(args) != 3)) | |
811 | 894 | then throw("Wrong args size") | |
812 | 895 | else if (if ((size(pAmounts) != 1)) | |
813 | 896 | then (size(pAmounts) != 2) | |
814 | 897 | else false) | |
815 | 898 | then throw("Two or one attached assets expected") | |
816 | 899 | else if (if ((pmtAssetId != assetIdA)) | |
817 | 900 | then (pmtAssetId != assetIdB) | |
818 | 901 | else false) | |
819 | 902 | then throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
820 | 903 | else if (initial) | |
821 | 904 | then throw("For initial exchanger you need to use two tokens") | |
822 | 905 | else if (if ((balanceA > accountBalanceA)) | |
823 | 906 | then true | |
824 | 907 | else (balanceB > accountBalanceB)) | |
825 | - | then $Tuple2(nil, | |
908 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ (if ((size(pAmounts) == 2)) | |
826 | 909 | then [AttachedPayment(if ((pAssetIds[2] == base58'')) | |
827 | 910 | then unit | |
828 | 911 | else pAssetIds[2], pAmounts[2])] | |
829 | - | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB)))) | |
912 | + | else (nil ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))))) | |
830 | 913 | else { | |
831 | - | let $ | |
832 | - | let fee = $ | |
833 | - | let govFee = $ | |
834 | - | let teamFee = $ | |
835 | - | let $ | |
836 | - | let pmtAssetIdStr = $ | |
837 | - | let pmtAssetIdName = $ | |
838 | - | let $ | |
839 | - | let shareTokenToPayAmount = $ | |
840 | - | let newBalanceA = $ | |
841 | - | let newBalanceB = $ | |
842 | - | let govReward = $ | |
843 | - | let teamReward = $ | |
844 | - | let govRewardAsset = $ | |
914 | + | let $t03428934356 = getFeeParams(i.caller, i.originCaller) | |
915 | + | let fee = $t03428934356._1 | |
916 | + | let govFee = $t03428934356._2 | |
917 | + | let teamFee = $t03428934356._3 | |
918 | + | let $t03436534427 = getAssetInfo(pmtAssetId) | |
919 | + | let pmtAssetIdStr = $t03436534427._1 | |
920 | + | let pmtAssetIdName = $t03436534427._2 | |
921 | + | let $t03444534690 = calcLPAmountReplenishOneToken(pmtAmount, pmtAssetId, assetIdA, assetIdB, balanceA, balanceB, shareAssetSupply, fee, govFee, teamFee, virtGetMinAmount) | |
922 | + | let shareTokenToPayAmount = $t03444534690._1 | |
923 | + | let newBalanceA = $t03444534690._2 | |
924 | + | let newBalanceB = $t03444534690._3 | |
925 | + | let govReward = $t03444534690._4 | |
926 | + | let teamReward = $t03444534690._5 | |
927 | + | let govRewardAsset = $t03444534690._6 | |
845 | 928 | let govRewardAssetStr = if ((govRewardAsset == assetIdA)) | |
846 | 929 | then strAssetIdA | |
847 | 930 | else strAssetIdB | |
848 | 931 | if ((shareTokenToPayAmount == 0)) | |
849 | 932 | then throw("Too small amount to replenish") | |
850 | 933 | else { | |
851 | 934 | let stake1 = if (contains(stakingAssets, pmtAssetIdStr)) | |
852 | 935 | then invoke(i.caller, "stakeUnstake", [true, pmtAmount, pmtAssetIdStr], nil) | |
853 | 936 | else 0 | |
854 | 937 | if ((stake1 == stake1)) | |
855 | 938 | then { | |
856 | 939 | let stake2 = if (contains(stakingAssets, govRewardAssetStr)) | |
857 | 940 | then invoke(i.caller, "stakeUnstake", [false, (govReward + teamReward), govRewardAssetStr], nil) | |
858 | 941 | else 0 | |
859 | 942 | if ((stake2 == stake2)) | |
860 | 943 | then { | |
861 | 944 | let shareTokenST = if (stakeFarming) | |
862 | 945 | then { | |
863 | 946 | let stPayments = ([AttachedPayment(shareAssetId, shareTokenToPayAmount)] ++ (if ((size(pAmounts) == 2)) | |
864 | 947 | then [AttachedPayment(if ((pAssetIds[1] == base58'')) | |
865 | 948 | then unit | |
866 | 949 | else pAssetIds[1], pAmounts[1])] | |
867 | 950 | else nil)) | |
868 | 951 | let reissue = invoke(i.caller, "reissueShareToken", [shareTokenToPayAmount], nil) | |
869 | 952 | if ((reissue == reissue)) | |
870 | 953 | then { | |
871 | 954 | let stake3 = invoke(farmingAddress, "lockShareTokensFromPool", [callerBytes, toString(i.caller), lockType], stPayments) | |
872 | 955 | if ((stake3 == stake3)) | |
873 | 956 | then nil | |
874 | 957 | else throw("Strict value is not equal to itself.") | |
875 | 958 | } | |
876 | 959 | else throw("Strict value is not equal to itself.") | |
877 | 960 | } | |
878 | 961 | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(caller, shareTokenToPayAmount, shareAssetId)] | |
879 | 962 | $Tuple2(nil, $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), ScriptTransfer(moneyBoxAddress, govReward, govRewardAsset), ScriptTransfer(teamBoxAddress, teamReward, govRewardAsset)] ++ shareTokenST), nil)) | |
880 | 963 | } | |
881 | 964 | else throw("Strict value is not equal to itself.") | |
882 | 965 | } | |
883 | 966 | else throw("Strict value is not equal to itself.") | |
884 | 967 | } | |
885 | 968 | } | |
886 | 969 | }))) | |
887 | 970 | ||
888 | 971 | ||
889 | 972 | ||
890 | 973 | @Callable(i) | |
891 | 974 | func withdraw (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
892 | 975 | let caller = Address(callerBytes) | |
893 | - | let $ | |
894 | - | let strAssetIdA = $ | |
895 | - | let strAssetIdB = $ | |
896 | - | let assetIdA = $ | |
897 | - | let assetIdB = $ | |
898 | - | let shareAssetId = $ | |
899 | - | let $ | |
900 | - | let balanceA = $ | |
901 | - | let balanceB = $ | |
902 | - | let accountBalanceA = $ | |
903 | - | let accountBalanceB = $ | |
904 | - | let shareAssetSupply = | |
905 | - | let $ | |
976 | + | let $t03675836848 = getPoolAssets(i.caller) | |
977 | + | let strAssetIdA = $t03675836848._1 | |
978 | + | let strAssetIdB = $t03675836848._2 | |
979 | + | let assetIdA = $t03675836848._3 | |
980 | + | let assetIdB = $t03675836848._4 | |
981 | + | let shareAssetId = $t03675836848._5 | |
982 | + | let $t03685736981 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
983 | + | let balanceA = $t03685736981._1 | |
984 | + | let balanceB = $t03685736981._2 | |
985 | + | let accountBalanceA = $t03685736981._3 | |
986 | + | let accountBalanceB = $t03685736981._4 | |
987 | + | let shareAssetSupply = $t03685736981._5 | |
988 | + | let $t03699037370 = if ((size(pAmounts) == 1)) | |
906 | 989 | then { | |
907 | 990 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
908 | 991 | if ((pAsset != shareAssetId)) | |
909 | 992 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
910 | 993 | else $Tuple2(pAmounts[0], pAsset) | |
911 | 994 | } | |
912 | 995 | else $Tuple2(0, shareAssetId) | |
913 | - | let pmtAmount = $ | |
914 | - | let pmtAssetId = $ | |
996 | + | let pmtAmount = $t03699037370._1 | |
997 | + | let pmtAssetId = $t03699037370._2 | |
915 | 998 | if ((size(args) != 1)) | |
916 | 999 | then throw("Wrong args size") | |
917 | 1000 | else if ((size(pAmounts) > 1)) | |
918 | 1001 | then throw("One attached payment expected") | |
919 | 1002 | else if (if ((balanceA > accountBalanceA)) | |
920 | 1003 | then true | |
921 | 1004 | else (balanceB > accountBalanceB)) | |
922 | - | then $Tuple2(nil, | |
1005 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
923 | 1006 | else { | |
924 | 1007 | let unlockAmount = parseIntValue(valueOrElse(args[0], "0")) | |
925 | 1008 | let unlock = if ((unlockAmount > 0)) | |
926 | 1009 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [callerBytes, toString(i.caller), unlockAmount], nil) | |
927 | 1010 | else 0 | |
928 | 1011 | if ((unlock == unlock)) | |
929 | 1012 | then { | |
930 | 1013 | let withdrawAmount = (pmtAmount + unlockAmount) | |
931 | 1014 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
932 | 1015 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
933 | 1016 | let stake1 = if (contains(stakingAssets, strAssetIdA)) | |
934 | 1017 | then invoke(i.caller, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
935 | 1018 | else 0 | |
936 | 1019 | if ((stake1 == stake1)) | |
937 | 1020 | then { | |
938 | 1021 | let stake2 = if (contains(stakingAssets, strAssetIdB)) | |
939 | 1022 | then invoke(i.caller, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
940 | 1023 | else 0 | |
941 | 1024 | if ((stake2 == stake2)) | |
942 | 1025 | then $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2([IntegerEntry(kBalanceA, (balanceA - amountToPayA)), IntegerEntry(kBalanceB, (balanceB - amountToPayB)), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(caller, amountToPayA, assetIdA), ScriptTransfer(caller, amountToPayB, assetIdB)], nil)) | |
943 | 1026 | else throw("Strict value is not equal to itself.") | |
944 | 1027 | } | |
945 | 1028 | else throw("Strict value is not equal to itself.") | |
946 | 1029 | } | |
947 | 1030 | else throw("Strict value is not equal to itself.") | |
948 | 1031 | } | |
949 | 1032 | })) | |
950 | 1033 | ||
951 | 1034 | ||
952 | 1035 | ||
953 | 1036 | @Callable(i) | |
954 | 1037 | func withdrawOneToken (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isDepricated(toString(i.caller)), valueOrElse(isActive(), { | |
955 | 1038 | let caller = Address(callerBytes) | |
956 | 1039 | let withdrawAsset = if ((args[0] == "")) | |
957 | 1040 | then unit | |
958 | 1041 | else fromBase58String(args[0]) | |
959 | - | let $ | |
960 | - | let strAssetIdA = $ | |
961 | - | let strAssetIdB = $ | |
962 | - | let assetIdA = $ | |
963 | - | let assetIdB = $ | |
964 | - | let shareAssetId = $ | |
965 | - | let $ | |
966 | - | let balanceA = $ | |
967 | - | let balanceB = $ | |
968 | - | let accountBalanceA = $ | |
969 | - | let accountBalanceB = $ | |
970 | - | let shareAssetSupply = | |
971 | - | let $ | |
1042 | + | let $t03958839678 = getPoolAssets(i.caller) | |
1043 | + | let strAssetIdA = $t03958839678._1 | |
1044 | + | let strAssetIdB = $t03958839678._2 | |
1045 | + | let assetIdA = $t03958839678._3 | |
1046 | + | let assetIdB = $t03958839678._4 | |
1047 | + | let shareAssetId = $t03958839678._5 | |
1048 | + | let $t03968739811 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1049 | + | let balanceA = $t03968739811._1 | |
1050 | + | let balanceB = $t03968739811._2 | |
1051 | + | let accountBalanceA = $t03968739811._3 | |
1052 | + | let accountBalanceB = $t03968739811._4 | |
1053 | + | let shareAssetSupply = $t03968739811._5 | |
1054 | + | let $t03982040172 = if ((size(pAmounts) == 1)) | |
972 | 1055 | then { | |
973 | 1056 | let pAsset = parsePaymentAsset(pAssetIds[0]) | |
974 | 1057 | if ((pAsset != shareAssetId)) | |
975 | 1058 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
976 | 1059 | else $Tuple2(pAmounts[0], pAsset) | |
977 | 1060 | } | |
978 | 1061 | else $Tuple2(0, shareAssetId) | |
979 | - | let pmtAmount = $ | |
980 | - | let pmtAssetId = $ | |
1062 | + | let pmtAmount = $t03982040172._1 | |
1063 | + | let pmtAssetId = $t03982040172._2 | |
981 | 1064 | let virtMinToRecive = parseIntValue(args[1]) | |
982 | 1065 | if ((size(args) != 3)) | |
983 | 1066 | then throw("Wrong args size") | |
984 | 1067 | else if ((size(pAmounts) > 1)) | |
985 | 1068 | then throw("One attached payment expected") | |
986 | 1069 | else if ((pmtAssetId != shareAssetId)) | |
987 | 1070 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
988 | 1071 | else if (!(containsElement([assetIdA, assetIdB], withdrawAsset))) | |
989 | 1072 | then throw("Incorrect withdraw asset.") | |
990 | 1073 | else if (if ((balanceA > accountBalanceA)) | |
991 | 1074 | then true | |
992 | 1075 | else (balanceB > accountBalanceB)) | |
993 | - | then $Tuple2(nil, | |
1076 | + | then $Tuple2(nil, ([ScriptTransfer(caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious(accountBalanceA, accountBalanceB, balanceA, balanceB, strAssetIdA, strAssetIdB))) | |
994 | 1077 | else { | |
995 | 1078 | let unlockAmount = parseIntValue(valueOrElse(args[2], "0")) | |
996 | 1079 | let unlock = if ((unlockAmount > 0)) | |
997 | 1080 | then invoke(farmingAddress, "withdrawShareTokensFromPool", [callerBytes, toString(i.caller), unlockAmount], nil) | |
998 | 1081 | else 0 | |
999 | 1082 | if ((unlock == unlock)) | |
1000 | 1083 | then { | |
1001 | 1084 | let withdrawAmount = (pmtAmount + unlockAmount) | |
1002 | 1085 | let amountToPayA = fraction(withdrawAmount, balanceA, shareAssetSupply) | |
1003 | 1086 | let amountToPayB = fraction(withdrawAmount, balanceB, shareAssetSupply) | |
1004 | - | let $ | |
1005 | - | let fee = $ | |
1006 | - | let govFee = $ | |
1007 | - | let teamFee = $ | |
1008 | - | let $ | |
1087 | + | let $t04143941506 = getFeeParams(i.caller, i.originCaller) | |
1088 | + | let fee = $t04143941506._1 | |
1089 | + | let govFee = $t04143941506._2 | |
1090 | + | let teamFee = $t04143941506._3 | |
1091 | + | let $t04151941933 = if ((withdrawAsset == assetIdA)) | |
1009 | 1092 | then calculateFees(amountToPayB, virtMinToRecive, (balanceB - amountToPayB), (balanceA - amountToPayA), fee, govFee, teamFee) | |
1010 | 1093 | else calculateFees(amountToPayA, virtMinToRecive, (balanceA - amountToPayA), (balanceB - amountToPayB), fee, govFee, teamFee) | |
1011 | - | let amountWithoutFee = $ | |
1012 | - | let amountWithFee = $ | |
1013 | - | let governanceReward = $ | |
1014 | - | let teamReward = $ | |
1015 | - | let $ | |
1094 | + | let amountWithoutFee = $t04151941933._1 | |
1095 | + | let amountWithFee = $t04151941933._2 | |
1096 | + | let governanceReward = $t04151941933._3 | |
1097 | + | let teamReward = $t04151941933._4 | |
1098 | + | let $t04194643256 = if ((withdrawAsset == assetIdA)) | |
1016 | 1099 | then { | |
1017 | 1100 | let unstake = if (contains(stakingAssets, strAssetIdA)) | |
1018 | 1101 | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayA + amountWithFee) + governanceReward) + teamReward), strAssetIdA], nil) | |
1019 | 1102 | else 0 | |
1020 | 1103 | if ((unstake == unstake)) | |
1021 | 1104 | then $Tuple4(((((balanceA - amountToPayA) - amountWithFee) - governanceReward) - teamReward), balanceB, assetIdA, [ScriptTransfer(caller, (amountToPayA + amountWithFee), assetIdA)]) | |
1022 | 1105 | else throw("Strict value is not equal to itself.") | |
1023 | 1106 | } | |
1024 | 1107 | else { | |
1025 | 1108 | let unstake = if (contains(stakingAssets, strAssetIdB)) | |
1026 | 1109 | then invoke(i.caller, "stakeUnstake", [false, (((amountToPayB + amountWithFee) + governanceReward) + teamReward), strAssetIdB], nil) | |
1027 | 1110 | else 0 | |
1028 | 1111 | if ((unstake == unstake)) | |
1029 | 1112 | then $Tuple4(balanceA, ((((balanceB - amountToPayB) - amountWithFee) - governanceReward) - teamReward), assetIdB, [ScriptTransfer(caller, (amountToPayB + amountWithFee), assetIdB)]) | |
1030 | 1113 | else throw("Strict value is not equal to itself.") | |
1031 | 1114 | } | |
1032 | - | let newBalanceA = $ | |
1033 | - | let newBalanceB = $ | |
1034 | - | let govRewardAssetId = $ | |
1035 | - | let userTransfer = $ | |
1115 | + | let newBalanceA = $t04194643256._1 | |
1116 | + | let newBalanceB = $t04194643256._2 | |
1117 | + | let govRewardAssetId = $t04194643256._3 | |
1118 | + | let userTransfer = $t04194643256._4 | |
1036 | 1119 | $Tuple2([ScriptTransfer(i.caller, unlockAmount, shareAssetId)], $Tuple2(([IntegerEntry(kBalanceA, newBalanceA), IntegerEntry(kBalanceB, newBalanceB), IntegerEntry(kShareAssetSupply, (shareAssetSupply - withdrawAmount)), Burn(shareAssetId, withdrawAmount), ScriptTransfer(moneyBoxAddress, governanceReward, govRewardAssetId), ScriptTransfer(teamBoxAddress, teamReward, govRewardAssetId)] ++ userTransfer), nil)) | |
1037 | 1120 | } | |
1038 | 1121 | else throw("Strict value is not equal to itself.") | |
1039 | 1122 | } | |
1040 | 1123 | }))) | |
1041 | 1124 | ||
1042 | 1125 | ||
1043 | 1126 | ||
1044 | 1127 | @Callable(i) | |
1045 | 1128 | func takeIntoAccountExtraFunds (callerBytes,args,pAmounts,pAssetIds) = valueOrElse(isOraclePool(toString(i.caller)), valueOrElse(isActive(), { | |
1046 | - | let $ | |
1047 | - | let strAssetIdA = $ | |
1048 | - | let strAssetIdB = $ | |
1049 | - | let assetIdA = $ | |
1050 | - | let assetIdB = $ | |
1129 | + | let $t04401644092 = getPoolAssets(i.caller) | |
1130 | + | let strAssetIdA = $t04401644092._1 | |
1131 | + | let strAssetIdB = $t04401644092._2 | |
1132 | + | let assetIdA = $t04401644092._3 | |
1133 | + | let assetIdB = $t04401644092._4 | |
1051 | 1134 | let claim = if (if ((assetIdA == USDN)) | |
1052 | 1135 | then true | |
1053 | 1136 | else (assetIdB == USDN)) | |
1054 | 1137 | then invoke(i.caller, "claimNetrinoRewards", nil, nil) | |
1055 | - | else | |
1138 | + | else 0 | |
1056 | 1139 | if ((claim == claim)) | |
1057 | 1140 | then { | |
1058 | - | let $t04196942105 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1059 | - | let balanceA = $t04196942105._1 | |
1060 | - | let balanceB = $t04196942105._2 | |
1061 | - | let accountBalanceA = $t04196942105._3 | |
1062 | - | let accountBalanceB = $t04196942105._4 | |
1063 | - | let stakedAmountA = $t04196942105._5 | |
1064 | - | let stakedAmountB = $t04196942105._6 | |
1141 | + | let $t04425244358 = getPoolBalances(i.caller, assetIdA, assetIdB) | |
1142 | + | let balanceA = $t04425244358._1 | |
1143 | + | let balanceB = $t04425244358._2 | |
1144 | + | let accountBalanceA = $t04425244358._3 | |
1145 | + | let accountBalanceB = $t04425244358._4 | |
1065 | 1146 | let amountEnrollA = (accountBalanceA - balanceA) | |
1066 | 1147 | let amountEnrollB = (accountBalanceB - balanceB) | |
1067 | - | let $t04222542539 = if ((assetIdA == L2MP)) | |
1068 | - | then $Tuple2((accountBalanceA - stakedAmountA), amountEnrollB) | |
1069 | - | else if ((assetIdB == L2MP)) | |
1070 | - | then $Tuple2(amountEnrollA, (accountBalanceB - stakedAmountB)) | |
1071 | - | else $Tuple2(amountEnrollA, amountEnrollB) | |
1072 | - | let amountToStakeA = $t04222542539._1 | |
1073 | - | let amountToStakeB = $t04222542539._2 | |
1074 | 1148 | if ((size(args) != 0)) | |
1075 | 1149 | then throw("Wrong args size") | |
1076 | 1150 | else if ((moneyBoxAddress != i.originCaller)) | |
1077 | 1151 | then throw("Only the wallet can call this function") | |
1078 | 1152 | else if (if ((0 > amountEnrollA)) | |
1079 | 1153 | then true | |
1080 | 1154 | else (0 > amountEnrollB)) | |
1081 | 1155 | then suspend("Enroll amount negative") | |
1082 | 1156 | else if (if ((amountEnrollA == 0)) | |
1083 | 1157 | then (amountEnrollB == 0) | |
1084 | 1158 | else false) | |
1085 | 1159 | then throw("No money to take") | |
1086 | 1160 | else { | |
1087 | 1161 | let stake1 = if (if (contains(stakingAssets, strAssetIdA)) | |
1088 | - | then ( | |
1162 | + | then (amountEnrollA > 0) | |
1089 | 1163 | else false) | |
1090 | - | then invoke(i.caller, "stakeUnstake", [true, | |
1164 | + | then invoke(i.caller, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
1091 | 1165 | else 0 | |
1092 | 1166 | if ((stake1 == stake1)) | |
1093 | 1167 | then { | |
1094 | 1168 | let stake2 = if (if (contains(stakingAssets, strAssetIdB)) | |
1095 | - | then ( | |
1169 | + | then (amountEnrollB > 0) | |
1096 | 1170 | else false) | |
1097 | - | then invoke(i.caller, "stakeUnstake", [true, | |
1171 | + | then invoke(i.caller, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
1098 | 1172 | else 0 | |
1099 | 1173 | if ((stake2 == stake2)) | |
1100 | 1174 | then $Tuple2(nil, $Tuple2([IntegerEntry(kBalanceA, (balanceA + amountEnrollA)), IntegerEntry(kBalanceB, (balanceB + amountEnrollB))], nil)) | |
1101 | 1175 | else throw("Strict value is not equal to itself.") | |
1102 | 1176 | } | |
1103 | 1177 | else throw("Strict value is not equal to itself.") | |
1104 | 1178 | } | |
1105 | 1179 | } | |
1106 | 1180 | else throw("Strict value is not equal to itself.") | |
1107 | 1181 | })) | |
1108 | 1182 | ||
1109 | 1183 | ||
1110 | 1184 | @Verifier(tx) | |
1111 | 1185 | func verify () = { | |
1112 | 1186 | let multiSignedByAdmins = { | |
1113 | 1187 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
1114 | 1188 | then 1 | |
1115 | 1189 | else 0 | |
1116 | 1190 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
1117 | 1191 | then 1 | |
1118 | 1192 | else 0 | |
1119 | 1193 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
1120 | 1194 | then 1 | |
1121 | 1195 | else 0 | |
1122 | 1196 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
1123 | 1197 | } | |
1124 | 1198 | multiSignedByAdmins | |
1125 | 1199 | } | |
1126 | 1200 |
github/deemru/w8io/026f985 204.23 ms ◑