tx · EP4sVG81wmGjP6gprVZ2nmnyzZCC1NNbTTtNGNe3JmrE 3Mq63YubY7UKJEobhDuXfsnXaPDJZT1fDhx: -0.01400000 Waves 2021.12.29 19:15 [1855734] smart account 3Mq63YubY7UKJEobhDuXfsnXaPDJZT1fDhx > SELF 0.00000000 Waves
{ "type": 13, "id": "EP4sVG81wmGjP6gprVZ2nmnyzZCC1NNbTTtNGNe3JmrE", "fee": 1400000, "feeAssetId": null, "timestamp": 1640794555561, "version": 2, "chainId": 84, "sender": "3Mq63YubY7UKJEobhDuXfsnXaPDJZT1fDhx", "senderPublicKey": "HXfVyeXgXUtHD3uSP6yjsk6JQcTwmU9qQTvhXzFpPw2T", "proofs": [ "2UeJQp8EeecgmA2VSv9MvUbWMa5HwNvUBvj6iNsw7sV62vffQ1Sus24C3jNmG7NNRFSyhrGeQCKR1L4DRZraGmQT", "5L9QXHsTJQzD76ngxG6YdPnEakKfN9ppqha1vVZS2WN49DzLfgj4RMXVG9DCyCGTDwqhvXjBjmTqwBtVpngdcPh8" ], "script": "base64:AAIFAAAAAAAADsAIAhIDCgEEEgcKBQEBCAgEEgMKAQESAwoBARIAEgMKAQESABIAEgMKAQESBQoDBAEIEgAaFAoBQRIPa2V5QWRtaW5QdWJLZXkyGhQKAUISD2tleUFkbWluUHViS2V5MxoLCgFDEgZvcmFjbGUaEAoBRBILZ2V0QWRtaW5QdWIaEAoBRRILa2V5QWRtaW5QdWIaDAoBRhIHJG1hdGNoMBoLCgFHEgZzdHJpbmcaDAoBSBIHbm90aGluZxoRCgFJEgxhZG1pblB1YktleTEaEQoBShIMYWRtaW5QdWJLZXkyGhEKAUsSDGFkbWluUHViS2V5MxoZCgFMEhRhZG1pblB1YktleVN0YXJ0U3RvcBoXCgFNEhJhZG1pblB1YktleVN0YWtpbmcaEgoBThINd2FsbGV0QWRkcmVzcxoSCgFPEg12b3RpbmdBZGRyZXNzGgkKAVASBFVTRE4aCQoBURIETlNCVBoJCgFSEgRFVVJOGhIKAVM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Z2UHCQAAAAAAAAIFAAAAAmFlBQAAAAFQBwYDAwkAAAAAAAACBQAAAAJhZgUAAAABUAkAAAAAAAACCQABkAAAAAEIBQAAAAJjdAAAAAhwYXltZW50cwAAAAAAAAAAAQcJAAAAAAAAAggJAAGRAAAAAggFAAAAAmN0AAAACHBheW1lbnRzAAAAAAAAAAAAAAAAB2Fzc2V0SWQFAAAAAVAHBAAAAAJjRQMDAwkAAAAAAAACCAUAAAACY3QAAAAEZEFwcAUAAAABVwkAAAAAAAACCAUAAAACY3QAAAAIZnVuY3Rpb24CAAAACGV4Y2hhbmdlBwkAAAAAAAACBQAAAAJhZQUAAAABUQcGAwMJAAAAAAAAAgUAAAACYWYFAAAAAVEJAAAAAAAAAgkAAZAAAAABCAUAAAACY3QAAAAIcGF5bWVudHMAAAAAAAAAAAEHCQAAAAAAAAIICQABkQAAAAIIBQAAAAJjdAAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAdhc3NldElkBQAAAAFQBwQAAAACY0YDAwMJAAH0AAAAAwgFAAAAAmN3AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY3cAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAFJBgkAAfQAAAADCAUAAAACY3cAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJjdwAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAAUoGCQAB9AAAAAMIBQAAAAJjdwAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmN3AAAABnByb29mcwAAAAAAAAAAAAUAAAABSwYJAAH0AAAAAwgFAAAAAmN3AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACY3cAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAFNAwMDAwUAAAACY0MGBQAAAAJjRAYFAAAAAmNFBQAAAAJjRgcGBQAAAAJjeQUAAAACY3krZvYu", "height": 1855734, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 269JkUQbjcwiHcSmcSz2fWZsuNFA9VVsioiztQz6ryo5 Next: 8rYiFi2o9kjEz3Z3JKP8AvKttrKcfT4sRexurNmsGQfs Diff:
Old | New | Differences | |
---|---|---|---|
197 | 197 | ||
198 | 198 | let assetInitB = getIntegerValue(this, keyBalanceInitB) | |
199 | 199 | ||
200 | - | let availableBalanceA = (balanceA - stakedAmountA) | |
201 | - | ||
202 | - | let availableBalanceB = (balanceB - stakedAmountB) | |
203 | - | ||
204 | 200 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
205 | 201 | ||
206 | 202 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
262 | 258 | } | |
263 | 259 | ||
264 | 260 | ||
265 | - | func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
266 | - | ||
267 | - | ||
268 | - | func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
269 | - | ||
270 | - | ||
271 | 261 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceWithStakedA)) + " ") + assetNameA) + ", ") + toString(accountBalanceWithStakedB)) + " ") + assetNameB) + ". State: ") + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB)) | |
272 | 262 | ||
273 | 263 | ||
274 | 264 | @Callable(i) | |
275 | 265 | func init (firstHarvest) = { | |
276 | - | let $ | |
277 | - | let pmtAmountA = $ | |
278 | - | let pmtAssetIdA = $ | |
279 | - | let $ | |
280 | - | let pmtAmountB = $ | |
281 | - | let pmtAssetIdB = $ | |
282 | - | let $ | |
283 | - | let pmtStrAssetIdA = $ | |
284 | - | let pmtAssetNameA = $ | |
285 | - | let pmtDecimalsA = $ | |
286 | - | let $ | |
287 | - | let pmtStrAssetIdB = $ | |
288 | - | let pmtAssetNameB = $ | |
289 | - | let pmtDecimalsB = $ | |
266 | + | let $t075797656 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
267 | + | let pmtAmountA = $t075797656._1 | |
268 | + | let pmtAssetIdA = $t075797656._2 | |
269 | + | let $t076617738 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
270 | + | let pmtAmountB = $t076617738._1 | |
271 | + | let pmtAssetIdB = $t076617738._2 | |
272 | + | let $t077437820 = getAssetInfo(pmtAssetIdA) | |
273 | + | let pmtStrAssetIdA = $t077437820._1 | |
274 | + | let pmtAssetNameA = $t077437820._2 | |
275 | + | let pmtDecimalsA = $t077437820._3 | |
276 | + | let $t078257902 = getAssetInfo(pmtAssetIdB) | |
277 | + | let pmtStrAssetIdB = $t078257902._1 | |
278 | + | let pmtAssetNameB = $t078257902._2 | |
279 | + | let pmtDecimalsB = $t078257902._3 | |
290 | 280 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
291 | 281 | then throw("Only admin can call this function") | |
292 | 282 | else if (isDefined(getBoolean(this, keyActive))) | |
328 | 318 | ||
329 | 319 | @Callable(i) | |
330 | 320 | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
331 | - | let $ | |
332 | - | let pmtStrAssetIdA = $ | |
333 | - | let pmtAssetNameA = $ | |
334 | - | let pmtDecimalsA = $ | |
335 | - | let $ | |
336 | - | let pmtStrAssetIdB = $ | |
337 | - | let pmtAssetNameB = $ | |
338 | - | let pmtDecimalsB = $ | |
321 | + | let $t01049110578 = getAssetInfoFromString(strAssetIdA) | |
322 | + | let pmtStrAssetIdA = $t01049110578._1 | |
323 | + | let pmtAssetNameA = $t01049110578._2 | |
324 | + | let pmtDecimalsA = $t01049110578._3 | |
325 | + | let $t01058310670 = getAssetInfoFromString(strAssetIdB) | |
326 | + | let pmtStrAssetIdB = $t01058310670._1 | |
327 | + | let pmtAssetNameB = $t01058310670._2 | |
328 | + | let pmtDecimalsB = $t01058310670._3 | |
339 | 329 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
340 | 330 | then throw("Only admin can call this function") | |
341 | 331 | else if (isDefined(getBoolean(this, keyActive))) | |
373 | 363 | let pmtAssetIdB = i.payments[1].assetId | |
374 | 364 | let pmtAmountA = i.payments[0].amount | |
375 | 365 | let pmtAmountB = i.payments[1].amount | |
376 | - | let $ | |
377 | - | let pmtStrAssetIdA = $ | |
378 | - | let pmtAssetNameA = $ | |
379 | - | let pmtDecimalsA = $ | |
380 | - | let $ | |
381 | - | let pmtStrAssetIdB = $ | |
382 | - | let pmtAssetNameB = $ | |
383 | - | let pmtDecimalsB = $ | |
366 | + | let $t01316713244 = getAssetInfo(pmtAssetIdA) | |
367 | + | let pmtStrAssetIdA = $t01316713244._1 | |
368 | + | let pmtAssetNameA = $t01316713244._2 | |
369 | + | let pmtDecimalsA = $t01316713244._3 | |
370 | + | let $t01324913326 = getAssetInfo(pmtAssetIdB) | |
371 | + | let pmtStrAssetIdB = $t01324913326._1 | |
372 | + | let pmtAssetNameB = $t01324913326._2 | |
373 | + | let pmtDecimalsB = $t01324913326._3 | |
384 | 374 | if (if ((balanceA == 0)) | |
385 | 375 | then (balanceB == 0) | |
386 | 376 | else false) | |
475 | 465 | ||
476 | 466 | @Callable(i) | |
477 | 467 | func withdraw () = { | |
478 | - | let $ | |
479 | - | let pmtAmount = $ | |
480 | - | let pmtAssetId = $ | |
468 | + | let $t01849518570 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
469 | + | let pmtAmount = $t01849518570._1 | |
470 | + | let pmtAssetId = $t01849518570._2 | |
481 | 471 | let amountToPayA = fraction(pmtAmount, balanceA, shareAssetSupply) | |
482 | 472 | let amountToPayB = fraction(pmtAmount, balanceB, shareAssetSupply) | |
483 | 473 | if (!(isActive)) | |
488 | 478 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
489 | 479 | else if (!(hasEnoughBalance)) | |
490 | 480 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
491 | - | else if (if ((amountToPayA > availableBalanceA)) | |
492 | - | then true | |
493 | - | else (amountToPayB > availableBalanceB)) | |
494 | - | then throwInsufficientAvailableBalances(amountToPayA, amountToPayB) | |
495 | - | else { | |
496 | - | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
497 | - | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
498 | - | else 0 | |
499 | - | if ((stake1 == stake1)) | |
500 | - | then { | |
501 | - | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
502 | - | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
503 | - | else 0 | |
504 | - | if ((stake2 == stake2)) | |
505 | - | then [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
506 | - | else throw("Strict value is not equal to itself.") | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
509 | - | } | |
481 | + | else { | |
482 | + | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
483 | + | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
484 | + | else 0 | |
485 | + | if ((stake1 == stake1)) | |
486 | + | then { | |
487 | + | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
488 | + | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
489 | + | else 0 | |
490 | + | if ((stake2 == stake2)) | |
491 | + | then [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
492 | + | else throw("Strict value is not equal to itself.") | |
493 | + | } | |
494 | + | else throw("Strict value is not equal to itself.") | |
495 | + | } | |
510 | 496 | } | |
511 | 497 | ||
512 | 498 | ||
513 | 499 | ||
514 | 500 | @Callable(i) | |
515 | 501 | func exchange (minAmountToReceive) = { | |
516 | - | let $ | |
517 | - | let pmtAmount = $ | |
518 | - | let pmtAssetId = $ | |
502 | + | let $t01992820003 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
503 | + | let pmtAmount = $t01992820003._1 | |
504 | + | let pmtAssetId = $t01992820003._2 | |
519 | 505 | func calculateFees (tokenFrom,tokenTo) = { | |
520 | 506 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
521 | 507 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
540 | 526 | else if ((pmtAssetId == assetIdA)) | |
541 | 527 | then { | |
542 | 528 | let assetIdSend = assetIdB | |
543 | - | let $ | |
544 | - | let amountWithoutFee = $ | |
545 | - | let amountWithFee = $ | |
546 | - | let governanceReward = $ | |
529 | + | let $t02127721368 = calculateFees(balanceA, balanceB) | |
530 | + | let amountWithoutFee = $t02127721368._1 | |
531 | + | let amountWithFee = $t02127721368._2 | |
532 | + | let governanceReward = $t02127721368._3 | |
547 | 533 | let newBalanceA = (balanceA + pmtAmount) | |
548 | 534 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
549 | 535 | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
563 | 549 | else if ((pmtAssetId == assetIdB)) | |
564 | 550 | then { | |
565 | 551 | let assetIdSend = assetIdA | |
566 | - | let $ | |
567 | - | let amountWithoutFee = $ | |
568 | - | let amountWithFee = $ | |
569 | - | let governanceReward = $ | |
552 | + | let $t02232322414 = calculateFees(balanceB, balanceA) | |
553 | + | let amountWithoutFee = $t02232322414._1 | |
554 | + | let amountWithFee = $t02232322414._2 | |
555 | + | let governanceReward = $t02232322414._3 | |
570 | 556 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
571 | 557 | let newBalanceB = (balanceB + pmtAmount) | |
572 | - | if ( | |
573 | - | then | |
574 | - | else | |
575 | - | | |
576 | - | | |
577 | - | let | |
578 | - | then invoke(this, "stakeUnstake", [ | |
558 | + | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
559 | + | then invoke(this, "stakeUnstake", [false, (amountWithFee + governanceReward), strAssetIdA], nil) | |
560 | + | else 0 | |
561 | + | if ((stake1 == stake1)) | |
562 | + | then { | |
563 | + | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
564 | + | then invoke(this, "stakeUnstake", [true, pmtAmount, strAssetIdB], nil) | |
579 | 565 | else 0 | |
580 | - | if ((stake1 == stake1)) | |
581 | - | then { | |
582 | - | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
583 | - | then invoke(this, "stakeUnstake", [true, pmtAmount, strAssetIdB], nil) | |
584 | - | else 0 | |
585 | - | if ((stake2 == stake2)) | |
586 | - | then [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
587 | - | else throw("Strict value is not equal to itself.") | |
588 | - | } | |
566 | + | if ((stake2 == stake2)) | |
567 | + | then [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
589 | 568 | else throw("Strict value is not equal to itself.") | |
590 | 569 | } | |
570 | + | else throw("Strict value is not equal to itself.") | |
591 | 571 | } | |
592 | 572 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
593 | 573 | } | |
681 | 661 | } | |
682 | 662 | } | |
683 | 663 | else { | |
684 | - | let $ | |
685 | - | let call = $ | |
686 | - | let addr = $ | |
687 | - | let params = $ | |
688 | - | let payments = $ | |
664 | + | let $t02665226755 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
665 | + | let call = $t02665226755._1 | |
666 | + | let addr = $t02665226755._2 | |
667 | + | let params = $t02665226755._3 | |
668 | + | let payments = $t02665226755._4 | |
689 | 669 | let inv = invoke(addr, call, params, payments) | |
690 | 670 | if ((inv == inv)) | |
691 | 671 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "1.0.0" | |
5 | 5 | ||
6 | 6 | let keyVersion = "version" | |
7 | 7 | ||
8 | 8 | let keyActive = "active" | |
9 | 9 | ||
10 | 10 | let keyAssetIdA = "A_asset_id" | |
11 | 11 | ||
12 | 12 | let keyAssetIdB = "B_asset_id" | |
13 | 13 | ||
14 | 14 | let keyBalanceA = "A_asset_balance" | |
15 | 15 | ||
16 | 16 | let keyBalanceB = "B_asset_balance" | |
17 | 17 | ||
18 | 18 | let keyBalanceInitA = "A_asset_init" | |
19 | 19 | ||
20 | 20 | let keyBalanceInitB = "B_asset_init" | |
21 | 21 | ||
22 | 22 | let keyShareAssetId = "share_asset_id" | |
23 | 23 | ||
24 | 24 | let keyShareAssetSupply = "share_asset_supply" | |
25 | 25 | ||
26 | 26 | let keyCommission = "commission" | |
27 | 27 | ||
28 | 28 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let keyFirstHarvest = "first_harvest" | |
33 | 33 | ||
34 | 34 | let keyFirstHarvestHeight = "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 keyUSDNNSBTAddress = "staking_usdnnsbt_address" | |
45 | 45 | ||
46 | 46 | let keyEURNAddress = "staking_eurn_address" | |
47 | 47 | ||
48 | 48 | let keyLeasingPool = "leasing_address" | |
49 | 49 | ||
50 | 50 | let keyLeasingAmount = "leasing_amount" | |
51 | 51 | ||
52 | 52 | let keyLeasingId = "leasing_id" | |
53 | 53 | ||
54 | 54 | let keyAdminPubKey1 = "admin_pub_1" | |
55 | 55 | ||
56 | 56 | let keyAdminPubKey2 = "admin_pub_2" | |
57 | 57 | ||
58 | 58 | let keyAdminPubKey3 = "admin_pub_3" | |
59 | 59 | ||
60 | 60 | let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
61 | 61 | ||
62 | 62 | func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) { | |
63 | 63 | case string: String => | |
64 | 64 | fromBase58String(string) | |
65 | 65 | case nothing => | |
66 | 66 | throw("Admin public key is empty") | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let adminPubKey1 = getAdminPub(keyAdminPubKey1) | |
71 | 71 | ||
72 | 72 | let adminPubKey2 = getAdminPub(keyAdminPubKey2) | |
73 | 73 | ||
74 | 74 | let adminPubKey3 = getAdminPub(keyAdminPubKey3) | |
75 | 75 | ||
76 | 76 | let adminPubKeyStartStop = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
77 | 77 | ||
78 | 78 | let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK' | |
79 | 79 | ||
80 | 80 | let walletAddress = Address(base58'3NAGTtZz6WpupSN89NZD5rMZwwziZEg4Kx4') | |
81 | 81 | ||
82 | 82 | let votingAddress = Address(base58'3MrJgdL1GniipErHy44YF9idzLaUL2iX5DQ') | |
83 | 83 | ||
84 | 84 | let USDN = base58'8UrfDVd5GreeUwm7uPk7eYz1eMv376kzR52C6sANPkwS' | |
85 | 85 | ||
86 | 86 | let NSBT = base58'36mg8NZTaFRDygiVwb8uBnLR51hetJruUCZcxhaVcHj9' | |
87 | 87 | ||
88 | 88 | let EURN = base58'ECBCkHS68DckpBrzLeoRgYbFg7sCVqR176mPqbXsj9pA' | |
89 | 89 | ||
90 | 90 | let stakingAssets = ["WAVES", toBase58String(USDN), toBase58String(NSBT), toBase58String(EURN)] | |
91 | 91 | ||
92 | 92 | let stakingUSDNNSBTAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyUSDNNSBTAddress), "no usdn staking address"))) | |
93 | 93 | ||
94 | 94 | let stakingEURNAddress = Address(fromBase58String(valueOrErrorMessage(getString(oracle, keyEURNAddress), "no usdn staking address"))) | |
95 | 95 | ||
96 | 96 | let USDNToWavesExchanger = Address(base58'3N8PGkzXhbtTvEwEQTtE2xiTJmsDEQ9XfoZ') | |
97 | 97 | ||
98 | 98 | let USDNToNSBTExchanger = Address(base58'3MqW1t2cxdYy2emEMk3YtZkRwQPhHaTfWRe') | |
99 | 99 | ||
100 | 100 | let basePeriod = valueOrErrorMessage(getInteger(votingAddress, kBasePeriod), "Empty kBasePeriod") | |
101 | 101 | ||
102 | 102 | let startHeight = valueOrErrorMessage(getInteger(votingAddress, kStartHeight), "Empty kStartHeight") | |
103 | 103 | ||
104 | 104 | let periodLength = valueOrErrorMessage(getInteger(votingAddress, kPeriodLength), "Empty kPeriodLength") | |
105 | 105 | ||
106 | 106 | let firstHarvestEndPeriod = ((basePeriod + ((height - startHeight) / periodLength)) + 3) | |
107 | 107 | ||
108 | 108 | let isActive = getBooleanValue(this, keyActive) | |
109 | 109 | ||
110 | 110 | let strAssetIdA = getStringValue(this, keyAssetIdA) | |
111 | 111 | ||
112 | 112 | let strAssetIdB = getStringValue(this, keyAssetIdB) | |
113 | 113 | ||
114 | 114 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
115 | 115 | then unit | |
116 | 116 | else fromBase58String(strAssetIdA) | |
117 | 117 | ||
118 | 118 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
119 | 119 | then unit | |
120 | 120 | else fromBase58String(strAssetIdB) | |
121 | 121 | ||
122 | 122 | let assetNameA = match assetIdA { | |
123 | 123 | case id: ByteVector => | |
124 | 124 | value(assetInfo(id)).name | |
125 | 125 | case waves: Unit => | |
126 | 126 | "WAVES" | |
127 | 127 | case _ => | |
128 | 128 | throw("Match error") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | let assetNameB = match assetIdB { | |
132 | 132 | case id: ByteVector => | |
133 | 133 | value(assetInfo(id)).name | |
134 | 134 | case waves: Unit => | |
135 | 135 | "WAVES" | |
136 | 136 | case _ => | |
137 | 137 | throw("Match error") | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | let balanceA = getIntegerValue(this, keyBalanceA) | |
141 | 141 | ||
142 | 142 | let balanceB = getIntegerValue(this, keyBalanceB) | |
143 | 143 | ||
144 | 144 | let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId)) | |
145 | 145 | ||
146 | 146 | let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply) | |
147 | 147 | ||
148 | 148 | let commission = 3000 | |
149 | 149 | ||
150 | 150 | let commissionScaleDelimiter = 1000000 | |
151 | 151 | ||
152 | 152 | let scaleValue3 = 1000 | |
153 | 153 | ||
154 | 154 | let scaleValue8 = 100000000 | |
155 | 155 | ||
156 | 156 | let slippageToleranceDelimiter = 1000 | |
157 | 157 | ||
158 | 158 | func accountBalance (assetId) = match assetId { | |
159 | 159 | case id: ByteVector => | |
160 | 160 | assetBalance(this, id) | |
161 | 161 | case waves: Unit => | |
162 | 162 | wavesBalance(this).available | |
163 | 163 | case _ => | |
164 | 164 | throw("Match error") | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func stakedAmount (assetId) = { | |
169 | 169 | let stakedAmountCalculated = match assetId { | |
170 | 170 | case aId: ByteVector => | |
171 | 171 | if (if ((aId == USDN)) | |
172 | 172 | then true | |
173 | 173 | else (aId == NSBT)) | |
174 | 174 | then getInteger(stakingUSDNNSBTAddress, ((("rpd_balance_" + toBase58String(aId)) + "_") + toString(this))) | |
175 | 175 | else if ((aId == EURN)) | |
176 | 176 | then getInteger(stakingEURNAddress, ((("%s%s%s__stakingBalance__" + toBase58String(aId)) + "__") + toString(this))) | |
177 | 177 | else 0 | |
178 | 178 | case _: Unit => | |
179 | 179 | valueOrElse(getInteger(this, keyLeasingAmount), 0) | |
180 | 180 | case _ => | |
181 | 181 | throw("Match error") | |
182 | 182 | } | |
183 | 183 | match stakedAmountCalculated { | |
184 | 184 | case i: Int => | |
185 | 185 | i | |
186 | 186 | case _ => | |
187 | 187 | 0 | |
188 | 188 | } | |
189 | 189 | } | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | let stakedAmountA = stakedAmount(assetIdA) | |
193 | 193 | ||
194 | 194 | let stakedAmountB = stakedAmount(assetIdB) | |
195 | 195 | ||
196 | 196 | let assetInitA = getIntegerValue(this, keyBalanceInitA) | |
197 | 197 | ||
198 | 198 | let assetInitB = getIntegerValue(this, keyBalanceInitB) | |
199 | 199 | ||
200 | - | let availableBalanceA = (balanceA - stakedAmountA) | |
201 | - | ||
202 | - | let availableBalanceB = (balanceB - stakedAmountB) | |
203 | - | ||
204 | 200 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + stakedAmountA) | |
205 | 201 | ||
206 | 202 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + stakedAmountB) | |
207 | 203 | ||
208 | 204 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
209 | 205 | then (accountBalanceWithStakedB >= balanceB) | |
210 | 206 | else false | |
211 | 207 | ||
212 | 208 | func getAssetInfo (assetId) = match assetId { | |
213 | 209 | case id: ByteVector => | |
214 | 210 | let stringId = toBase58String(id) | |
215 | 211 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
216 | 212 | $Tuple3(stringId, info.name, info.decimals) | |
217 | 213 | case waves: Unit => | |
218 | 214 | $Tuple3("WAVES", "WAVES", 8) | |
219 | 215 | case _ => | |
220 | 216 | throw("Match error") | |
221 | 217 | } | |
222 | 218 | ||
223 | 219 | ||
224 | 220 | func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES")) | |
225 | 221 | then $Tuple3("WAVES", "WAVES", 8) | |
226 | 222 | else { | |
227 | 223 | let stringId = assetStr | |
228 | 224 | let id = fromBase58String(assetStr) | |
229 | 225 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
230 | 226 | $Tuple3(stringId, info.name, info.decimals) | |
231 | 227 | } | |
232 | 228 | ||
233 | 229 | ||
234 | 230 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
235 | 231 | ||
236 | 232 | ||
237 | 233 | func calcStakingFuncAndAddres (stake,assetId) = if (stake) | |
238 | 234 | then if ((assetId == USDN)) | |
239 | 235 | then $Tuple2("lockNeutrino", stakingUSDNNSBTAddress) | |
240 | 236 | else if ((assetId == NSBT)) | |
241 | 237 | then $Tuple2("lockNsbt", stakingUSDNNSBTAddress) | |
242 | 238 | else $Tuple2("startStaking", stakingEURNAddress) | |
243 | 239 | else if ((assetId == USDN)) | |
244 | 240 | then $Tuple2("unlockNeutrino", stakingUSDNNSBTAddress) | |
245 | 241 | else if ((assetId == NSBT)) | |
246 | 242 | then $Tuple2("unlockNsbt", stakingUSDNNSBTAddress) | |
247 | 243 | else $Tuple2("stopStaking", stakingEURNAddress) | |
248 | 244 | ||
249 | 245 | ||
250 | 246 | func calcStakingParams (stake,amount,assetId) = if (stake) | |
251 | 247 | then { | |
252 | 248 | let $t069306996 = calcStakingFuncAndAddres(stake, assetId) | |
253 | 249 | let call = $t069306996._1 | |
254 | 250 | let stakingAddr = $t069306996._2 | |
255 | 251 | $Tuple4(call, stakingAddr, nil, [AttachedPayment(assetId, amount)]) | |
256 | 252 | } | |
257 | 253 | else { | |
258 | 254 | let $t070827148 = calcStakingFuncAndAddres(stake, assetId) | |
259 | 255 | let call = $t070827148._1 | |
260 | 256 | let stakingAddr = $t070827148._2 | |
261 | 257 | $Tuple4(call, stakingAddr, [amount, toBase58String(assetId)], nil) | |
262 | 258 | } | |
263 | 259 | ||
264 | 260 | ||
265 | - | func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
266 | - | ||
267 | - | ||
268 | - | func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport")) | |
269 | - | ||
270 | - | ||
271 | 261 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(accountBalanceWithStakedA)) + " ") + assetNameA) + ", ") + toString(accountBalanceWithStakedB)) + " ") + assetNameB) + ". State: ") + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB)) | |
272 | 262 | ||
273 | 263 | ||
274 | 264 | @Callable(i) | |
275 | 265 | func init (firstHarvest) = { | |
276 | - | let $ | |
277 | - | let pmtAmountA = $ | |
278 | - | let pmtAssetIdA = $ | |
279 | - | let $ | |
280 | - | let pmtAmountB = $ | |
281 | - | let pmtAssetIdB = $ | |
282 | - | let $ | |
283 | - | let pmtStrAssetIdA = $ | |
284 | - | let pmtAssetNameA = $ | |
285 | - | let pmtDecimalsA = $ | |
286 | - | let $ | |
287 | - | let pmtStrAssetIdB = $ | |
288 | - | let pmtAssetNameB = $ | |
289 | - | let pmtDecimalsB = $ | |
266 | + | let $t075797656 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
267 | + | let pmtAmountA = $t075797656._1 | |
268 | + | let pmtAssetIdA = $t075797656._2 | |
269 | + | let $t076617738 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
270 | + | let pmtAmountB = $t076617738._1 | |
271 | + | let pmtAssetIdB = $t076617738._2 | |
272 | + | let $t077437820 = getAssetInfo(pmtAssetIdA) | |
273 | + | let pmtStrAssetIdA = $t077437820._1 | |
274 | + | let pmtAssetNameA = $t077437820._2 | |
275 | + | let pmtDecimalsA = $t077437820._3 | |
276 | + | let $t078257902 = getAssetInfo(pmtAssetIdB) | |
277 | + | let pmtStrAssetIdB = $t078257902._1 | |
278 | + | let pmtAssetNameB = $t078257902._2 | |
279 | + | let pmtDecimalsB = $t078257902._3 | |
290 | 280 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
291 | 281 | then throw("Only admin can call this function") | |
292 | 282 | else if (isDefined(getBoolean(this, keyActive))) | |
293 | 283 | then throw("DApp is already active") | |
294 | 284 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
295 | 285 | then throw("Assets must be different") | |
296 | 286 | else { | |
297 | 287 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
298 | 288 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
299 | 289 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
300 | 290 | let arg1 = pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN) | |
301 | 291 | let arg2 = pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN) | |
302 | 292 | let arg3 = pow(10, 0, shareDecimals, 0, 0, DOWN) | |
303 | 293 | let shareInitialSupply = fraction(arg1, arg2, arg3) | |
304 | 294 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
305 | 295 | let shareIssueId = calculateAssetId(shareIssue) | |
306 | 296 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
307 | 297 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
308 | 298 | else 0 | |
309 | 299 | if ((stake1 == stake1)) | |
310 | 300 | then { | |
311 | 301 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
312 | 302 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
313 | 303 | else 0 | |
314 | 304 | if ((stake2 == stake2)) | |
315 | 305 | then { | |
316 | 306 | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
317 | 307 | if (firstHarvest) | |
318 | 308 | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
319 | 309 | else baseEntry | |
320 | 310 | } | |
321 | 311 | else throw("Strict value is not equal to itself.") | |
322 | 312 | } | |
323 | 313 | else throw("Strict value is not equal to itself.") | |
324 | 314 | } | |
325 | 315 | } | |
326 | 316 | ||
327 | 317 | ||
328 | 318 | ||
329 | 319 | @Callable(i) | |
330 | 320 | func initWithInitRatio (amtAssetA,amtAssetB,strAssetIdA,strAssetIdB,firstHarvest) = { | |
331 | - | let $ | |
332 | - | let pmtStrAssetIdA = $ | |
333 | - | let pmtAssetNameA = $ | |
334 | - | let pmtDecimalsA = $ | |
335 | - | let $ | |
336 | - | let pmtStrAssetIdB = $ | |
337 | - | let pmtAssetNameB = $ | |
338 | - | let pmtDecimalsB = $ | |
321 | + | let $t01049110578 = getAssetInfoFromString(strAssetIdA) | |
322 | + | let pmtStrAssetIdA = $t01049110578._1 | |
323 | + | let pmtAssetNameA = $t01049110578._2 | |
324 | + | let pmtDecimalsA = $t01049110578._3 | |
325 | + | let $t01058310670 = getAssetInfoFromString(strAssetIdB) | |
326 | + | let pmtStrAssetIdB = $t01058310670._1 | |
327 | + | let pmtAssetNameB = $t01058310670._2 | |
328 | + | let pmtDecimalsB = $t01058310670._3 | |
339 | 329 | if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
340 | 330 | then throw("Only admin can call this function") | |
341 | 331 | else if (isDefined(getBoolean(this, keyActive))) | |
342 | 332 | then throw("DApp is already active") | |
343 | 333 | else if ((strAssetIdA == strAssetIdB)) | |
344 | 334 | then throw("Assets must be different") | |
345 | 335 | else { | |
346 | 336 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
347 | 337 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
348 | 338 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
349 | 339 | let shareInitialSupply = 0 | |
350 | 340 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
351 | 341 | let shareIssueId = calculateAssetId(shareIssue) | |
352 | 342 | let baseEntry = [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceInitA, amtAssetA), IntegerEntry(keyBalanceInitB, amtAssetB), IntegerEntry(keyBalanceA, 0), IntegerEntry(keyBalanceB, 0), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply)] | |
353 | 343 | if (firstHarvest) | |
354 | 344 | then (baseEntry ++ [BooleanEntry(keyFirstHarvest, firstHarvest), IntegerEntry(keyFirstHarvestHeight, (startHeight + (firstHarvestEndPeriod * periodLength)))]) | |
355 | 345 | else baseEntry | |
356 | 346 | } | |
357 | 347 | } | |
358 | 348 | ||
359 | 349 | ||
360 | 350 | ||
361 | 351 | @Callable(i) | |
362 | 352 | func keepLimitForFirstHarvest (shareLimit) = if (!(isActive)) | |
363 | 353 | then throw("DApp is inactive at this moment") | |
364 | 354 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
365 | 355 | then throw("Only admin can call this function") | |
366 | 356 | else [IntegerEntry(kShareLimit, shareLimit)] | |
367 | 357 | ||
368 | 358 | ||
369 | 359 | ||
370 | 360 | @Callable(i) | |
371 | 361 | func replenishWithTwoTokens (slippageTolerance) = { | |
372 | 362 | let pmtAssetIdA = i.payments[0].assetId | |
373 | 363 | let pmtAssetIdB = i.payments[1].assetId | |
374 | 364 | let pmtAmountA = i.payments[0].amount | |
375 | 365 | let pmtAmountB = i.payments[1].amount | |
376 | - | let $ | |
377 | - | let pmtStrAssetIdA = $ | |
378 | - | let pmtAssetNameA = $ | |
379 | - | let pmtDecimalsA = $ | |
380 | - | let $ | |
381 | - | let pmtStrAssetIdB = $ | |
382 | - | let pmtAssetNameB = $ | |
383 | - | let pmtDecimalsB = $ | |
366 | + | let $t01316713244 = getAssetInfo(pmtAssetIdA) | |
367 | + | let pmtStrAssetIdA = $t01316713244._1 | |
368 | + | let pmtAssetNameA = $t01316713244._2 | |
369 | + | let pmtDecimalsA = $t01316713244._3 | |
370 | + | let $t01324913326 = getAssetInfo(pmtAssetIdB) | |
371 | + | let pmtStrAssetIdB = $t01324913326._1 | |
372 | + | let pmtAssetNameB = $t01324913326._2 | |
373 | + | let pmtDecimalsB = $t01324913326._3 | |
384 | 374 | if (if ((balanceA == 0)) | |
385 | 375 | then (balanceB == 0) | |
386 | 376 | else false) | |
387 | 377 | then { | |
388 | 378 | let tokenRatio = fraction(fraction(assetInitA, scaleValue8, pmtAmountA), scaleValue3, fraction(assetInitB, scaleValue8, pmtAmountB)) | |
389 | 379 | if ((pmtAssetIdA == pmtAssetIdB)) | |
390 | 380 | then throw("Assets must be different") | |
391 | 381 | else { | |
392 | 382 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
393 | 383 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, DOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, DOWN), pow(10, 0, shareDecimals, 0, 0, DOWN)) | |
394 | 384 | if (!(isActive)) | |
395 | 385 | then throw("DApp is inactive at this moment") | |
396 | 386 | else if (if ((0 > slippageTolerance)) | |
397 | 387 | then true | |
398 | 388 | else (slippageTolerance > slippageToleranceDelimiter)) | |
399 | 389 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
400 | 390 | else if ((size(i.payments) != 2)) | |
401 | 391 | then throw("Two attached assets expected") | |
402 | 392 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
403 | 393 | then true | |
404 | 394 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
405 | 395 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
406 | 396 | else if (if ((pmtAssetIdA != assetIdA)) | |
407 | 397 | then true | |
408 | 398 | else (pmtAssetIdB != assetIdB)) | |
409 | 399 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
410 | 400 | else if ((shareInitialSupply == 0)) | |
411 | 401 | then throw("Too small amount to replenish") | |
412 | 402 | else if (!(hasEnoughBalance)) | |
413 | 403 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
414 | 404 | else { | |
415 | 405 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
416 | 406 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
417 | 407 | else 0 | |
418 | 408 | if ((stake1 == stake1)) | |
419 | 409 | then { | |
420 | 410 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
421 | 411 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
422 | 412 | else 0 | |
423 | 413 | if ((stake2 == stake2)) | |
424 | 414 | then [Reissue(shareAssetId, shareInitialSupply, true), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareAssetId)] | |
425 | 415 | else throw("Strict value is not equal to itself.") | |
426 | 416 | } | |
427 | 417 | else throw("Strict value is not equal to itself.") | |
428 | 418 | } | |
429 | 419 | } | |
430 | 420 | } | |
431 | 421 | else { | |
432 | 422 | let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB)) | |
433 | 423 | let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA) | |
434 | 424 | let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB) | |
435 | 425 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
436 | 426 | if (!(isActive)) | |
437 | 427 | then throw("DApp is inactive at this moment") | |
438 | 428 | else if (if ((0 > slippageTolerance)) | |
439 | 429 | then true | |
440 | 430 | else (slippageTolerance > slippageToleranceDelimiter)) | |
441 | 431 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
442 | 432 | else if ((size(i.payments) != 2)) | |
443 | 433 | then throw("Two attached assets expected") | |
444 | 434 | else if (if ((pmtAssetIdA != assetIdA)) | |
445 | 435 | then true | |
446 | 436 | else (pmtAssetIdB != assetIdB)) | |
447 | 437 | then throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
448 | 438 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
449 | 439 | then true | |
450 | 440 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
451 | 441 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
452 | 442 | else if ((shareTokenToPayAmount == 0)) | |
453 | 443 | then throw("Too small amount to replenish") | |
454 | 444 | else if (!(hasEnoughBalance)) | |
455 | 445 | then ([ScriptTransfer(i.caller, pmtAmountA, pmtAssetIdA), ScriptTransfer(i.caller, pmtAmountB, pmtAssetIdB)] ++ suspendSuspicious()) | |
456 | 446 | else { | |
457 | 447 | let stake1 = if (containsElement(stakingAssets, pmtStrAssetIdA)) | |
458 | 448 | then invoke(this, "stakeUnstake", [true, pmtAmountA, pmtStrAssetIdA], nil) | |
459 | 449 | else 0 | |
460 | 450 | if ((stake1 == stake1)) | |
461 | 451 | then { | |
462 | 452 | let stake2 = if (containsElement(stakingAssets, pmtStrAssetIdB)) | |
463 | 453 | then invoke(this, "stakeUnstake", [true, pmtAmountB, pmtStrAssetIdB], nil) | |
464 | 454 | else 0 | |
465 | 455 | if ((stake2 == stake2)) | |
466 | 456 | then [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)] | |
467 | 457 | else throw("Strict value is not equal to itself.") | |
468 | 458 | } | |
469 | 459 | else throw("Strict value is not equal to itself.") | |
470 | 460 | } | |
471 | 461 | } | |
472 | 462 | } | |
473 | 463 | ||
474 | 464 | ||
475 | 465 | ||
476 | 466 | @Callable(i) | |
477 | 467 | func withdraw () = { | |
478 | - | let $ | |
479 | - | let pmtAmount = $ | |
480 | - | let pmtAssetId = $ | |
468 | + | let $t01849518570 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
469 | + | let pmtAmount = $t01849518570._1 | |
470 | + | let pmtAssetId = $t01849518570._2 | |
481 | 471 | let amountToPayA = fraction(pmtAmount, balanceA, shareAssetSupply) | |
482 | 472 | let amountToPayB = fraction(pmtAmount, balanceB, shareAssetSupply) | |
483 | 473 | if (!(isActive)) | |
484 | 474 | then throw("DApp is inactive at this moment") | |
485 | 475 | else if ((size(i.payments) != 1)) | |
486 | 476 | then throw("One attached payment expected") | |
487 | 477 | else if ((pmtAssetId != shareAssetId)) | |
488 | 478 | then throw(("Incorrect asset attached. Expected: " + toBase58String(shareAssetId))) | |
489 | 479 | else if (!(hasEnoughBalance)) | |
490 | 480 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
491 | - | else if (if ((amountToPayA > availableBalanceA)) | |
492 | - | then true | |
493 | - | else (amountToPayB > availableBalanceB)) | |
494 | - | then throwInsufficientAvailableBalances(amountToPayA, amountToPayB) | |
495 | - | else { | |
496 | - | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
497 | - | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
498 | - | else 0 | |
499 | - | if ((stake1 == stake1)) | |
500 | - | then { | |
501 | - | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
502 | - | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
503 | - | else 0 | |
504 | - | if ((stake2 == stake2)) | |
505 | - | then [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
506 | - | else throw("Strict value is not equal to itself.") | |
507 | - | } | |
508 | - | else throw("Strict value is not equal to itself.") | |
509 | - | } | |
481 | + | else { | |
482 | + | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
483 | + | then invoke(this, "stakeUnstake", [false, amountToPayA, strAssetIdA], nil) | |
484 | + | else 0 | |
485 | + | if ((stake1 == stake1)) | |
486 | + | then { | |
487 | + | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
488 | + | then invoke(this, "stakeUnstake", [false, amountToPayB, strAssetIdB], nil) | |
489 | + | else 0 | |
490 | + | if ((stake2 == stake2)) | |
491 | + | then [IntegerEntry(keyBalanceA, (balanceA - amountToPayA)), IntegerEntry(keyBalanceB, (balanceB - amountToPayB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply - pmtAmount)), Burn(shareAssetId, pmtAmount), ScriptTransfer(i.caller, amountToPayA, assetIdA), ScriptTransfer(i.caller, amountToPayB, assetIdB)] | |
492 | + | else throw("Strict value is not equal to itself.") | |
493 | + | } | |
494 | + | else throw("Strict value is not equal to itself.") | |
495 | + | } | |
510 | 496 | } | |
511 | 497 | ||
512 | 498 | ||
513 | 499 | ||
514 | 500 | @Callable(i) | |
515 | 501 | func exchange (minAmountToReceive) = { | |
516 | - | let $ | |
517 | - | let pmtAmount = $ | |
518 | - | let pmtAssetId = $ | |
502 | + | let $t01992820003 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
503 | + | let pmtAmount = $t01992820003._1 | |
504 | + | let pmtAssetId = $t01992820003._2 | |
519 | 505 | func calculateFees (tokenFrom,tokenTo) = { | |
520 | 506 | let amountWithoutFee = fraction(tokenTo, pmtAmount, (pmtAmount + tokenFrom)) | |
521 | 507 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
522 | 508 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
523 | 509 | if ((minAmountToReceive > amountWithFee)) | |
524 | 510 | then throw(((("Calculated amount to receive " + toString(amountWithFee)) + " is less than specified minimum ") + toString(minAmountToReceive))) | |
525 | 511 | else $Tuple3(amountWithoutFee, amountWithFee, governanceReward) | |
526 | 512 | } | |
527 | 513 | ||
528 | 514 | if (!(isActive)) | |
529 | 515 | then throw("DApp is inactive at this moment") | |
530 | 516 | else if (if ((balanceA == 0)) | |
531 | 517 | then true | |
532 | 518 | else (balanceB == 0)) | |
533 | 519 | then throw("Can't exchange with zero balance") | |
534 | 520 | else if ((0 >= minAmountToReceive)) | |
535 | 521 | then throw(("Minimal amount to receive must be positive. Actual: " + toString(minAmountToReceive))) | |
536 | 522 | else if ((size(i.payments) != 1)) | |
537 | 523 | then throw("One attached payment expected") | |
538 | 524 | else if (!(hasEnoughBalance)) | |
539 | 525 | then ([ScriptTransfer(i.caller, pmtAmount, pmtAssetId)] ++ suspendSuspicious()) | |
540 | 526 | else if ((pmtAssetId == assetIdA)) | |
541 | 527 | then { | |
542 | 528 | let assetIdSend = assetIdB | |
543 | - | let $ | |
544 | - | let amountWithoutFee = $ | |
545 | - | let amountWithFee = $ | |
546 | - | let governanceReward = $ | |
529 | + | let $t02127721368 = calculateFees(balanceA, balanceB) | |
530 | + | let amountWithoutFee = $t02127721368._1 | |
531 | + | let amountWithFee = $t02127721368._2 | |
532 | + | let governanceReward = $t02127721368._3 | |
547 | 533 | let newBalanceA = (balanceA + pmtAmount) | |
548 | 534 | let newBalanceB = ((balanceB - amountWithFee) - governanceReward) | |
549 | 535 | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
550 | 536 | then invoke(this, "stakeUnstake", [true, pmtAmount, strAssetIdA], nil) | |
551 | 537 | else 0 | |
552 | 538 | if ((stake1 == stake1)) | |
553 | 539 | then { | |
554 | 540 | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
555 | 541 | then invoke(this, "stakeUnstake", [false, (amountWithFee + governanceReward), strAssetIdB], nil) | |
556 | 542 | else 0 | |
557 | 543 | if ((stake2 == stake2)) | |
558 | 544 | then [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
559 | 545 | else throw("Strict value is not equal to itself.") | |
560 | 546 | } | |
561 | 547 | else throw("Strict value is not equal to itself.") | |
562 | 548 | } | |
563 | 549 | else if ((pmtAssetId == assetIdB)) | |
564 | 550 | then { | |
565 | 551 | let assetIdSend = assetIdA | |
566 | - | let $ | |
567 | - | let amountWithoutFee = $ | |
568 | - | let amountWithFee = $ | |
569 | - | let governanceReward = $ | |
552 | + | let $t02232322414 = calculateFees(balanceB, balanceA) | |
553 | + | let amountWithoutFee = $t02232322414._1 | |
554 | + | let amountWithFee = $t02232322414._2 | |
555 | + | let governanceReward = $t02232322414._3 | |
570 | 556 | let newBalanceA = ((balanceA - amountWithFee) - governanceReward) | |
571 | 557 | let newBalanceB = (balanceB + pmtAmount) | |
572 | - | if ( | |
573 | - | then | |
574 | - | else | |
575 | - | | |
576 | - | | |
577 | - | let | |
578 | - | then invoke(this, "stakeUnstake", [ | |
558 | + | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
559 | + | then invoke(this, "stakeUnstake", [false, (amountWithFee + governanceReward), strAssetIdA], nil) | |
560 | + | else 0 | |
561 | + | if ((stake1 == stake1)) | |
562 | + | then { | |
563 | + | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
564 | + | then invoke(this, "stakeUnstake", [true, pmtAmount, strAssetIdB], nil) | |
579 | 565 | else 0 | |
580 | - | if ((stake1 == stake1)) | |
581 | - | then { | |
582 | - | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
583 | - | then invoke(this, "stakeUnstake", [true, pmtAmount, strAssetIdB], nil) | |
584 | - | else 0 | |
585 | - | if ((stake2 == stake2)) | |
586 | - | then [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
587 | - | else throw("Strict value is not equal to itself.") | |
588 | - | } | |
566 | + | if ((stake2 == stake2)) | |
567 | + | then [IntegerEntry(keyBalanceA, newBalanceA), IntegerEntry(keyBalanceB, newBalanceB), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(walletAddress, governanceReward, assetIdSend)] | |
589 | 568 | else throw("Strict value is not equal to itself.") | |
590 | 569 | } | |
570 | + | else throw("Strict value is not equal to itself.") | |
591 | 571 | } | |
592 | 572 | else throw(((("Incorrect asset attached. Expected: " + strAssetIdA) + " or ") + strAssetIdB)) | |
593 | 573 | } | |
594 | 574 | ||
595 | 575 | ||
596 | 576 | ||
597 | 577 | @Callable(i) | |
598 | 578 | func shutdown () = if (!(isActive)) | |
599 | 579 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
600 | 580 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
601 | 581 | then throw("Only admin can call this function") | |
602 | 582 | else suspend("Paused by admin") | |
603 | 583 | ||
604 | 584 | ||
605 | 585 | ||
606 | 586 | @Callable(i) | |
607 | 587 | func activate () = if (isActive) | |
608 | 588 | then throw("DApp is already active") | |
609 | 589 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
610 | 590 | then throw("Only admin can call this function") | |
611 | 591 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
612 | 592 | ||
613 | 593 | ||
614 | 594 | ||
615 | 595 | @Callable(i) | |
616 | 596 | func takeIntoAccountExtraFunds (amountLeave) = { | |
617 | 597 | let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA) | |
618 | 598 | let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB) | |
619 | 599 | let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == unit)) | |
620 | 600 | then amountLeave | |
621 | 601 | else 0)) | |
622 | 602 | let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == unit)) | |
623 | 603 | then amountLeave | |
624 | 604 | else 0)) | |
625 | 605 | if (!(isActive)) | |
626 | 606 | then throw("DApp is inactive at this moment") | |
627 | 607 | else if ((i.caller != this)) | |
628 | 608 | then throw("Only the DApp itself can call this function") | |
629 | 609 | else if ((0 > amountLeave)) | |
630 | 610 | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave))) | |
631 | 611 | else if (if ((0 > uncountableAmountEnrollAssetA)) | |
632 | 612 | then true | |
633 | 613 | else (0 > uncountableAmountEnrollAssetB)) | |
634 | 614 | then suspend("Enroll amount negative") | |
635 | 615 | else if (if ((0 > amountEnrollA)) | |
636 | 616 | then true | |
637 | 617 | else (0 > amountEnrollB)) | |
638 | 618 | then throw("Too large amountLeave") | |
639 | 619 | else { | |
640 | 620 | let stake1 = if (if (containsElement(stakingAssets, strAssetIdA)) | |
641 | 621 | then (amountEnrollA > 0) | |
642 | 622 | else false) | |
643 | 623 | then invoke(this, "stakeUnstake", [true, amountEnrollA, strAssetIdA], nil) | |
644 | 624 | else 0 | |
645 | 625 | if ((stake1 == stake1)) | |
646 | 626 | then { | |
647 | 627 | let stake2 = if (if (containsElement(stakingAssets, strAssetIdB)) | |
648 | 628 | then (amountEnrollB > 0) | |
649 | 629 | else false) | |
650 | 630 | then invoke(this, "stakeUnstake", [true, amountEnrollB, strAssetIdB], nil) | |
651 | 631 | else 0 | |
652 | 632 | if ((stake2 == stake2)) | |
653 | 633 | then [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB)), IntegerEntry(("last_income_" + strAssetIdA), amountEnrollA), IntegerEntry(("last_income_" + strAssetIdB), amountEnrollB)] | |
654 | 634 | else throw("Strict value is not equal to itself.") | |
655 | 635 | } | |
656 | 636 | else throw("Strict value is not equal to itself.") | |
657 | 637 | } | |
658 | 638 | } | |
659 | 639 | ||
660 | 640 | ||
661 | 641 | ||
662 | 642 | @Callable(i) | |
663 | 643 | func stakeUnstake (stake,amount,assetIdString) = if ((i.caller != this)) | |
664 | 644 | then throw("Only contract itself can invoke this function") | |
665 | 645 | else if ((assetIdString == "WAVES")) | |
666 | 646 | then { | |
667 | 647 | let pool = addressFromStringValue(valueOrErrorMessage(getString(oracle, keyLeasingPool), "No leasing pool in oracle")) | |
668 | 648 | let leasingId = getBinary(this, keyLeasingId) | |
669 | 649 | let leasingAmount = valueOrElse(getInteger(this, keyLeasingAmount), 0) | |
670 | 650 | let newLeaseAmount = if (stake) | |
671 | 651 | then (leasingAmount + amount) | |
672 | 652 | else (leasingAmount - amount) | |
673 | 653 | let newLease = Lease(pool, newLeaseAmount) | |
674 | 654 | let newLeaseId = calculateLeaseId(newLease) | |
675 | 655 | let baseEtry = [newLease, BinaryEntry(keyLeasingId, newLeaseId), IntegerEntry(keyLeasingAmount, newLeaseAmount)] | |
676 | 656 | match leasingId { | |
677 | 657 | case lId: ByteVector => | |
678 | 658 | ([LeaseCancel(lId)] ++ baseEtry) | |
679 | 659 | case _ => | |
680 | 660 | baseEtry | |
681 | 661 | } | |
682 | 662 | } | |
683 | 663 | else { | |
684 | - | let $ | |
685 | - | let call = $ | |
686 | - | let addr = $ | |
687 | - | let params = $ | |
688 | - | let payments = $ | |
664 | + | let $t02665226755 = calcStakingParams(stake, amount, fromBase58String(assetIdString)) | |
665 | + | let call = $t02665226755._1 | |
666 | + | let addr = $t02665226755._2 | |
667 | + | let params = $t02665226755._3 | |
668 | + | let payments = $t02665226755._4 | |
689 | 669 | let inv = invoke(addr, call, params, payments) | |
690 | 670 | if ((inv == inv)) | |
691 | 671 | then nil | |
692 | 672 | else throw("Strict value is not equal to itself.") | |
693 | 673 | } | |
694 | 674 | ||
695 | 675 | ||
696 | 676 | ||
697 | 677 | @Callable(i) | |
698 | 678 | func stakeAll () = if (!(isActive)) | |
699 | 679 | then throw("DApp is inactive at this moment") | |
700 | 680 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
701 | 681 | then throw("Only admin can call this function") | |
702 | 682 | else { | |
703 | 683 | let stake1 = if (containsElement(stakingAssets, strAssetIdA)) | |
704 | 684 | then { | |
705 | 685 | let amountA = (balanceA - stakedAmountA) | |
706 | 686 | if ((amountA > 0)) | |
707 | 687 | then invoke(this, "stakeUnstake", [true, amountA, strAssetIdA], nil) | |
708 | 688 | else 0 | |
709 | 689 | } | |
710 | 690 | else 0 | |
711 | 691 | if ((stake1 == stake1)) | |
712 | 692 | then { | |
713 | 693 | let stake2 = if (containsElement(stakingAssets, strAssetIdB)) | |
714 | 694 | then { | |
715 | 695 | let amountB = (balanceB - stakedAmountB) | |
716 | 696 | if ((amountB > 0)) | |
717 | 697 | then invoke(this, "stakeUnstake", [true, amountB, strAssetIdB], nil) | |
718 | 698 | else 0 | |
719 | 699 | } | |
720 | 700 | else 0 | |
721 | 701 | if ((stake2 == stake2)) | |
722 | 702 | then nil | |
723 | 703 | else throw("Strict value is not equal to itself.") | |
724 | 704 | } | |
725 | 705 | else throw("Strict value is not equal to itself.") | |
726 | 706 | } | |
727 | 707 | ||
728 | 708 | ||
729 | 709 | @Verifier(tx) | |
730 | 710 | func verify () = { | |
731 | 711 | let multiSignedByAdmins = { | |
732 | 712 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
733 | 713 | then 1 | |
734 | 714 | else 0 | |
735 | 715 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
736 | 716 | then 1 | |
737 | 717 | else 0 | |
738 | 718 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
739 | 719 | then 1 | |
740 | 720 | else 0 | |
741 | 721 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
742 | 722 | } | |
743 | 723 | match tx { | |
744 | 724 | case inv: InvokeScriptTransaction => | |
745 | 725 | let callTakeIntoAccount = if ((inv.dApp == this)) | |
746 | 726 | then (inv.function == "takeIntoAccountExtraFunds") | |
747 | 727 | else false | |
748 | 728 | let exchangeToWaves = if (if (if ((inv.dApp == USDNToWavesExchanger)) | |
749 | 729 | then (inv.function == "exchange") | |
750 | 730 | else false) | |
751 | 731 | then (assetIdA == USDN) | |
752 | 732 | else false) | |
753 | 733 | then true | |
754 | 734 | else if (if ((assetIdB == USDN)) | |
755 | 735 | then (size(inv.payments) == 1) | |
756 | 736 | else false) | |
757 | 737 | then (inv.payments[0].assetId == USDN) | |
758 | 738 | else false | |
759 | 739 | let exchangeToNSBTs = if (if (if ((inv.dApp == USDNToNSBTExchanger)) | |
760 | 740 | then (inv.function == "exchange") | |
761 | 741 | else false) | |
762 | 742 | then (assetIdA == NSBT) | |
763 | 743 | else false) | |
764 | 744 | then true | |
765 | 745 | else if (if ((assetIdB == NSBT)) | |
766 | 746 | then (size(inv.payments) == 1) | |
767 | 747 | else false) | |
768 | 748 | then (inv.payments[0].assetId == USDN) | |
769 | 749 | else false | |
770 | 750 | let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
771 | 751 | then true | |
772 | 752 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2)) | |
773 | 753 | then true | |
774 | 754 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3)) | |
775 | 755 | then true | |
776 | 756 | else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking) | |
777 | 757 | if (if (if (if (callTakeIntoAccount) | |
778 | 758 | then true | |
779 | 759 | else exchangeToWaves) | |
780 | 760 | then true | |
781 | 761 | else exchangeToNSBTs) | |
782 | 762 | then signedByAdmin | |
783 | 763 | else false) | |
784 | 764 | then true | |
785 | 765 | else multiSignedByAdmins | |
786 | 766 | case _ => | |
787 | 767 | multiSignedByAdmins | |
788 | 768 | } | |
789 | 769 | } | |
790 | 770 |
github/deemru/w8io/026f985 112.90 ms ◑