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:AAIEAAAAAAAAAA8IAhIAEgASABIAEgMKAQEAAAAQAAAAAAhJZFRva2VuQQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAANYXNzZXRJZFRva2VuQQAAAAAISWRUb2tlbkIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAADWFzc2V0SWRUb2tlbkIAAAAADGFtb3VudFRva2VuQgkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAMYW1vdW50VG9rZW5CAAAAAAxhbW91bnRUb2tlbkEJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQQAAAAARYXNzZXRJZFRva2VuU2hhcmUJAQAAABFAZXh0ck5hdGl2ZSgxMDUyKQAAAAIFAAAABHRoaXMCAAAADnNoYXJlX3Rva2VuX2lkAAAAABB0b2tlblNoYXJlU3VwcGx5CQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAABJzaGFyZV90b2tlbl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AAAA1hc3NldElkVG9rZW5CCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxhbW91bnRUb2tlbkEJAABkAAAAAgUAAAAMYW1vdW50VG9rZW5BBQAAABJ0b2tlblJlY2VpdmVBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADGFtb3VudFRva2VuQgkAAGUAAAACBQAAAAxhbW91bnRUb2tlbkIFAAAAD3Rva2VuU2VuZEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAOZXhjaGFuZ2VfY291bnQJAABkAAAAAgUAAAAFY291bnQAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAACmNvbnRleHRPYmoAAAAGY2FsbGVyBQAAAA90b2tlblNlbmRBbW91bnQFAAAAC2Fzc2V0SWRTZW50BQAAAANuaWwJAAACAAAAAQIAAAAUQXNzZXQgaXMgbm90IGFsbG93ZWQAAAAA2SK/xA==", "chainId": 84, "height": 1232163, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3FUGuFpzbYabvBrmuP7MrXCJY6eQydXzPvJdb1BCu4YJ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = getStringValue(this, "assetIdTokenB") | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = getIntegerValue(this, "amountTokenB") | |
9 | 9 | ||
10 | 10 | let d = getIntegerValue(this, "amountTokenA") | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = getBinaryValue(this, "share_token_id") | |
13 | 13 | ||
14 | 14 | let f = getIntegerValue(this, "share_token_supply") | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 500 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 1000000 | |
19 | 19 | ||
20 | - | let i = " | |
20 | + | let i = "1.0.0" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 100000000 | |
23 | 23 | ||
24 | 24 | let k = 100000000 | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = 99999000 | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = 8 | |
29 | 29 | ||
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) | |
43 | 33 | ||
44 | 34 | ||
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) | |
49 | 36 | ||
37 | + | let q = n(b) | |
50 | 38 | ||
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) | |
85 | 40 | func fund () = { | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | if ($isInstanceOf( | |
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")) | |
95 | 50 | then { | |
96 | - | let | |
51 | + | let A = z | |
97 | 52 | 8 | |
98 | 53 | } | |
99 | - | else if ($isInstanceOf( | |
54 | + | else if ($isInstanceOf(z, "ByteVector")) | |
100 | 55 | then { | |
101 | - | let | |
102 | - | value(assetInfo( | |
56 | + | let A = z | |
57 | + | value(assetInfo(A)).decimals | |
103 | 58 | } | |
104 | 59 | else throw("Match error") | |
105 | 60 | } | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
61 | + | let B = { | |
62 | + | let z = w | |
63 | + | if ($isInstanceOf(z, "Unit")) | |
109 | 64 | then { | |
110 | - | let | |
65 | + | let A = z | |
111 | 66 | 8 | |
112 | 67 | } | |
113 | - | else if ($isInstanceOf( | |
68 | + | else if ($isInstanceOf(z, "ByteVector")) | |
114 | 69 | then { | |
115 | - | let | |
116 | - | value(assetInfo( | |
70 | + | let A = z | |
71 | + | value(assetInfo(A)).decimals | |
117 | 72 | } | |
118 | 73 | else throw("Match error") | |
119 | 74 | } | |
120 | 75 | if (isDefined(getBoolean(this, "status"))) | |
121 | 76 | then throw("already active") | |
122 | 77 | else { | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | if ($isInstanceOf( | |
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")) | |
130 | 85 | then { | |
131 | - | let | |
86 | + | let H = z | |
132 | 87 | "WAVES" | |
133 | 88 | } | |
134 | - | else if ($isInstanceOf( | |
89 | + | else if ($isInstanceOf(z, "ByteVector")) | |
135 | 90 | then { | |
136 | - | let | |
137 | - | toBase58String(value( | |
91 | + | let H = z | |
92 | + | toBase58String(value(u)) | |
138 | 93 | } | |
139 | 94 | else throw("Match error") | |
140 | 95 | } | |
141 | - | let | |
142 | - | let | |
143 | - | if ($isInstanceOf( | |
96 | + | let I = { | |
97 | + | let z = w | |
98 | + | if ($isInstanceOf(z, "Unit")) | |
144 | 99 | then { | |
145 | - | let | |
100 | + | let H = z | |
146 | 101 | "WAVES" | |
147 | 102 | } | |
148 | - | else if ($isInstanceOf( | |
103 | + | else if ($isInstanceOf(z, "ByteVector")) | |
149 | 104 | then { | |
150 | - | let | |
151 | - | toBase58String(value( | |
105 | + | let H = z | |
106 | + | toBase58String(value(w)) | |
152 | 107 | } | |
153 | 108 | else throw("Match error") | |
154 | 109 | } | |
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)] | |
157 | 111 | } | |
158 | 112 | } | |
159 | 113 | ||
160 | 114 | ||
161 | 115 | ||
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)) | |
172 | 127 | then true | |
173 | - | else ( | |
128 | + | else (w != q)) | |
174 | 129 | then throw("incorrect assets") | |
175 | 130 | else { | |
176 | - | let | |
177 | - | if (!(if (( | |
178 | - | then ( | |
131 | + | let L = (fraction(v, (1000000000000 * 100000), J) / fraction(K, 1000000000000, x)) | |
132 | + | if (!(if ((L > 99990)) | |
133 | + | then (100010 > L) | |
179 | 134 | else false)) | |
180 | 135 | then throw("incorrect assets amount") | |
181 | 136 | else { | |
182 | - | let | |
183 | - | if (( | |
137 | + | let M = fraction(v, f, J) | |
138 | + | if ((M == 0)) | |
184 | 139 | then throw("you try replansish with very small amount") | |
185 | - | else [Reissue( | |
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))] | |
186 | 141 | } | |
187 | 142 | } | |
188 | 143 | } | |
189 | 144 | ||
190 | 145 | ||
191 | 146 | ||
192 | - | @Callable( | |
193 | - | func replanishmentWithOneToken ( | |
194 | - | let | |
195 | - | let | |
196 | - | let | |
197 | - | if (( | |
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)) | |
198 | 153 | 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)] | |
220 | 160 | } | |
221 | - | else if (( | |
161 | + | else if ((O == q)) | |
222 | 162 | 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)] | |
244 | 169 | } | |
245 | 170 | else throw("incorrect assets in payment") | |
246 | 171 | } | |
247 | 172 | ||
248 | 173 | ||
249 | 174 | ||
250 | - | @Callable( | |
175 | + | @Callable(r) | |
251 | 176 | 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))) | |
257 | 184 | 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)] | |
262 | 188 | } | |
263 | 189 | } | |
264 | 190 | ||
265 | 191 | ||
266 | 192 | ||
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)) | |
277 | 210 | 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 | + | } | |
294 | 218 | } | |
295 | 219 | else throw("Asset is not allowed") | |
296 | 220 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = getStringValue(this, "assetIdTokenA") | |
5 | 5 | ||
6 | 6 | let b = getStringValue(this, "assetIdTokenB") | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = getIntegerValue(this, "amountTokenB") | |
9 | 9 | ||
10 | 10 | let d = getIntegerValue(this, "amountTokenA") | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = getBinaryValue(this, "share_token_id") | |
13 | 13 | ||
14 | 14 | let f = getIntegerValue(this, "share_token_supply") | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 500 | |
17 | 17 | ||
18 | - | let h = | |
18 | + | let h = 1000000 | |
19 | 19 | ||
20 | - | let i = " | |
20 | + | let i = "1.0.0" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = 100000000 | |
23 | 23 | ||
24 | 24 | let k = 100000000 | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = 99999000 | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = 8 | |
29 | 29 | ||
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) | |
43 | 33 | ||
44 | 34 | ||
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) | |
49 | 36 | ||
37 | + | let q = n(b) | |
50 | 38 | ||
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) | |
85 | 40 | func fund () = { | |
86 | - | let | |
87 | - | let | |
88 | - | let | |
89 | - | let | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | if ($isInstanceOf( | |
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")) | |
95 | 50 | then { | |
96 | - | let | |
51 | + | let A = z | |
97 | 52 | 8 | |
98 | 53 | } | |
99 | - | else if ($isInstanceOf( | |
54 | + | else if ($isInstanceOf(z, "ByteVector")) | |
100 | 55 | then { | |
101 | - | let | |
102 | - | value(assetInfo( | |
56 | + | let A = z | |
57 | + | value(assetInfo(A)).decimals | |
103 | 58 | } | |
104 | 59 | else throw("Match error") | |
105 | 60 | } | |
106 | - | let | |
107 | - | let | |
108 | - | if ($isInstanceOf( | |
61 | + | let B = { | |
62 | + | let z = w | |
63 | + | if ($isInstanceOf(z, "Unit")) | |
109 | 64 | then { | |
110 | - | let | |
65 | + | let A = z | |
111 | 66 | 8 | |
112 | 67 | } | |
113 | - | else if ($isInstanceOf( | |
68 | + | else if ($isInstanceOf(z, "ByteVector")) | |
114 | 69 | then { | |
115 | - | let | |
116 | - | value(assetInfo( | |
70 | + | let A = z | |
71 | + | value(assetInfo(A)).decimals | |
117 | 72 | } | |
118 | 73 | else throw("Match error") | |
119 | 74 | } | |
120 | 75 | if (isDefined(getBoolean(this, "status"))) | |
121 | 76 | then throw("already active") | |
122 | 77 | else { | |
123 | - | let | |
124 | - | let | |
125 | - | let | |
126 | - | let | |
127 | - | let | |
128 | - | let | |
129 | - | if ($isInstanceOf( | |
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")) | |
130 | 85 | then { | |
131 | - | let | |
86 | + | let H = z | |
132 | 87 | "WAVES" | |
133 | 88 | } | |
134 | - | else if ($isInstanceOf( | |
89 | + | else if ($isInstanceOf(z, "ByteVector")) | |
135 | 90 | then { | |
136 | - | let | |
137 | - | toBase58String(value( | |
91 | + | let H = z | |
92 | + | toBase58String(value(u)) | |
138 | 93 | } | |
139 | 94 | else throw("Match error") | |
140 | 95 | } | |
141 | - | let | |
142 | - | let | |
143 | - | if ($isInstanceOf( | |
96 | + | let I = { | |
97 | + | let z = w | |
98 | + | if ($isInstanceOf(z, "Unit")) | |
144 | 99 | then { | |
145 | - | let | |
100 | + | let H = z | |
146 | 101 | "WAVES" | |
147 | 102 | } | |
148 | - | else if ($isInstanceOf( | |
103 | + | else if ($isInstanceOf(z, "ByteVector")) | |
149 | 104 | then { | |
150 | - | let | |
151 | - | toBase58String(value( | |
105 | + | let H = z | |
106 | + | toBase58String(value(w)) | |
152 | 107 | } | |
153 | 108 | else throw("Match error") | |
154 | 109 | } | |
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)] | |
157 | 111 | } | |
158 | 112 | } | |
159 | 113 | ||
160 | 114 | ||
161 | 115 | ||
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)) | |
172 | 127 | then true | |
173 | - | else ( | |
128 | + | else (w != q)) | |
174 | 129 | then throw("incorrect assets") | |
175 | 130 | else { | |
176 | - | let | |
177 | - | if (!(if (( | |
178 | - | then ( | |
131 | + | let L = (fraction(v, (1000000000000 * 100000), J) / fraction(K, 1000000000000, x)) | |
132 | + | if (!(if ((L > 99990)) | |
133 | + | then (100010 > L) | |
179 | 134 | else false)) | |
180 | 135 | then throw("incorrect assets amount") | |
181 | 136 | else { | |
182 | - | let | |
183 | - | if (( | |
137 | + | let M = fraction(v, f, J) | |
138 | + | if ((M == 0)) | |
184 | 139 | then throw("you try replansish with very small amount") | |
185 | - | else [Reissue( | |
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))] | |
186 | 141 | } | |
187 | 142 | } | |
188 | 143 | } | |
189 | 144 | ||
190 | 145 | ||
191 | 146 | ||
192 | - | @Callable( | |
193 | - | func replanishmentWithOneToken ( | |
194 | - | let | |
195 | - | let | |
196 | - | let | |
197 | - | if (( | |
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)) | |
198 | 153 | 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)] | |
220 | 160 | } | |
221 | - | else if (( | |
161 | + | else if ((O == q)) | |
222 | 162 | 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)] | |
244 | 169 | } | |
245 | 170 | else throw("incorrect assets in payment") | |
246 | 171 | } | |
247 | 172 | ||
248 | 173 | ||
249 | 174 | ||
250 | - | @Callable( | |
175 | + | @Callable(r) | |
251 | 176 | 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))) | |
257 | 184 | 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)] | |
262 | 188 | } | |
263 | 189 | } | |
264 | 190 | ||
265 | 191 | ||
266 | 192 | ||
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)) | |
277 | 210 | 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 | + | } | |
294 | 218 | } | |
295 | 219 | else throw("Asset is not allowed") | |
296 | 220 | } | |
297 | 221 | ||
298 | 222 |
github/deemru/w8io/169f3d6 69.42 ms ◑