tx · 3B7r7AW4Yt4wRGxMM8jJyBdwGHUmmR4fLhTgWqtRnrEY 3N69YR9dGN9tJnhxGrURt5cQycjAN1zbQ9t: -0.05000000 Waves 2021.01.28 22:57 [1373792] smart account 3N69YR9dGN9tJnhxGrURt5cQycjAN1zbQ9t > SELF 0.00000000 Waves
{ "type": 13, "id": "3B7r7AW4Yt4wRGxMM8jJyBdwGHUmmR4fLhTgWqtRnrEY", "fee": 5000000, "feeAssetId": null, "timestamp": 1611863940854, "version": 2, "chainId": 84, "sender": "3N69YR9dGN9tJnhxGrURt5cQycjAN1zbQ9t", "senderPublicKey": "Bo16mjUNTGCeZDYvQc6gHh46P21B3DqYCHoDt9CyzxHf", "proofs": [ "uuKVurWa1iBqEwTAXdE9NG2rj9vikxHfRX27YgXobdCUHFEEaix4ynVqeLkjMezuqNy6r3AFkLfnikpkGm43Aqh" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAACgAAAAABZQAAAAAAEDPE1gAAAAAOa3dvdGFyb3dub3dhZ2kAAAAJGE5yoAAAAAAABGJhemEJAABoAAAAAgUAAAAOa3dvdGFyb3dub3dhZ2kAAAAAAAAAABIAAAAABnBvemlvbQkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAGUG96aW9tAAAAAApiYWxhbnNVU0ROCQAAaAAAAAIJAAPwAAAAAgUAAAAEdGhpcwEAAAAgtzARUPMAfn8omFYD7FEBrjXso9H7lLybJrQmByOrp0oAAAAAAAAAAGQAAAAACmJhbGFuc1VTRFQJAABoAAAAAgkAA/AAAAACBQAAAAR0aGlzAQAAACAJCQhzVKVOgFDqDmysbJV8OkcOJOmBXIL2KV5qFrGDzgAAAAAAAAAAZAEAAAACbG4AAAABAAAAAXgJAABtAAAABgUAAAABeAAAAAAAAAAACAUAAAABZQAAAAAAAAAACAAAAAAAAAAACAUAAAAERE9XTgEAAAADZXhwAAAAAQAAAAF4CQAAbAAAAAYFAAAAAWUAAAAAAAAAAAgF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55IGFzc2V0AAAAAMzoUKQ=", "height": 1373792, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JAHuLpq9dWoy4TRNqsm4ezAujkBNNtVnun5iuKR2tSHk Next: 6XUBAgt8nbyVNgdVf4dhhA5Rx9nDvxVLHdPVV8qzRXp8 Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | } | |
40 | 40 | else { | |
41 | 41 | let czesc1 = (kwotarownowagi - balansUSDT) | |
42 | - | let czesc2 = (kwotawymiany - czesc1) | |
43 | 42 | let nowypoziom = (((balansUSDT + kwotawymiany) + baza) - kwotarownowagi) | |
44 | 43 | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
45 | 44 | [ScriptTransfer(i.caller, (wyplata / 100), base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 2)] | |
59 | 58 | } | |
60 | 59 | else { | |
61 | 60 | let czesc1 = (kwotarownowagi - balansUSDN) | |
62 | - | let czesc2 = (kwotawymiany - czesc1) | |
63 | 61 | let nowypoziom = (((balansUSDN + kwotawymiany) + baza) - kwotarownowagi) | |
64 | 62 | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
65 | 63 | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 21)] | |
73 | 71 | } | |
74 | 72 | ||
75 | 73 | ||
76 | - | ||
77 | - | @Callable(i) | |
78 | - | func USDNnaUSDT () = { | |
79 | - | let kwotawymiany = i.payments[0].amount | |
80 | - | if ((kwotawymiany > (kwotarownowagi - balansUSDN))) | |
81 | - | then if ((balansUSDN >= kwotarownowagi)) | |
82 | - | then { | |
83 | - | let nowypoziom = (poziom + kwotawymiany) | |
84 | - | let wyplata = mnozenie(baza, (ln(nowypoziom) - ln(poziom))) | |
85 | - | [IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 11), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
86 | - | } | |
87 | - | else { | |
88 | - | let czesc1 = (kwotarownowagi - balansUSDN) | |
89 | - | let czesc2 = (kwotawymiany - czesc1) | |
90 | - | let nowypoziom = (((balansUSDN + kwotawymiany) + baza) - kwotarownowagi) | |
91 | - | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
92 | - | [IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 21), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
93 | - | } | |
94 | - | else { | |
95 | - | let wyplata = (poziom - dzielenie(poziom, exp(dzielenie(kwotawymiany, baza)))) | |
96 | - | let nowypoziom = (poziom - wyplata) | |
97 | - | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 31), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
98 | - | } | |
99 | - | } | |
100 | - | ||
101 | - |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let e = 271828182 | |
5 | 5 | ||
6 | 6 | let kwotarownowagi = 10000000000000 | |
7 | 7 | ||
8 | 8 | let baza = (kwotarownowagi * 18) | |
9 | 9 | ||
10 | 10 | let poziom = getIntegerValue(this, "Poziom") | |
11 | 11 | ||
12 | 12 | let balansUSDN = (assetBalance(this, base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d') * 100) | |
13 | 13 | ||
14 | 14 | let balansUSDT = (assetBalance(this, base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y') * 100) | |
15 | 15 | ||
16 | 16 | func ln (x) = log(x, 8, e, 8, 8, DOWN) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func exp (x) = pow(e, 8, x, 8, 8, DOWN) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func mnozenie (x,y) = fraction(x, y, 100000000) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func dzielenie (x,y) = fraction(x, 100000000, y) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func USDTnaUSDNnaUSDT () = { | |
30 | 30 | let oplata = fraction(i.payments[0].amount, 4, 10000) | |
31 | 31 | let kwotawymiany = fraction((i.payments[0].amount - oplata), 100, 1) | |
32 | 32 | if ((i.payments[0].assetId == base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y')) | |
33 | 33 | then if ((kwotawymiany > (kwotarownowagi - balansUSDT))) | |
34 | 34 | then if ((balansUSDT >= kwotarownowagi)) | |
35 | 35 | then { | |
36 | 36 | let nowypoziom = (poziom + kwotawymiany) | |
37 | 37 | let wyplata = mnozenie(baza, (ln(nowypoziom) - ln(poziom))) | |
38 | 38 | [ScriptTransfer(i.caller, (wyplata / 100), base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 1)] | |
39 | 39 | } | |
40 | 40 | else { | |
41 | 41 | let czesc1 = (kwotarownowagi - balansUSDT) | |
42 | - | let czesc2 = (kwotawymiany - czesc1) | |
43 | 42 | let nowypoziom = (((balansUSDT + kwotawymiany) + baza) - kwotarownowagi) | |
44 | 43 | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
45 | 44 | [ScriptTransfer(i.caller, (wyplata / 100), base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 2)] | |
46 | 45 | } | |
47 | 46 | else { | |
48 | 47 | let wyplata = (poziom - dzielenie(poziom, exp(dzielenie(kwotawymiany, baza)))) | |
49 | 48 | let nowypoziom = (poziom - wyplata) | |
50 | 49 | [ScriptTransfer(i.caller, (wyplata / 100), base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 3)] | |
51 | 50 | } | |
52 | 51 | else if ((i.payments[0].assetId == base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d')) | |
53 | 52 | then if ((kwotawymiany > (kwotarownowagi - balansUSDN))) | |
54 | 53 | then if ((balansUSDN >= kwotarownowagi)) | |
55 | 54 | then { | |
56 | 55 | let nowypoziom = (poziom + kwotawymiany) | |
57 | 56 | let wyplata = mnozenie(baza, (ln(nowypoziom) - ln(poziom))) | |
58 | 57 | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 11)] | |
59 | 58 | } | |
60 | 59 | else { | |
61 | 60 | let czesc1 = (kwotarownowagi - balansUSDN) | |
62 | - | let czesc2 = (kwotawymiany - czesc1) | |
63 | 61 | let nowypoziom = (((balansUSDN + kwotawymiany) + baza) - kwotarownowagi) | |
64 | 62 | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
65 | 63 | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 21)] | |
66 | 64 | } | |
67 | 65 | else { | |
68 | 66 | let wyplata = (poziom - dzielenie(poziom, exp(dzielenie(kwotawymiany, baza)))) | |
69 | 67 | let nowypoziom = (poziom - wyplata) | |
70 | 68 | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), ScriptTransfer(addressFromStringValue("3MreQWCMA3vhziCq8yMCf9BdBmHcZGrbW4S"), oplata, base58'DL67xXsNV42GiRUY1XMTXNyLCs42gnEL8jizPLBbrb8d'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Poziom", nowypoziom), IntegerEntry("Warunek", 31)] | |
71 | 69 | } | |
72 | 70 | else throw("Nieobsługiwany asset") | |
73 | 71 | } | |
74 | 72 | ||
75 | 73 | ||
76 | - | ||
77 | - | @Callable(i) | |
78 | - | func USDNnaUSDT () = { | |
79 | - | let kwotawymiany = i.payments[0].amount | |
80 | - | if ((kwotawymiany > (kwotarownowagi - balansUSDN))) | |
81 | - | then if ((balansUSDN >= kwotarownowagi)) | |
82 | - | then { | |
83 | - | let nowypoziom = (poziom + kwotawymiany) | |
84 | - | let wyplata = mnozenie(baza, (ln(nowypoziom) - ln(poziom))) | |
85 | - | [IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 11), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
86 | - | } | |
87 | - | else { | |
88 | - | let czesc1 = (kwotarownowagi - balansUSDN) | |
89 | - | let czesc2 = (kwotawymiany - czesc1) | |
90 | - | let nowypoziom = (((balansUSDN + kwotawymiany) + baza) - kwotarownowagi) | |
91 | - | let wyplata = ((mnozenie(baza, (ln(nowypoziom) - ln(baza))) + poziom) - dzielenie(poziom, exp(dzielenie(czesc1, baza)))) | |
92 | - | [IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 21), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
93 | - | } | |
94 | - | else { | |
95 | - | let wyplata = (poziom - dzielenie(poziom, exp(dzielenie(kwotawymiany, baza)))) | |
96 | - | let nowypoziom = (poziom - wyplata) | |
97 | - | [ScriptTransfer(i.caller, (wyplata / 100), base58'cGfAv1s7NxGWL913wR2Lp9yFSY7DrkWip6YPQGJGc6y'), IntegerEntry("Wyplata", fraction(wyplata, 1, 100)), IntegerEntry("Warunek", 31), IntegerEntry("USDT", fraction((balansUSDT - wyplata), 1, 100)), IntegerEntry("USDN", fraction((balansUSDN + kwotawymiany), 1, 100))] | |
98 | - | } | |
99 | - | } | |
100 | - | ||
101 | - |
github/deemru/w8io/026f985 49.73 ms ◑