tx · BNtv4PQa8EXSrzAnfNNzzXJDLDks5AM4xixcmKwHwKwe 3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ: -0.01400000 Waves 2021.03.07 17:21 [1427382] smart account 3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ > SELF 0.00000000 Waves
{ "type": 13, "id": "BNtv4PQa8EXSrzAnfNNzzXJDLDks5AM4xixcmKwHwKwe", "fee": 1400000, "feeAssetId": null, "timestamp": 1615126915730, "version": 1, "sender": "3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ", "senderPublicKey": "71DfVUys2KXcuEivd6kRxABvVQKB5k5c48qobMB1DzKN", "proofs": [ "3mVXMbBENoLVivYqa8sBPwy1CpG758211eq3TYABC4ojMJN5NebTGZCLJerykB2o1r6UL9VjugSDHFLCnFsSSSrm" ], "script": "base64:AAIEAAAAAAAAABoIAhIAEgMKAQESBAoCAQESBAoCAQESAwoBAQAAAEoAAAAAB3ZlcnNpb24CAAAABTIuMC4wAAAAAAprZXlWZXJzaW9uAgAAAAd2ZXJzaW9uAAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAALa2V5QXNzZXRJZEECAAAACkFfYXNzZXRfaWQAAAAAC2tleUFzc2V0SWRCAgAAAApCX2Fzc2V0X2lkAAAAAAtrZXlCYWxhbmNlQQIAAAAPQV9hc3NldF9iYWxhbmNlAAAAAAtrZXlCYWxhbmNlQgIAAAAPQl9hc3NldF9iYWxhbmNlAAAAAA9rZXlTaGFyZUFzc2V0SWQCAAAADnNoYXJlX2Fzc2V0X2lkAAAAABNrZXlTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAAF2tleUNvbW1pc3Npb25Hb3Zlcm5hb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AABQAAAB11bmNvdW50YWJsZUFtb3VudEVucm9sbEFzc2V0QgkBAAAAB3N1c3BlbmQAAAABAgAAABZFbnJvbGwgYW1vdW50IG5lZ2F0aXZlAwMJAABmAAAAAgAAAAAAAAAAAAUAAAANYW1vdW50RW5yb2xsQQYJAABmAAAAAgAAAAAAAAAAAAUAAAANYW1vdW50RW5yb2xsQgkAAAIAAAABAgAAABVUb28gbGFyZ2UgYW1vdW50TGVhdmUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAC2tleUJhbGFuY2VBCQAAZAAAAAIFAAAACGJhbGFuY2VBBQAAAA1hbW91bnRFbnJvbGxBCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAtrZXlCYWxhbmNlQgkAAGQAAAACBQAAAAhiYWxhbmNlQgUAAAANYW1vdW50RW5yb2xsQgUAAAADbmlsAAAAAAYAAV4=", "chainId": 84, "height": 1427382, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8y9JJ95njDLc2aTHC9yCRvSWVVY6tgM9DsckQxJsp3RB Next: AdtBnkNhURz1y9Pg77ehS6YwMaipYwox23doVrPoX9eR Diff:
Old | New | Differences | |
---|---|---|---|
357 | 357 | let $t04229442369 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
358 | 358 | let pmtAmount = $t04229442369._1 | |
359 | 359 | let pmtAssetId = $t04229442369._2 | |
360 | - | let pmtMinThreshold = 5000000 | |
361 | - | let thresholdValueForMinTolerance = 50000000 | |
362 | - | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
363 | - | then 100000 | |
364 | - | else 1 | |
365 | - | let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000)) | |
366 | - | let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000)) | |
367 | - | let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
368 | - | let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000)) | |
369 | - | if (!(isActive)) | |
370 | - | then throwIsInactive() | |
371 | - | else if ((pmtMinThreshold > pmtAmount)) | |
372 | - | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
373 | - | else if ((size(i.payments) != 1)) | |
374 | - | then throw("One attached payment expected") | |
375 | - | else if (!(hasEnoughBalance)) | |
376 | - | then suspendSuspicious() | |
377 | - | else if ((pmtAssetId == assetIdA)) | |
378 | - | then { | |
379 | - | let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay) | |
380 | - | let amountVirtualReplenishTokenB = virtualSwapTokenGet | |
381 | - | let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay) | |
382 | - | let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet) | |
383 | - | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
384 | - | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
385 | - | if (if ((invariantEstimatedRatio >= slippageValueMinForSwap)) | |
386 | - | then ((invariantNew - invariant) >= 0) | |
387 | - | else false) | |
360 | + | if (true) | |
361 | + | then throw(toString(value(value(assetInfo(USDN)).minSponsoredFee))) | |
362 | + | else { | |
363 | + | let pmtMinThreshold = 5000000 | |
364 | + | let thresholdValueForMinTolerance = 50000000 | |
365 | + | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
366 | + | then 100000 | |
367 | + | else 1 | |
368 | + | let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000)) | |
369 | + | let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000)) | |
370 | + | let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
371 | + | let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000)) | |
372 | + | if (!(isActive)) | |
373 | + | then throwIsInactive() | |
374 | + | else if ((pmtMinThreshold > pmtAmount)) | |
375 | + | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
376 | + | else if ((size(i.payments) != 1)) | |
377 | + | then throw("One attached payment expected") | |
378 | + | else if (!(hasEnoughBalance)) | |
379 | + | then suspendSuspicious() | |
380 | + | else if ((pmtAssetId == assetIdA)) | |
388 | 381 | then { | |
389 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
390 | - | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
391 | - | then true | |
392 | - | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
393 | - | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
394 | - | else { | |
395 | - | let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000)) | |
396 | - | let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA) | |
397 | - | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
398 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
399 | - | let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
400 | - | let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB) | |
401 | - | let newAmountTokenA = (balanceA + pmtAmount) | |
402 | - | let newAmountTokenB = balanceB | |
403 | - | let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount)) | |
404 | - | let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount)) | |
405 | - | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
406 | - | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
382 | + | let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay) | |
383 | + | let amountVirtualReplenishTokenB = virtualSwapTokenGet | |
384 | + | let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay) | |
385 | + | let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet) | |
386 | + | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
387 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
388 | + | if (if ((invariantEstimatedRatio >= slippageValueMinForSwap)) | |
389 | + | then ((invariantNew - invariant) >= 0) | |
390 | + | else false) | |
391 | + | then { | |
392 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
393 | + | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
407 | 394 | then true | |
408 | - | else (dAppThresholdAmount > newAmountTokenB)) | |
409 | - | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
410 | - | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)] | |
395 | + | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
396 | + | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
397 | + | else { | |
398 | + | let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000)) | |
399 | + | let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA) | |
400 | + | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
401 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
402 | + | let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
403 | + | let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB) | |
404 | + | let newAmountTokenA = (balanceA + pmtAmount) | |
405 | + | let newAmountTokenB = balanceB | |
406 | + | let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount)) | |
407 | + | let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount)) | |
408 | + | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
409 | + | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
410 | + | then true | |
411 | + | else (dAppThresholdAmount > newAmountTokenB)) | |
412 | + | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
413 | + | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)] | |
414 | + | } | |
411 | 415 | } | |
416 | + | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
412 | 417 | } | |
413 | - | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
414 | - | } | |
415 | - | else if ((pmtAssetId == assetIdB)) | |
416 | - | then { | |
417 | - | let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay) | |
418 | - | let amountVirtualReplenishTokenA = virtualSwapTokenGet | |
419 | - | let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet) | |
420 | - | let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay) | |
421 | - | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
422 | - | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
423 | - | if (if ((invariantEstimatedRatio > slippageValueMinForSwap)) | |
424 | - | then ((invariantNew - invariant) >= 0) | |
425 | - | else false) | |
418 | + | else if ((pmtAssetId == assetIdB)) | |
426 | 419 | then { | |
427 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
428 | - | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
429 | - | then true | |
430 | - | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
431 | - | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
432 | - | else { | |
433 | - | let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA) | |
434 | - | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
435 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
436 | - | let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount)) | |
437 | - | let newAmountTokenA = balanceA | |
438 | - | let newAmountTokenB = (balanceB + pmtAmount) | |
439 | - | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
440 | - | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
420 | + | let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay) | |
421 | + | let amountVirtualReplenishTokenA = virtualSwapTokenGet | |
422 | + | let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet) | |
423 | + | let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay) | |
424 | + | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
425 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
426 | + | if (if ((invariantEstimatedRatio > slippageValueMinForSwap)) | |
427 | + | then ((invariantNew - invariant) >= 0) | |
428 | + | else false) | |
429 | + | then { | |
430 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
431 | + | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
441 | 432 | then true | |
442 | - | else (dAppThresholdAmount > newAmountTokenB)) | |
443 | - | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
444 | - | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)] | |
433 | + | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
434 | + | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
435 | + | else { | |
436 | + | let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA) | |
437 | + | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
438 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
439 | + | let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount)) | |
440 | + | let newAmountTokenA = balanceA | |
441 | + | let newAmountTokenB = (balanceB + pmtAmount) | |
442 | + | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
443 | + | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
444 | + | then true | |
445 | + | else (dAppThresholdAmount > newAmountTokenB)) | |
446 | + | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
447 | + | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)] | |
448 | + | } | |
445 | 449 | } | |
450 | + | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
446 | 451 | } | |
447 | - | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
448 | - | } | |
449 | - | else throwAssets() | |
452 | + | else throwAssets() | |
453 | + | } | |
450 | 454 | } | |
451 | 455 | ||
452 | 456 | ||
453 | 457 | ||
454 | 458 | @Callable(i) | |
455 | 459 | func exchange (estimatedAmountToReceive,minAmountToReceive) = { | |
456 | - | let $ | |
457 | - | let pmtAmount = $ | |
458 | - | let pmtAssetId = $ | |
460 | + | let $t05001550090 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
461 | + | let pmtAmount = $t05001550090._1 | |
462 | + | let pmtAssetId = $t05001550090._2 | |
459 | 463 | if (!(isActive)) | |
460 | 464 | then throwIsInactive() | |
461 | 465 | else if ((0 >= estimatedAmountToReceive)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let version = "2.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 keyShareAssetId = "share_asset_id" | |
19 | 19 | ||
20 | 20 | let keyShareAssetSupply = "share_asset_supply" | |
21 | 21 | ||
22 | 22 | let keyCommission = "commission" | |
23 | 23 | ||
24 | 24 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
25 | 25 | ||
26 | 26 | let keyCommissionGovernance = "commission_governance" | |
27 | 27 | ||
28 | 28 | let keyInvariant = "invariant" | |
29 | 29 | ||
30 | 30 | let keyCause = "shutdown_cause" | |
31 | 31 | ||
32 | 32 | let adminPubKey1 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4' | |
33 | 33 | ||
34 | 34 | let adminPubKey2 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4' | |
35 | 35 | ||
36 | 36 | let adminPubKey3 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4' | |
37 | 37 | ||
38 | 38 | let adminPubKeyStartStop = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4' | |
39 | 39 | ||
40 | 40 | let adminPubKeyStaking = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4' | |
41 | 41 | ||
42 | 42 | let governanceAddress = Address(base58'3MqhxbxHEMtp2Rwy1gUb6cPSJHQepdap1Yp') | |
43 | 43 | ||
44 | 44 | let stakingAddress = Address(base58'3MqhxbxHEMtp2Rwy1gUb6cPSJHQepdap1Yp') | |
45 | 45 | ||
46 | 46 | let USDN = base58'3FUNGbzfNsQ1AZfvumCUqARXvpjjLQrvCzorYuDryQAq' | |
47 | 47 | ||
48 | 48 | let stakingFeeInUSDN = (9 * value(value(assetInfo(USDN)).minSponsoredFee)) | |
49 | 49 | ||
50 | 50 | let isActive = getBooleanValue(this, keyActive) | |
51 | 51 | ||
52 | 52 | let strAssetIdA = getStringValue(this, keyAssetIdA) | |
53 | 53 | ||
54 | 54 | let strAssetIdB = getStringValue(this, keyAssetIdB) | |
55 | 55 | ||
56 | 56 | let assetIdA = if ((strAssetIdA == "WAVES")) | |
57 | 57 | then unit | |
58 | 58 | else fromBase58String(strAssetIdA) | |
59 | 59 | ||
60 | 60 | let assetIdB = if ((strAssetIdB == "WAVES")) | |
61 | 61 | then unit | |
62 | 62 | else fromBase58String(strAssetIdB) | |
63 | 63 | ||
64 | 64 | let assetNameA = match assetIdA { | |
65 | 65 | case id: ByteVector => | |
66 | 66 | value(assetInfo(id)).name | |
67 | 67 | case waves: Unit => | |
68 | 68 | "WAVES" | |
69 | 69 | case _ => | |
70 | 70 | throw("Match error") | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | let assetNameB = match assetIdB { | |
74 | 74 | case id: ByteVector => | |
75 | 75 | value(assetInfo(id)).name | |
76 | 76 | case waves: Unit => | |
77 | 77 | "WAVES" | |
78 | 78 | case _ => | |
79 | 79 | throw("Match error") | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | let balanceA = getIntegerValue(this, keyBalanceA) | |
83 | 83 | ||
84 | 84 | let balanceB = getIntegerValue(this, keyBalanceB) | |
85 | 85 | ||
86 | 86 | let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId)) | |
87 | 87 | ||
88 | 88 | let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply) | |
89 | 89 | ||
90 | 90 | let invariant = getIntegerValue(this, keyInvariant) | |
91 | 91 | ||
92 | 92 | let commission = 500 | |
93 | 93 | ||
94 | 94 | let commissionGovernance = 200 | |
95 | 95 | ||
96 | 96 | let commissionScaleDelimiter = 1000000 | |
97 | 97 | ||
98 | 98 | let scaleValue3 = 1000 | |
99 | 99 | ||
100 | 100 | let scaleValue8 = 100000000 | |
101 | 101 | ||
102 | 102 | let scaleValue12 = 1000000000000 | |
103 | 103 | ||
104 | 104 | let slippageToleranceDelimiter = 1000 | |
105 | 105 | ||
106 | 106 | let scaleValue8Digits = 8 | |
107 | 107 | ||
108 | 108 | let scaleValue12Digits = 12 | |
109 | 109 | ||
110 | 110 | let dAppThreshold = 50 | |
111 | 111 | ||
112 | 112 | let dAppThresholdDelimiter = 100 | |
113 | 113 | ||
114 | 114 | let ratioThresholdMax = 100000000 | |
115 | 115 | ||
116 | 116 | let ratioThresholdMin = 99999000 | |
117 | 117 | ||
118 | 118 | let alpha = 50 | |
119 | 119 | ||
120 | 120 | let alphaDigits = 2 | |
121 | 121 | ||
122 | 122 | let beta = 46000000 | |
123 | 123 | ||
124 | 124 | let betaDigits = 8 | |
125 | 125 | ||
126 | 126 | func accountBalance (assetId) = match assetId { | |
127 | 127 | case id: ByteVector => | |
128 | 128 | assetBalance(this, id) | |
129 | 129 | case waves: Unit => | |
130 | 130 | wavesBalance(this).available | |
131 | 131 | case _ => | |
132 | 132 | throw("Match error") | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | let stakedAmountUSDN = match getInteger(stakingAddress, ((("rpd_balance_" + toBase58String(USDN)) + "_") + toString(this))) { | |
137 | 137 | case staked: Int => | |
138 | 138 | staked | |
139 | 139 | case nothing: Unit => | |
140 | 140 | 0 | |
141 | 141 | case _ => | |
142 | 142 | throw("Match error") | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | let availableBalanceA = (balanceA - (if ((assetIdA == USDN)) | |
146 | 146 | then stakedAmountUSDN | |
147 | 147 | else 0)) | |
148 | 148 | ||
149 | 149 | let availableBalanceB = (balanceB - (if ((assetIdB == USDN)) | |
150 | 150 | then stakedAmountUSDN | |
151 | 151 | else 0)) | |
152 | 152 | ||
153 | 153 | let accountBalanceWithStakedA = (accountBalance(assetIdA) + (if ((assetIdA == USDN)) | |
154 | 154 | then stakedAmountUSDN | |
155 | 155 | else 0)) | |
156 | 156 | ||
157 | 157 | let accountBalanceWithStakedB = (accountBalance(assetIdB) + (if ((assetIdB == USDN)) | |
158 | 158 | then stakedAmountUSDN | |
159 | 159 | else 0)) | |
160 | 160 | ||
161 | 161 | let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA)) | |
162 | 162 | then (accountBalanceWithStakedB >= balanceB) | |
163 | 163 | else false | |
164 | 164 | ||
165 | 165 | func skewness (x,y) = (((fraction(scaleValue12, x, y) + fraction(scaleValue12, y, x)) / 2) / 10000) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func invariantCalc (x,y) = { | |
169 | 169 | let sk = skewness(x, y) | |
170 | 170 | (fraction((x + y), scaleValue8, pow(sk, scaleValue8Digits, alpha, alphaDigits, scaleValue8Digits, UP)) + (2 * fraction(pow(fraction(x, y, scaleValue8), 0, 5, 1, (scaleValue8Digits / 2), DOWN), pow((sk - beta), scaleValue8Digits, alpha, alphaDigits, scaleValue8Digits, DOWN), scaleValue8))) | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func calculateHowManySendTokenA (amountToSendEstimated,minTokenReceiveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = { | |
175 | 175 | let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
176 | 176 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
177 | 177 | let amountToSendStep1 = (amountToSendEstimated - ((1 * deltaBetweenMaxAndMinSendValue) / 5)) | |
178 | 178 | let amountToSendStep2 = (amountToSendEstimated - ((2 * deltaBetweenMaxAndMinSendValue) / 5)) | |
179 | 179 | let amountToSendStep3 = (amountToSendEstimated - ((3 * deltaBetweenMaxAndMinSendValue) / 5)) | |
180 | 180 | let amountToSendStep4 = (amountToSendEstimated - ((4 * deltaBetweenMaxAndMinSendValue) / 5)) | |
181 | 181 | let amountToSendStep5 = (amountToSendEstimated - ((5 * deltaBetweenMaxAndMinSendValue) / 5)) | |
182 | 182 | let y = (amountTokenB + tokenReceiveAmount) | |
183 | 183 | let invariantNew = invariantCalc((amountTokenA - amountToSendEstimated), y) | |
184 | 184 | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
185 | 185 | if ((0 >= (invariantCalc((amountTokenA - amountToSendStep5), y) - invariant))) | |
186 | 186 | then throw("minTokenReceiveAmount too large.err1") | |
187 | 187 | else if (if ((invariantEstimatedRatio > slippageValue)) | |
188 | 188 | then ((invariantNew - invariant) > 0) | |
189 | 189 | else false) | |
190 | 190 | then amountToSendEstimated | |
191 | 191 | else if (((invariantCalc((amountTokenA - amountToSendStep1), y) - invariant) > 0)) | |
192 | 192 | then ((amountToSendStep1 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
193 | 193 | else if (((invariantCalc((amountTokenA - amountToSendStep2), y) - invariant) > 0)) | |
194 | 194 | then ((amountToSendStep2 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
195 | 195 | else if (((invariantCalc((amountTokenA - amountToSendStep3), y) - invariant) > 0)) | |
196 | 196 | then ((amountToSendStep3 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
197 | 197 | else if (((invariantCalc((amountTokenA - amountToSendStep4), y) - invariant) > 0)) | |
198 | 198 | then ((amountToSendStep4 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
199 | 199 | else if (((invariantCalc((amountTokenA - amountToSendStep5), y) - invariant) > 0)) | |
200 | 200 | then ((amountToSendStep5 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
201 | 201 | else throw("something went wrong while working with amountToSendStep. err2") | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func calculateHowManySendTokenB (amountToSendEstimated,minTokenReceiveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = { | |
206 | 206 | let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
207 | 207 | let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount) | |
208 | 208 | let amountToSendStep1 = (amountToSendEstimated - ((1 * deltaBetweenMaxAndMinSendValue) / 5)) | |
209 | 209 | let amountToSendStep2 = (amountToSendEstimated - ((2 * deltaBetweenMaxAndMinSendValue) / 5)) | |
210 | 210 | let amountToSendStep3 = (amountToSendEstimated - ((3 * deltaBetweenMaxAndMinSendValue) / 5)) | |
211 | 211 | let amountToSendStep4 = (amountToSendEstimated - ((4 * deltaBetweenMaxAndMinSendValue) / 5)) | |
212 | 212 | let amountToSendStep5 = (amountToSendEstimated - ((5 * deltaBetweenMaxAndMinSendValue) / 5)) | |
213 | 213 | let x = (amountTokenA + tokenReceiveAmount) | |
214 | 214 | let invariantNew = invariantCalc(x, (amountTokenB - amountToSendEstimated)) | |
215 | 215 | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
216 | 216 | if ((0 >= (invariantCalc(x, (amountTokenB - amountToSendStep5)) - invariant))) | |
217 | 217 | then throw("minTokenReceiveAmount too large.err1") | |
218 | 218 | else if (if ((invariantEstimatedRatio > slippageValue)) | |
219 | 219 | then ((invariantNew - invariant) > 0) | |
220 | 220 | else false) | |
221 | 221 | then amountToSendEstimated | |
222 | 222 | else if (((invariantCalc(x, (amountTokenB - amountToSendStep1)) - invariant) > 0)) | |
223 | 223 | then ((amountToSendStep1 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
224 | 224 | else if (((invariantCalc(x, (amountTokenB - amountToSendStep2)) - invariant) > 0)) | |
225 | 225 | then ((amountToSendStep2 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
226 | 226 | else if (((invariantCalc(x, (amountTokenB - amountToSendStep3)) - invariant) > 0)) | |
227 | 227 | then ((amountToSendStep3 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
228 | 228 | else if (((invariantCalc(x, (amountTokenB - amountToSendStep4)) - invariant) > 0)) | |
229 | 229 | then ((amountToSendStep4 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
230 | 230 | else if (((invariantCalc(x, (amountTokenB - amountToSendStep5)) - invariant) > 0)) | |
231 | 231 | then ((amountToSendStep5 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter) | |
232 | 232 | else throw("something went wrong while working with amountToSendStep. err2") | |
233 | 233 | } | |
234 | 234 | ||
235 | 235 | ||
236 | 236 | func getAssetInfo (assetId) = match assetId { | |
237 | 237 | case id: ByteVector => | |
238 | 238 | let stringId = toBase58String(id) | |
239 | 239 | let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist")) | |
240 | 240 | $Tuple3(stringId, info.name, info.decimals) | |
241 | 241 | case waves: Unit => | |
242 | 242 | $Tuple3("WAVES", "WAVES", 8) | |
243 | 243 | case _ => | |
244 | 244 | throw("Match error") | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func deductStakingFee (amount,assetId) = if ((assetId == USDN)) | |
252 | 252 | then { | |
253 | 253 | let result = (amount - stakingFeeInUSDN) | |
254 | 254 | if ((0 >= result)) | |
255 | 255 | then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakingFeeInUSDN)) + " USD-N")) | |
256 | 256 | else result | |
257 | 257 | } | |
258 | 258 | else amount | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func throwIsActive () = throw("DApp is already active") | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | func throwIsInactive () = throw("DApp is inactive at this moment") | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | func throwOnlyAdmin () = throw("Only admin can call this function") | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB)) | |
271 | 271 | ||
272 | 272 | ||
273 | 273 | func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB)) | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | 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")) | |
277 | 277 | ||
278 | 278 | ||
279 | 279 | 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")) | |
280 | 280 | ||
281 | 281 | ||
282 | 282 | func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB)) | |
283 | 283 | ||
284 | 284 | ||
285 | 285 | @Callable(i) | |
286 | 286 | func init () = { | |
287 | 287 | let $t03744437521 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
288 | 288 | let pmtAmountA = $t03744437521._1 | |
289 | 289 | let pmtAssetIdA = $t03744437521._2 | |
290 | 290 | let $t03752637603 = $Tuple2(i.payments[1].amount, i.payments[1].assetId) | |
291 | 291 | let pmtAmountB = $t03752637603._1 | |
292 | 292 | let pmtAssetIdB = $t03752637603._2 | |
293 | 293 | let $t03760837685 = getAssetInfo(pmtAssetIdA) | |
294 | 294 | let pmtStrAssetIdA = $t03760837685._1 | |
295 | 295 | let pmtAssetNameA = $t03760837685._2 | |
296 | 296 | let pmtDecimalsA = $t03760837685._3 | |
297 | 297 | let $t03769037767 = getAssetInfo(pmtAssetIdB) | |
298 | 298 | let pmtStrAssetIdB = $t03769037767._1 | |
299 | 299 | let pmtAssetNameB = $t03769037767._2 | |
300 | 300 | let pmtDecimalsB = $t03769037767._3 | |
301 | 301 | if (isDefined(getBoolean(this, keyActive))) | |
302 | 302 | then throwIsActive() | |
303 | 303 | else if ((pmtAssetIdA == pmtAssetIdB)) | |
304 | 304 | then throw("Assets must be different") | |
305 | 305 | else { | |
306 | 306 | let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7)) | |
307 | 307 | let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this)) | |
308 | 308 | let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2) | |
309 | 309 | let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN)) | |
310 | 310 | let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true) | |
311 | 311 | let shareIssueId = calculateAssetId(shareIssue) | |
312 | 312 | let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB) | |
313 | 313 | [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyInvariant, invariantCalculated), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)] | |
314 | 314 | } | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | ||
319 | 319 | @Callable(i) | |
320 | 320 | func replenishWithTwoTokens (slippageTolerance) = { | |
321 | 321 | let pmtAssetIdA = i.payments[0].assetId | |
322 | 322 | let pmtAssetIdB = i.payments[1].assetId | |
323 | 323 | let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA) | |
324 | 324 | let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB) | |
325 | 325 | let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB)) | |
326 | 326 | let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA) | |
327 | 327 | let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB) | |
328 | 328 | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
329 | 329 | let invariantCalculated = invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB)) | |
330 | 330 | if (!(isActive)) | |
331 | 331 | then throwIsInactive() | |
332 | 332 | else if (if ((0 > slippageTolerance)) | |
333 | 333 | then true | |
334 | 334 | else (slippageTolerance > slippageToleranceDelimiter)) | |
335 | 335 | then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance))) | |
336 | 336 | else if ((size(i.payments) != 2)) | |
337 | 337 | then throw("Two attached assets expected") | |
338 | 338 | else if (if ((pmtAssetIdA != assetIdA)) | |
339 | 339 | then true | |
340 | 340 | else (pmtAssetIdB != assetIdB)) | |
341 | 341 | then throwAssets() | |
342 | 342 | else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio)) | |
343 | 343 | then true | |
344 | 344 | else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter))) | |
345 | 345 | then throw("Incorrect assets amount: amounts must have the contract ratio") | |
346 | 346 | else if ((shareTokenToPayAmount == 0)) | |
347 | 347 | then throw("Too small amount to replenish") | |
348 | 348 | else if (!(hasEnoughBalance)) | |
349 | 349 | then suspendSuspicious() | |
350 | 350 | else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyInvariant, invariantCalculated), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)] | |
351 | 351 | } | |
352 | 352 | ||
353 | 353 | ||
354 | 354 | ||
355 | 355 | @Callable(i) | |
356 | 356 | func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = { | |
357 | 357 | let $t04229442369 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
358 | 358 | let pmtAmount = $t04229442369._1 | |
359 | 359 | let pmtAssetId = $t04229442369._2 | |
360 | - | let pmtMinThreshold = 5000000 | |
361 | - | let thresholdValueForMinTolerance = 50000000 | |
362 | - | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
363 | - | then 100000 | |
364 | - | else 1 | |
365 | - | let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000)) | |
366 | - | let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000)) | |
367 | - | let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
368 | - | let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000)) | |
369 | - | if (!(isActive)) | |
370 | - | then throwIsInactive() | |
371 | - | else if ((pmtMinThreshold > pmtAmount)) | |
372 | - | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
373 | - | else if ((size(i.payments) != 1)) | |
374 | - | then throw("One attached payment expected") | |
375 | - | else if (!(hasEnoughBalance)) | |
376 | - | then suspendSuspicious() | |
377 | - | else if ((pmtAssetId == assetIdA)) | |
378 | - | then { | |
379 | - | let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay) | |
380 | - | let amountVirtualReplenishTokenB = virtualSwapTokenGet | |
381 | - | let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay) | |
382 | - | let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet) | |
383 | - | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
384 | - | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
385 | - | if (if ((invariantEstimatedRatio >= slippageValueMinForSwap)) | |
386 | - | then ((invariantNew - invariant) >= 0) | |
387 | - | else false) | |
360 | + | if (true) | |
361 | + | then throw(toString(value(value(assetInfo(USDN)).minSponsoredFee))) | |
362 | + | else { | |
363 | + | let pmtMinThreshold = 5000000 | |
364 | + | let thresholdValueForMinTolerance = 50000000 | |
365 | + | let tolerance = if ((thresholdValueForMinTolerance > pmtAmount)) | |
366 | + | then 100000 | |
367 | + | else 1 | |
368 | + | let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000)) | |
369 | + | let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000)) | |
370 | + | let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000)) | |
371 | + | let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000)) | |
372 | + | if (!(isActive)) | |
373 | + | then throwIsInactive() | |
374 | + | else if ((pmtMinThreshold > pmtAmount)) | |
375 | + | then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens")) | |
376 | + | else if ((size(i.payments) != 1)) | |
377 | + | then throw("One attached payment expected") | |
378 | + | else if (!(hasEnoughBalance)) | |
379 | + | then suspendSuspicious() | |
380 | + | else if ((pmtAssetId == assetIdA)) | |
388 | 381 | then { | |
389 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
390 | - | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
391 | - | then true | |
392 | - | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
393 | - | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
394 | - | else { | |
395 | - | let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000)) | |
396 | - | let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA) | |
397 | - | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
398 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
399 | - | let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
400 | - | let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB) | |
401 | - | let newAmountTokenA = (balanceA + pmtAmount) | |
402 | - | let newAmountTokenB = balanceB | |
403 | - | let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount)) | |
404 | - | let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount)) | |
405 | - | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
406 | - | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
382 | + | let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay) | |
383 | + | let amountVirtualReplenishTokenB = virtualSwapTokenGet | |
384 | + | let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay) | |
385 | + | let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet) | |
386 | + | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
387 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
388 | + | if (if ((invariantEstimatedRatio >= slippageValueMinForSwap)) | |
389 | + | then ((invariantNew - invariant) >= 0) | |
390 | + | else false) | |
391 | + | then { | |
392 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
393 | + | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
407 | 394 | then true | |
408 | - | else (dAppThresholdAmount > newAmountTokenB)) | |
409 | - | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
410 | - | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)] | |
395 | + | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
396 | + | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
397 | + | else { | |
398 | + | let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000)) | |
399 | + | let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA) | |
400 | + | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
401 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
402 | + | let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
403 | + | let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB) | |
404 | + | let newAmountTokenA = (balanceA + pmtAmount) | |
405 | + | let newAmountTokenB = balanceB | |
406 | + | let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount)) | |
407 | + | let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount)) | |
408 | + | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
409 | + | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
410 | + | then true | |
411 | + | else (dAppThresholdAmount > newAmountTokenB)) | |
412 | + | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
413 | + | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)] | |
414 | + | } | |
411 | 415 | } | |
416 | + | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
412 | 417 | } | |
413 | - | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
414 | - | } | |
415 | - | else if ((pmtAssetId == assetIdB)) | |
416 | - | then { | |
417 | - | let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay) | |
418 | - | let amountVirtualReplenishTokenA = virtualSwapTokenGet | |
419 | - | let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet) | |
420 | - | let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay) | |
421 | - | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
422 | - | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
423 | - | if (if ((invariantEstimatedRatio > slippageValueMinForSwap)) | |
424 | - | then ((invariantNew - invariant) >= 0) | |
425 | - | else false) | |
418 | + | else if ((pmtAssetId == assetIdB)) | |
426 | 419 | then { | |
427 | - | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
428 | - | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
429 | - | then true | |
430 | - | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
431 | - | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
432 | - | else { | |
433 | - | let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA) | |
434 | - | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
435 | - | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
436 | - | let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount)) | |
437 | - | let newAmountTokenA = balanceA | |
438 | - | let newAmountTokenB = (balanceB + pmtAmount) | |
439 | - | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
440 | - | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
420 | + | let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay) | |
421 | + | let amountVirtualReplenishTokenA = virtualSwapTokenGet | |
422 | + | let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet) | |
423 | + | let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay) | |
424 | + | let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB) | |
425 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew) | |
426 | + | if (if ((invariantEstimatedRatio > slippageValueMinForSwap)) | |
427 | + | then ((invariantNew - invariant) >= 0) | |
428 | + | else false) | |
429 | + | then { | |
430 | + | let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB)) | |
431 | + | if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish)) | |
441 | 432 | then true | |
442 | - | else (dAppThresholdAmount > newAmountTokenB)) | |
443 | - | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
444 | - | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)] | |
433 | + | else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish)) | |
434 | + | then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect") | |
435 | + | else { | |
436 | + | let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA) | |
437 | + | let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB) | |
438 | + | let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8) | |
439 | + | let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount)) | |
440 | + | let newAmountTokenA = balanceA | |
441 | + | let newAmountTokenB = (balanceB + pmtAmount) | |
442 | + | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
443 | + | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
444 | + | then true | |
445 | + | else (dAppThresholdAmount > newAmountTokenB)) | |
446 | + | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
447 | + | else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)] | |
448 | + | } | |
445 | 449 | } | |
450 | + | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
446 | 451 | } | |
447 | - | else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value") | |
448 | - | } | |
449 | - | else throwAssets() | |
452 | + | else throwAssets() | |
453 | + | } | |
450 | 454 | } | |
451 | 455 | ||
452 | 456 | ||
453 | 457 | ||
454 | 458 | @Callable(i) | |
455 | 459 | func exchange (estimatedAmountToReceive,minAmountToReceive) = { | |
456 | - | let $ | |
457 | - | let pmtAmount = $ | |
458 | - | let pmtAssetId = $ | |
460 | + | let $t05001550090 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
461 | + | let pmtAmount = $t05001550090._1 | |
462 | + | let pmtAssetId = $t05001550090._2 | |
459 | 463 | if (!(isActive)) | |
460 | 464 | then throwIsInactive() | |
461 | 465 | else if ((0 >= estimatedAmountToReceive)) | |
462 | 466 | then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive))) | |
463 | 467 | else if ((minAmountToReceive > estimatedAmountToReceive)) | |
464 | 468 | then throw(((("Minimal amount can't be greater than estimated. Estimated: " + toString(estimatedAmountToReceive)) + ". Minimal: ") + toString(minAmountToReceive))) | |
465 | 469 | else if ((size(i.payments) != 1)) | |
466 | 470 | then throw("One attached payment expected") | |
467 | 471 | else if (!(hasEnoughBalance)) | |
468 | 472 | then suspendSuspicious() | |
469 | 473 | else if ((pmtAssetId == assetIdA)) | |
470 | 474 | then { | |
471 | 475 | let assetIdSend = assetIdB | |
472 | 476 | let amountWithoutFee = calculateHowManySendTokenB(estimatedAmountToReceive, minAmountToReceive, balanceA, balanceB, pmtAmount) | |
473 | 477 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
474 | 478 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
475 | 479 | let newAmountTokenA = (balanceA + pmtAmount) | |
476 | 480 | let newAmountTokenB = ((balanceB - amountWithFee) - governanceReward) | |
477 | 481 | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
478 | 482 | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
479 | 483 | then true | |
480 | 484 | else (dAppThresholdAmount > newAmountTokenB)) | |
481 | 485 | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
482 | 486 | else if (if (if ((assetIdA == USDN)) | |
483 | 487 | then (stakedAmountUSDN >= newAmountTokenA) | |
484 | 488 | else false) | |
485 | 489 | then true | |
486 | 490 | else if ((assetIdB == USDN)) | |
487 | 491 | then (stakedAmountUSDN >= newAmountTokenB) | |
488 | 492 | else false) | |
489 | 493 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB) | |
490 | 494 | else [IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalc((balanceA + pmtAmount), ((balanceB - amountWithFee) - governanceReward))), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(governanceAddress, governanceReward, assetIdSend)] | |
491 | 495 | } | |
492 | 496 | else if ((pmtAssetId == assetIdB)) | |
493 | 497 | then { | |
494 | 498 | let assetIdSend = assetIdA | |
495 | 499 | let amountWithoutFee = calculateHowManySendTokenA(estimatedAmountToReceive, minAmountToReceive, balanceA, balanceB, pmtAmount) | |
496 | 500 | let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter) | |
497 | 501 | let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter) | |
498 | 502 | let newAmountTokenA = ((balanceA - amountWithFee) - governanceReward) | |
499 | 503 | let newAmountTokenB = (balanceB + pmtAmount) | |
500 | 504 | let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter)) | |
501 | 505 | if (if ((dAppThresholdAmount > newAmountTokenA)) | |
502 | 506 | then true | |
503 | 507 | else (dAppThresholdAmount > newAmountTokenB)) | |
504 | 508 | then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB) | |
505 | 509 | else if (if (if ((assetIdA == USDN)) | |
506 | 510 | then (stakedAmountUSDN >= newAmountTokenA) | |
507 | 511 | else false) | |
508 | 512 | then true | |
509 | 513 | else if ((assetIdB == USDN)) | |
510 | 514 | then (stakedAmountUSDN >= newAmountTokenB) | |
511 | 515 | else false) | |
512 | 516 | then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA) | |
513 | 517 | else [IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalc(((balanceA - amountWithFee) - governanceReward), (balanceB + pmtAmount))), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(governanceAddress, governanceReward, assetIdSend)] | |
514 | 518 | } | |
515 | 519 | else throwAssets() | |
516 | 520 | } | |
517 | 521 | ||
518 | 522 | ||
519 | 523 | ||
520 | 524 | @Callable(i) | |
521 | 525 | func takeIntoAccountExtraFunds (amountLeave) = { | |
522 | 526 | let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA) | |
523 | 527 | let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB) | |
524 | 528 | let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == USDN)) | |
525 | 529 | then amountLeave | |
526 | 530 | else 0)) | |
527 | 531 | let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == USDN)) | |
528 | 532 | then amountLeave | |
529 | 533 | else 0)) | |
530 | 534 | if (!(isActive)) | |
531 | 535 | then throwIsInactive() | |
532 | 536 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey))) | |
533 | 537 | then throwOnlyAdmin() | |
534 | 538 | else if ((0 > amountLeave)) | |
535 | 539 | then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave))) | |
536 | 540 | else if (if ((0 > uncountableAmountEnrollAssetA)) | |
537 | 541 | then true | |
538 | 542 | else (0 > uncountableAmountEnrollAssetB)) | |
539 | 543 | then suspend("Enroll amount negative") | |
540 | 544 | else if (if ((0 > amountEnrollA)) | |
541 | 545 | then true | |
542 | 546 | else (0 > amountEnrollB)) | |
543 | 547 | then throw("Too large amountLeave") | |
544 | 548 | else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB))] | |
545 | 549 | } | |
546 | 550 | ||
547 | 551 |
github/deemru/w8io/169f3d6 64.89 ms ◑