tx · AkDPVGtjTXBVAg3XDDHEjcyzDUzwZNdyXE3EqCBVGAGB

3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4:  -0.01400000 Waves

2020.10.22 21:52 [1232163] smart account 3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4 > SELF 0.00000000 Waves

{ "type": 13, "id": "AkDPVGtjTXBVAg3XDDHEjcyzDUzwZNdyXE3EqCBVGAGB", "fee": 1400000, "feeAssetId": null, "timestamp": 1603392738206, "version": 1, "sender": "3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4", "senderPublicKey": "HuNwRHF9iwGdZDspJ7V7eY2akXjp5fWmTprKuM97CATY", "proofs": [ "KpP3Md1Zw2nf53kxu79PSAxAQteT5FZ2z1Kg3n7q86AMivnrJeeFGyoG89XBMk9X7VoUNyDjbM8KRfLaH5rye7e" ], "script": "base64:AAIEAAAAAAAAAA8IAhIAEgASABIAEgMKAQEAAAAQAAAAAAhJZFRva2VuQQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAANYXNzZXRJZFRva2VuQQAAAAAISWRUb2tlbkIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADWFzc2V0SWRUb2tlbkIAAAAADGFtb3VudFRva2VuQgkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAMYW1vdW50VG9rZW5CAAAAAAxhbW91bnRUb2tlbkEJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQQAAAAARYXNzZXRJZFRva2VuU2hhcmUJAQAAABFAZXh0ck5hdGl2ZSgxMDUyKQAAAAIFAAAABHRoaXMCAAAADnNoYXJlX3Rva2VuX2lkAAAAABB0b2tlblNoYXJlU3VwcGx5CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAABJzaGFyZV90b2tlb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QAAAA1hc3NldElkVG9rZW5CCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxhbW91bnRUb2tlbkEJAABkAAAAAgUAAAAMYW1vdW50VG9rZW5BBQAAABJ0b2tlblJlY2VpdmVBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGFtb3VudFRva2VuQgkAAGUAAAACBQAAAAxhbW91bnRUb2tlbkIFAAAAD3Rva2VuU2VuZEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOZXhjaGFuZ2VfY291bnQJAABkAAAAAgUAAAAFY291bnQAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAA90b2tlblNlbmRBbW91bnQFAAAAC2Fzc2V0SWRTZW50BQAAAANuaWwJAAACAAAAAQIAAAAUQXNzZXQgaXMgbm90IGFsbG93ZWQAAAAA2SK/xA==", "chainId": 84, "height": 1232163, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3FUGuFpzbYabvBrmuP7MrXCJY6eQydXzPvJdb1BCu4YJ Next: none Diff:
OldNewDifferences
55
66 let b = getStringValue(this, "assetIdTokenB")
77
8-let c = getStringValue(this, "share_token_id")
8+let c = getIntegerValue(this, "amountTokenB")
99
1010 let d = getIntegerValue(this, "amountTokenA")
1111
12-let e = getIntegerValue(this, "amountTokenB")
12+let e = getBinaryValue(this, "share_token_id")
1313
1414 let f = getIntegerValue(this, "share_token_supply")
1515
16-let g = 0
16+let g = 500
1717
18-let h = 10000
18+let h = 1000000
1919
20-let i = "2.0.0"
20+let i = "1.0.0"
2121
22-let j = getIntegerValue(this, "invariant")
22+let j = 100000000
2323
2424 let k = 100000000
2525
26-let l = 8
26+let l = 99999000
2727
28-let m = 1000000000000
28+let m = 8
2929
30-let n = 100000000
31-
32-let o = 99999000
33-
34-let p = 50
35-
36-let q = 2
37-
38-let r = 46
39-
40-let s = 2
41-
42-func t (u,v) = ((fraction(k, u, v) + fraction(k, v, u)) / 2)
30+func n (o) = if ((o == "WAVES"))
31+ then unit
32+ else fromBase58String(o)
4333
4434
45-func w (u,v) = {
46- let x = t(u, v)
47- (fraction((u + v), pow(x, l, -(p), q, 8, HALFDOWN), k) + (2 * fraction(fraction(pow(u, 0, 5, 1, l, HALFDOWN), pow(v, 0, 5, 1, l, HALFDOWN), (k * k)), pow((x - ((r * k) / 100)), 0, p, q, l, HALFDOWN), m)))
48- }
35+let p = n(a)
4936
37+let q = n(b)
5038
51-func y (z) = if ((z == "WAVES"))
52- then unit
53- else fromBase58String(z)
54-
55-
56-func A (B,C,D,E,F) = {
57- let G = (k - ((k * 1) / 10000))
58- let H = fraction(j, k, w((D - B), (E + F)))
59- if (if ((H > G))
60- then (k > H)
61- else false)
62- then ((B * (h - g)) / h)
63- else throw("price has changed dramatically. err2")
64- }
65-
66-
67-func I (B,C,D,E,F) = {
68- let G = (k - ((k * 1) / 10000))
69- let H = fraction(j, k, w((D + F), (E - B)))
70- if (if ((H > G))
71- then (k > H)
72- else false)
73- then ((B * (h - g)) / h)
74- else throw("price has changed dramatically. err2")
75- }
76-
77-
78-let J = y(a)
79-
80-let K = y(b)
81-
82-let L = fromBase58String(c)
83-
84-@Callable(M)
39+@Callable(r)
8540 func fund () = {
86- let N = value(M.payments[0])
87- let O = value(M.payments[1])
88- let P = N.assetId
89- let Q = N.amount
90- let R = O.assetId
91- let S = O.amount
92- let T = {
93- let U = P
94- if ($isInstanceOf(U, "Unit"))
41+ let s = value(r.payments[0])
42+ let t = value(r.payments[1])
43+ let u = s.assetId
44+ let v = s.amount
45+ let w = t.assetId
46+ let x = t.amount
47+ let y = {
48+ let z = u
49+ if ($isInstanceOf(z, "Unit"))
9550 then {
96- let V = U
51+ let A = z
9752 8
9853 }
99- else if ($isInstanceOf(U, "ByteVector"))
54+ else if ($isInstanceOf(z, "ByteVector"))
10055 then {
101- let V = U
102- value(assetInfo(V)).decimals
56+ let A = z
57+ value(assetInfo(A)).decimals
10358 }
10459 else throw("Match error")
10560 }
106- let W = {
107- let U = R
108- if ($isInstanceOf(U, "Unit"))
61+ let B = {
62+ let z = w
63+ if ($isInstanceOf(z, "Unit"))
10964 then {
110- let V = U
65+ let A = z
11166 8
11267 }
113- else if ($isInstanceOf(U, "ByteVector"))
68+ else if ($isInstanceOf(z, "ByteVector"))
11469 then {
115- let V = U
116- value(assetInfo(V)).decimals
70+ let A = z
71+ value(assetInfo(A)).decimals
11772 }
11873 else throw("Match error")
11974 }
12075 if (isDefined(getBoolean(this, "status")))
12176 then throw("already active")
12277 else {
123- let X = ("ShareT_" + takeRight(toString(this), 5))
124- let Y = ((T + W) / 2)
125- let Z = fraction(pow(Q, T, 5, 1, T, HALFDOWN), pow(S, W, 5, 1, W, HALFDOWN), pow(10, 0, Y, 0, 0, HALFDOWN))
126- let aa = calculateAssetId(Issue(X, X, Z, Y, true))
127- let ab = {
128- let U = P
129- if ($isInstanceOf(U, "Unit"))
78+ let C = ("ShareT_" + takeRight(toString(this), 5))
79+ let D = ((y + B) / 2)
80+ let E = fraction(pow(v, y, 5, 1, y, HALFDOWN), pow(x, B, 5, 1, B, HALFDOWN), pow(10, 0, D, 0, 0, HALFDOWN))
81+ let F = calculateAssetId(Issue(C, C, E, D, true))
82+ let G = {
83+ let z = u
84+ if ($isInstanceOf(z, "Unit"))
13085 then {
131- let ac = U
86+ let H = z
13287 "WAVES"
13388 }
134- else if ($isInstanceOf(U, "ByteVector"))
89+ else if ($isInstanceOf(z, "ByteVector"))
13590 then {
136- let ac = U
137- toBase58String(value(P))
91+ let H = z
92+ toBase58String(value(u))
13893 }
13994 else throw("Match error")
14095 }
141- let ad = {
142- let U = R
143- if ($isInstanceOf(U, "Unit"))
96+ let I = {
97+ let z = w
98+ if ($isInstanceOf(z, "Unit"))
14499 then {
145- let ac = U
100+ let H = z
146101 "WAVES"
147102 }
148- else if ($isInstanceOf(U, "ByteVector"))
103+ else if ($isInstanceOf(z, "ByteVector"))
149104 then {
150- let ac = U
151- toBase58String(value(R))
105+ let H = z
106+ toBase58String(value(w))
152107 }
153108 else throw("Match error")
154109 }
155- let ae = w(Q, S)
156-[IntegerEntry("amountTokenA", Q), IntegerEntry("amountTokenB", S), StringEntry("assetIdTokenA", ab), StringEntry("assetIdTokenB", ad), IntegerEntry("invariant", ae), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", g), IntegerEntry("comissionScaleDelimiter", h), StringEntry("version", i), Issue(X, X, Z, Y, true), ScriptTransfer(M.caller, Z, aa), StringEntry("share_token_id", toBase58String(aa)), IntegerEntry("share_token_supply", Z)]
110+[IntegerEntry("amountTokenA", v), IntegerEntry("amountTokenB", x), StringEntry("assetIdTokenA", G), StringEntry("assetIdTokenB", I), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", g), IntegerEntry("comissionScaleDelimiter", h), StringEntry("version", i), Issue(C, C, E, D, true), ScriptTransfer(r.caller, E, F), BinaryEntry("share_token_id", F), IntegerEntry("share_token_supply", E)]
157111 }
158112 }
159113
160114
161115
162-@Callable(M)
163-func replenishmentWithTwoToken () = {
164- let N = value(M.payments[0])
165- let O = value(M.payments[1])
166- let P = N.assetId
167- let Q = N.amount
168- let R = O.assetId
169- let S = O.amount
170- let ae = w((d + Q), (e + S))
171- if (if ((P != J))
116+@Callable(r)
117+func replenishment () = {
118+ let s = value(r.payments[0])
119+ let t = value(r.payments[1])
120+ let u = s.assetId
121+ let v = s.amount
122+ let w = t.assetId
123+ let x = t.amount
124+ let J = getIntegerValue(this, "amountTokenA")
125+ let K = getIntegerValue(this, "amountTokenB")
126+ if (if ((u != p))
172127 then true
173- else (R != K))
128+ else (w != q))
174129 then throw("incorrect assets")
175130 else {
176- let af = (fraction(Q, (1000000000000 * 1000), d) / fraction(e, 1000000000000, S))
177- if (!(if ((af > 990))
178- then (1010 > af)
131+ let L = (fraction(v, (1000000000000 * 100000), J) / fraction(K, 1000000000000, x))
132+ if (!(if ((L > 99990))
133+ then (100010 > L)
179134 else false))
180135 then throw("incorrect assets amount")
181136 else {
182- let ag = fraction(Q, f, d)
183- if ((ag == 0))
137+ let M = fraction(v, f, J)
138+ if ((M == 0))
184139 then throw("you try replansish with very small amount")
185- else [Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenA", (d + Q)), IntegerEntry("amountTokenB", (e + S)), IntegerEntry("invariant", ae)]
140+ else [Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenA", (J + v)), IntegerEntry("amountTokenB", (K + x))]
186141 }
187142 }
188143 }
189144
190145
191146
192-@Callable(M)
193-func replanishmentWithOneToken (ah,ai) = {
194- let aj = value(M.payments[0])
195- let ak = aj.assetId
196- let F = aj.amount
197- if ((ak == J))
147+@Callable(r)
148+func replanishmentWithOneToken () = {
149+ let N = value(r.payments[0])
150+ let O = N.assetId
151+ let P = N.amount
152+ if ((O == p))
198153 then {
199- let al = (d + F)
200- let am = w(al, e)
201- let an = fraction(al, k, e)
202- let ao = fraction(ai, an, ah)
203- if (if ((ao > n))
204- then true
205- else (o > ao))
206- then throw("incorrect function args: price")
207- else {
208- let ap = w(ah, ai)
209- let aq = fraction(ap, k, j)
210- if (if ((aq > n))
211- then true
212- else (o > aq))
213- then throw("incorrect function args: invariant")
214- else {
215- let ar = fraction(ai, f, e)
216- let ag = (ar - f)
217-[Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenA", al), IntegerEntry("invariant", am)]
218- }
219- }
154+ let Q = (d + P)
155+ let R = fraction(Q, j, c)
156+ let S = pow(fraction(d, c, R), 0, 5, 1, 0, HALFDOWN)
157+ let T = fraction(c, f, S)
158+ let M = (T - f)
159+[Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenA", Q)]
220160 }
221- else if ((ak == K))
161+ else if ((O == q))
222162 then {
223- let as = (e + F)
224- let am = w(d, as)
225- let an = fraction(d, k, as)
226- let ao = fraction(ai, an, ah)
227- if (if ((ao > n))
228- then true
229- else (o > ao))
230- then throw("incorrect function args: price")
231- else {
232- let ap = w(ah, ai)
233- let aq = fraction(ap, k, j)
234- if (if ((aq > n))
235- then true
236- else (o > aq))
237- then throw("incorrect function args: invariant")
238- else {
239- let ar = fraction(ai, f, e)
240- let ag = (ar - f)
241-[Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenB", as), IntegerEntry("invariant", am)]
242- }
243- }
163+ let U = (c + P)
164+ let R = fraction(d, j, U)
165+ let S = pow(fraction(d, c, R), 0, 5, 1, 0, HALFDOWN)
166+ let T = fraction(c, f, S)
167+ let M = (T - f)
168+[Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenB", U)]
244169 }
245170 else throw("incorrect assets in payment")
246171 }
247172
248173
249174
250-@Callable(M)
175+@Callable(r)
251176 func withdraw () = {
252- let aj = value(M.payments[0])
253- let ak = aj.assetId
254- let F = aj.amount
255- if ((L != ak))
256- then throw(("you need to attach share token for this dApp " + toBase58String(L)))
177+ let J = getIntegerValue(this, "amountTokenA")
178+ let K = getIntegerValue(this, "amountTokenB")
179+ let N = value(r.payments[0])
180+ let O = N.assetId
181+ let P = N.amount
182+ if ((e != O))
183+ then throw(("you need to attach share token for this dApp " + toBase58String(e)))
257184 else {
258- let at = fraction(F, d, f)
259- let au = fraction(F, e, f)
260- let ae = w((d - at), (e - au))
261-[IntegerEntry("amountTokenA", (d - at)), IntegerEntry("amountTokenB", (e - au)), IntegerEntry("share_token_supply", (f - F)), ScriptTransfer(M.caller, at, J), ScriptTransfer(M.caller, au, K), Burn(L, F), IntegerEntry("invariant", ae)]
185+ let V = fraction(P, J, f)
186+ let W = fraction(P, K, f)
187+[ScriptTransfer(r.caller, V, p), ScriptTransfer(r.caller, W, q), IntegerEntry("amountTokenA", (J - V)), IntegerEntry("amountTokenB", (K - W)), IntegerEntry("share_token_supply", (f - P)), Burn(e, P)]
262188 }
263189 }
264190
265191
266192
267-@Callable(M)
268-func exchanger (B,C) = {
269- let E = getIntegerValue(this, "amountTokenB")
270- let D = getIntegerValue(this, "amountTokenA")
271- let aj = value(M.payments[0])
272- let ak = aj.assetId
273- let F = aj.amount
274- let av = {
275- let U = getInteger(this, "exchange_count")
276- if ($isInstanceOf(U, "Int"))
193+@Callable(r)
194+func exchanger (X) = {
195+ let N = value(r.payments[0])
196+ let O = N.assetId
197+ let P = N.amount
198+ let Y = value(getInteger(this, "exchange_count"))
199+ if ((O == q))
200+ then {
201+ let Z = ((fraction(d, P, (P + c)) * (h - g)) / h)
202+ if ((X > Z))
203+ then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
204+ else {
205+ let aa = p
206+[IntegerEntry("amountTokenA", (d - Z)), IntegerEntry("amountTokenB", (c + P)), IntegerEntry("exchange_count", (Y + 1)), ScriptTransfer(r.caller, Z, aa)]
207+ }
208+ }
209+ else if ((O == p))
277210 then {
278- let aw = U
279- (value(getInteger(this, "exchange_count")) + aw)
280- }
281- else 0
282- }
283- if ((ak == K))
284- then {
285- let ax = A(B, C, D, E, F)
286- let ay = J
287-[IntegerEntry("amountTokenA", (D - ax)), IntegerEntry("amountTokenB", (E + F)), IntegerEntry("exchange_count", (av + 1)), IntegerEntry("invariant", w((D - ax), (E + F))), ScriptTransfer(M.caller, ax, ay)]
288- }
289- else if ((ak == J))
290- then {
291- let ax = I(B, C, D, E, F)
292- let ay = K
293-[IntegerEntry("amountTokenA", (D + F)), IntegerEntry("amountTokenB", (E - ax)), IntegerEntry("exchange_count", (av + 1)), IntegerEntry("invariant", w((D + F), (E - ax))), ScriptTransfer(M.caller, ax, ay)]
211+ let Z = ((fraction(c, P, (P + d)) * (h - g)) / h)
212+ if ((X > Z))
213+ then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
214+ else {
215+ let aa = q
216+[IntegerEntry("amountTokenA", (d + P)), IntegerEntry("amountTokenB", (c - Z)), IntegerEntry("exchange_count", (Y + 1)), ScriptTransfer(r.caller, Z, aa)]
217+ }
294218 }
295219 else throw("Asset is not allowed")
296220 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = getStringValue(this, "assetIdTokenA")
55
66 let b = getStringValue(this, "assetIdTokenB")
77
8-let c = getStringValue(this, "share_token_id")
8+let c = getIntegerValue(this, "amountTokenB")
99
1010 let d = getIntegerValue(this, "amountTokenA")
1111
12-let e = getIntegerValue(this, "amountTokenB")
12+let e = getBinaryValue(this, "share_token_id")
1313
1414 let f = getIntegerValue(this, "share_token_supply")
1515
16-let g = 0
16+let g = 500
1717
18-let h = 10000
18+let h = 1000000
1919
20-let i = "2.0.0"
20+let i = "1.0.0"
2121
22-let j = getIntegerValue(this, "invariant")
22+let j = 100000000
2323
2424 let k = 100000000
2525
26-let l = 8
26+let l = 99999000
2727
28-let m = 1000000000000
28+let m = 8
2929
30-let n = 100000000
31-
32-let o = 99999000
33-
34-let p = 50
35-
36-let q = 2
37-
38-let r = 46
39-
40-let s = 2
41-
42-func t (u,v) = ((fraction(k, u, v) + fraction(k, v, u)) / 2)
30+func n (o) = if ((o == "WAVES"))
31+ then unit
32+ else fromBase58String(o)
4333
4434
45-func w (u,v) = {
46- let x = t(u, v)
47- (fraction((u + v), pow(x, l, -(p), q, 8, HALFDOWN), k) + (2 * fraction(fraction(pow(u, 0, 5, 1, l, HALFDOWN), pow(v, 0, 5, 1, l, HALFDOWN), (k * k)), pow((x - ((r * k) / 100)), 0, p, q, l, HALFDOWN), m)))
48- }
35+let p = n(a)
4936
37+let q = n(b)
5038
51-func y (z) = if ((z == "WAVES"))
52- then unit
53- else fromBase58String(z)
54-
55-
56-func A (B,C,D,E,F) = {
57- let G = (k - ((k * 1) / 10000))
58- let H = fraction(j, k, w((D - B), (E + F)))
59- if (if ((H > G))
60- then (k > H)
61- else false)
62- then ((B * (h - g)) / h)
63- else throw("price has changed dramatically. err2")
64- }
65-
66-
67-func I (B,C,D,E,F) = {
68- let G = (k - ((k * 1) / 10000))
69- let H = fraction(j, k, w((D + F), (E - B)))
70- if (if ((H > G))
71- then (k > H)
72- else false)
73- then ((B * (h - g)) / h)
74- else throw("price has changed dramatically. err2")
75- }
76-
77-
78-let J = y(a)
79-
80-let K = y(b)
81-
82-let L = fromBase58String(c)
83-
84-@Callable(M)
39+@Callable(r)
8540 func fund () = {
86- let N = value(M.payments[0])
87- let O = value(M.payments[1])
88- let P = N.assetId
89- let Q = N.amount
90- let R = O.assetId
91- let S = O.amount
92- let T = {
93- let U = P
94- if ($isInstanceOf(U, "Unit"))
41+ let s = value(r.payments[0])
42+ let t = value(r.payments[1])
43+ let u = s.assetId
44+ let v = s.amount
45+ let w = t.assetId
46+ let x = t.amount
47+ let y = {
48+ let z = u
49+ if ($isInstanceOf(z, "Unit"))
9550 then {
96- let V = U
51+ let A = z
9752 8
9853 }
99- else if ($isInstanceOf(U, "ByteVector"))
54+ else if ($isInstanceOf(z, "ByteVector"))
10055 then {
101- let V = U
102- value(assetInfo(V)).decimals
56+ let A = z
57+ value(assetInfo(A)).decimals
10358 }
10459 else throw("Match error")
10560 }
106- let W = {
107- let U = R
108- if ($isInstanceOf(U, "Unit"))
61+ let B = {
62+ let z = w
63+ if ($isInstanceOf(z, "Unit"))
10964 then {
110- let V = U
65+ let A = z
11166 8
11267 }
113- else if ($isInstanceOf(U, "ByteVector"))
68+ else if ($isInstanceOf(z, "ByteVector"))
11469 then {
115- let V = U
116- value(assetInfo(V)).decimals
70+ let A = z
71+ value(assetInfo(A)).decimals
11772 }
11873 else throw("Match error")
11974 }
12075 if (isDefined(getBoolean(this, "status")))
12176 then throw("already active")
12277 else {
123- let X = ("ShareT_" + takeRight(toString(this), 5))
124- let Y = ((T + W) / 2)
125- let Z = fraction(pow(Q, T, 5, 1, T, HALFDOWN), pow(S, W, 5, 1, W, HALFDOWN), pow(10, 0, Y, 0, 0, HALFDOWN))
126- let aa = calculateAssetId(Issue(X, X, Z, Y, true))
127- let ab = {
128- let U = P
129- if ($isInstanceOf(U, "Unit"))
78+ let C = ("ShareT_" + takeRight(toString(this), 5))
79+ let D = ((y + B) / 2)
80+ let E = fraction(pow(v, y, 5, 1, y, HALFDOWN), pow(x, B, 5, 1, B, HALFDOWN), pow(10, 0, D, 0, 0, HALFDOWN))
81+ let F = calculateAssetId(Issue(C, C, E, D, true))
82+ let G = {
83+ let z = u
84+ if ($isInstanceOf(z, "Unit"))
13085 then {
131- let ac = U
86+ let H = z
13287 "WAVES"
13388 }
134- else if ($isInstanceOf(U, "ByteVector"))
89+ else if ($isInstanceOf(z, "ByteVector"))
13590 then {
136- let ac = U
137- toBase58String(value(P))
91+ let H = z
92+ toBase58String(value(u))
13893 }
13994 else throw("Match error")
14095 }
141- let ad = {
142- let U = R
143- if ($isInstanceOf(U, "Unit"))
96+ let I = {
97+ let z = w
98+ if ($isInstanceOf(z, "Unit"))
14499 then {
145- let ac = U
100+ let H = z
146101 "WAVES"
147102 }
148- else if ($isInstanceOf(U, "ByteVector"))
103+ else if ($isInstanceOf(z, "ByteVector"))
149104 then {
150- let ac = U
151- toBase58String(value(R))
105+ let H = z
106+ toBase58String(value(w))
152107 }
153108 else throw("Match error")
154109 }
155- let ae = w(Q, S)
156-[IntegerEntry("amountTokenA", Q), IntegerEntry("amountTokenB", S), StringEntry("assetIdTokenA", ab), StringEntry("assetIdTokenB", ad), IntegerEntry("invariant", ae), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", g), IntegerEntry("comissionScaleDelimiter", h), StringEntry("version", i), Issue(X, X, Z, Y, true), ScriptTransfer(M.caller, Z, aa), StringEntry("share_token_id", toBase58String(aa)), IntegerEntry("share_token_supply", Z)]
110+[IntegerEntry("amountTokenA", v), IntegerEntry("amountTokenB", x), StringEntry("assetIdTokenA", G), StringEntry("assetIdTokenB", I), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", g), IntegerEntry("comissionScaleDelimiter", h), StringEntry("version", i), Issue(C, C, E, D, true), ScriptTransfer(r.caller, E, F), BinaryEntry("share_token_id", F), IntegerEntry("share_token_supply", E)]
157111 }
158112 }
159113
160114
161115
162-@Callable(M)
163-func replenishmentWithTwoToken () = {
164- let N = value(M.payments[0])
165- let O = value(M.payments[1])
166- let P = N.assetId
167- let Q = N.amount
168- let R = O.assetId
169- let S = O.amount
170- let ae = w((d + Q), (e + S))
171- if (if ((P != J))
116+@Callable(r)
117+func replenishment () = {
118+ let s = value(r.payments[0])
119+ let t = value(r.payments[1])
120+ let u = s.assetId
121+ let v = s.amount
122+ let w = t.assetId
123+ let x = t.amount
124+ let J = getIntegerValue(this, "amountTokenA")
125+ let K = getIntegerValue(this, "amountTokenB")
126+ if (if ((u != p))
172127 then true
173- else (R != K))
128+ else (w != q))
174129 then throw("incorrect assets")
175130 else {
176- let af = (fraction(Q, (1000000000000 * 1000), d) / fraction(e, 1000000000000, S))
177- if (!(if ((af > 990))
178- then (1010 > af)
131+ let L = (fraction(v, (1000000000000 * 100000), J) / fraction(K, 1000000000000, x))
132+ if (!(if ((L > 99990))
133+ then (100010 > L)
179134 else false))
180135 then throw("incorrect assets amount")
181136 else {
182- let ag = fraction(Q, f, d)
183- if ((ag == 0))
137+ let M = fraction(v, f, J)
138+ if ((M == 0))
184139 then throw("you try replansish with very small amount")
185- else [Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenA", (d + Q)), IntegerEntry("amountTokenB", (e + S)), IntegerEntry("invariant", ae)]
140+ else [Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenA", (J + v)), IntegerEntry("amountTokenB", (K + x))]
186141 }
187142 }
188143 }
189144
190145
191146
192-@Callable(M)
193-func replanishmentWithOneToken (ah,ai) = {
194- let aj = value(M.payments[0])
195- let ak = aj.assetId
196- let F = aj.amount
197- if ((ak == J))
147+@Callable(r)
148+func replanishmentWithOneToken () = {
149+ let N = value(r.payments[0])
150+ let O = N.assetId
151+ let P = N.amount
152+ if ((O == p))
198153 then {
199- let al = (d + F)
200- let am = w(al, e)
201- let an = fraction(al, k, e)
202- let ao = fraction(ai, an, ah)
203- if (if ((ao > n))
204- then true
205- else (o > ao))
206- then throw("incorrect function args: price")
207- else {
208- let ap = w(ah, ai)
209- let aq = fraction(ap, k, j)
210- if (if ((aq > n))
211- then true
212- else (o > aq))
213- then throw("incorrect function args: invariant")
214- else {
215- let ar = fraction(ai, f, e)
216- let ag = (ar - f)
217-[Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenA", al), IntegerEntry("invariant", am)]
218- }
219- }
154+ let Q = (d + P)
155+ let R = fraction(Q, j, c)
156+ let S = pow(fraction(d, c, R), 0, 5, 1, 0, HALFDOWN)
157+ let T = fraction(c, f, S)
158+ let M = (T - f)
159+[Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenA", Q)]
220160 }
221- else if ((ak == K))
161+ else if ((O == q))
222162 then {
223- let as = (e + F)
224- let am = w(d, as)
225- let an = fraction(d, k, as)
226- let ao = fraction(ai, an, ah)
227- if (if ((ao > n))
228- then true
229- else (o > ao))
230- then throw("incorrect function args: price")
231- else {
232- let ap = w(ah, ai)
233- let aq = fraction(ap, k, j)
234- if (if ((aq > n))
235- then true
236- else (o > aq))
237- then throw("incorrect function args: invariant")
238- else {
239- let ar = fraction(ai, f, e)
240- let ag = (ar - f)
241-[Reissue(L, ag, true), ScriptTransfer(M.caller, ag, L), IntegerEntry("share_token_supply", (f + ag)), IntegerEntry("amountTokenB", as), IntegerEntry("invariant", am)]
242- }
243- }
163+ let U = (c + P)
164+ let R = fraction(d, j, U)
165+ let S = pow(fraction(d, c, R), 0, 5, 1, 0, HALFDOWN)
166+ let T = fraction(c, f, S)
167+ let M = (T - f)
168+[Reissue(e, M, true), ScriptTransfer(r.caller, M, e), IntegerEntry("share_token_supply", (f + M)), IntegerEntry("amountTokenB", U)]
244169 }
245170 else throw("incorrect assets in payment")
246171 }
247172
248173
249174
250-@Callable(M)
175+@Callable(r)
251176 func withdraw () = {
252- let aj = value(M.payments[0])
253- let ak = aj.assetId
254- let F = aj.amount
255- if ((L != ak))
256- then throw(("you need to attach share token for this dApp " + toBase58String(L)))
177+ let J = getIntegerValue(this, "amountTokenA")
178+ let K = getIntegerValue(this, "amountTokenB")
179+ let N = value(r.payments[0])
180+ let O = N.assetId
181+ let P = N.amount
182+ if ((e != O))
183+ then throw(("you need to attach share token for this dApp " + toBase58String(e)))
257184 else {
258- let at = fraction(F, d, f)
259- let au = fraction(F, e, f)
260- let ae = w((d - at), (e - au))
261-[IntegerEntry("amountTokenA", (d - at)), IntegerEntry("amountTokenB", (e - au)), IntegerEntry("share_token_supply", (f - F)), ScriptTransfer(M.caller, at, J), ScriptTransfer(M.caller, au, K), Burn(L, F), IntegerEntry("invariant", ae)]
185+ let V = fraction(P, J, f)
186+ let W = fraction(P, K, f)
187+[ScriptTransfer(r.caller, V, p), ScriptTransfer(r.caller, W, q), IntegerEntry("amountTokenA", (J - V)), IntegerEntry("amountTokenB", (K - W)), IntegerEntry("share_token_supply", (f - P)), Burn(e, P)]
262188 }
263189 }
264190
265191
266192
267-@Callable(M)
268-func exchanger (B,C) = {
269- let E = getIntegerValue(this, "amountTokenB")
270- let D = getIntegerValue(this, "amountTokenA")
271- let aj = value(M.payments[0])
272- let ak = aj.assetId
273- let F = aj.amount
274- let av = {
275- let U = getInteger(this, "exchange_count")
276- if ($isInstanceOf(U, "Int"))
193+@Callable(r)
194+func exchanger (X) = {
195+ let N = value(r.payments[0])
196+ let O = N.assetId
197+ let P = N.amount
198+ let Y = value(getInteger(this, "exchange_count"))
199+ if ((O == q))
200+ then {
201+ let Z = ((fraction(d, P, (P + c)) * (h - g)) / h)
202+ if ((X > Z))
203+ then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
204+ else {
205+ let aa = p
206+[IntegerEntry("amountTokenA", (d - Z)), IntegerEntry("amountTokenB", (c + P)), IntegerEntry("exchange_count", (Y + 1)), ScriptTransfer(r.caller, Z, aa)]
207+ }
208+ }
209+ else if ((O == p))
277210 then {
278- let aw = U
279- (value(getInteger(this, "exchange_count")) + aw)
280- }
281- else 0
282- }
283- if ((ak == K))
284- then {
285- let ax = A(B, C, D, E, F)
286- let ay = J
287-[IntegerEntry("amountTokenA", (D - ax)), IntegerEntry("amountTokenB", (E + F)), IntegerEntry("exchange_count", (av + 1)), IntegerEntry("invariant", w((D - ax), (E + F))), ScriptTransfer(M.caller, ax, ay)]
288- }
289- else if ((ak == J))
290- then {
291- let ax = I(B, C, D, E, F)
292- let ay = K
293-[IntegerEntry("amountTokenA", (D + F)), IntegerEntry("amountTokenB", (E - ax)), IntegerEntry("exchange_count", (av + 1)), IntegerEntry("invariant", w((D + F), (E - ax))), ScriptTransfer(M.caller, ax, ay)]
211+ let Z = ((fraction(c, P, (P + d)) * (h - g)) / h)
212+ if ((X > Z))
213+ then throw("Price has changed dramaticaly. Receiving token amount don't satisfy specified price level")
214+ else {
215+ let aa = q
216+[IntegerEntry("amountTokenA", (d + P)), IntegerEntry("amountTokenB", (c - Z)), IntegerEntry("exchange_count", (Y + 1)), ScriptTransfer(r.caller, Z, aa)]
217+ }
294218 }
295219 else throw("Asset is not allowed")
296220 }
297221
298222

github/deemru/w8io/169f3d6 
69.42 ms