tx · D3HqXfxmoJK1aYh6j8DmK6VQ4Ev4jvdMm6Djso6Xqcos 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT: -0.03100000 Waves 2022.12.09 09:33 [2352430] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves
{ "type": 13, "id": "D3HqXfxmoJK1aYh6j8DmK6VQ4Ev4jvdMm6Djso6Xqcos", "fee": 3100000, "feeAssetId": null, "timestamp": 1670567515976, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "nqwcqTvEEXjTh8vMa8NNU7B3wjXHz7UY1Eih5UDdhr8oMhHtGiFYJx5J64cdAsjjyVEb98PxqiHNb46apXr1Qb6" ], "script": "base64:BgKhIggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCBIAIgZzY2FsZTgiDHNjYWxlOEJpZ0ludCIHc2NhbGUxOCIKemVyb0JpZ0ludCIEYmlnMCIEYmlnMSIEYmlnMiIKc2xpcHBhZ2U0RCILd2F2ZXNTdHJpbmciBUFtdWx0IgVEY29udiIDU0VQIgVFTVBUWSIKUG9vbEFjdGl2ZSIKUG9vbFB1dERpcyIOUG9vbE1hdGNoZXJEaXMiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiCWlkeFBvb2xTdCIJaWR4TFBBc0lkIglpZHhBbUFzSWQiCWlkeFByQXNJZCILaWR4QW10QXNEY20iDWlkeFByaWNlQXNEY20iC2lkeElBbXRBc0lkIg1pZHhJUHJpY2VBc0lkIg9pZHhGYWN0U3Rha0Nud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WAZzY3JpcHQEAmdVCQDbBAEJAQV2YWx1ZQEJAJ0IAgUCYUYJAQJhcQAEAmdWCQDxBwEFBHRoaXMDAwkAAAIFAmdVBQJnVAkBAiE9AgUCZ1YFAmdUBwYJAPQDAwgFAmdNCWJvZHlCeXRlcwkAkQMCCAUCZ00GcHJvb2ZzAAAFAmdPCQD0AwMIBQJnTQlib2R5Qnl0ZXMJAJEDAggFAmdNBnByb29mcwAABQJnT6kdqhQ=", "chainId": 84, "height": 2352430, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HtqZBdmkGa8XV7JaW6AFRiLZcB3LzjdoLC8XUgTUtmd7 Next: 2C6YVhaGZyj5ZAEGQDBGjGVhoV13tJvK2cAYiNeWRdaJ Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | let g = toBigInt(2) | |
17 | 17 | ||
18 | - | let h = toBigInt( | |
18 | + | let h = toBigInt((a - ((a * 1) / a))) | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "WAVES" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "100" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "1" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "__" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 1 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 2 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 3 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 4 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 1 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 3 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 4 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 5 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 6 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 7 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 8 | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = 9 | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = 1 | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = 6 | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = 7 | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = 10 | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = fraction(10, a, 10000) | |
65 | 65 | ||
66 | - | let F = 10 | |
67 | - | ||
68 | - | let G = fraction(10, a, 10000) | |
69 | - | ||
70 | - | func H (I,J) = fraction(toBigInt(I), c, toBigInt(J)) | |
66 | + | func F (G,H) = fraction(toBigInt(G), c, toBigInt(H)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func I (J,K) = toInt(fraction(J, toBigInt(K), c)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func | |
72 | + | func L (M,N,O) = fraction(M, N, O) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func | |
80 | - | then -( | |
81 | - | else | |
75 | + | func P (J) = if ((d > J)) | |
76 | + | then -(J) | |
77 | + | else J | |
82 | 78 | ||
83 | 79 | ||
84 | - | func | |
85 | - | then -( | |
86 | - | else | |
80 | + | func Q (J) = if ((d > J)) | |
81 | + | then -(J) | |
82 | + | else J | |
87 | 83 | ||
88 | 84 | ||
89 | - | func | |
85 | + | func R () = "%s__factoryContract" | |
90 | 86 | ||
91 | 87 | ||
92 | - | func | |
88 | + | func S () = "%s__managerPublicKey" | |
93 | 89 | ||
94 | 90 | ||
95 | - | func | |
91 | + | func T () = "%s__pendingManagerPublicKey" | |
96 | 92 | ||
97 | 93 | ||
98 | - | func | |
94 | + | func U () = "%s%s__price__last" | |
99 | 95 | ||
100 | 96 | ||
101 | - | func | |
97 | + | func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l) | |
102 | 98 | ||
103 | 99 | ||
104 | - | func | |
100 | + | func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa) | |
105 | 101 | ||
106 | 102 | ||
107 | - | func | |
103 | + | func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa) | |
108 | 104 | ||
109 | 105 | ||
110 | - | func | |
106 | + | func ac () = "%s__amountAsset" | |
111 | 107 | ||
112 | 108 | ||
113 | - | func | |
109 | + | func ad () = "%s__priceAsset" | |
114 | 110 | ||
115 | 111 | ||
116 | - | func | |
112 | + | func ae () = "%s__amp" | |
117 | 113 | ||
118 | 114 | ||
119 | - | func | |
115 | + | func af () = "%s__addonAddr" | |
120 | 116 | ||
121 | 117 | ||
122 | - | let | |
118 | + | let ag = "%s__fee" | |
123 | 119 | ||
124 | - | let | |
120 | + | let ah = valueOrElse(getInteger(this, ag), E) | |
125 | 121 | ||
126 | - | let ak = makeString(["%s", "dLp"], n) | |
127 | - | ||
128 | - | let al = makeString(["%s", "dLpRefreshedHeight"], n) | |
129 | - | ||
130 | - | let am = makeString(["%s", "refreshDLpDelay"], n) | |
131 | - | ||
132 | - | let an = 1 | |
133 | - | ||
134 | - | let ao = valueOrElse(getInteger(this, am), an) | |
135 | - | ||
136 | - | func ap () = "%s__factoryConfig" | |
122 | + | func ai () = "%s__factoryConfig" | |
137 | 123 | ||
138 | 124 | ||
139 | - | func | |
125 | + | func aj () = "%s%s__matcher__publicKey" | |
140 | 126 | ||
141 | 127 | ||
142 | - | func | |
128 | + | func ak (al,am) = (((("%d%d%s__" + al) + "__") + am) + "__config") | |
143 | 129 | ||
144 | 130 | ||
145 | - | func | |
131 | + | func an (ao) = ("%s%s%s__mappings__baseAsset2internalId__" + ao) | |
146 | 132 | ||
147 | 133 | ||
148 | - | func | |
134 | + | func ap () = "%s__shutdown" | |
149 | 135 | ||
150 | 136 | ||
151 | - | func | |
137 | + | func aq () = "%s__allowedLpStableScriptHash" | |
152 | 138 | ||
153 | 139 | ||
154 | - | func | |
140 | + | func ar () = "%s__feeCollectorAddress" | |
155 | 141 | ||
156 | 142 | ||
157 | - | func | |
143 | + | func as (at,au,av) = throw(((((("Failed: ordValid=" + toString(at)) + " sndrValid=") + toString(au)) + " mtchrValid=") + toString(av))) | |
158 | 144 | ||
159 | 145 | ||
160 | - | func | |
161 | - | let | |
162 | - | if ($isInstanceOf( | |
146 | + | func aw (J) = { | |
147 | + | let ax = J | |
148 | + | if ($isInstanceOf(ax, "String")) | |
163 | 149 | then { | |
164 | - | let | |
165 | - | | |
150 | + | let ay = ax | |
151 | + | ay | |
166 | 152 | } | |
167 | 153 | else throw("fail cast to String") | |
168 | 154 | } | |
169 | 155 | ||
170 | 156 | ||
171 | - | func | |
157 | + | func az (aA,aB) = valueOrErrorMessage(getString(aA, aB), makeString(["mandatory ", toString(aA), ".", aB, " not defined"], "")) | |
172 | 158 | ||
173 | 159 | ||
174 | - | func | |
160 | + | func aC (aA,aB) = valueOrErrorMessage(getInteger(aA, aB), makeString(["mandatory ", toString(aA), ".", aB, " not defined"], "")) | |
175 | 161 | ||
176 | 162 | ||
177 | - | func | |
163 | + | func aD (aE) = throw(makeString(["lp_stable.ride:", aE], " ")) | |
178 | 164 | ||
179 | 165 | ||
180 | - | func aM (aL) = makeString(["lp_stable.ride:", aL], " ") | |
166 | + | let aF = addressFromStringValue(az(this, R())) | |
167 | + | ||
168 | + | let aG = az(this, ae()) | |
169 | + | ||
170 | + | func aH () = valueOrElse(getBoolean(aF, ap()), false) | |
181 | 171 | ||
182 | 172 | ||
183 | - | let aN = addressFromStringValue(aG(this, T())) | |
184 | - | ||
185 | - | let aO = aG(this, ag()) | |
186 | - | ||
187 | - | func aP () = valueOrElse(getBoolean(aN, aw()), false) | |
173 | + | func aI () = fromBase58String(az(aF, aj())) | |
188 | 174 | ||
189 | 175 | ||
190 | - | ||
176 | + | let aJ = addressFromStringValue(az(aF, ar())) | |
191 | 177 | ||
192 | - | ||
193 | - | let aR = addressFromStringValue(aG(aN, ay())) | |
194 | - | ||
195 | - | func aS () = { | |
196 | - | let aT = aG(this, ae()) | |
197 | - | let aU = aG(this, af()) | |
198 | - | let aV = aJ(aN, au(aU)) | |
199 | - | let as = aJ(aN, au(aT)) | |
200 | - | split(aG(aN, ar(toString(as), toString(aV))), n) | |
178 | + | func aK () = { | |
179 | + | let aL = az(this, ac()) | |
180 | + | let aM = az(this, ad()) | |
181 | + | let aN = aC(aF, an(aM)) | |
182 | + | let al = aC(aF, an(aL)) | |
183 | + | split(az(aF, ak(toString(al), toString(aN))), l) | |
201 | 184 | } | |
202 | 185 | ||
203 | 186 | ||
204 | - | func | |
187 | + | func aO (aP) = if ((aP == i)) | |
205 | 188 | then unit | |
206 | - | else fromBase58String( | |
189 | + | else fromBase58String(aP) | |
207 | 190 | ||
208 | 191 | ||
209 | - | func | |
210 | - | then | |
211 | - | else toBase58String(value( | |
192 | + | func aQ (aP) = if ((aP == unit)) | |
193 | + | then i | |
194 | + | else toBase58String(value(aP)) | |
212 | 195 | ||
213 | 196 | ||
214 | - | func | |
197 | + | func aR (aS) = $Tuple7(addressFromStringValue(aS[r]), parseIntValue(aS[s]), fromBase58String(aS[t]), aO(aS[u]), aO(aS[v]), parseIntValue(aS[w]), parseIntValue(aS[x])) | |
215 | 198 | ||
216 | 199 | ||
217 | - | let | |
200 | + | let aT = aR(aK()) | |
218 | 201 | ||
219 | - | let | |
202 | + | let aU = aT | |
220 | 203 | ||
221 | - | let | |
204 | + | let aV = aU._1 | |
222 | 205 | ||
223 | - | let | |
206 | + | let aW = aU._2 | |
224 | 207 | ||
225 | - | let | |
208 | + | let aX = aU._3 | |
226 | 209 | ||
227 | - | let | |
210 | + | let aY = aU._4 | |
228 | 211 | ||
229 | - | let | |
212 | + | let aZ = aU._5 | |
230 | 213 | ||
231 | - | let | |
214 | + | let ba = aU._6 | |
232 | 215 | ||
233 | - | let | |
216 | + | let bb = aU._7 | |
234 | 217 | ||
235 | - | func | |
218 | + | func bc () = split(az(aF, ai()), l) | |
236 | 219 | ||
237 | 220 | ||
238 | - | let | |
221 | + | let bd = bc() | |
239 | 222 | ||
240 | - | let | |
223 | + | let be = valueOrErrorMessage(addressFromString(bd[A]), "Invalid staking contract address") | |
241 | 224 | ||
242 | - | let | |
225 | + | let bf = valueOrErrorMessage(addressFromString(bd[C]), "Invalid slipage contract address") | |
243 | 226 | ||
244 | - | let | |
227 | + | let bg = valueOrErrorMessage(addressFromString(bd[D]), "Invalid gwx contract address") | |
245 | 228 | ||
246 | - | let | |
229 | + | let bh = valueOrErrorMessage(addressFromString(bd[B]), "Invalid gwx contract address") | |
247 | 230 | ||
248 | - | func | |
231 | + | func bi (bj,bk,bl,bm,bn,bo,bp,bq,br,bs) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bj), toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs)], l) | |
249 | 232 | ||
250 | 233 | ||
251 | - | func | |
234 | + | func bt (bu,bv,bw,bm,bp,bq) = makeString(["%d%d%d%d%d%d", toString(bu), toString(bv), toString(bw), toString(bm), toString(bp), toString(bq)], l) | |
252 | 235 | ||
253 | 236 | ||
254 | - | func | |
237 | + | func bx (by) = if ((by == "WAVES")) | |
255 | 238 | then wavesBalance(this).available | |
256 | - | else assetBalance(this, fromBase58String( | |
239 | + | else assetBalance(this, fromBase58String(by)) | |
257 | 240 | ||
258 | 241 | ||
259 | - | func | |
242 | + | func bz (bA,bB) = fraction(bA, c, bB) | |
260 | 243 | ||
261 | 244 | ||
262 | - | func | |
263 | - | let | |
264 | - | let | |
265 | - | if (!( | |
266 | - | then throw(("Big slpg: " + toString( | |
267 | - | else $Tuple2( | |
245 | + | func bC (bD,bE,bF) = { | |
246 | + | let bG = fraction((bD - bE), b, bE) | |
247 | + | let bH = ((bF - P(bG)) > d) | |
248 | + | if (!(bH)) | |
249 | + | then throw(("Big slpg: " + toString(bG))) | |
250 | + | else $Tuple2(bH, min([bD, bE])) | |
268 | 251 | } | |
269 | 252 | ||
270 | 253 | ||
271 | - | func | |
272 | - | let | |
273 | - | let | |
274 | - | if (if ( | |
254 | + | func bI (bJ,bK,bL) = { | |
255 | + | let bG = fraction(bK, b, bJ) | |
256 | + | let bM = (bL > bG) | |
257 | + | if (if (bM) | |
275 | 258 | then true | |
276 | - | else ( | |
277 | - | then throw(((((((toString( | |
278 | - | else | |
259 | + | else (bK > bJ)) | |
260 | + | then throw(((((((toString(bK) + " ") + toString(bJ)) + " ") + toString(bG)) + " ") + toString(bL))) | |
261 | + | else bM | |
279 | 262 | } | |
280 | 263 | ||
281 | 264 | ||
282 | - | func | |
283 | - | let | |
284 | - | let | |
285 | - | | |
265 | + | func bN (bO,bP,bQ,bR) = { | |
266 | + | let bS = F(bQ, bO) | |
267 | + | let bT = F(bR, bP) | |
268 | + | bz(bT, bS) | |
286 | 269 | } | |
287 | 270 | ||
288 | 271 | ||
289 | - | func | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | [ | |
272 | + | func bU (bQ,bR,bV) = { | |
273 | + | let bW = aK() | |
274 | + | let bX = parseIntValue(bW[w]) | |
275 | + | let bY = parseIntValue(bW[x]) | |
276 | + | let bZ = bN(bX, bY, bQ, bR) | |
277 | + | let bB = F(bQ, bX) | |
278 | + | let bA = F(bR, bY) | |
279 | + | let ca = F(bV, a) | |
280 | + | let cb = bz(bB, ca) | |
281 | + | let cc = bz(bA, ca) | |
282 | + | [bZ, cb, cc] | |
300 | 283 | } | |
301 | 284 | ||
302 | 285 | ||
303 | - | func | |
304 | - | let | |
305 | - | [ | |
286 | + | func cd (bQ,bR,bV) = { | |
287 | + | let ce = bU(bQ, bR, bV) | |
288 | + | [I(ce[0], a), I(ce[1], a), I(ce[2], a)] | |
306 | 289 | } | |
307 | 290 | ||
308 | 291 | ||
309 | - | func | |
310 | - | let | |
311 | - | $Tuple2(( | |
292 | + | func cf (cg) = { | |
293 | + | let ch = fraction(cg, ah, a) | |
294 | + | $Tuple2((cg - ch), ch) | |
312 | 295 | } | |
313 | 296 | ||
314 | 297 | ||
315 | - | func | |
316 | - | let | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | let | |
323 | - | let | |
324 | - | if (( | |
298 | + | func ci (cj,ck,cl,cm) = { | |
299 | + | let bW = aK() | |
300 | + | let cn = bW[t] | |
301 | + | let co = bW[u] | |
302 | + | let cp = bW[v] | |
303 | + | let cq = parseIntValue(bW[w]) | |
304 | + | let cr = parseIntValue(bW[x]) | |
305 | + | let cs = bW[s] | |
306 | + | let ct = valueOrErrorMessage(assetInfo(fromBase58String(cn)), "Wrong LP id").quantity | |
307 | + | if ((cn != ck)) | |
325 | 308 | then throw("Wrong pmt asset") | |
326 | 309 | else { | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
335 | - | let | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | let | |
310 | + | let cu = bx(co) | |
311 | + | let cv = F(cu, cq) | |
312 | + | let cw = bx(cp) | |
313 | + | let cx = F(cw, cr) | |
314 | + | let cy = bz(cx, cv) | |
315 | + | let cz = I(cy, a) | |
316 | + | let cA = F(cl, a) | |
317 | + | let cB = F(ct, a) | |
318 | + | let cC = fraction(cv, cA, cB) | |
319 | + | let cD = fraction(cx, cA, cB) | |
320 | + | let cE = I(cC, cq) | |
321 | + | let cF = I(cD, cr) | |
322 | + | let cG = if ((cj == "")) | |
340 | 323 | then nil | |
341 | - | else [ScriptTransfer( | |
324 | + | else [ScriptTransfer(cm, cE, if ((co == "WAVES")) | |
342 | 325 | then unit | |
343 | - | else fromBase58String( | |
326 | + | else fromBase58String(co)), ScriptTransfer(cm, cF, if ((cp == "WAVES")) | |
344 | 327 | then unit | |
345 | - | else fromBase58String( | |
346 | - | $Tuple10( | |
328 | + | else fromBase58String(cp)), StringEntry(ab(toString(cm), cj), bt(cE, cF, cl, cz, height, lastBlock.timestamp)), IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz)] | |
329 | + | $Tuple10(cE, cF, co, cp, cu, cw, ct, cy, cs, cG) | |
347 | 330 | } | |
348 | 331 | } | |
349 | 332 | ||
350 | 333 | ||
351 | - | func | |
352 | - | let | |
353 | - | let | |
354 | - | let | |
355 | - | let | |
356 | - | let | |
357 | - | let | |
358 | - | let | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | then | |
364 | - | else if (if ( | |
365 | - | then ( | |
334 | + | func cH (cj,bF,cI,cJ,cK,cL,cm,cM,cN,cO,cP,cQ,cR) = { | |
335 | + | let bW = aK() | |
336 | + | let cn = fromBase58String(bW[t]) | |
337 | + | let cS = bW[u] | |
338 | + | let cT = bW[v] | |
339 | + | let cU = bW[y] | |
340 | + | let cV = bW[z] | |
341 | + | let cW = parseIntValue(bW[w]) | |
342 | + | let cX = parseIntValue(bW[x]) | |
343 | + | let cs = bW[s] | |
344 | + | let cY = valueOrErrorMessage(assetInfo(cn), "Wr lp as").quantity | |
345 | + | let cu = if (cM) | |
346 | + | then bx(cS) | |
347 | + | else if (if (cO) | |
348 | + | then (cR == cS) | |
366 | 349 | else false) | |
367 | - | then ( | |
368 | - | else if ( | |
369 | - | then | |
370 | - | else ( | |
371 | - | let | |
372 | - | then | |
373 | - | else if (if ( | |
374 | - | then ( | |
350 | + | then (bx(cS) - cQ) | |
351 | + | else if (cO) | |
352 | + | then bx(cS) | |
353 | + | else (bx(cS) - cI) | |
354 | + | let cw = if (cM) | |
355 | + | then bx(cT) | |
356 | + | else if (if (cO) | |
357 | + | then (cR == cT) | |
375 | 358 | else false) | |
376 | - | then ( | |
377 | - | else if ( | |
378 | - | then | |
379 | - | else ( | |
380 | - | let | |
381 | - | let | |
382 | - | let | |
383 | - | let | |
384 | - | let | |
385 | - | let | |
359 | + | then (bx(cT) - cQ) | |
360 | + | else if (cO) | |
361 | + | then bx(cT) | |
362 | + | else (bx(cT) - cK) | |
363 | + | let cZ = F(cI, cW) | |
364 | + | let da = F(cK, cX) | |
365 | + | let db = bz(da, cZ) | |
366 | + | let cv = F(cu, cW) | |
367 | + | let cx = F(cw, cX) | |
368 | + | let dc = if ((cY == 0)) | |
386 | 369 | then { | |
387 | - | let | |
388 | - | let | |
389 | - | let | |
390 | - | $Tuple5( | |
370 | + | let cy = d | |
371 | + | let dd = d | |
372 | + | let ca = pow((cZ * da), 0, toBigInt(5), 1, 0, DOWN) | |
373 | + | $Tuple5(I(ca, a), I(cZ, cW), I(da, cX), bz((cx + da), (cv + cZ)), dd) | |
391 | 374 | } | |
392 | 375 | else { | |
393 | - | let | |
394 | - | let | |
395 | - | let | |
396 | - | if (if (if ( | |
397 | - | then ( | |
376 | + | let cy = bz(cx, cv) | |
377 | + | let de = fraction(P((cy - db)), c, cy) | |
378 | + | let dd = F(bF, a) | |
379 | + | if (if (if (cP) | |
380 | + | then (cy != d) | |
398 | 381 | else false) | |
399 | - | then ( | |
382 | + | then (de > dd) | |
400 | 383 | else false) | |
401 | - | then throw(((("Price slippage " + toString( | |
384 | + | then throw(((("Price slippage " + toString(de)) + " > ") + toString(dd))) | |
402 | 385 | else { | |
403 | - | let | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | then $Tuple2( | |
408 | - | else $Tuple2( | |
409 | - | let | |
410 | - | let | |
411 | - | let | |
412 | - | $Tuple5( | |
386 | + | let df = F(cY, a) | |
387 | + | let dg = fraction(cZ, cy, c) | |
388 | + | let dh = fraction(da, c, cy) | |
389 | + | let di = if ((dg > da)) | |
390 | + | then $Tuple2(dh, da) | |
391 | + | else $Tuple2(cZ, dg) | |
392 | + | let dj = di._1 | |
393 | + | let dk = di._2 | |
394 | + | let ca = fraction(df, dk, cx) | |
395 | + | $Tuple5(I(ca, a), I(dj, cW), I(dk, cX), cy, dd) | |
413 | 396 | } | |
414 | 397 | } | |
415 | - | let | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | let | |
420 | - | if ((0 >= | |
398 | + | let dl = dc._1 | |
399 | + | let dm = dc._2 | |
400 | + | let dn = dc._3 | |
401 | + | let cz = I(dc._4, a) | |
402 | + | let do = I(dc._5, a) | |
403 | + | if ((0 >= dl)) | |
421 | 404 | then throw("LP <= 0") | |
422 | 405 | else { | |
423 | - | let | |
406 | + | let dp = if (!(cN)) | |
424 | 407 | then 0 | |
425 | - | else | |
426 | - | let | |
427 | - | let | |
428 | - | let | |
429 | - | then ( | |
408 | + | else dl | |
409 | + | let dq = (cI - dm) | |
410 | + | let dr = (cK - dn) | |
411 | + | let ds = if (if (cO) | |
412 | + | then (cR == cS) | |
430 | 413 | else false) | |
431 | - | then $Tuple2( | |
432 | - | else if (if ( | |
433 | - | then ( | |
414 | + | then $Tuple2(cQ, 0) | |
415 | + | else if (if (cO) | |
416 | + | then (cR == cT) | |
434 | 417 | else false) | |
435 | - | then $Tuple2(0, | |
436 | - | else $Tuple2( | |
437 | - | let | |
438 | - | let | |
439 | - | let | |
440 | - | $Tuple13( | |
418 | + | then $Tuple2(0, cQ) | |
419 | + | else $Tuple2(dm, dn) | |
420 | + | let dt = ds._1 | |
421 | + | let du = ds._2 | |
422 | + | let dv = [IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz), StringEntry(Y(cm, cj), bi(dt, du, dp, cz, bF, do, height, lastBlock.timestamp, dq, dr))] | |
423 | + | $Tuple13(dl, dp, cz, cu, cw, cY, cn, cs, dv, dq, dr, cJ, cL) | |
441 | 424 | } | |
442 | 425 | } | |
443 | 426 | ||
444 | 427 | ||
445 | - | func dE (dF) = { | |
446 | - | let dG = dF[0] | |
447 | - | let dH = dF[1] | |
448 | - | let dI = (dG + dH) | |
449 | - | if ((dI == e)) | |
450 | - | then e | |
428 | + | func dw (dx) = { | |
429 | + | let bW = aK() | |
430 | + | let dy = bW[u] | |
431 | + | let dz = bW[v] | |
432 | + | let cs = parseIntValue(bW[s]) | |
433 | + | let bX = parseIntValue(bW[w]) | |
434 | + | let bY = parseIntValue(bW[x]) | |
435 | + | let dA = bx(dy) | |
436 | + | let dB = bx(dz) | |
437 | + | let cy = if ((dx.orderType == Buy)) | |
438 | + | then bN(bX, bY, (dA + dx.amount), dB) | |
439 | + | else bN(bX, bY, (dA - dx.amount), dB) | |
440 | + | let cz = I(cy, a) | |
441 | + | if (if (if (aH()) | |
442 | + | then true | |
443 | + | else (cs == p)) | |
444 | + | then true | |
445 | + | else (cs == q)) | |
446 | + | then throw("Admin blocked") | |
451 | 447 | else { | |
452 | - | let dJ = parseIntValue(aO) | |
453 | - | let dK = (dJ * 2) | |
454 | - | let cm = fraction(dG, dH, f) | |
455 | - | let dL = fraction(cm, i, f) | |
456 | - | let dM = fraction(toBigInt(dK), dI, f) | |
457 | - | let dN = toBigInt((dK - 1)) | |
458 | - | func dO (dP) = { | |
459 | - | let dQ = fraction(dP, dP, f) | |
460 | - | let dR = fraction(dQ, dP, f) | |
461 | - | let dS = fraction(dR, f, dL) | |
462 | - | fraction((dM + fraction(dS, g, f)), dP, (fraction(dN, dP, f) + fraction(h, dS, f)), CEILING) | |
463 | - | } | |
464 | - | ||
465 | - | func dT (dU,dV) = if (dU._2) | |
466 | - | then dU | |
448 | + | let dC = dx.assetPair.amountAsset | |
449 | + | let dD = if ((dC == unit)) | |
450 | + | then "WAVES" | |
451 | + | else toBase58String(value(dC)) | |
452 | + | let dE = dx.assetPair.priceAsset | |
453 | + | let dF = if ((dE == unit)) | |
454 | + | then "WAVES" | |
455 | + | else toBase58String(value(dE)) | |
456 | + | if (if ((dD != dy)) | |
457 | + | then true | |
458 | + | else (dF != dz)) | |
459 | + | then throw("Wr assets") | |
467 | 460 | else { | |
468 | - | let dP = dU._1 | |
469 | - | let dW = dO(dP) | |
470 | - | let dX = toInt((dW - value(dP))) | |
471 | - | let dY = if ((0 > dX)) | |
472 | - | then -(dX) | |
473 | - | else dX | |
474 | - | if ((1 >= dY)) | |
475 | - | then $Tuple2(dW, true) | |
476 | - | else $Tuple2(dW, false) | |
461 | + | let dG = dx.price | |
462 | + | let cX = fraction(a, bY, bX) | |
463 | + | let dH = L(dG, a, cX) | |
464 | + | let dI = if ((dx.orderType == Buy)) | |
465 | + | then (cz >= dH) | |
466 | + | else (dH >= cz) | |
467 | + | true | |
477 | 468 | } | |
478 | - | ||
479 | - | let dZ = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
480 | - | let ea = { | |
481 | - | let eb = dZ | |
482 | - | let ec = size(eb) | |
483 | - | let ed = $Tuple2(dI, false) | |
484 | - | func ee (ef,eg) = if ((eg >= ec)) | |
485 | - | then ef | |
486 | - | else dT(ef, eb[eg]) | |
487 | - | ||
488 | - | func eh (ef,eg) = if ((eg >= ec)) | |
489 | - | then ef | |
490 | - | else throw("List size exceeds 15") | |
491 | - | ||
492 | - | eh(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ed, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
493 | - | } | |
494 | - | let dP = ea._1 | |
495 | - | let ei = ea._2 | |
496 | - | if (ei) | |
497 | - | then dP | |
498 | - | else throw(("D calculation error, D = " + toString(dP))) | |
499 | 469 | } | |
500 | 470 | } | |
501 | 471 | ||
502 | 472 | ||
503 | - | func ej (dF) = { | |
504 | - | let ek = g | |
505 | - | let dG = dF[0] | |
506 | - | let dH = dF[1] | |
507 | - | let el = parseBigIntValue(l) | |
508 | - | let dJ = (parseBigIntValue(aO) * el) | |
509 | - | let dI = (dG + dH) | |
510 | - | if ((dI == e)) | |
473 | + | func dJ (dK) = if ((size(dK.payments) != 1)) | |
474 | + | then throw("1 pmnt exp") | |
475 | + | else { | |
476 | + | let dL = value(dK.payments[0]) | |
477 | + | let ck = value(dL.assetId) | |
478 | + | let cQ = dL.amount | |
479 | + | let dc = ci(toBase58String(dK.transactionId), toBase58String(ck), cQ, dK.caller) | |
480 | + | let cE = dc._1 | |
481 | + | let cF = dc._2 | |
482 | + | let cs = parseIntValue(dc._9) | |
483 | + | let cG = dc._10 | |
484 | + | if (if (aH()) | |
485 | + | then true | |
486 | + | else (cs == q)) | |
487 | + | then throw(("Admin blocked: " + toString(cs))) | |
488 | + | else $Tuple5(cE, cF, cQ, ck, cG) | |
489 | + | } | |
490 | + | ||
491 | + | ||
492 | + | func dM (dN,aa,dO,dP,bF,cN,cO,cP,cQ,cR) = { | |
493 | + | let dc = cH(aa, bF, value(dO).amount, value(dO).assetId, value(dP).amount, value(dP).assetId, dN, (aa == ""), cN, cO, cP, cQ, cR) | |
494 | + | let cs = parseIntValue(dc._8) | |
495 | + | if (if (if (aH()) | |
496 | + | then true | |
497 | + | else (cs == o)) | |
498 | + | then true | |
499 | + | else (cs == q)) | |
500 | + | then throw(("Blocked:" + toString(cs))) | |
501 | + | else dc | |
502 | + | } | |
503 | + | ||
504 | + | ||
505 | + | func dQ (dR) = { | |
506 | + | let dS = g | |
507 | + | let dT = dR[0] | |
508 | + | let dU = dR[1] | |
509 | + | let dV = parseBigIntValue(j) | |
510 | + | let dW = (parseBigIntValue(aG) * dV) | |
511 | + | let dX = (dT + dU) | |
512 | + | if ((dX == e)) | |
511 | 513 | then e | |
512 | 514 | else { | |
513 | - | let | |
514 | - | let | |
515 | - | let | |
516 | - | let | |
517 | - | let | |
518 | - | func | |
519 | - | let | |
520 | - | let | |
521 | - | let ei = | |
515 | + | let dY = (dW * dS) | |
516 | + | let dZ = (((dT * dU) * dS) * dS) | |
517 | + | let ea = ((dY * dX) / dV) | |
518 | + | let eb = (dY - dV) | |
519 | + | let ec = (dS + f) | |
520 | + | func ed (ee,ef) = { | |
521 | + | let eg = ee | |
522 | + | let eh = eg._1 | |
523 | + | let ei = eg._2 | |
522 | 524 | if ((ei != unit)) | |
523 | - | then | |
525 | + | then ee | |
524 | 526 | else { | |
525 | - | let | |
526 | - | let | |
527 | - | let | |
528 | - | if ((f >= | |
529 | - | then $Tuple2( | |
530 | - | else $Tuple2( | |
527 | + | let ej = (((eh * eh) * eh) / dZ) | |
528 | + | let ek = (((ea + (ej * dS)) * eh) / (((eb * eh) / dV) + (ec * ej))) | |
529 | + | let el = Q((ek - value(eh))) | |
530 | + | if ((f >= el)) | |
531 | + | then $Tuple2(ek, ef) | |
532 | + | else $Tuple2(ek, unit) | |
531 | 533 | } | |
532 | 534 | } | |
533 | 535 | ||
534 | - | let | |
535 | - | let | |
536 | - | let | |
537 | - | let | |
538 | - | let | |
539 | - | func | |
540 | - | then | |
541 | - | else | |
536 | + | let em = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
537 | + | let en = { | |
538 | + | let eo = em | |
539 | + | let ep = size(eo) | |
540 | + | let eq = $Tuple2(dX, unit) | |
541 | + | func er (es,et) = if ((et >= ep)) | |
542 | + | then es | |
543 | + | else ed(es, eo[et]) | |
542 | 544 | ||
543 | - | func | |
544 | - | then | |
545 | + | func eu (es,et) = if ((et >= ep)) | |
546 | + | then es | |
545 | 547 | else throw("List size exceeds 15") | |
546 | 548 | ||
547 | - | | |
549 | + | eu(er(er(er(er(er(er(er(er(er(er(er(er(er(er(er(eq, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
548 | 550 | } | |
549 | - | let | |
550 | - | let ei = | |
551 | + | let eh = en._1 | |
552 | + | let ei = en._2 | |
551 | 553 | if ((ei != unit)) | |
552 | - | then | |
553 | - | else throw(("D calculation error, D = " + toString( | |
554 | + | then eh | |
555 | + | else throw(("D calculation error, D = " + toString(eh))) | |
554 | 556 | } | |
555 | 557 | } | |
556 | 558 | ||
557 | 559 | ||
558 | - | func | |
559 | - | let | |
560 | - | let | |
560 | + | func ev (dR,dK,ew) = { | |
561 | + | let dS = g | |
562 | + | let ex = dR[if ((dK == 0)) | |
561 | 563 | then 1 | |
562 | 564 | else 0] | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | let | |
567 | - | let | |
568 | - | let | |
569 | - | func | |
570 | - | let | |
571 | - | let | |
572 | - | let ei = | |
565 | + | let dV = parseBigIntValue(j) | |
566 | + | let dW = (parseBigIntValue(aG) * dV) | |
567 | + | let dX = ex | |
568 | + | let dY = (dW * dS) | |
569 | + | let ey = (((((ew * ew) / (ex * dS)) * ew) * dV) / (dY * dS)) | |
570 | + | let ez = ((dX + ((ew * dV) / dY)) - ew) | |
571 | + | func ed (ee,ef) = { | |
572 | + | let eA = ee | |
573 | + | let eB = eA._1 | |
574 | + | let ei = eA._2 | |
573 | 575 | if ((ei != unit)) | |
574 | - | then | |
576 | + | then ee | |
575 | 577 | else { | |
576 | - | let | |
577 | - | let | |
578 | - | if ((f >= | |
579 | - | then $Tuple2( | |
580 | - | else $Tuple2( | |
578 | + | let eC = (((eB * eB) + ey) / ((g * eB) + ez)) | |
579 | + | let eD = Q((eC - value(eB))) | |
580 | + | if ((f >= eD)) | |
581 | + | then $Tuple2(eC, ef) | |
582 | + | else $Tuple2(eC, unit) | |
581 | 583 | } | |
582 | 584 | } | |
583 | 585 | ||
584 | - | let | |
585 | - | let | |
586 | - | let | |
587 | - | let | |
588 | - | let | |
589 | - | func | |
590 | - | then | |
591 | - | else | |
586 | + | let em = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
587 | + | let eE = { | |
588 | + | let eo = em | |
589 | + | let ep = size(eo) | |
590 | + | let eq = $Tuple2(ew, unit) | |
591 | + | func er (es,et) = if ((et >= ep)) | |
592 | + | then es | |
593 | + | else ed(es, eo[et]) | |
592 | 594 | ||
593 | - | func | |
594 | - | then | |
595 | + | func eu (es,et) = if ((et >= ep)) | |
596 | + | then es | |
595 | 597 | else throw("List size exceeds 15") | |
596 | 598 | ||
597 | - | | |
599 | + | eu(er(er(er(er(er(er(er(er(er(er(er(er(er(er(er(eq, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
598 | 600 | } | |
599 | - | let | |
600 | - | let ei = | |
601 | + | let eB = eE._1 | |
602 | + | let ei = eE._2 | |
601 | 603 | if ((ei != unit)) | |
602 | - | then | |
603 | - | else throw(("Y calculation error, Y = " + toString( | |
604 | + | then eB | |
605 | + | else throw(("Y calculation error, Y = " + toString(eB))) | |
604 | 606 | } | |
605 | 607 | ||
606 | 608 | ||
607 | - | func eC (eD,eE,eF) = { | |
608 | - | let eG = fraction(dE([eD, eE]), c, eF) | |
609 | - | if ((eF == e)) | |
610 | - | then e | |
611 | - | else eG | |
612 | - | } | |
613 | - | ||
614 | - | ||
615 | - | func eH (eI,eJ,eK) = { | |
616 | - | let eL = (toBigInt(bF(aY(bg))) - eI) | |
617 | - | let eM = (toBigInt(bF(aY(bh))) - eJ) | |
618 | - | let eN = (toBigInt(value(assetInfo(bf)).quantity) - eK) | |
619 | - | let eO = eC(eL, eM, eN) | |
620 | - | eO | |
621 | - | } | |
622 | - | ||
623 | - | ||
624 | - | func eP (eQ,eR,eK) = { | |
625 | - | let eL = (bF(aY(bg)) + eQ) | |
626 | - | let eM = (bF(aY(bh)) + eR) | |
627 | - | let eN = (value(assetInfo(bf)).quantity + eK) | |
628 | - | let eG = eC(toBigInt(eL), toBigInt(eM), toBigInt(eN)) | |
629 | - | let eS = [IntegerEntry(al, height), StringEntry(ak, toString(eG))] | |
630 | - | $Tuple2(eS, eG) | |
631 | - | } | |
632 | - | ||
633 | - | ||
634 | - | func eT (eU,eG) = if ((eG >= eU)) | |
635 | - | then true | |
636 | - | else aK("updated DLp lower than current DLp") | |
637 | - | ||
638 | - | ||
639 | - | func eV (eW) = { | |
640 | - | let eX = eW.amount | |
641 | - | let eY = fraction(eW.amount, eW.price, a, FLOOR) | |
642 | - | let eZ = if ((eW.orderType == Buy)) | |
643 | - | then $Tuple2(eX, -(eY)) | |
644 | - | else $Tuple2(-(eX), eY) | |
645 | - | let eQ = eZ._1 | |
646 | - | let eR = eZ._2 | |
647 | - | if (if (if (aP()) | |
648 | - | then true | |
649 | - | else (be == r)) | |
650 | - | then true | |
651 | - | else (be == s)) | |
652 | - | then throw("Admin blocked") | |
653 | - | else if (if ((eW.assetPair.amountAsset != bg)) | |
654 | - | then true | |
655 | - | else (eW.assetPair.priceAsset != bh)) | |
656 | - | then throw("Wr assets") | |
657 | - | else { | |
658 | - | let fa = parseBigIntValue(getStringValue(this, ak)) | |
659 | - | let fb = eP(eQ, eR, 0) | |
660 | - | let fc = fb._1 | |
661 | - | let fd = fb._2 | |
662 | - | let fe = (fd >= fa) | |
663 | - | fe | |
664 | - | } | |
665 | - | } | |
666 | - | ||
667 | - | ||
668 | - | func ff (dV) = if ((size(dV.payments) != 1)) | |
669 | - | then throw("1 pmnt exp") | |
670 | - | else { | |
671 | - | let fg = value(dV.payments[0]) | |
672 | - | let cs = value(fg.assetId) | |
673 | - | let cY = fg.amount | |
674 | - | let dk = cq(toBase58String(dV.transactionId), toBase58String(cs), cY, dV.caller) | |
675 | - | let cM = dk._1 | |
676 | - | let cN = dk._2 | |
677 | - | let cA = parseIntValue(dk._9) | |
678 | - | let cO = dk._10 | |
679 | - | if (if (aP()) | |
680 | - | then true | |
681 | - | else (cA == s)) | |
682 | - | then throw(("Admin blocked: " + toString(cA))) | |
683 | - | else $Tuple5(cM, cN, cY, cs, cO) | |
684 | - | } | |
685 | - | ||
686 | - | ||
687 | - | func fh (fi,ac,fj,fk,bN,cV,cW,cX,cY,cZ) = { | |
688 | - | let dk = cP(ac, bN, value(fj).amount, value(fj).assetId, value(fk).amount, value(fk).assetId, fi, (ac == ""), cV, cW, cX, cY, cZ) | |
689 | - | let cA = parseIntValue(dk._8) | |
690 | - | if (if (if (aP()) | |
691 | - | then true | |
692 | - | else (cA == q)) | |
693 | - | then true | |
694 | - | else (cA == s)) | |
695 | - | then throw(("Blocked:" + toString(cA))) | |
696 | - | else dk | |
697 | - | } | |
698 | - | ||
699 | - | ||
700 | - | func fl (fm,cs,cu,ac,fn) = { | |
701 | - | let ba = aS() | |
702 | - | let cw = ba[w] | |
703 | - | let cx = ba[x] | |
704 | - | let cv = ba[v] | |
705 | - | let de = parseIntValue(ba[y]) | |
706 | - | let df = parseIntValue(ba[z]) | |
707 | - | let eN = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cv)), "invalid lp asset").quantity) | |
708 | - | let fo = if ((eN > e)) | |
609 | + | func eF (eG,ck,cm,aa,eH) = { | |
610 | + | let aS = aK() | |
611 | + | let co = aS[u] | |
612 | + | let cp = aS[v] | |
613 | + | let cn = aS[t] | |
614 | + | let cW = parseIntValue(aS[w]) | |
615 | + | let cX = parseIntValue(aS[x]) | |
616 | + | let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cn)), "invalid lp asset").quantity) | |
617 | + | let eJ = if ((eI > e)) | |
709 | 618 | then true | |
710 | 619 | else throw("initial deposit requires all coins") | |
711 | - | if (( | |
620 | + | if ((eJ == eJ)) | |
712 | 621 | then { | |
713 | - | let | |
714 | - | let | |
715 | - | let | |
716 | - | then $Tuple2( | |
717 | - | else if (( | |
718 | - | then if (( | |
622 | + | let cu = bx(co) | |
623 | + | let cw = bx(cp) | |
624 | + | let eK = if ((aa == "")) | |
625 | + | then $Tuple2(cu, cw) | |
626 | + | else if ((ck == co)) | |
627 | + | then if ((eG > cu)) | |
719 | 628 | then throw("invalid payment amount") | |
720 | - | else $Tuple2(( | |
721 | - | else if (( | |
722 | - | then if (( | |
629 | + | else $Tuple2((cu - eG), cw) | |
630 | + | else if ((ck == cp)) | |
631 | + | then if ((eG > cw)) | |
723 | 632 | then throw("invalid payment amount") | |
724 | - | else $Tuple2( | |
633 | + | else $Tuple2(cu, (cw - eG)) | |
725 | 634 | else throw("wrong pmtAssetId") | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | then $Tuple2( | |
730 | - | else if (( | |
731 | - | then $Tuple2(0, | |
635 | + | let eL = eK._1 | |
636 | + | let eM = eK._2 | |
637 | + | let eN = if ((ck == co)) | |
638 | + | then $Tuple2(eG, 0) | |
639 | + | else if ((ck == cp)) | |
640 | + | then $Tuple2(0, eG) | |
732 | 641 | else throw("invalid payment") | |
733 | - | let | |
734 | - | let | |
735 | - | let | |
736 | - | then $Tuple3( | |
737 | - | else $Tuple3( | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | let | |
744 | - | let | |
745 | - | let | |
642 | + | let eO = eN._1 | |
643 | + | let eP = eN._2 | |
644 | + | let eQ = if (eH) | |
645 | + | then $Tuple3(cf(eO)._1, cf(eP)._1, cf(eG)._2) | |
646 | + | else $Tuple3(eO, eP, 0) | |
647 | + | let eR = eQ._1 | |
648 | + | let eS = eQ._2 | |
649 | + | let ch = eQ._3 | |
650 | + | let eT = (eL + eR) | |
651 | + | let eU = (eM + eS) | |
652 | + | let bK = dQ([toBigInt(eL), toBigInt(eM)]) | |
653 | + | let bJ = dQ([toBigInt(eT), toBigInt(eU)]) | |
654 | + | let eV = if ((bJ > bK)) | |
746 | 655 | then true | |
747 | 656 | else throw() | |
748 | - | if (( | |
657 | + | if ((eV == eV)) | |
749 | 658 | then { | |
750 | - | let | |
751 | - | let | |
752 | - | let | |
753 | - | let | |
754 | - | let | |
755 | - | let | |
756 | - | let | |
757 | - | let | |
758 | - | $Tuple4(toInt( | |
659 | + | let eW = fraction(eI, (bJ - bK), bK) | |
660 | + | let cz = I(bz(F(eU, cX), F(eT, cW)), a) | |
661 | + | let dv = [IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz), StringEntry(Y(cm, aa), bi(eO, eP, toInt(eW), cz, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
662 | + | let eX = fraction(eM, a, eL) | |
663 | + | let eY = fraction(eG, a, (eX + a)) | |
664 | + | let eZ = (eG - eY) | |
665 | + | let fa = fraction(eI, toBigInt(eZ), toBigInt(eM)) | |
666 | + | let fb = toInt(fraction((eW - fa), b, fa)) | |
667 | + | $Tuple4(toInt(eW), dv, ch, fb) | |
759 | 668 | } | |
760 | 669 | else throw("Strict value is not equal to itself.") | |
761 | 670 | } | |
763 | 672 | } | |
764 | 673 | ||
765 | 674 | ||
766 | - | func fH (fI,fJ,fK,fi,fL,fM) = { | |
767 | - | let ba = aS() | |
768 | - | let cv = ba[v] | |
769 | - | let cw = ba[w] | |
770 | - | let cx = ba[x] | |
771 | - | let fN = parseIntValue(ba[y]) | |
772 | - | let fO = parseIntValue(ba[z]) | |
773 | - | let fP = ba[u] | |
774 | - | let cu = if ((fi == bp)) | |
775 | - | then fL | |
776 | - | else fi | |
777 | - | let fg = value(fK[0]) | |
778 | - | let cs = value(fg.assetId) | |
779 | - | let cY = fg.amount | |
780 | - | let eO = eH(e, e, e) | |
781 | - | if ((eO == eO)) | |
782 | - | then { | |
783 | - | let cr = toBase58String(fM) | |
784 | - | if ((cv != toBase58String(cs))) | |
785 | - | then throw("Wrong LP") | |
786 | - | else { | |
787 | - | let cC = bF(cw) | |
788 | - | let cE = bF(cx) | |
789 | - | let fQ = { | |
790 | - | let fR = invoke(this, "getOneTknV2READONLY", [fI, cY], nil) | |
791 | - | if ($isInstanceOf(fR, "(Int, Int)")) | |
792 | - | then fR | |
793 | - | else throw(($getType(fR) + " couldn't be cast to (Int, Int)")) | |
794 | - | } | |
795 | - | if ((fQ == fQ)) | |
675 | + | func fc (fd,fe,ff,dN,fg,fh) = { | |
676 | + | let aS = aK() | |
677 | + | let cn = aS[t] | |
678 | + | let co = aS[u] | |
679 | + | let cp = aS[v] | |
680 | + | let fi = parseIntValue(aS[w]) | |
681 | + | let fj = parseIntValue(aS[x]) | |
682 | + | let fk = aS[s] | |
683 | + | let cm = if ((dN == bh)) | |
684 | + | then fg | |
685 | + | else dN | |
686 | + | let dL = value(ff[0]) | |
687 | + | let ck = value(dL.assetId) | |
688 | + | let cQ = dL.amount | |
689 | + | let cj = toBase58String(fh) | |
690 | + | if ((cn != toBase58String(ck))) | |
691 | + | then throw("Wrong LP") | |
692 | + | else { | |
693 | + | let cu = bx(co) | |
694 | + | let cw = bx(cp) | |
695 | + | let fl = { | |
696 | + | let fm = invoke(this, "getOneTknV2READONLY", [fd, cQ], nil) | |
697 | + | if ($isInstanceOf(fm, "(Int, Int)")) | |
698 | + | then fm | |
699 | + | else throw(($getType(fm) + " couldn't be cast to (Int, Int)")) | |
700 | + | } | |
701 | + | if ((fl == fl)) | |
702 | + | then { | |
703 | + | let ch = fl._2 | |
704 | + | let fn = fl._1 | |
705 | + | let fo = if (if ((fe > 0)) | |
706 | + | then (fe > fn) | |
707 | + | else false) | |
708 | + | then aD(makeString(["amount to receive is less than ", toString(fe)], "")) | |
709 | + | else fn | |
710 | + | let fp = if ((fd == co)) | |
711 | + | then $Tuple4(fo, 0, ((cu - fo) - ch), cw) | |
712 | + | else if ((fd == cp)) | |
713 | + | then $Tuple4(0, fo, cu, ((cw - fo) - ch)) | |
714 | + | else throw("invalid out asset id") | |
715 | + | let fq = fp._1 | |
716 | + | let fr = fp._2 | |
717 | + | let eT = fp._3 | |
718 | + | let eU = fp._4 | |
719 | + | let fs = bz(F(eU, fj), F(eT, fi)) | |
720 | + | let ft = I(fs, a) | |
721 | + | let fu = if ((fd == "WAVES")) | |
722 | + | then unit | |
723 | + | else fromBase58String(fd) | |
724 | + | let fv = if ((ch > 0)) | |
725 | + | then [ScriptTransfer(aJ, ch, fu)] | |
726 | + | else nil | |
727 | + | let cG = ([ScriptTransfer(cm, fo, fu), StringEntry(ab(toString(cm), cj), bt(fq, fr, cQ, ft, height, lastBlock.timestamp)), IntegerEntry(U(), ft), IntegerEntry(V(height, lastBlock.timestamp), ft)] ++ fv) | |
728 | + | if ((cG == cG)) | |
796 | 729 | then { | |
797 | - | let cp = fQ._2 | |
798 | - | let fS = fQ._1 | |
799 | - | let fT = if (if ((fJ > 0)) | |
800 | - | then (fJ > fS) | |
801 | - | else false) | |
802 | - | then aK(makeString(["amount to receive is less than ", toString(fJ)], "")) | |
803 | - | else fS | |
804 | - | let fU = if ((fI == cw)) | |
805 | - | then $Tuple4(fT, 0, ((cC - fT) - cp), cE) | |
806 | - | else if ((fI == cx)) | |
807 | - | then $Tuple4(0, fT, cC, ((cE - fT) - cp)) | |
808 | - | else throw("invalid out asset id") | |
809 | - | let fV = fU._1 | |
810 | - | let fW = fU._2 | |
811 | - | let fy = fU._3 | |
812 | - | let fz = fU._4 | |
813 | - | let fX = bH(H(fz, fO), H(fy, fN)) | |
814 | - | let fY = K(fX, a) | |
815 | - | let fZ = if ((fI == "WAVES")) | |
816 | - | then unit | |
817 | - | else fromBase58String(fI) | |
818 | - | let ga = if ((cp > 0)) | |
819 | - | then [ScriptTransfer(aR, cp, fZ)] | |
820 | - | else nil | |
821 | - | let cO = ([ScriptTransfer(cu, fT, fZ), StringEntry(ad(toString(cu), cr), bB(fV, fW, cY, fY, height, lastBlock.timestamp)), IntegerEntry(W(), fY), IntegerEntry(X(height, lastBlock.timestamp), fY)] ++ ga) | |
822 | - | if ((cO == cO)) | |
823 | - | then { | |
824 | - | let gb = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
825 | - | if ((gb == gb)) | |
826 | - | then { | |
827 | - | let gc = { | |
828 | - | let gd = if ((this == aR)) | |
829 | - | then 0 | |
830 | - | else cp | |
831 | - | let ge = if ((aW(fI) == bg)) | |
832 | - | then true | |
833 | - | else false | |
834 | - | if (ge) | |
835 | - | then $Tuple2(-((fS + gd)), 0) | |
836 | - | else $Tuple2(0, -((fS + gd))) | |
837 | - | } | |
838 | - | let eQ = gc._1 | |
839 | - | let eR = gc._2 | |
840 | - | let gf = eP(eQ, eR, 0) | |
841 | - | let gg = gf._1 | |
842 | - | let eG = gf._2 | |
843 | - | let gh = eT(eO, eG) | |
844 | - | if ((gh == gh)) | |
845 | - | then $Tuple2((cO ++ gg), fT) | |
846 | - | else throw("Strict value is not equal to itself.") | |
847 | - | } | |
848 | - | else throw("Strict value is not equal to itself.") | |
849 | - | } | |
730 | + | let fw = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
731 | + | if ((fw == fw)) | |
732 | + | then $Tuple2(cG, fo) | |
850 | 733 | else throw("Strict value is not equal to itself.") | |
851 | 734 | } | |
852 | 735 | else throw("Strict value is not equal to itself.") | |
853 | 736 | } | |
737 | + | else throw("Strict value is not equal to itself.") | |
854 | 738 | } | |
855 | - | else throw("Strict value is not equal to itself.") | |
856 | 739 | } | |
857 | 740 | ||
858 | 741 | ||
859 | - | func | |
860 | - | let | |
861 | - | if ($isInstanceOf( | |
742 | + | func fx () = { | |
743 | + | let ax = getString(S()) | |
744 | + | if ($isInstanceOf(ax, "String")) | |
862 | 745 | then { | |
863 | - | let | |
864 | - | fromBase58String( | |
746 | + | let dX = ax | |
747 | + | fromBase58String(dX) | |
865 | 748 | } | |
866 | - | else if ($isInstanceOf( | |
749 | + | else if ($isInstanceOf(ax, "Unit")) | |
867 | 750 | then unit | |
868 | 751 | else throw("Match error") | |
869 | 752 | } | |
870 | 753 | ||
871 | 754 | ||
872 | - | func | |
873 | - | let | |
874 | - | if ($isInstanceOf( | |
755 | + | func fy () = { | |
756 | + | let ax = getString(T()) | |
757 | + | if ($isInstanceOf(ax, "String")) | |
875 | 758 | then { | |
876 | - | let | |
877 | - | fromBase58String( | |
759 | + | let dX = ax | |
760 | + | fromBase58String(dX) | |
878 | 761 | } | |
879 | - | else if ($isInstanceOf( | |
762 | + | else if ($isInstanceOf(ax, "Unit")) | |
880 | 763 | then unit | |
881 | 764 | else throw("Match error") | |
882 | 765 | } | |
883 | 766 | ||
884 | 767 | ||
885 | - | let | |
768 | + | let fz = throw("Permission denied") | |
886 | 769 | ||
887 | - | func | |
888 | - | let | |
889 | - | if ($isInstanceOf( | |
770 | + | func fA (dK) = { | |
771 | + | let ax = fx() | |
772 | + | if ($isInstanceOf(ax, "ByteVector")) | |
890 | 773 | then { | |
891 | - | let | |
892 | - | ( | |
774 | + | let fB = ax | |
775 | + | (dK.callerPublicKey == fB) | |
893 | 776 | } | |
894 | - | else if ($isInstanceOf( | |
895 | - | then ( | |
777 | + | else if ($isInstanceOf(ax, "Unit")) | |
778 | + | then (dK.caller == this) | |
896 | 779 | else throw("Match error") | |
897 | 780 | } | |
898 | 781 | ||
899 | 782 | ||
900 | - | func | |
901 | - | let | |
902 | - | if ($isInstanceOf( | |
783 | + | func fC (dK) = { | |
784 | + | let ax = fx() | |
785 | + | if ($isInstanceOf(ax, "ByteVector")) | |
903 | 786 | then { | |
904 | - | let | |
905 | - | if (( | |
787 | + | let fB = ax | |
788 | + | if ((dK.callerPublicKey == fB)) | |
906 | 789 | then true | |
907 | - | else | |
790 | + | else fz | |
908 | 791 | } | |
909 | - | else if ($isInstanceOf( | |
910 | - | then if (( | |
792 | + | else if ($isInstanceOf(ax, "Unit")) | |
793 | + | then if ((dK.caller == this)) | |
911 | 794 | then true | |
912 | - | else | |
795 | + | else fz | |
913 | 796 | else throw("Match error") | |
914 | 797 | } | |
915 | 798 | ||
916 | 799 | ||
917 | - | @Callable( | |
918 | - | func constructor ( | |
919 | - | let | |
920 | - | if (( | |
921 | - | then [StringEntry( | |
800 | + | @Callable(dK) | |
801 | + | func constructor (R) = { | |
802 | + | let ey = fC(dK) | |
803 | + | if ((ey == ey)) | |
804 | + | then [StringEntry(R(), R)] | |
922 | 805 | else throw("Strict value is not equal to itself.") | |
923 | 806 | } | |
924 | 807 | ||
925 | 808 | ||
926 | 809 | ||
927 | - | @Callable( | |
928 | - | func setManager ( | |
929 | - | let | |
930 | - | if (( | |
810 | + | @Callable(dK) | |
811 | + | func setManager (fD) = { | |
812 | + | let ey = fC(dK) | |
813 | + | if ((ey == ey)) | |
931 | 814 | then { | |
932 | - | let | |
933 | - | if (( | |
934 | - | then [StringEntry( | |
815 | + | let fE = fromBase58String(fD) | |
816 | + | if ((fE == fE)) | |
817 | + | then [StringEntry(T(), fD)] | |
935 | 818 | else throw("Strict value is not equal to itself.") | |
936 | 819 | } | |
937 | 820 | else throw("Strict value is not equal to itself.") | |
939 | 822 | ||
940 | 823 | ||
941 | 824 | ||
942 | - | @Callable( | |
825 | + | @Callable(dK) | |
943 | 826 | func confirmManager () = { | |
944 | - | let | |
945 | - | let | |
827 | + | let ce = fy() | |
828 | + | let fF = if (isDefined(ce)) | |
946 | 829 | then true | |
947 | 830 | else throw("No pending manager") | |
948 | - | if (( | |
831 | + | if ((fF == fF)) | |
949 | 832 | then { | |
950 | - | let | |
833 | + | let fG = if ((dK.callerPublicKey == value(ce))) | |
951 | 834 | then true | |
952 | 835 | else throw("You are not pending manager") | |
953 | - | if (( | |
954 | - | then [StringEntry( | |
836 | + | if ((fG == fG)) | |
837 | + | then [StringEntry(S(), toBase58String(value(ce))), DeleteEntry(T())] | |
955 | 838 | else throw("Strict value is not equal to itself.") | |
956 | 839 | } | |
957 | 840 | else throw("Strict value is not equal to itself.") | |
959 | 842 | ||
960 | 843 | ||
961 | 844 | ||
962 | - | @Callable( | |
963 | - | func put ( | |
964 | - | let | |
965 | - | let | |
966 | - | let | |
967 | - | if ((0 > | |
845 | + | @Callable(dK) | |
846 | + | func put (fH,fI) = { | |
847 | + | let fJ = bc() | |
848 | + | let fK = valueOrErrorMessage(addressFromString(fJ[A]), "Wr st addr") | |
849 | + | let fL = valueOrErrorMessage(addressFromString(fJ[C]), "Wr sl addr") | |
850 | + | if ((0 > fH)) | |
968 | 851 | then throw("Wrong slippage") | |
969 | - | else if ((size( | |
852 | + | else if ((size(dK.payments) != 2)) | |
970 | 853 | then throw("2 pmnts expd") | |
971 | 854 | else { | |
972 | - | let gx = toBigInt(value(dV.payments[0]).amount) | |
973 | - | let gy = toBigInt(value(dV.payments[1]).amount) | |
974 | - | let eO = eH(gx, gy, toBigInt(0)) | |
975 | - | if ((eO == eO)) | |
855 | + | let fM = dM(toString(dK.caller), toBase58String(dK.transactionId), AttachedPayment(value(dK.payments[0]).assetId, value(dK.payments[0]).amount), dK.payments[1], fH, true, false, true, 0, "") | |
856 | + | let dp = fM._2 | |
857 | + | let fN = fM._7 | |
858 | + | let cG = fM._9 | |
859 | + | let dq = fM._10 | |
860 | + | let dr = fM._11 | |
861 | + | let co = fM._12 | |
862 | + | let cp = fM._13 | |
863 | + | let dc = invoke(aF, "emit", [dp], nil) | |
864 | + | if ((dc == dc)) | |
976 | 865 | then { | |
977 | - | let | |
978 | - | let | |
979 | - | | |
980 | - | | |
981 | - | let | |
982 | - | | |
983 | - | | |
984 | - | | |
985 | - | | |
986 | - | if (( | |
866 | + | let fO = { | |
867 | + | let ax = dc | |
868 | + | if ($isInstanceOf(ax, "Address")) | |
869 | + | then { | |
870 | + | let fP = ax | |
871 | + | invoke(fP, "emit", [dp], nil) | |
872 | + | } | |
873 | + | else unit | |
874 | + | } | |
875 | + | if ((fO == fO)) | |
987 | 876 | then { | |
988 | - | let gB = { | |
989 | - | let aE = dk | |
990 | - | if ($isInstanceOf(aE, "Address")) | |
991 | - | then { | |
992 | - | let gC = aE | |
993 | - | invoke(gC, "emit", [dx], nil) | |
994 | - | } | |
995 | - | else unit | |
996 | - | } | |
997 | - | if ((gB == gB)) | |
877 | + | let fQ = if ((dq > 0)) | |
878 | + | then invoke(fL, "put", nil, [AttachedPayment(co, dq)]) | |
879 | + | else nil | |
880 | + | if ((fQ == fQ)) | |
998 | 881 | then { | |
999 | - | let | |
1000 | - | then invoke( | |
882 | + | let fR = if ((dr > 0)) | |
883 | + | then invoke(fL, "put", nil, [AttachedPayment(cp, dr)]) | |
1001 | 884 | else nil | |
1002 | - | if (( | |
885 | + | if ((fR == fR)) | |
1003 | 886 | then { | |
1004 | - | let gE = if ((dz > 0)) | |
1005 | - | then invoke(gw, "put", nil, [AttachedPayment(cx, dz)]) | |
1006 | - | else nil | |
1007 | - | if ((gE == gE)) | |
887 | + | let fS = if (fI) | |
1008 | 888 | then { | |
1009 | - | let gF = if (gt) | |
1010 | - | then { | |
1011 | - | let gG = invoke(gv, "stake", nil, [AttachedPayment(gA, dx)]) | |
1012 | - | if ((gG == gG)) | |
1013 | - | then nil | |
1014 | - | else throw("Strict value is not equal to itself.") | |
1015 | - | } | |
1016 | - | else [ScriptTransfer(dV.caller, dx, gA)] | |
1017 | - | let gH = eP(0, 0, 0) | |
1018 | - | let gg = gH._1 | |
1019 | - | let eG = gH._2 | |
1020 | - | let gh = eT(eO, eG) | |
1021 | - | if ((gh == gh)) | |
1022 | - | then ((cO ++ gF) ++ gg) | |
889 | + | let fT = invoke(fK, "stake", nil, [AttachedPayment(fN, dp)]) | |
890 | + | if ((fT == fT)) | |
891 | + | then nil | |
1023 | 892 | else throw("Strict value is not equal to itself.") | |
1024 | 893 | } | |
1025 | - | else throw("Strict value is not equal to itself.") | |
894 | + | else [ScriptTransfer(dK.caller, dp, fN)] | |
895 | + | (cG ++ fS) | |
1026 | 896 | } | |
1027 | 897 | else throw("Strict value is not equal to itself.") | |
1028 | 898 | } | |
1036 | 906 | ||
1037 | 907 | ||
1038 | 908 | ||
1039 | - | @Callable( | |
1040 | - | func putOneTknV2 ( | |
1041 | - | let | |
1042 | - | let | |
1043 | - | if ($isInstanceOf( | |
1044 | - | then | |
1045 | - | else throw(($getType( | |
909 | + | @Callable(dK) | |
910 | + | func putOneTknV2 (fe,fI) = { | |
911 | + | let fU = { | |
912 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
913 | + | if ($isInstanceOf(fm, "Boolean")) | |
914 | + | then fm | |
915 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1046 | 916 | } | |
1047 | - | let | |
917 | + | let fV = if (if (if (aH()) | |
1048 | 918 | then true | |
1049 | - | else ( | |
919 | + | else (aW == o)) | |
1050 | 920 | then true | |
1051 | - | else ( | |
921 | + | else (aW == q)) | |
1052 | 922 | then true | |
1053 | - | else | |
1054 | - | let | |
923 | + | else fU | |
924 | + | let fW = [if (if (!(fV)) | |
1055 | 925 | then true | |
1056 | - | else | |
926 | + | else fA(dK)) | |
1057 | 927 | then true | |
1058 | - | else | |
928 | + | else aD("put operation is blocked by admin"), if ((size(dK.payments) == 1)) | |
1059 | 929 | then true | |
1060 | - | else | |
1061 | - | if (( | |
930 | + | else aD("exactly 1 payment are expected")] | |
931 | + | if ((fW == fW)) | |
1062 | 932 | then { | |
1063 | - | let | |
1064 | - | let | |
1065 | - | let | |
1066 | - | let | |
1067 | - | let | |
1068 | - | let | |
1069 | - | let | |
1070 | - | then | |
1071 | - | else | |
1072 | - | let | |
1073 | - | let | |
1074 | - | let | |
1075 | - | let | |
1076 | - | if (( | |
933 | + | let aS = aK() | |
934 | + | let co = aS[u] | |
935 | + | let cp = aS[v] | |
936 | + | let cn = fromBase58String(aS[t]) | |
937 | + | let fi = parseIntValue(aS[w]) | |
938 | + | let fj = parseIntValue(aS[x]) | |
939 | + | let cm = if ((dK.caller == this)) | |
940 | + | then dK.originCaller | |
941 | + | else dK.caller | |
942 | + | let dL = value(dK.payments[0]) | |
943 | + | let ck = toBase58String(value(dL.assetId)) | |
944 | + | let cQ = dL.amount | |
945 | + | let fX = eF(cQ, ck, toString(cm), toBase58String(dK.transactionId), true) | |
946 | + | if ((fX == fX)) | |
1077 | 947 | then { | |
1078 | - | let | |
1079 | - | let | |
1080 | - | let | |
1081 | - | let | |
1082 | - | then ( | |
948 | + | let ch = fX._3 | |
949 | + | let cG = fX._2 | |
950 | + | let fY = fX._1 | |
951 | + | let dp = if (if ((fe > 0)) | |
952 | + | then (fe > fY) | |
1083 | 953 | else false) | |
1084 | - | then | |
1085 | - | else | |
1086 | - | let | |
1087 | - | if (( | |
954 | + | then aD(makeString(["amount to receive is less than ", toString(fe)], "")) | |
955 | + | else fY | |
956 | + | let fM = invoke(aF, "emit", [dp], nil) | |
957 | + | if ((fM == fM)) | |
1088 | 958 | then { | |
1089 | - | let | |
1090 | - | let | |
1091 | - | if ($isInstanceOf( | |
959 | + | let fO = { | |
960 | + | let ax = fM | |
961 | + | if ($isInstanceOf(ax, "Address")) | |
1092 | 962 | then { | |
1093 | - | let | |
1094 | - | invoke( | |
963 | + | let fP = ax | |
964 | + | invoke(fP, "emit", [dp], nil) | |
1095 | 965 | } | |
1096 | 966 | else unit | |
1097 | 967 | } | |
1098 | - | if (( | |
968 | + | if ((fO == fO)) | |
1099 | 969 | then { | |
1100 | - | let | |
970 | + | let fS = if (fI) | |
1101 | 971 | then { | |
1102 | - | let | |
1103 | - | if (( | |
972 | + | let fT = invoke(be, "stake", nil, [AttachedPayment(cn, dp)]) | |
973 | + | if ((fT == fT)) | |
1104 | 974 | then nil | |
1105 | 975 | else throw("Strict value is not equal to itself.") | |
1106 | 976 | } | |
1107 | - | else [ScriptTransfer( | |
1108 | - | let | |
1109 | - | then [ScriptTransfer( | |
977 | + | else [ScriptTransfer(dK.caller, dp, cn)] | |
978 | + | let fv = if ((ch > 0)) | |
979 | + | then [ScriptTransfer(aJ, ch, fromBase58String(ck))] | |
1110 | 980 | else nil | |
1111 | - | let gN = if ((this == aR)) | |
1112 | - | then $Tuple2(0, 0) | |
1113 | - | else { | |
1114 | - | let gO = if ((fg.assetId == bg)) | |
1115 | - | then true | |
1116 | - | else false | |
1117 | - | if (gO) | |
1118 | - | then $Tuple2(-(cp), 0) | |
1119 | - | else $Tuple2(0, -(cp)) | |
1120 | - | } | |
1121 | - | let eQ = gN._1 | |
1122 | - | let eR = gN._2 | |
1123 | - | let gP = eP(eQ, eR, 0) | |
1124 | - | let gg = gP._1 | |
1125 | - | let eG = gP._2 | |
1126 | - | $Tuple2((((cO ++ gF) ++ ga) ++ gg), dx) | |
981 | + | $Tuple2(((cG ++ fS) ++ fv), dp) | |
1127 | 982 | } | |
1128 | 983 | else throw("Strict value is not equal to itself.") | |
1129 | 984 | } | |
1136 | 991 | ||
1137 | 992 | ||
1138 | 993 | ||
1139 | - | @Callable( | |
1140 | - | func putForFree ( | |
994 | + | @Callable(dK) | |
995 | + | func putForFree (fZ) = if ((0 > fZ)) | |
1141 | 996 | then throw("Wrong slpg") | |
1142 | - | else if ((size( | |
997 | + | else if ((size(dK.payments) != 2)) | |
1143 | 998 | then throw("2 pmnts expd") | |
1144 | 999 | else { | |
1145 | - | let gR = fh(toString(dV.caller), toBase58String(dV.transactionId), AttachedPayment(value(dV.payments[0]).assetId, value(dV.payments[0]).amount), dV.payments[1], gQ, false, false, true, 0, "") | |
1146 | - | let cO = gR._9 | |
1147 | - | let gx = toBigInt(value(dV.payments[0]).amount) | |
1148 | - | let gy = toBigInt(value(dV.payments[1]).amount) | |
1149 | - | let eO = eH(gx, gy, toBigInt(0)) | |
1150 | - | if ((eO == eO)) | |
1151 | - | then { | |
1152 | - | let gS = eP(0, 0, 0) | |
1153 | - | let gg = gS._1 | |
1154 | - | let eG = gS._2 | |
1155 | - | let gh = eT(eO, eG) | |
1156 | - | if ((gh == gh)) | |
1157 | - | then (cO ++ gg) | |
1158 | - | else throw("Strict value is not equal to itself.") | |
1159 | - | } | |
1160 | - | else throw("Strict value is not equal to itself.") | |
1000 | + | let ga = dM(toString(dK.caller), toBase58String(dK.transactionId), AttachedPayment(value(dK.payments[0]).assetId, value(dK.payments[0]).amount), dK.payments[1], fZ, false, false, true, 0, "") | |
1001 | + | ga._9 | |
1161 | 1002 | } | |
1162 | 1003 | ||
1163 | 1004 | ||
1164 | 1005 | ||
1165 | - | @Callable( | |
1006 | + | @Callable(dK) | |
1166 | 1007 | func get () = { | |
1167 | - | let dk = ff(dV) | |
1168 | - | let gT = dk._1 | |
1169 | - | let cN = dk._2 | |
1170 | - | let cY = dk._3 | |
1171 | - | let cs = dk._4 | |
1172 | - | let cO = dk._5 | |
1173 | - | let ew = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
1174 | - | if ((ew == ew)) | |
1008 | + | let dc = dJ(dK) | |
1009 | + | let gb = dc._1 | |
1010 | + | let cF = dc._2 | |
1011 | + | let cQ = dc._3 | |
1012 | + | let ck = dc._4 | |
1013 | + | let cG = dc._5 | |
1014 | + | let ez = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
1015 | + | if ((ez == ez)) | |
1016 | + | then cG | |
1017 | + | else throw("Strict value is not equal to itself.") | |
1018 | + | } | |
1019 | + | ||
1020 | + | ||
1021 | + | ||
1022 | + | @Callable(dK) | |
1023 | + | func getOneTknV2 (fd,fe) = { | |
1024 | + | let fU = { | |
1025 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1026 | + | if ($isInstanceOf(fm, "Boolean")) | |
1027 | + | then fm | |
1028 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1029 | + | } | |
1030 | + | let gc = if (if (aH()) | |
1031 | + | then true | |
1032 | + | else (aW == q)) | |
1033 | + | then true | |
1034 | + | else fU | |
1035 | + | let fW = [if (if (!(gc)) | |
1036 | + | then true | |
1037 | + | else fA(dK)) | |
1038 | + | then true | |
1039 | + | else aD("get operation is blocked by admin"), if ((size(dK.payments) == 1)) | |
1040 | + | then true | |
1041 | + | else aD("exactly 1 payment are expected")] | |
1042 | + | if ((fW == fW)) | |
1175 | 1043 | then { | |
1176 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(cY)) | |
1177 | - | let gU = eP(-(gT), -(cN), 0) | |
1178 | - | let gg = gU._1 | |
1179 | - | let eG = gU._2 | |
1180 | - | let gh = eT(eO, eG) | |
1181 | - | if ((gh == gh)) | |
1182 | - | then (cO ++ gg) | |
1183 | - | else throw("Strict value is not equal to itself.") | |
1044 | + | let gd = fc(fd, fe, dK.payments, dK.caller, dK.originCaller, dK.transactionId) | |
1045 | + | let cG = gd._1 | |
1046 | + | let fo = gd._2 | |
1047 | + | $Tuple2(cG, fo) | |
1184 | 1048 | } | |
1185 | 1049 | else throw("Strict value is not equal to itself.") | |
1186 | 1050 | } | |
1187 | 1051 | ||
1188 | 1052 | ||
1189 | 1053 | ||
1190 | - | @Callable(dV) | |
1191 | - | func getOneTknV2 (fI,fJ) = { | |
1192 | - | let gI = { | |
1193 | - | let fR = invoke(aN, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1194 | - | if ($isInstanceOf(fR, "Boolean")) | |
1195 | - | then fR | |
1196 | - | else throw(($getType(fR) + " couldn't be cast to Boolean")) | |
1197 | - | } | |
1198 | - | let gV = if (if (aP()) | |
1199 | - | then true | |
1200 | - | else (be == s)) | |
1201 | - | then true | |
1202 | - | else gI | |
1203 | - | let gK = [if (if (!(gV)) | |
1204 | - | then true | |
1205 | - | else gl(dV)) | |
1206 | - | then true | |
1207 | - | else aK("get operation is blocked by admin"), if ((size(dV.payments) == 1)) | |
1208 | - | then true | |
1209 | - | else aK("exactly 1 payment are expected")] | |
1210 | - | if ((gK == gK)) | |
1211 | - | then { | |
1212 | - | let gW = fH(fI, fJ, dV.payments, dV.caller, dV.originCaller, dV.transactionId) | |
1213 | - | let cO = gW._1 | |
1214 | - | let fT = gW._2 | |
1215 | - | $Tuple2(cO, fT) | |
1216 | - | } | |
1217 | - | else throw("Strict value is not equal to itself.") | |
1054 | + | @Callable(dK) | |
1055 | + | func getOneTknV2READONLY (fd,ge) = { | |
1056 | + | let aS = aK() | |
1057 | + | let co = aS[u] | |
1058 | + | let cp = aS[v] | |
1059 | + | let cn = aS[t] | |
1060 | + | let dR = [toBigInt(bx(co)), toBigInt(bx(cp))] | |
1061 | + | let gf = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cn)), "invalid lp asset").quantity) | |
1062 | + | let bK = dQ(dR) | |
1063 | + | let bJ = (bK - fraction(toBigInt(ge), bK, gf)) | |
1064 | + | let gg = if ((fd == co)) | |
1065 | + | then 0 | |
1066 | + | else if ((fd == cp)) | |
1067 | + | then 1 | |
1068 | + | else throw("invalid out asset id") | |
1069 | + | let gh = ev(dR, gg, bJ) | |
1070 | + | let gi = (dR[gg] - gh) | |
1071 | + | let gj = max([0, toInt((gi - f))]) | |
1072 | + | let gk = cf(gj) | |
1073 | + | let fn = gk._1 | |
1074 | + | let ch = gk._2 | |
1075 | + | $Tuple2(nil, $Tuple2(fn, ch)) | |
1218 | 1076 | } | |
1219 | 1077 | ||
1220 | 1078 | ||
1221 | 1079 | ||
1222 | - | @Callable(dV) | |
1223 | - | func refreshDLp () = { | |
1224 | - | let gX = valueOrElse(getInteger(al), 0) | |
1225 | - | let gY = if (((height - gX) >= ao)) | |
1226 | - | then unit | |
1227 | - | else aK(makeString([toString(ao), " blocks have not passed since the previous call"], "")) | |
1228 | - | if ((gY == gY)) | |
1229 | - | then { | |
1230 | - | let fa = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ak), "0")), aM("invalid dLp")) | |
1231 | - | let gZ = eP(0, 0, 0) | |
1232 | - | let ha = gZ._1 | |
1233 | - | let eG = gZ._2 | |
1234 | - | let eS = if ((fa != eG)) | |
1235 | - | then ha | |
1236 | - | else aK("nothing to refresh") | |
1237 | - | $Tuple2(eS, toString(eG)) | |
1238 | - | } | |
1239 | - | else throw("Strict value is not equal to itself.") | |
1080 | + | @Callable(dK) | |
1081 | + | func getOneTknV2WithBonusREADONLY (fd,ge) = { | |
1082 | + | let aS = aK() | |
1083 | + | let co = aS[u] | |
1084 | + | let cp = aS[v] | |
1085 | + | let cn = aS[t] | |
1086 | + | let cu = bx(co) | |
1087 | + | let cw = bx(cp) | |
1088 | + | let gl = { | |
1089 | + | let fm = invoke(this, "getOneTknV2READONLY", [fd, ge], nil) | |
1090 | + | if ($isInstanceOf(fm, "(Int, Int)")) | |
1091 | + | then fm | |
1092 | + | else throw(($getType(fm) + " couldn't be cast to (Int, Int)")) | |
1093 | + | } | |
1094 | + | let fn = gl._1 | |
1095 | + | let ch = gl._2 | |
1096 | + | let dc = ci("", cn, ge, this) | |
1097 | + | let cE = dc._1 | |
1098 | + | let cF = dc._2 | |
1099 | + | let gm = (cE + cF) | |
1100 | + | let fb = if ((gm == 0)) | |
1101 | + | then if ((fn == 0)) | |
1102 | + | then 0 | |
1103 | + | else throw("bonus calculation error") | |
1104 | + | else fraction((fn - gm), a, gm) | |
1105 | + | $Tuple2(nil, $Tuple3(fn, ch, fb)) | |
1240 | 1106 | } | |
1241 | 1107 | ||
1242 | 1108 | ||
1243 | 1109 | ||
1244 | - | @Callable(dV) | |
1245 | - | func getOneTknV2READONLY (fI,hb) = { | |
1246 | - | let ba = aS() | |
1247 | - | let cw = ba[w] | |
1248 | - | let cx = ba[x] | |
1249 | - | let cv = ba[v] | |
1250 | - | let dF = [toBigInt(bF(cw)), toBigInt(bF(cx))] | |
1251 | - | let eF = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cv)), "invalid lp asset").quantity) | |
1252 | - | let bS = dE(dF) | |
1253 | - | let bR = (bS - fraction(toBigInt(hb), bS, eF)) | |
1254 | - | let hc = if ((fI == cw)) | |
1255 | - | then 0 | |
1256 | - | else if ((fI == cx)) | |
1257 | - | then 1 | |
1258 | - | else throw("invalid out asset id") | |
1259 | - | let hd = es(dF, hc, bR) | |
1260 | - | let he = (dF[hc] - hd) | |
1261 | - | let hf = max([0, toInt((he - f))]) | |
1262 | - | let hg = cn(hf) | |
1263 | - | let fS = hg._1 | |
1264 | - | let cp = hg._2 | |
1265 | - | $Tuple2(nil, $Tuple2(fS, cp)) | |
1266 | - | } | |
1267 | - | ||
1268 | - | ||
1269 | - | ||
1270 | - | @Callable(dV) | |
1271 | - | func getOneTknV2WithBonusREADONLY (fI,hb) = { | |
1272 | - | let ba = aS() | |
1273 | - | let cw = ba[w] | |
1274 | - | let cx = ba[x] | |
1275 | - | let cv = ba[v] | |
1276 | - | let cC = bF(cw) | |
1277 | - | let cE = bF(cx) | |
1278 | - | let hh = { | |
1279 | - | let fR = invoke(this, "getOneTknV2READONLY", [fI, hb], nil) | |
1280 | - | if ($isInstanceOf(fR, "(Int, Int)")) | |
1281 | - | then fR | |
1282 | - | else throw(($getType(fR) + " couldn't be cast to (Int, Int)")) | |
1283 | - | } | |
1284 | - | let fS = hh._1 | |
1285 | - | let cp = hh._2 | |
1286 | - | let dk = cq("", cv, hb, this) | |
1287 | - | let cM = dk._1 | |
1288 | - | let cN = dk._2 | |
1289 | - | let hi = (cM + cN) | |
1290 | - | let fG = if ((hi == 0)) | |
1291 | - | then if ((fS == 0)) | |
1292 | - | then 0 | |
1293 | - | else throw("bonus calculation error") | |
1294 | - | else fraction((fS - hi), a, hi) | |
1295 | - | $Tuple2(nil, $Tuple3(fS, cp, fG)) | |
1296 | - | } | |
1297 | - | ||
1298 | - | ||
1299 | - | ||
1300 | - | @Callable(dV) | |
1301 | - | func getNoLess (hj,hk) = { | |
1302 | - | let dk = ff(dV) | |
1303 | - | let cM = dk._1 | |
1304 | - | let cN = dk._2 | |
1305 | - | let cY = dk._3 | |
1306 | - | let cs = dk._4 | |
1307 | - | let cO = dk._5 | |
1308 | - | if ((hj > cM)) | |
1309 | - | then throw(((("Failed: " + toString(cM)) + " < ") + toString(hj))) | |
1310 | - | else if ((hk > cN)) | |
1311 | - | then throw(((("Failed: " + toString(cN)) + " < ") + toString(hk))) | |
1110 | + | @Callable(dK) | |
1111 | + | func getNoLess (gn,go) = { | |
1112 | + | let dc = dJ(dK) | |
1113 | + | let cE = dc._1 | |
1114 | + | let cF = dc._2 | |
1115 | + | let cQ = dc._3 | |
1116 | + | let ck = dc._4 | |
1117 | + | let cG = dc._5 | |
1118 | + | if ((gn > cE)) | |
1119 | + | then throw(((("Failed: " + toString(cE)) + " < ") + toString(gn))) | |
1120 | + | else if ((go > cF)) | |
1121 | + | then throw(((("Failed: " + toString(cF)) + " < ") + toString(go))) | |
1312 | 1122 | else { | |
1313 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(cY)) | |
1314 | - | let hl = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
1315 | - | if ((hl == hl)) | |
1316 | - | then { | |
1317 | - | let hm = eP(-(cM), -(cN), 0) | |
1318 | - | let gg = hm._1 | |
1319 | - | let eG = hm._2 | |
1320 | - | let gh = eT(eO, eG) | |
1321 | - | if ((gh == gh)) | |
1322 | - | then (cO ++ gg) | |
1323 | - | else throw("Strict value is not equal to itself.") | |
1324 | - | } | |
1123 | + | let gp = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
1124 | + | if ((gp == gp)) | |
1125 | + | then cG | |
1325 | 1126 | else throw("Strict value is not equal to itself.") | |
1326 | 1127 | } | |
1327 | 1128 | } | |
1328 | 1129 | ||
1329 | 1130 | ||
1330 | 1131 | ||
1331 | - | @Callable( | |
1332 | - | func unstakeAndGet ( | |
1333 | - | let | |
1132 | + | @Callable(dK) | |
1133 | + | func unstakeAndGet (cg) = { | |
1134 | + | let gq = if ((size(dK.payments) != 0)) | |
1334 | 1135 | then throw("No pmnts expd") | |
1335 | 1136 | else true | |
1336 | - | if (( | |
1137 | + | if ((gq == gq)) | |
1337 | 1138 | then { | |
1338 | - | let ce = aS() | |
1339 | - | let ho = bk() | |
1340 | - | let gA = fromBase58String(ce[v]) | |
1341 | - | let hp = valueOrErrorMessage(addressFromString(ho[C]), "Wr st addr") | |
1342 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1343 | - | let hq = invoke(hp, "unstake", [toBase58String(gA), co], nil) | |
1344 | - | if ((hq == hq)) | |
1139 | + | let bW = aK() | |
1140 | + | let gr = bc() | |
1141 | + | let fN = fromBase58String(bW[t]) | |
1142 | + | let gs = valueOrErrorMessage(addressFromString(gr[A]), "Wr st addr") | |
1143 | + | let gt = invoke(gs, "unstake", [toBase58String(fN), cg], nil) | |
1144 | + | if ((gt == gt)) | |
1345 | 1145 | then { | |
1346 | - | let dk = cq(toBase58String(dV.transactionId), toBase58String(gA), co, dV.caller) | |
1347 | - | let cM = dk._1 | |
1348 | - | let cN = dk._2 | |
1349 | - | let cA = parseIntValue(dk._9) | |
1350 | - | let cO = dk._10 | |
1351 | - | let hr = if (if (aP()) | |
1146 | + | let dc = ci(toBase58String(dK.transactionId), toBase58String(fN), cg, dK.caller) | |
1147 | + | let cs = parseIntValue(dc._9) | |
1148 | + | let cG = dc._10 | |
1149 | + | let gu = if (if (aH()) | |
1352 | 1150 | then true | |
1353 | - | else ( | |
1354 | - | then throw(("Blocked: " + toString( | |
1151 | + | else (cs == q)) | |
1152 | + | then throw(("Blocked: " + toString(cs))) | |
1355 | 1153 | else true | |
1356 | - | if (( | |
1154 | + | if ((gu == gu)) | |
1357 | 1155 | then { | |
1358 | - | let hs = invoke(aN, "burn", [co], [AttachedPayment(gA, co)]) | |
1359 | - | if ((hs == hs)) | |
1360 | - | then { | |
1361 | - | let ht = eP(-(cM), -(cN), 0) | |
1362 | - | let gg = ht._1 | |
1363 | - | let eG = ht._2 | |
1364 | - | let gh = eT(eO, eG) | |
1365 | - | if ((gh == gh)) | |
1366 | - | then (cO ++ gg) | |
1367 | - | else throw("Strict value is not equal to itself.") | |
1368 | - | } | |
1156 | + | let gv = invoke(aF, "burn", [cg], [AttachedPayment(fN, cg)]) | |
1157 | + | if ((gv == gv)) | |
1158 | + | then cG | |
1369 | 1159 | else throw("Strict value is not equal to itself.") | |
1370 | 1160 | } | |
1371 | 1161 | else throw("Strict value is not equal to itself.") | |
1377 | 1167 | ||
1378 | 1168 | ||
1379 | 1169 | ||
1380 | - | @Callable( | |
1381 | - | func unstakeAndGetNoLess ( | |
1382 | - | let | |
1170 | + | @Callable(dK) | |
1171 | + | func unstakeAndGetNoLess (gw,gx,go) = { | |
1172 | + | let gc = if (aH()) | |
1383 | 1173 | then true | |
1384 | - | else ( | |
1385 | - | let | |
1174 | + | else (aW == q) | |
1175 | + | let fW = [if (!(gc)) | |
1386 | 1176 | then true | |
1387 | - | else throw("get operation is blocked by admin"), if ((size( | |
1177 | + | else throw("get operation is blocked by admin"), if ((size(dK.payments) == 0)) | |
1388 | 1178 | then true | |
1389 | 1179 | else throw("no payments are expected")] | |
1390 | - | if (( | |
1180 | + | if ((fW == fW)) | |
1391 | 1181 | then { | |
1392 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1393 | - | let hq = invoke(bm, "unstake", [toBase58String(bf), hu], nil) | |
1394 | - | if ((hq == hq)) | |
1182 | + | let gt = invoke(be, "unstake", [toBase58String(aX), gw], nil) | |
1183 | + | if ((gt == gt)) | |
1395 | 1184 | then { | |
1396 | - | let | |
1397 | - | let | |
1398 | - | let | |
1399 | - | let | |
1400 | - | let | |
1185 | + | let gy = ci(toBase58String(dK.transactionId), toBase58String(aX), gw, dK.caller) | |
1186 | + | let cE = gy._1 | |
1187 | + | let cF = gy._2 | |
1188 | + | let cG = gy._10 | |
1189 | + | let gz = [if ((cE >= gx)) | |
1401 | 1190 | then true | |
1402 | - | else throw(makeString(["amount asset amount to receive is less than ", toString( | |
1191 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(gx)], "")), if ((cF >= go)) | |
1403 | 1192 | then true | |
1404 | - | else throw(makeString(["price asset amount to receive is less than ", toString( | |
1405 | - | if (( | |
1193 | + | else throw(makeString(["price asset amount to receive is less than ", toString(go)], ""))] | |
1194 | + | if ((gz == gz)) | |
1406 | 1195 | then { | |
1407 | - | let hl = invoke(aN, "burn", [hu], [AttachedPayment(bf, hu)]) | |
1408 | - | if ((hl == hl)) | |
1409 | - | then { | |
1410 | - | let hy = eP(-(cM), -(cN), 0) | |
1411 | - | let gg = hy._1 | |
1412 | - | let eG = hy._2 | |
1413 | - | let gh = eT(eO, eG) | |
1414 | - | if ((gh == gh)) | |
1415 | - | then (cO ++ gg) | |
1416 | - | else throw("Strict value is not equal to itself.") | |
1417 | - | } | |
1196 | + | let gp = invoke(aF, "burn", [gw], [AttachedPayment(aX, gw)]) | |
1197 | + | if ((gp == gp)) | |
1198 | + | then cG | |
1418 | 1199 | else throw("Strict value is not equal to itself.") | |
1419 | 1200 | } | |
1420 | 1201 | else throw("Strict value is not equal to itself.") | |
1426 | 1207 | ||
1427 | 1208 | ||
1428 | 1209 | ||
1429 | - | @Callable( | |
1430 | - | func unstakeAndGetOneTknV2 ( | |
1431 | - | let | |
1432 | - | let | |
1433 | - | if ($isInstanceOf( | |
1434 | - | then | |
1435 | - | else throw(($getType( | |
1210 | + | @Callable(dK) | |
1211 | + | func unstakeAndGetOneTknV2 (gw,fd,fe) = { | |
1212 | + | let fU = { | |
1213 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1214 | + | if ($isInstanceOf(fm, "Boolean")) | |
1215 | + | then fm | |
1216 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1436 | 1217 | } | |
1437 | - | let | |
1218 | + | let gc = if (if (aH()) | |
1438 | 1219 | then true | |
1439 | - | else ( | |
1220 | + | else (aW == q)) | |
1440 | 1221 | then true | |
1441 | - | else | |
1442 | - | let | |
1222 | + | else fU | |
1223 | + | let fW = [if (if (!(gc)) | |
1443 | 1224 | then true | |
1444 | - | else | |
1225 | + | else fA(dK)) | |
1445 | 1226 | then true | |
1446 | - | else | |
1227 | + | else aD("get operation is blocked by admin"), if ((size(dK.payments) == 0)) | |
1447 | 1228 | then true | |
1448 | - | else | |
1449 | - | if (( | |
1229 | + | else aD("no payments are expected")] | |
1230 | + | if ((fW == fW)) | |
1450 | 1231 | then { | |
1451 | - | let | |
1452 | - | let | |
1453 | - | let | |
1454 | - | let | |
1455 | - | let | |
1456 | - | if (( | |
1232 | + | let bW = aK() | |
1233 | + | let gr = bc() | |
1234 | + | let fN = fromBase58String(bW[t]) | |
1235 | + | let gs = valueOrErrorMessage(addressFromString(gr[A]), "Wr st addr") | |
1236 | + | let gt = invoke(gs, "unstake", [toBase58String(fN), gw], nil) | |
1237 | + | if ((gt == gt)) | |
1457 | 1238 | then { | |
1458 | - | let | |
1459 | - | let | |
1460 | - | let | |
1461 | - | $Tuple2( | |
1239 | + | let gA = fc(fd, fe, [AttachedPayment(fN, gw)], dK.caller, dK.originCaller, dK.transactionId) | |
1240 | + | let cG = gA._1 | |
1241 | + | let fo = gA._2 | |
1242 | + | $Tuple2(cG, fo) | |
1462 | 1243 | } | |
1463 | 1244 | else throw("Strict value is not equal to itself.") | |
1464 | 1245 | } | |
1467 | 1248 | ||
1468 | 1249 | ||
1469 | 1250 | ||
1470 | - | @Callable( | |
1471 | - | func putOneTknV2WithBonusREADONLY ( | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1479 | - | let | |
1480 | - | let | |
1481 | - | $Tuple2(nil, $Tuple3( | |
1251 | + | @Callable(dK) | |
1252 | + | func putOneTknV2WithBonusREADONLY (gB,gC) = { | |
1253 | + | let aS = aK() | |
1254 | + | let co = aS[u] | |
1255 | + | let cp = aS[v] | |
1256 | + | let cn = aS[t] | |
1257 | + | let gD = eF(gB, gC, "", "", true) | |
1258 | + | let eW = gD._1 | |
1259 | + | let cG = gD._2 | |
1260 | + | let ch = gD._3 | |
1261 | + | let fb = gD._4 | |
1262 | + | $Tuple2(nil, $Tuple3(eW, ch, fb)) | |
1482 | 1263 | } | |
1483 | 1264 | ||
1484 | 1265 | ||
1485 | 1266 | ||
1486 | - | @Callable( | |
1487 | - | func putOneTknV2WithoutTakeFeeREADONLY ( | |
1488 | - | let | |
1489 | - | let | |
1490 | - | let | |
1491 | - | let | |
1492 | - | let | |
1493 | - | let | |
1494 | - | let | |
1495 | - | let | |
1496 | - | let | |
1497 | - | $Tuple2(nil, $Tuple3( | |
1267 | + | @Callable(dK) | |
1268 | + | func putOneTknV2WithoutTakeFeeREADONLY (gB,gC) = { | |
1269 | + | let aS = aK() | |
1270 | + | let co = aS[u] | |
1271 | + | let cp = aS[v] | |
1272 | + | let cn = aS[t] | |
1273 | + | let gE = eF(gB, gC, "", "", false) | |
1274 | + | let eW = gE._1 | |
1275 | + | let cG = gE._2 | |
1276 | + | let ch = gE._3 | |
1277 | + | let fb = gE._4 | |
1278 | + | $Tuple2(nil, $Tuple3(eW, ch, fb)) | |
1498 | 1279 | } | |
1499 | 1280 | ||
1500 | 1281 | ||
1501 | 1282 | ||
1502 | - | @Callable( | |
1503 | - | func activate ( | |
1283 | + | @Callable(dK) | |
1284 | + | func activate (gF,gG) = if ((toString(dK.caller) != toString(aF))) | |
1504 | 1285 | then throw("denied") | |
1505 | - | else $Tuple2([StringEntry( | |
1286 | + | else $Tuple2([StringEntry(ac(), gF), StringEntry(ad(), gG)], "success") | |
1506 | 1287 | ||
1507 | 1288 | ||
1508 | 1289 | ||
1509 | - | @Callable( | |
1510 | - | func setS ( | |
1511 | - | then | |
1512 | - | else [StringEntry( | |
1290 | + | @Callable(dK) | |
1291 | + | func setS (gH,gu) = if ((toString(dK.caller) != az(this, af()))) | |
1292 | + | then fz | |
1293 | + | else [StringEntry(gH, gu)] | |
1513 | 1294 | ||
1514 | 1295 | ||
1515 | 1296 | ||
1516 | - | @Callable( | |
1517 | - | func setI ( | |
1518 | - | then | |
1519 | - | else [IntegerEntry( | |
1297 | + | @Callable(dK) | |
1298 | + | func setI (gH,gu) = if ((toString(dK.caller) != az(this, af()))) | |
1299 | + | then fz | |
1300 | + | else [IntegerEntry(gH, gu)] | |
1520 | 1301 | ||
1521 | 1302 | ||
1522 | 1303 | ||
1523 | - | @Callable( | |
1524 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
1304 | + | @Callable(dK) | |
1305 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aK()) | |
1525 | 1306 | ||
1526 | 1307 | ||
1527 | 1308 | ||
1528 | - | @Callable( | |
1529 | - | func getAccBalanceWrapperREADONLY ( | |
1309 | + | @Callable(dK) | |
1310 | + | func getAccBalanceWrapperREADONLY (by) = $Tuple2(nil, bx(by)) | |
1530 | 1311 | ||
1531 | 1312 | ||
1532 | 1313 | ||
1533 | - | @Callable( | |
1534 | - | func calcPricesWrapperREADONLY ( | |
1535 | - | let | |
1536 | - | $Tuple2(nil, [toString( | |
1314 | + | @Callable(dK) | |
1315 | + | func calcPricesWrapperREADONLY (bQ,bR,bV) = { | |
1316 | + | let gI = bU(bQ, bR, bV) | |
1317 | + | $Tuple2(nil, [toString(gI[0]), toString(gI[1]), toString(gI[2])]) | |
1537 | 1318 | } | |
1538 | 1319 | ||
1539 | 1320 | ||
1540 | 1321 | ||
1541 | - | @Callable( | |
1542 | - | func fromX18WrapperREADONLY ( | |
1322 | + | @Callable(dK) | |
1323 | + | func fromX18WrapperREADONLY (J,gJ) = $Tuple2(nil, I(parseBigIntValue(J), gJ)) | |
1543 | 1324 | ||
1544 | 1325 | ||
1545 | 1326 | ||
1546 | - | @Callable( | |
1547 | - | func toX18WrapperREADONLY ( | |
1327 | + | @Callable(dK) | |
1328 | + | func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H))) | |
1548 | 1329 | ||
1549 | 1330 | ||
1550 | 1331 | ||
1551 | - | @Callable( | |
1552 | - | func calcPriceBigIntWrapperREADONLY ( | |
1332 | + | @Callable(dK) | |
1333 | + | func calcPriceBigIntWrapperREADONLY (bA,bB) = $Tuple2(nil, toString(bz(parseBigIntValue(bA), parseBigIntValue(bB)))) | |
1553 | 1334 | ||
1554 | 1335 | ||
1555 | 1336 | ||
1556 | - | @Callable( | |
1557 | - | func estimatePutOperationWrapperREADONLY ( | |
1337 | + | @Callable(dK) | |
1338 | + | func estimatePutOperationWrapperREADONLY (cj,bF,cI,cJ,cK,cL,gK,cM,cN) = $Tuple2(nil, cH(cj, bF, cI, cJ, cK, cL, gK, cM, cN, true, false, 0, "")) | |
1558 | 1339 | ||
1559 | 1340 | ||
1560 | 1341 | ||
1561 | - | @Callable( | |
1562 | - | func estimateGetOperationWrapperREADONLY ( | |
1563 | - | let | |
1564 | - | $Tuple2(nil, $Tuple10( | |
1342 | + | @Callable(dK) | |
1343 | + | func estimateGetOperationWrapperREADONLY (cj,gL,cl,gK) = { | |
1344 | + | let dc = ci(cj, gL, cl, addressFromStringValue(gK)) | |
1345 | + | $Tuple2(nil, $Tuple10(dc._1, dc._2, dc._3, dc._4, dc._5, dc._6, dc._7, toString(dc._8), dc._9, dc._10)) | |
1565 | 1346 | } | |
1566 | 1347 | ||
1567 | 1348 | ||
1568 | 1349 | ||
1569 | - | @Callable( | |
1570 | - | func getFeeREADONLY () = $Tuple2(nil, | |
1350 | + | @Callable(dK) | |
1351 | + | func getFeeREADONLY () = $Tuple2(nil, ah) | |
1571 | 1352 | ||
1572 | 1353 | ||
1573 | - | @Verifier( | |
1574 | - | func | |
1575 | - | let | |
1576 | - | let | |
1577 | - | if ($isInstanceOf( | |
1354 | + | @Verifier(gM) | |
1355 | + | func gN () = { | |
1356 | + | let gO = { | |
1357 | + | let ax = fx() | |
1358 | + | if ($isInstanceOf(ax, "ByteVector")) | |
1578 | 1359 | then { | |
1579 | - | let | |
1580 | - | | |
1360 | + | let fB = ax | |
1361 | + | fB | |
1581 | 1362 | } | |
1582 | - | else if ($isInstanceOf( | |
1583 | - | then | |
1363 | + | else if ($isInstanceOf(ax, "Unit")) | |
1364 | + | then gM.senderPublicKey | |
1584 | 1365 | else throw("Match error") | |
1585 | 1366 | } | |
1586 | - | let | |
1587 | - | if ($isInstanceOf( | |
1367 | + | let ax = gM | |
1368 | + | if ($isInstanceOf(ax, "Order")) | |
1588 | 1369 | then { | |
1589 | - | let | |
1590 | - | let | |
1591 | - | let | |
1592 | - | let | |
1593 | - | let | |
1594 | - | if (if (if ( | |
1595 | - | then | |
1370 | + | let dx = ax | |
1371 | + | let gP = aI() | |
1372 | + | let gQ = dw(dx) | |
1373 | + | let gR = sigVerify(dx.bodyBytes, dx.proofs[0], dx.senderPublicKey) | |
1374 | + | let gS = sigVerify(dx.bodyBytes, dx.proofs[1], gP) | |
1375 | + | if (if (if (gQ) | |
1376 | + | then gR | |
1596 | 1377 | else false) | |
1597 | - | then | |
1378 | + | then gS | |
1598 | 1379 | else false) | |
1599 | 1380 | then true | |
1600 | - | else | |
1381 | + | else as(gQ, gR, gS) | |
1601 | 1382 | } | |
1602 | - | else if ($isInstanceOf( | |
1383 | + | else if ($isInstanceOf(ax, "SetScriptTransaction")) | |
1603 | 1384 | then { | |
1604 | - | let | |
1605 | - | let | |
1606 | - | let | |
1607 | - | let | |
1608 | - | if (if (( | |
1609 | - | then ( | |
1385 | + | let dX = ax | |
1386 | + | let gT = blake2b256(value(dX.script)) | |
1387 | + | let gU = fromBase64String(value(getString(aF, aq()))) | |
1388 | + | let gV = scriptHash(this) | |
1389 | + | if (if ((gU == gT)) | |
1390 | + | then (gV != gT) | |
1610 | 1391 | else false) | |
1611 | 1392 | then true | |
1612 | - | else sigVerify( | |
1393 | + | else sigVerify(gM.bodyBytes, gM.proofs[0], gO) | |
1613 | 1394 | } | |
1614 | - | else sigVerify( | |
1395 | + | else sigVerify(gM.bodyBytes, gM.proofs[0], gO) | |
1615 | 1396 | } | |
1616 | 1397 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let c = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let d = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let e = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let f = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let g = toBigInt(2) | |
17 | 17 | ||
18 | - | let h = toBigInt( | |
18 | + | let h = toBigInt((a - ((a * 1) / a))) | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "WAVES" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "100" | |
23 | 23 | ||
24 | - | let k = " | |
24 | + | let k = "1" | |
25 | 25 | ||
26 | - | let l = " | |
26 | + | let l = "__" | |
27 | 27 | ||
28 | - | let m = " | |
28 | + | let m = "" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 1 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 2 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 3 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 4 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 1 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 3 | |
43 | 43 | ||
44 | - | let u = | |
44 | + | let u = 4 | |
45 | 45 | ||
46 | - | let v = | |
46 | + | let v = 5 | |
47 | 47 | ||
48 | - | let w = | |
48 | + | let w = 6 | |
49 | 49 | ||
50 | - | let x = | |
50 | + | let x = 7 | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = 8 | |
53 | 53 | ||
54 | - | let z = | |
54 | + | let z = 9 | |
55 | 55 | ||
56 | - | let A = | |
56 | + | let A = 1 | |
57 | 57 | ||
58 | - | let B = | |
58 | + | let B = 6 | |
59 | 59 | ||
60 | - | let C = | |
60 | + | let C = 7 | |
61 | 61 | ||
62 | - | let D = | |
62 | + | let D = 10 | |
63 | 63 | ||
64 | - | let E = | |
64 | + | let E = fraction(10, a, 10000) | |
65 | 65 | ||
66 | - | let F = 10 | |
67 | - | ||
68 | - | let G = fraction(10, a, 10000) | |
69 | - | ||
70 | - | func H (I,J) = fraction(toBigInt(I), c, toBigInt(J)) | |
66 | + | func F (G,H) = fraction(toBigInt(G), c, toBigInt(H)) | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
69 | + | func I (J,K) = toInt(fraction(J, toBigInt(K), c)) | |
74 | 70 | ||
75 | 71 | ||
76 | - | func | |
72 | + | func L (M,N,O) = fraction(M, N, O) | |
77 | 73 | ||
78 | 74 | ||
79 | - | func | |
80 | - | then -( | |
81 | - | else | |
75 | + | func P (J) = if ((d > J)) | |
76 | + | then -(J) | |
77 | + | else J | |
82 | 78 | ||
83 | 79 | ||
84 | - | func | |
85 | - | then -( | |
86 | - | else | |
80 | + | func Q (J) = if ((d > J)) | |
81 | + | then -(J) | |
82 | + | else J | |
87 | 83 | ||
88 | 84 | ||
89 | - | func | |
85 | + | func R () = "%s__factoryContract" | |
90 | 86 | ||
91 | 87 | ||
92 | - | func | |
88 | + | func S () = "%s__managerPublicKey" | |
93 | 89 | ||
94 | 90 | ||
95 | - | func | |
91 | + | func T () = "%s__pendingManagerPublicKey" | |
96 | 92 | ||
97 | 93 | ||
98 | - | func | |
94 | + | func U () = "%s%s__price__last" | |
99 | 95 | ||
100 | 96 | ||
101 | - | func | |
97 | + | func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l) | |
102 | 98 | ||
103 | 99 | ||
104 | - | func | |
100 | + | func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa) | |
105 | 101 | ||
106 | 102 | ||
107 | - | func | |
103 | + | func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa) | |
108 | 104 | ||
109 | 105 | ||
110 | - | func | |
106 | + | func ac () = "%s__amountAsset" | |
111 | 107 | ||
112 | 108 | ||
113 | - | func | |
109 | + | func ad () = "%s__priceAsset" | |
114 | 110 | ||
115 | 111 | ||
116 | - | func | |
112 | + | func ae () = "%s__amp" | |
117 | 113 | ||
118 | 114 | ||
119 | - | func | |
115 | + | func af () = "%s__addonAddr" | |
120 | 116 | ||
121 | 117 | ||
122 | - | let | |
118 | + | let ag = "%s__fee" | |
123 | 119 | ||
124 | - | let | |
120 | + | let ah = valueOrElse(getInteger(this, ag), E) | |
125 | 121 | ||
126 | - | let ak = makeString(["%s", "dLp"], n) | |
127 | - | ||
128 | - | let al = makeString(["%s", "dLpRefreshedHeight"], n) | |
129 | - | ||
130 | - | let am = makeString(["%s", "refreshDLpDelay"], n) | |
131 | - | ||
132 | - | let an = 1 | |
133 | - | ||
134 | - | let ao = valueOrElse(getInteger(this, am), an) | |
135 | - | ||
136 | - | func ap () = "%s__factoryConfig" | |
122 | + | func ai () = "%s__factoryConfig" | |
137 | 123 | ||
138 | 124 | ||
139 | - | func | |
125 | + | func aj () = "%s%s__matcher__publicKey" | |
140 | 126 | ||
141 | 127 | ||
142 | - | func | |
128 | + | func ak (al,am) = (((("%d%d%s__" + al) + "__") + am) + "__config") | |
143 | 129 | ||
144 | 130 | ||
145 | - | func | |
131 | + | func an (ao) = ("%s%s%s__mappings__baseAsset2internalId__" + ao) | |
146 | 132 | ||
147 | 133 | ||
148 | - | func | |
134 | + | func ap () = "%s__shutdown" | |
149 | 135 | ||
150 | 136 | ||
151 | - | func | |
137 | + | func aq () = "%s__allowedLpStableScriptHash" | |
152 | 138 | ||
153 | 139 | ||
154 | - | func | |
140 | + | func ar () = "%s__feeCollectorAddress" | |
155 | 141 | ||
156 | 142 | ||
157 | - | func | |
143 | + | func as (at,au,av) = throw(((((("Failed: ordValid=" + toString(at)) + " sndrValid=") + toString(au)) + " mtchrValid=") + toString(av))) | |
158 | 144 | ||
159 | 145 | ||
160 | - | func | |
161 | - | let | |
162 | - | if ($isInstanceOf( | |
146 | + | func aw (J) = { | |
147 | + | let ax = J | |
148 | + | if ($isInstanceOf(ax, "String")) | |
163 | 149 | then { | |
164 | - | let | |
165 | - | | |
150 | + | let ay = ax | |
151 | + | ay | |
166 | 152 | } | |
167 | 153 | else throw("fail cast to String") | |
168 | 154 | } | |
169 | 155 | ||
170 | 156 | ||
171 | - | func | |
157 | + | func az (aA,aB) = valueOrErrorMessage(getString(aA, aB), makeString(["mandatory ", toString(aA), ".", aB, " not defined"], "")) | |
172 | 158 | ||
173 | 159 | ||
174 | - | func | |
160 | + | func aC (aA,aB) = valueOrErrorMessage(getInteger(aA, aB), makeString(["mandatory ", toString(aA), ".", aB, " not defined"], "")) | |
175 | 161 | ||
176 | 162 | ||
177 | - | func | |
163 | + | func aD (aE) = throw(makeString(["lp_stable.ride:", aE], " ")) | |
178 | 164 | ||
179 | 165 | ||
180 | - | func aM (aL) = makeString(["lp_stable.ride:", aL], " ") | |
166 | + | let aF = addressFromStringValue(az(this, R())) | |
167 | + | ||
168 | + | let aG = az(this, ae()) | |
169 | + | ||
170 | + | func aH () = valueOrElse(getBoolean(aF, ap()), false) | |
181 | 171 | ||
182 | 172 | ||
183 | - | let aN = addressFromStringValue(aG(this, T())) | |
184 | - | ||
185 | - | let aO = aG(this, ag()) | |
186 | - | ||
187 | - | func aP () = valueOrElse(getBoolean(aN, aw()), false) | |
173 | + | func aI () = fromBase58String(az(aF, aj())) | |
188 | 174 | ||
189 | 175 | ||
190 | - | ||
176 | + | let aJ = addressFromStringValue(az(aF, ar())) | |
191 | 177 | ||
192 | - | ||
193 | - | let aR = addressFromStringValue(aG(aN, ay())) | |
194 | - | ||
195 | - | func aS () = { | |
196 | - | let aT = aG(this, ae()) | |
197 | - | let aU = aG(this, af()) | |
198 | - | let aV = aJ(aN, au(aU)) | |
199 | - | let as = aJ(aN, au(aT)) | |
200 | - | split(aG(aN, ar(toString(as), toString(aV))), n) | |
178 | + | func aK () = { | |
179 | + | let aL = az(this, ac()) | |
180 | + | let aM = az(this, ad()) | |
181 | + | let aN = aC(aF, an(aM)) | |
182 | + | let al = aC(aF, an(aL)) | |
183 | + | split(az(aF, ak(toString(al), toString(aN))), l) | |
201 | 184 | } | |
202 | 185 | ||
203 | 186 | ||
204 | - | func | |
187 | + | func aO (aP) = if ((aP == i)) | |
205 | 188 | then unit | |
206 | - | else fromBase58String( | |
189 | + | else fromBase58String(aP) | |
207 | 190 | ||
208 | 191 | ||
209 | - | func | |
210 | - | then | |
211 | - | else toBase58String(value( | |
192 | + | func aQ (aP) = if ((aP == unit)) | |
193 | + | then i | |
194 | + | else toBase58String(value(aP)) | |
212 | 195 | ||
213 | 196 | ||
214 | - | func | |
197 | + | func aR (aS) = $Tuple7(addressFromStringValue(aS[r]), parseIntValue(aS[s]), fromBase58String(aS[t]), aO(aS[u]), aO(aS[v]), parseIntValue(aS[w]), parseIntValue(aS[x])) | |
215 | 198 | ||
216 | 199 | ||
217 | - | let | |
200 | + | let aT = aR(aK()) | |
218 | 201 | ||
219 | - | let | |
202 | + | let aU = aT | |
220 | 203 | ||
221 | - | let | |
204 | + | let aV = aU._1 | |
222 | 205 | ||
223 | - | let | |
206 | + | let aW = aU._2 | |
224 | 207 | ||
225 | - | let | |
208 | + | let aX = aU._3 | |
226 | 209 | ||
227 | - | let | |
210 | + | let aY = aU._4 | |
228 | 211 | ||
229 | - | let | |
212 | + | let aZ = aU._5 | |
230 | 213 | ||
231 | - | let | |
214 | + | let ba = aU._6 | |
232 | 215 | ||
233 | - | let | |
216 | + | let bb = aU._7 | |
234 | 217 | ||
235 | - | func | |
218 | + | func bc () = split(az(aF, ai()), l) | |
236 | 219 | ||
237 | 220 | ||
238 | - | let | |
221 | + | let bd = bc() | |
239 | 222 | ||
240 | - | let | |
223 | + | let be = valueOrErrorMessage(addressFromString(bd[A]), "Invalid staking contract address") | |
241 | 224 | ||
242 | - | let | |
225 | + | let bf = valueOrErrorMessage(addressFromString(bd[C]), "Invalid slipage contract address") | |
243 | 226 | ||
244 | - | let | |
227 | + | let bg = valueOrErrorMessage(addressFromString(bd[D]), "Invalid gwx contract address") | |
245 | 228 | ||
246 | - | let | |
229 | + | let bh = valueOrErrorMessage(addressFromString(bd[B]), "Invalid gwx contract address") | |
247 | 230 | ||
248 | - | func | |
231 | + | func bi (bj,bk,bl,bm,bn,bo,bp,bq,br,bs) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bj), toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs)], l) | |
249 | 232 | ||
250 | 233 | ||
251 | - | func | |
234 | + | func bt (bu,bv,bw,bm,bp,bq) = makeString(["%d%d%d%d%d%d", toString(bu), toString(bv), toString(bw), toString(bm), toString(bp), toString(bq)], l) | |
252 | 235 | ||
253 | 236 | ||
254 | - | func | |
237 | + | func bx (by) = if ((by == "WAVES")) | |
255 | 238 | then wavesBalance(this).available | |
256 | - | else assetBalance(this, fromBase58String( | |
239 | + | else assetBalance(this, fromBase58String(by)) | |
257 | 240 | ||
258 | 241 | ||
259 | - | func | |
242 | + | func bz (bA,bB) = fraction(bA, c, bB) | |
260 | 243 | ||
261 | 244 | ||
262 | - | func | |
263 | - | let | |
264 | - | let | |
265 | - | if (!( | |
266 | - | then throw(("Big slpg: " + toString( | |
267 | - | else $Tuple2( | |
245 | + | func bC (bD,bE,bF) = { | |
246 | + | let bG = fraction((bD - bE), b, bE) | |
247 | + | let bH = ((bF - P(bG)) > d) | |
248 | + | if (!(bH)) | |
249 | + | then throw(("Big slpg: " + toString(bG))) | |
250 | + | else $Tuple2(bH, min([bD, bE])) | |
268 | 251 | } | |
269 | 252 | ||
270 | 253 | ||
271 | - | func | |
272 | - | let | |
273 | - | let | |
274 | - | if (if ( | |
254 | + | func bI (bJ,bK,bL) = { | |
255 | + | let bG = fraction(bK, b, bJ) | |
256 | + | let bM = (bL > bG) | |
257 | + | if (if (bM) | |
275 | 258 | then true | |
276 | - | else ( | |
277 | - | then throw(((((((toString( | |
278 | - | else | |
259 | + | else (bK > bJ)) | |
260 | + | then throw(((((((toString(bK) + " ") + toString(bJ)) + " ") + toString(bG)) + " ") + toString(bL))) | |
261 | + | else bM | |
279 | 262 | } | |
280 | 263 | ||
281 | 264 | ||
282 | - | func | |
283 | - | let | |
284 | - | let | |
285 | - | | |
265 | + | func bN (bO,bP,bQ,bR) = { | |
266 | + | let bS = F(bQ, bO) | |
267 | + | let bT = F(bR, bP) | |
268 | + | bz(bT, bS) | |
286 | 269 | } | |
287 | 270 | ||
288 | 271 | ||
289 | - | func | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
294 | - | let | |
295 | - | let | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | [ | |
272 | + | func bU (bQ,bR,bV) = { | |
273 | + | let bW = aK() | |
274 | + | let bX = parseIntValue(bW[w]) | |
275 | + | let bY = parseIntValue(bW[x]) | |
276 | + | let bZ = bN(bX, bY, bQ, bR) | |
277 | + | let bB = F(bQ, bX) | |
278 | + | let bA = F(bR, bY) | |
279 | + | let ca = F(bV, a) | |
280 | + | let cb = bz(bB, ca) | |
281 | + | let cc = bz(bA, ca) | |
282 | + | [bZ, cb, cc] | |
300 | 283 | } | |
301 | 284 | ||
302 | 285 | ||
303 | - | func | |
304 | - | let | |
305 | - | [ | |
286 | + | func cd (bQ,bR,bV) = { | |
287 | + | let ce = bU(bQ, bR, bV) | |
288 | + | [I(ce[0], a), I(ce[1], a), I(ce[2], a)] | |
306 | 289 | } | |
307 | 290 | ||
308 | 291 | ||
309 | - | func | |
310 | - | let | |
311 | - | $Tuple2(( | |
292 | + | func cf (cg) = { | |
293 | + | let ch = fraction(cg, ah, a) | |
294 | + | $Tuple2((cg - ch), ch) | |
312 | 295 | } | |
313 | 296 | ||
314 | 297 | ||
315 | - | func | |
316 | - | let | |
317 | - | let | |
318 | - | let | |
319 | - | let | |
320 | - | let | |
321 | - | let | |
322 | - | let | |
323 | - | let | |
324 | - | if (( | |
298 | + | func ci (cj,ck,cl,cm) = { | |
299 | + | let bW = aK() | |
300 | + | let cn = bW[t] | |
301 | + | let co = bW[u] | |
302 | + | let cp = bW[v] | |
303 | + | let cq = parseIntValue(bW[w]) | |
304 | + | let cr = parseIntValue(bW[x]) | |
305 | + | let cs = bW[s] | |
306 | + | let ct = valueOrErrorMessage(assetInfo(fromBase58String(cn)), "Wrong LP id").quantity | |
307 | + | if ((cn != ck)) | |
325 | 308 | then throw("Wrong pmt asset") | |
326 | 309 | else { | |
327 | - | let | |
328 | - | let | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
335 | - | let | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | let | |
310 | + | let cu = bx(co) | |
311 | + | let cv = F(cu, cq) | |
312 | + | let cw = bx(cp) | |
313 | + | let cx = F(cw, cr) | |
314 | + | let cy = bz(cx, cv) | |
315 | + | let cz = I(cy, a) | |
316 | + | let cA = F(cl, a) | |
317 | + | let cB = F(ct, a) | |
318 | + | let cC = fraction(cv, cA, cB) | |
319 | + | let cD = fraction(cx, cA, cB) | |
320 | + | let cE = I(cC, cq) | |
321 | + | let cF = I(cD, cr) | |
322 | + | let cG = if ((cj == "")) | |
340 | 323 | then nil | |
341 | - | else [ScriptTransfer( | |
324 | + | else [ScriptTransfer(cm, cE, if ((co == "WAVES")) | |
342 | 325 | then unit | |
343 | - | else fromBase58String( | |
326 | + | else fromBase58String(co)), ScriptTransfer(cm, cF, if ((cp == "WAVES")) | |
344 | 327 | then unit | |
345 | - | else fromBase58String( | |
346 | - | $Tuple10( | |
328 | + | else fromBase58String(cp)), StringEntry(ab(toString(cm), cj), bt(cE, cF, cl, cz, height, lastBlock.timestamp)), IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz)] | |
329 | + | $Tuple10(cE, cF, co, cp, cu, cw, ct, cy, cs, cG) | |
347 | 330 | } | |
348 | 331 | } | |
349 | 332 | ||
350 | 333 | ||
351 | - | func | |
352 | - | let | |
353 | - | let | |
354 | - | let | |
355 | - | let | |
356 | - | let | |
357 | - | let | |
358 | - | let | |
359 | - | let | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | then | |
364 | - | else if (if ( | |
365 | - | then ( | |
334 | + | func cH (cj,bF,cI,cJ,cK,cL,cm,cM,cN,cO,cP,cQ,cR) = { | |
335 | + | let bW = aK() | |
336 | + | let cn = fromBase58String(bW[t]) | |
337 | + | let cS = bW[u] | |
338 | + | let cT = bW[v] | |
339 | + | let cU = bW[y] | |
340 | + | let cV = bW[z] | |
341 | + | let cW = parseIntValue(bW[w]) | |
342 | + | let cX = parseIntValue(bW[x]) | |
343 | + | let cs = bW[s] | |
344 | + | let cY = valueOrErrorMessage(assetInfo(cn), "Wr lp as").quantity | |
345 | + | let cu = if (cM) | |
346 | + | then bx(cS) | |
347 | + | else if (if (cO) | |
348 | + | then (cR == cS) | |
366 | 349 | else false) | |
367 | - | then ( | |
368 | - | else if ( | |
369 | - | then | |
370 | - | else ( | |
371 | - | let | |
372 | - | then | |
373 | - | else if (if ( | |
374 | - | then ( | |
350 | + | then (bx(cS) - cQ) | |
351 | + | else if (cO) | |
352 | + | then bx(cS) | |
353 | + | else (bx(cS) - cI) | |
354 | + | let cw = if (cM) | |
355 | + | then bx(cT) | |
356 | + | else if (if (cO) | |
357 | + | then (cR == cT) | |
375 | 358 | else false) | |
376 | - | then ( | |
377 | - | else if ( | |
378 | - | then | |
379 | - | else ( | |
380 | - | let | |
381 | - | let | |
382 | - | let | |
383 | - | let | |
384 | - | let | |
385 | - | let | |
359 | + | then (bx(cT) - cQ) | |
360 | + | else if (cO) | |
361 | + | then bx(cT) | |
362 | + | else (bx(cT) - cK) | |
363 | + | let cZ = F(cI, cW) | |
364 | + | let da = F(cK, cX) | |
365 | + | let db = bz(da, cZ) | |
366 | + | let cv = F(cu, cW) | |
367 | + | let cx = F(cw, cX) | |
368 | + | let dc = if ((cY == 0)) | |
386 | 369 | then { | |
387 | - | let | |
388 | - | let | |
389 | - | let | |
390 | - | $Tuple5( | |
370 | + | let cy = d | |
371 | + | let dd = d | |
372 | + | let ca = pow((cZ * da), 0, toBigInt(5), 1, 0, DOWN) | |
373 | + | $Tuple5(I(ca, a), I(cZ, cW), I(da, cX), bz((cx + da), (cv + cZ)), dd) | |
391 | 374 | } | |
392 | 375 | else { | |
393 | - | let | |
394 | - | let | |
395 | - | let | |
396 | - | if (if (if ( | |
397 | - | then ( | |
376 | + | let cy = bz(cx, cv) | |
377 | + | let de = fraction(P((cy - db)), c, cy) | |
378 | + | let dd = F(bF, a) | |
379 | + | if (if (if (cP) | |
380 | + | then (cy != d) | |
398 | 381 | else false) | |
399 | - | then ( | |
382 | + | then (de > dd) | |
400 | 383 | else false) | |
401 | - | then throw(((("Price slippage " + toString( | |
384 | + | then throw(((("Price slippage " + toString(de)) + " > ") + toString(dd))) | |
402 | 385 | else { | |
403 | - | let | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | then $Tuple2( | |
408 | - | else $Tuple2( | |
409 | - | let | |
410 | - | let | |
411 | - | let | |
412 | - | $Tuple5( | |
386 | + | let df = F(cY, a) | |
387 | + | let dg = fraction(cZ, cy, c) | |
388 | + | let dh = fraction(da, c, cy) | |
389 | + | let di = if ((dg > da)) | |
390 | + | then $Tuple2(dh, da) | |
391 | + | else $Tuple2(cZ, dg) | |
392 | + | let dj = di._1 | |
393 | + | let dk = di._2 | |
394 | + | let ca = fraction(df, dk, cx) | |
395 | + | $Tuple5(I(ca, a), I(dj, cW), I(dk, cX), cy, dd) | |
413 | 396 | } | |
414 | 397 | } | |
415 | - | let | |
416 | - | let | |
417 | - | let | |
418 | - | let | |
419 | - | let | |
420 | - | if ((0 >= | |
398 | + | let dl = dc._1 | |
399 | + | let dm = dc._2 | |
400 | + | let dn = dc._3 | |
401 | + | let cz = I(dc._4, a) | |
402 | + | let do = I(dc._5, a) | |
403 | + | if ((0 >= dl)) | |
421 | 404 | then throw("LP <= 0") | |
422 | 405 | else { | |
423 | - | let | |
406 | + | let dp = if (!(cN)) | |
424 | 407 | then 0 | |
425 | - | else | |
426 | - | let | |
427 | - | let | |
428 | - | let | |
429 | - | then ( | |
408 | + | else dl | |
409 | + | let dq = (cI - dm) | |
410 | + | let dr = (cK - dn) | |
411 | + | let ds = if (if (cO) | |
412 | + | then (cR == cS) | |
430 | 413 | else false) | |
431 | - | then $Tuple2( | |
432 | - | else if (if ( | |
433 | - | then ( | |
414 | + | then $Tuple2(cQ, 0) | |
415 | + | else if (if (cO) | |
416 | + | then (cR == cT) | |
434 | 417 | else false) | |
435 | - | then $Tuple2(0, | |
436 | - | else $Tuple2( | |
437 | - | let | |
438 | - | let | |
439 | - | let | |
440 | - | $Tuple13( | |
418 | + | then $Tuple2(0, cQ) | |
419 | + | else $Tuple2(dm, dn) | |
420 | + | let dt = ds._1 | |
421 | + | let du = ds._2 | |
422 | + | let dv = [IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz), StringEntry(Y(cm, cj), bi(dt, du, dp, cz, bF, do, height, lastBlock.timestamp, dq, dr))] | |
423 | + | $Tuple13(dl, dp, cz, cu, cw, cY, cn, cs, dv, dq, dr, cJ, cL) | |
441 | 424 | } | |
442 | 425 | } | |
443 | 426 | ||
444 | 427 | ||
445 | - | func dE (dF) = { | |
446 | - | let dG = dF[0] | |
447 | - | let dH = dF[1] | |
448 | - | let dI = (dG + dH) | |
449 | - | if ((dI == e)) | |
450 | - | then e | |
428 | + | func dw (dx) = { | |
429 | + | let bW = aK() | |
430 | + | let dy = bW[u] | |
431 | + | let dz = bW[v] | |
432 | + | let cs = parseIntValue(bW[s]) | |
433 | + | let bX = parseIntValue(bW[w]) | |
434 | + | let bY = parseIntValue(bW[x]) | |
435 | + | let dA = bx(dy) | |
436 | + | let dB = bx(dz) | |
437 | + | let cy = if ((dx.orderType == Buy)) | |
438 | + | then bN(bX, bY, (dA + dx.amount), dB) | |
439 | + | else bN(bX, bY, (dA - dx.amount), dB) | |
440 | + | let cz = I(cy, a) | |
441 | + | if (if (if (aH()) | |
442 | + | then true | |
443 | + | else (cs == p)) | |
444 | + | then true | |
445 | + | else (cs == q)) | |
446 | + | then throw("Admin blocked") | |
451 | 447 | else { | |
452 | - | let dJ = parseIntValue(aO) | |
453 | - | let dK = (dJ * 2) | |
454 | - | let cm = fraction(dG, dH, f) | |
455 | - | let dL = fraction(cm, i, f) | |
456 | - | let dM = fraction(toBigInt(dK), dI, f) | |
457 | - | let dN = toBigInt((dK - 1)) | |
458 | - | func dO (dP) = { | |
459 | - | let dQ = fraction(dP, dP, f) | |
460 | - | let dR = fraction(dQ, dP, f) | |
461 | - | let dS = fraction(dR, f, dL) | |
462 | - | fraction((dM + fraction(dS, g, f)), dP, (fraction(dN, dP, f) + fraction(h, dS, f)), CEILING) | |
463 | - | } | |
464 | - | ||
465 | - | func dT (dU,dV) = if (dU._2) | |
466 | - | then dU | |
448 | + | let dC = dx.assetPair.amountAsset | |
449 | + | let dD = if ((dC == unit)) | |
450 | + | then "WAVES" | |
451 | + | else toBase58String(value(dC)) | |
452 | + | let dE = dx.assetPair.priceAsset | |
453 | + | let dF = if ((dE == unit)) | |
454 | + | then "WAVES" | |
455 | + | else toBase58String(value(dE)) | |
456 | + | if (if ((dD != dy)) | |
457 | + | then true | |
458 | + | else (dF != dz)) | |
459 | + | then throw("Wr assets") | |
467 | 460 | else { | |
468 | - | let dP = dU._1 | |
469 | - | let dW = dO(dP) | |
470 | - | let dX = toInt((dW - value(dP))) | |
471 | - | let dY = if ((0 > dX)) | |
472 | - | then -(dX) | |
473 | - | else dX | |
474 | - | if ((1 >= dY)) | |
475 | - | then $Tuple2(dW, true) | |
476 | - | else $Tuple2(dW, false) | |
461 | + | let dG = dx.price | |
462 | + | let cX = fraction(a, bY, bX) | |
463 | + | let dH = L(dG, a, cX) | |
464 | + | let dI = if ((dx.orderType == Buy)) | |
465 | + | then (cz >= dH) | |
466 | + | else (dH >= cz) | |
467 | + | true | |
477 | 468 | } | |
478 | - | ||
479 | - | let dZ = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
480 | - | let ea = { | |
481 | - | let eb = dZ | |
482 | - | let ec = size(eb) | |
483 | - | let ed = $Tuple2(dI, false) | |
484 | - | func ee (ef,eg) = if ((eg >= ec)) | |
485 | - | then ef | |
486 | - | else dT(ef, eb[eg]) | |
487 | - | ||
488 | - | func eh (ef,eg) = if ((eg >= ec)) | |
489 | - | then ef | |
490 | - | else throw("List size exceeds 15") | |
491 | - | ||
492 | - | eh(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ee(ed, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
493 | - | } | |
494 | - | let dP = ea._1 | |
495 | - | let ei = ea._2 | |
496 | - | if (ei) | |
497 | - | then dP | |
498 | - | else throw(("D calculation error, D = " + toString(dP))) | |
499 | 469 | } | |
500 | 470 | } | |
501 | 471 | ||
502 | 472 | ||
503 | - | func ej (dF) = { | |
504 | - | let ek = g | |
505 | - | let dG = dF[0] | |
506 | - | let dH = dF[1] | |
507 | - | let el = parseBigIntValue(l) | |
508 | - | let dJ = (parseBigIntValue(aO) * el) | |
509 | - | let dI = (dG + dH) | |
510 | - | if ((dI == e)) | |
473 | + | func dJ (dK) = if ((size(dK.payments) != 1)) | |
474 | + | then throw("1 pmnt exp") | |
475 | + | else { | |
476 | + | let dL = value(dK.payments[0]) | |
477 | + | let ck = value(dL.assetId) | |
478 | + | let cQ = dL.amount | |
479 | + | let dc = ci(toBase58String(dK.transactionId), toBase58String(ck), cQ, dK.caller) | |
480 | + | let cE = dc._1 | |
481 | + | let cF = dc._2 | |
482 | + | let cs = parseIntValue(dc._9) | |
483 | + | let cG = dc._10 | |
484 | + | if (if (aH()) | |
485 | + | then true | |
486 | + | else (cs == q)) | |
487 | + | then throw(("Admin blocked: " + toString(cs))) | |
488 | + | else $Tuple5(cE, cF, cQ, ck, cG) | |
489 | + | } | |
490 | + | ||
491 | + | ||
492 | + | func dM (dN,aa,dO,dP,bF,cN,cO,cP,cQ,cR) = { | |
493 | + | let dc = cH(aa, bF, value(dO).amount, value(dO).assetId, value(dP).amount, value(dP).assetId, dN, (aa == ""), cN, cO, cP, cQ, cR) | |
494 | + | let cs = parseIntValue(dc._8) | |
495 | + | if (if (if (aH()) | |
496 | + | then true | |
497 | + | else (cs == o)) | |
498 | + | then true | |
499 | + | else (cs == q)) | |
500 | + | then throw(("Blocked:" + toString(cs))) | |
501 | + | else dc | |
502 | + | } | |
503 | + | ||
504 | + | ||
505 | + | func dQ (dR) = { | |
506 | + | let dS = g | |
507 | + | let dT = dR[0] | |
508 | + | let dU = dR[1] | |
509 | + | let dV = parseBigIntValue(j) | |
510 | + | let dW = (parseBigIntValue(aG) * dV) | |
511 | + | let dX = (dT + dU) | |
512 | + | if ((dX == e)) | |
511 | 513 | then e | |
512 | 514 | else { | |
513 | - | let | |
514 | - | let | |
515 | - | let | |
516 | - | let | |
517 | - | let | |
518 | - | func | |
519 | - | let | |
520 | - | let | |
521 | - | let ei = | |
515 | + | let dY = (dW * dS) | |
516 | + | let dZ = (((dT * dU) * dS) * dS) | |
517 | + | let ea = ((dY * dX) / dV) | |
518 | + | let eb = (dY - dV) | |
519 | + | let ec = (dS + f) | |
520 | + | func ed (ee,ef) = { | |
521 | + | let eg = ee | |
522 | + | let eh = eg._1 | |
523 | + | let ei = eg._2 | |
522 | 524 | if ((ei != unit)) | |
523 | - | then | |
525 | + | then ee | |
524 | 526 | else { | |
525 | - | let | |
526 | - | let | |
527 | - | let | |
528 | - | if ((f >= | |
529 | - | then $Tuple2( | |
530 | - | else $Tuple2( | |
527 | + | let ej = (((eh * eh) * eh) / dZ) | |
528 | + | let ek = (((ea + (ej * dS)) * eh) / (((eb * eh) / dV) + (ec * ej))) | |
529 | + | let el = Q((ek - value(eh))) | |
530 | + | if ((f >= el)) | |
531 | + | then $Tuple2(ek, ef) | |
532 | + | else $Tuple2(ek, unit) | |
531 | 533 | } | |
532 | 534 | } | |
533 | 535 | ||
534 | - | let | |
535 | - | let | |
536 | - | let | |
537 | - | let | |
538 | - | let | |
539 | - | func | |
540 | - | then | |
541 | - | else | |
536 | + | let em = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
537 | + | let en = { | |
538 | + | let eo = em | |
539 | + | let ep = size(eo) | |
540 | + | let eq = $Tuple2(dX, unit) | |
541 | + | func er (es,et) = if ((et >= ep)) | |
542 | + | then es | |
543 | + | else ed(es, eo[et]) | |
542 | 544 | ||
543 | - | func | |
544 | - | then | |
545 | + | func eu (es,et) = if ((et >= ep)) | |
546 | + | then es | |
545 | 547 | else throw("List size exceeds 15") | |
546 | 548 | ||
547 | - | | |
549 | + | eu(er(er(er(er(er(er(er(er(er(er(er(er(er(er(er(eq, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
548 | 550 | } | |
549 | - | let | |
550 | - | let ei = | |
551 | + | let eh = en._1 | |
552 | + | let ei = en._2 | |
551 | 553 | if ((ei != unit)) | |
552 | - | then | |
553 | - | else throw(("D calculation error, D = " + toString( | |
554 | + | then eh | |
555 | + | else throw(("D calculation error, D = " + toString(eh))) | |
554 | 556 | } | |
555 | 557 | } | |
556 | 558 | ||
557 | 559 | ||
558 | - | func | |
559 | - | let | |
560 | - | let | |
560 | + | func ev (dR,dK,ew) = { | |
561 | + | let dS = g | |
562 | + | let ex = dR[if ((dK == 0)) | |
561 | 563 | then 1 | |
562 | 564 | else 0] | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | let | |
567 | - | let | |
568 | - | let | |
569 | - | func | |
570 | - | let | |
571 | - | let | |
572 | - | let ei = | |
565 | + | let dV = parseBigIntValue(j) | |
566 | + | let dW = (parseBigIntValue(aG) * dV) | |
567 | + | let dX = ex | |
568 | + | let dY = (dW * dS) | |
569 | + | let ey = (((((ew * ew) / (ex * dS)) * ew) * dV) / (dY * dS)) | |
570 | + | let ez = ((dX + ((ew * dV) / dY)) - ew) | |
571 | + | func ed (ee,ef) = { | |
572 | + | let eA = ee | |
573 | + | let eB = eA._1 | |
574 | + | let ei = eA._2 | |
573 | 575 | if ((ei != unit)) | |
574 | - | then | |
576 | + | then ee | |
575 | 577 | else { | |
576 | - | let | |
577 | - | let | |
578 | - | if ((f >= | |
579 | - | then $Tuple2( | |
580 | - | else $Tuple2( | |
578 | + | let eC = (((eB * eB) + ey) / ((g * eB) + ez)) | |
579 | + | let eD = Q((eC - value(eB))) | |
580 | + | if ((f >= eD)) | |
581 | + | then $Tuple2(eC, ef) | |
582 | + | else $Tuple2(eC, unit) | |
581 | 583 | } | |
582 | 584 | } | |
583 | 585 | ||
584 | - | let | |
585 | - | let | |
586 | - | let | |
587 | - | let | |
588 | - | let | |
589 | - | func | |
590 | - | then | |
591 | - | else | |
586 | + | let em = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] | |
587 | + | let eE = { | |
588 | + | let eo = em | |
589 | + | let ep = size(eo) | |
590 | + | let eq = $Tuple2(ew, unit) | |
591 | + | func er (es,et) = if ((et >= ep)) | |
592 | + | then es | |
593 | + | else ed(es, eo[et]) | |
592 | 594 | ||
593 | - | func | |
594 | - | then | |
595 | + | func eu (es,et) = if ((et >= ep)) | |
596 | + | then es | |
595 | 597 | else throw("List size exceeds 15") | |
596 | 598 | ||
597 | - | | |
599 | + | eu(er(er(er(er(er(er(er(er(er(er(er(er(er(er(er(eq, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
598 | 600 | } | |
599 | - | let | |
600 | - | let ei = | |
601 | + | let eB = eE._1 | |
602 | + | let ei = eE._2 | |
601 | 603 | if ((ei != unit)) | |
602 | - | then | |
603 | - | else throw(("Y calculation error, Y = " + toString( | |
604 | + | then eB | |
605 | + | else throw(("Y calculation error, Y = " + toString(eB))) | |
604 | 606 | } | |
605 | 607 | ||
606 | 608 | ||
607 | - | func eC (eD,eE,eF) = { | |
608 | - | let eG = fraction(dE([eD, eE]), c, eF) | |
609 | - | if ((eF == e)) | |
610 | - | then e | |
611 | - | else eG | |
612 | - | } | |
613 | - | ||
614 | - | ||
615 | - | func eH (eI,eJ,eK) = { | |
616 | - | let eL = (toBigInt(bF(aY(bg))) - eI) | |
617 | - | let eM = (toBigInt(bF(aY(bh))) - eJ) | |
618 | - | let eN = (toBigInt(value(assetInfo(bf)).quantity) - eK) | |
619 | - | let eO = eC(eL, eM, eN) | |
620 | - | eO | |
621 | - | } | |
622 | - | ||
623 | - | ||
624 | - | func eP (eQ,eR,eK) = { | |
625 | - | let eL = (bF(aY(bg)) + eQ) | |
626 | - | let eM = (bF(aY(bh)) + eR) | |
627 | - | let eN = (value(assetInfo(bf)).quantity + eK) | |
628 | - | let eG = eC(toBigInt(eL), toBigInt(eM), toBigInt(eN)) | |
629 | - | let eS = [IntegerEntry(al, height), StringEntry(ak, toString(eG))] | |
630 | - | $Tuple2(eS, eG) | |
631 | - | } | |
632 | - | ||
633 | - | ||
634 | - | func eT (eU,eG) = if ((eG >= eU)) | |
635 | - | then true | |
636 | - | else aK("updated DLp lower than current DLp") | |
637 | - | ||
638 | - | ||
639 | - | func eV (eW) = { | |
640 | - | let eX = eW.amount | |
641 | - | let eY = fraction(eW.amount, eW.price, a, FLOOR) | |
642 | - | let eZ = if ((eW.orderType == Buy)) | |
643 | - | then $Tuple2(eX, -(eY)) | |
644 | - | else $Tuple2(-(eX), eY) | |
645 | - | let eQ = eZ._1 | |
646 | - | let eR = eZ._2 | |
647 | - | if (if (if (aP()) | |
648 | - | then true | |
649 | - | else (be == r)) | |
650 | - | then true | |
651 | - | else (be == s)) | |
652 | - | then throw("Admin blocked") | |
653 | - | else if (if ((eW.assetPair.amountAsset != bg)) | |
654 | - | then true | |
655 | - | else (eW.assetPair.priceAsset != bh)) | |
656 | - | then throw("Wr assets") | |
657 | - | else { | |
658 | - | let fa = parseBigIntValue(getStringValue(this, ak)) | |
659 | - | let fb = eP(eQ, eR, 0) | |
660 | - | let fc = fb._1 | |
661 | - | let fd = fb._2 | |
662 | - | let fe = (fd >= fa) | |
663 | - | fe | |
664 | - | } | |
665 | - | } | |
666 | - | ||
667 | - | ||
668 | - | func ff (dV) = if ((size(dV.payments) != 1)) | |
669 | - | then throw("1 pmnt exp") | |
670 | - | else { | |
671 | - | let fg = value(dV.payments[0]) | |
672 | - | let cs = value(fg.assetId) | |
673 | - | let cY = fg.amount | |
674 | - | let dk = cq(toBase58String(dV.transactionId), toBase58String(cs), cY, dV.caller) | |
675 | - | let cM = dk._1 | |
676 | - | let cN = dk._2 | |
677 | - | let cA = parseIntValue(dk._9) | |
678 | - | let cO = dk._10 | |
679 | - | if (if (aP()) | |
680 | - | then true | |
681 | - | else (cA == s)) | |
682 | - | then throw(("Admin blocked: " + toString(cA))) | |
683 | - | else $Tuple5(cM, cN, cY, cs, cO) | |
684 | - | } | |
685 | - | ||
686 | - | ||
687 | - | func fh (fi,ac,fj,fk,bN,cV,cW,cX,cY,cZ) = { | |
688 | - | let dk = cP(ac, bN, value(fj).amount, value(fj).assetId, value(fk).amount, value(fk).assetId, fi, (ac == ""), cV, cW, cX, cY, cZ) | |
689 | - | let cA = parseIntValue(dk._8) | |
690 | - | if (if (if (aP()) | |
691 | - | then true | |
692 | - | else (cA == q)) | |
693 | - | then true | |
694 | - | else (cA == s)) | |
695 | - | then throw(("Blocked:" + toString(cA))) | |
696 | - | else dk | |
697 | - | } | |
698 | - | ||
699 | - | ||
700 | - | func fl (fm,cs,cu,ac,fn) = { | |
701 | - | let ba = aS() | |
702 | - | let cw = ba[w] | |
703 | - | let cx = ba[x] | |
704 | - | let cv = ba[v] | |
705 | - | let de = parseIntValue(ba[y]) | |
706 | - | let df = parseIntValue(ba[z]) | |
707 | - | let eN = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cv)), "invalid lp asset").quantity) | |
708 | - | let fo = if ((eN > e)) | |
609 | + | func eF (eG,ck,cm,aa,eH) = { | |
610 | + | let aS = aK() | |
611 | + | let co = aS[u] | |
612 | + | let cp = aS[v] | |
613 | + | let cn = aS[t] | |
614 | + | let cW = parseIntValue(aS[w]) | |
615 | + | let cX = parseIntValue(aS[x]) | |
616 | + | let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cn)), "invalid lp asset").quantity) | |
617 | + | let eJ = if ((eI > e)) | |
709 | 618 | then true | |
710 | 619 | else throw("initial deposit requires all coins") | |
711 | - | if (( | |
620 | + | if ((eJ == eJ)) | |
712 | 621 | then { | |
713 | - | let | |
714 | - | let | |
715 | - | let | |
716 | - | then $Tuple2( | |
717 | - | else if (( | |
718 | - | then if (( | |
622 | + | let cu = bx(co) | |
623 | + | let cw = bx(cp) | |
624 | + | let eK = if ((aa == "")) | |
625 | + | then $Tuple2(cu, cw) | |
626 | + | else if ((ck == co)) | |
627 | + | then if ((eG > cu)) | |
719 | 628 | then throw("invalid payment amount") | |
720 | - | else $Tuple2(( | |
721 | - | else if (( | |
722 | - | then if (( | |
629 | + | else $Tuple2((cu - eG), cw) | |
630 | + | else if ((ck == cp)) | |
631 | + | then if ((eG > cw)) | |
723 | 632 | then throw("invalid payment amount") | |
724 | - | else $Tuple2( | |
633 | + | else $Tuple2(cu, (cw - eG)) | |
725 | 634 | else throw("wrong pmtAssetId") | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | then $Tuple2( | |
730 | - | else if (( | |
731 | - | then $Tuple2(0, | |
635 | + | let eL = eK._1 | |
636 | + | let eM = eK._2 | |
637 | + | let eN = if ((ck == co)) | |
638 | + | then $Tuple2(eG, 0) | |
639 | + | else if ((ck == cp)) | |
640 | + | then $Tuple2(0, eG) | |
732 | 641 | else throw("invalid payment") | |
733 | - | let | |
734 | - | let | |
735 | - | let | |
736 | - | then $Tuple3( | |
737 | - | else $Tuple3( | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | let | |
744 | - | let | |
745 | - | let | |
642 | + | let eO = eN._1 | |
643 | + | let eP = eN._2 | |
644 | + | let eQ = if (eH) | |
645 | + | then $Tuple3(cf(eO)._1, cf(eP)._1, cf(eG)._2) | |
646 | + | else $Tuple3(eO, eP, 0) | |
647 | + | let eR = eQ._1 | |
648 | + | let eS = eQ._2 | |
649 | + | let ch = eQ._3 | |
650 | + | let eT = (eL + eR) | |
651 | + | let eU = (eM + eS) | |
652 | + | let bK = dQ([toBigInt(eL), toBigInt(eM)]) | |
653 | + | let bJ = dQ([toBigInt(eT), toBigInt(eU)]) | |
654 | + | let eV = if ((bJ > bK)) | |
746 | 655 | then true | |
747 | 656 | else throw() | |
748 | - | if (( | |
657 | + | if ((eV == eV)) | |
749 | 658 | then { | |
750 | - | let | |
751 | - | let | |
752 | - | let | |
753 | - | let | |
754 | - | let | |
755 | - | let | |
756 | - | let | |
757 | - | let | |
758 | - | $Tuple4(toInt( | |
659 | + | let eW = fraction(eI, (bJ - bK), bK) | |
660 | + | let cz = I(bz(F(eU, cX), F(eT, cW)), a) | |
661 | + | let dv = [IntegerEntry(U(), cz), IntegerEntry(V(height, lastBlock.timestamp), cz), StringEntry(Y(cm, aa), bi(eO, eP, toInt(eW), cz, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
662 | + | let eX = fraction(eM, a, eL) | |
663 | + | let eY = fraction(eG, a, (eX + a)) | |
664 | + | let eZ = (eG - eY) | |
665 | + | let fa = fraction(eI, toBigInt(eZ), toBigInt(eM)) | |
666 | + | let fb = toInt(fraction((eW - fa), b, fa)) | |
667 | + | $Tuple4(toInt(eW), dv, ch, fb) | |
759 | 668 | } | |
760 | 669 | else throw("Strict value is not equal to itself.") | |
761 | 670 | } | |
762 | 671 | else throw("Strict value is not equal to itself.") | |
763 | 672 | } | |
764 | 673 | ||
765 | 674 | ||
766 | - | func fH (fI,fJ,fK,fi,fL,fM) = { | |
767 | - | let ba = aS() | |
768 | - | let cv = ba[v] | |
769 | - | let cw = ba[w] | |
770 | - | let cx = ba[x] | |
771 | - | let fN = parseIntValue(ba[y]) | |
772 | - | let fO = parseIntValue(ba[z]) | |
773 | - | let fP = ba[u] | |
774 | - | let cu = if ((fi == bp)) | |
775 | - | then fL | |
776 | - | else fi | |
777 | - | let fg = value(fK[0]) | |
778 | - | let cs = value(fg.assetId) | |
779 | - | let cY = fg.amount | |
780 | - | let eO = eH(e, e, e) | |
781 | - | if ((eO == eO)) | |
782 | - | then { | |
783 | - | let cr = toBase58String(fM) | |
784 | - | if ((cv != toBase58String(cs))) | |
785 | - | then throw("Wrong LP") | |
786 | - | else { | |
787 | - | let cC = bF(cw) | |
788 | - | let cE = bF(cx) | |
789 | - | let fQ = { | |
790 | - | let fR = invoke(this, "getOneTknV2READONLY", [fI, cY], nil) | |
791 | - | if ($isInstanceOf(fR, "(Int, Int)")) | |
792 | - | then fR | |
793 | - | else throw(($getType(fR) + " couldn't be cast to (Int, Int)")) | |
794 | - | } | |
795 | - | if ((fQ == fQ)) | |
675 | + | func fc (fd,fe,ff,dN,fg,fh) = { | |
676 | + | let aS = aK() | |
677 | + | let cn = aS[t] | |
678 | + | let co = aS[u] | |
679 | + | let cp = aS[v] | |
680 | + | let fi = parseIntValue(aS[w]) | |
681 | + | let fj = parseIntValue(aS[x]) | |
682 | + | let fk = aS[s] | |
683 | + | let cm = if ((dN == bh)) | |
684 | + | then fg | |
685 | + | else dN | |
686 | + | let dL = value(ff[0]) | |
687 | + | let ck = value(dL.assetId) | |
688 | + | let cQ = dL.amount | |
689 | + | let cj = toBase58String(fh) | |
690 | + | if ((cn != toBase58String(ck))) | |
691 | + | then throw("Wrong LP") | |
692 | + | else { | |
693 | + | let cu = bx(co) | |
694 | + | let cw = bx(cp) | |
695 | + | let fl = { | |
696 | + | let fm = invoke(this, "getOneTknV2READONLY", [fd, cQ], nil) | |
697 | + | if ($isInstanceOf(fm, "(Int, Int)")) | |
698 | + | then fm | |
699 | + | else throw(($getType(fm) + " couldn't be cast to (Int, Int)")) | |
700 | + | } | |
701 | + | if ((fl == fl)) | |
702 | + | then { | |
703 | + | let ch = fl._2 | |
704 | + | let fn = fl._1 | |
705 | + | let fo = if (if ((fe > 0)) | |
706 | + | then (fe > fn) | |
707 | + | else false) | |
708 | + | then aD(makeString(["amount to receive is less than ", toString(fe)], "")) | |
709 | + | else fn | |
710 | + | let fp = if ((fd == co)) | |
711 | + | then $Tuple4(fo, 0, ((cu - fo) - ch), cw) | |
712 | + | else if ((fd == cp)) | |
713 | + | then $Tuple4(0, fo, cu, ((cw - fo) - ch)) | |
714 | + | else throw("invalid out asset id") | |
715 | + | let fq = fp._1 | |
716 | + | let fr = fp._2 | |
717 | + | let eT = fp._3 | |
718 | + | let eU = fp._4 | |
719 | + | let fs = bz(F(eU, fj), F(eT, fi)) | |
720 | + | let ft = I(fs, a) | |
721 | + | let fu = if ((fd == "WAVES")) | |
722 | + | then unit | |
723 | + | else fromBase58String(fd) | |
724 | + | let fv = if ((ch > 0)) | |
725 | + | then [ScriptTransfer(aJ, ch, fu)] | |
726 | + | else nil | |
727 | + | let cG = ([ScriptTransfer(cm, fo, fu), StringEntry(ab(toString(cm), cj), bt(fq, fr, cQ, ft, height, lastBlock.timestamp)), IntegerEntry(U(), ft), IntegerEntry(V(height, lastBlock.timestamp), ft)] ++ fv) | |
728 | + | if ((cG == cG)) | |
796 | 729 | then { | |
797 | - | let cp = fQ._2 | |
798 | - | let fS = fQ._1 | |
799 | - | let fT = if (if ((fJ > 0)) | |
800 | - | then (fJ > fS) | |
801 | - | else false) | |
802 | - | then aK(makeString(["amount to receive is less than ", toString(fJ)], "")) | |
803 | - | else fS | |
804 | - | let fU = if ((fI == cw)) | |
805 | - | then $Tuple4(fT, 0, ((cC - fT) - cp), cE) | |
806 | - | else if ((fI == cx)) | |
807 | - | then $Tuple4(0, fT, cC, ((cE - fT) - cp)) | |
808 | - | else throw("invalid out asset id") | |
809 | - | let fV = fU._1 | |
810 | - | let fW = fU._2 | |
811 | - | let fy = fU._3 | |
812 | - | let fz = fU._4 | |
813 | - | let fX = bH(H(fz, fO), H(fy, fN)) | |
814 | - | let fY = K(fX, a) | |
815 | - | let fZ = if ((fI == "WAVES")) | |
816 | - | then unit | |
817 | - | else fromBase58String(fI) | |
818 | - | let ga = if ((cp > 0)) | |
819 | - | then [ScriptTransfer(aR, cp, fZ)] | |
820 | - | else nil | |
821 | - | let cO = ([ScriptTransfer(cu, fT, fZ), StringEntry(ad(toString(cu), cr), bB(fV, fW, cY, fY, height, lastBlock.timestamp)), IntegerEntry(W(), fY), IntegerEntry(X(height, lastBlock.timestamp), fY)] ++ ga) | |
822 | - | if ((cO == cO)) | |
823 | - | then { | |
824 | - | let gb = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
825 | - | if ((gb == gb)) | |
826 | - | then { | |
827 | - | let gc = { | |
828 | - | let gd = if ((this == aR)) | |
829 | - | then 0 | |
830 | - | else cp | |
831 | - | let ge = if ((aW(fI) == bg)) | |
832 | - | then true | |
833 | - | else false | |
834 | - | if (ge) | |
835 | - | then $Tuple2(-((fS + gd)), 0) | |
836 | - | else $Tuple2(0, -((fS + gd))) | |
837 | - | } | |
838 | - | let eQ = gc._1 | |
839 | - | let eR = gc._2 | |
840 | - | let gf = eP(eQ, eR, 0) | |
841 | - | let gg = gf._1 | |
842 | - | let eG = gf._2 | |
843 | - | let gh = eT(eO, eG) | |
844 | - | if ((gh == gh)) | |
845 | - | then $Tuple2((cO ++ gg), fT) | |
846 | - | else throw("Strict value is not equal to itself.") | |
847 | - | } | |
848 | - | else throw("Strict value is not equal to itself.") | |
849 | - | } | |
730 | + | let fw = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
731 | + | if ((fw == fw)) | |
732 | + | then $Tuple2(cG, fo) | |
850 | 733 | else throw("Strict value is not equal to itself.") | |
851 | 734 | } | |
852 | 735 | else throw("Strict value is not equal to itself.") | |
853 | 736 | } | |
737 | + | else throw("Strict value is not equal to itself.") | |
854 | 738 | } | |
855 | - | else throw("Strict value is not equal to itself.") | |
856 | 739 | } | |
857 | 740 | ||
858 | 741 | ||
859 | - | func | |
860 | - | let | |
861 | - | if ($isInstanceOf( | |
742 | + | func fx () = { | |
743 | + | let ax = getString(S()) | |
744 | + | if ($isInstanceOf(ax, "String")) | |
862 | 745 | then { | |
863 | - | let | |
864 | - | fromBase58String( | |
746 | + | let dX = ax | |
747 | + | fromBase58String(dX) | |
865 | 748 | } | |
866 | - | else if ($isInstanceOf( | |
749 | + | else if ($isInstanceOf(ax, "Unit")) | |
867 | 750 | then unit | |
868 | 751 | else throw("Match error") | |
869 | 752 | } | |
870 | 753 | ||
871 | 754 | ||
872 | - | func | |
873 | - | let | |
874 | - | if ($isInstanceOf( | |
755 | + | func fy () = { | |
756 | + | let ax = getString(T()) | |
757 | + | if ($isInstanceOf(ax, "String")) | |
875 | 758 | then { | |
876 | - | let | |
877 | - | fromBase58String( | |
759 | + | let dX = ax | |
760 | + | fromBase58String(dX) | |
878 | 761 | } | |
879 | - | else if ($isInstanceOf( | |
762 | + | else if ($isInstanceOf(ax, "Unit")) | |
880 | 763 | then unit | |
881 | 764 | else throw("Match error") | |
882 | 765 | } | |
883 | 766 | ||
884 | 767 | ||
885 | - | let | |
768 | + | let fz = throw("Permission denied") | |
886 | 769 | ||
887 | - | func | |
888 | - | let | |
889 | - | if ($isInstanceOf( | |
770 | + | func fA (dK) = { | |
771 | + | let ax = fx() | |
772 | + | if ($isInstanceOf(ax, "ByteVector")) | |
890 | 773 | then { | |
891 | - | let | |
892 | - | ( | |
774 | + | let fB = ax | |
775 | + | (dK.callerPublicKey == fB) | |
893 | 776 | } | |
894 | - | else if ($isInstanceOf( | |
895 | - | then ( | |
777 | + | else if ($isInstanceOf(ax, "Unit")) | |
778 | + | then (dK.caller == this) | |
896 | 779 | else throw("Match error") | |
897 | 780 | } | |
898 | 781 | ||
899 | 782 | ||
900 | - | func | |
901 | - | let | |
902 | - | if ($isInstanceOf( | |
783 | + | func fC (dK) = { | |
784 | + | let ax = fx() | |
785 | + | if ($isInstanceOf(ax, "ByteVector")) | |
903 | 786 | then { | |
904 | - | let | |
905 | - | if (( | |
787 | + | let fB = ax | |
788 | + | if ((dK.callerPublicKey == fB)) | |
906 | 789 | then true | |
907 | - | else | |
790 | + | else fz | |
908 | 791 | } | |
909 | - | else if ($isInstanceOf( | |
910 | - | then if (( | |
792 | + | else if ($isInstanceOf(ax, "Unit")) | |
793 | + | then if ((dK.caller == this)) | |
911 | 794 | then true | |
912 | - | else | |
795 | + | else fz | |
913 | 796 | else throw("Match error") | |
914 | 797 | } | |
915 | 798 | ||
916 | 799 | ||
917 | - | @Callable( | |
918 | - | func constructor ( | |
919 | - | let | |
920 | - | if (( | |
921 | - | then [StringEntry( | |
800 | + | @Callable(dK) | |
801 | + | func constructor (R) = { | |
802 | + | let ey = fC(dK) | |
803 | + | if ((ey == ey)) | |
804 | + | then [StringEntry(R(), R)] | |
922 | 805 | else throw("Strict value is not equal to itself.") | |
923 | 806 | } | |
924 | 807 | ||
925 | 808 | ||
926 | 809 | ||
927 | - | @Callable( | |
928 | - | func setManager ( | |
929 | - | let | |
930 | - | if (( | |
810 | + | @Callable(dK) | |
811 | + | func setManager (fD) = { | |
812 | + | let ey = fC(dK) | |
813 | + | if ((ey == ey)) | |
931 | 814 | then { | |
932 | - | let | |
933 | - | if (( | |
934 | - | then [StringEntry( | |
815 | + | let fE = fromBase58String(fD) | |
816 | + | if ((fE == fE)) | |
817 | + | then [StringEntry(T(), fD)] | |
935 | 818 | else throw("Strict value is not equal to itself.") | |
936 | 819 | } | |
937 | 820 | else throw("Strict value is not equal to itself.") | |
938 | 821 | } | |
939 | 822 | ||
940 | 823 | ||
941 | 824 | ||
942 | - | @Callable( | |
825 | + | @Callable(dK) | |
943 | 826 | func confirmManager () = { | |
944 | - | let | |
945 | - | let | |
827 | + | let ce = fy() | |
828 | + | let fF = if (isDefined(ce)) | |
946 | 829 | then true | |
947 | 830 | else throw("No pending manager") | |
948 | - | if (( | |
831 | + | if ((fF == fF)) | |
949 | 832 | then { | |
950 | - | let | |
833 | + | let fG = if ((dK.callerPublicKey == value(ce))) | |
951 | 834 | then true | |
952 | 835 | else throw("You are not pending manager") | |
953 | - | if (( | |
954 | - | then [StringEntry( | |
836 | + | if ((fG == fG)) | |
837 | + | then [StringEntry(S(), toBase58String(value(ce))), DeleteEntry(T())] | |
955 | 838 | else throw("Strict value is not equal to itself.") | |
956 | 839 | } | |
957 | 840 | else throw("Strict value is not equal to itself.") | |
958 | 841 | } | |
959 | 842 | ||
960 | 843 | ||
961 | 844 | ||
962 | - | @Callable( | |
963 | - | func put ( | |
964 | - | let | |
965 | - | let | |
966 | - | let | |
967 | - | if ((0 > | |
845 | + | @Callable(dK) | |
846 | + | func put (fH,fI) = { | |
847 | + | let fJ = bc() | |
848 | + | let fK = valueOrErrorMessage(addressFromString(fJ[A]), "Wr st addr") | |
849 | + | let fL = valueOrErrorMessage(addressFromString(fJ[C]), "Wr sl addr") | |
850 | + | if ((0 > fH)) | |
968 | 851 | then throw("Wrong slippage") | |
969 | - | else if ((size( | |
852 | + | else if ((size(dK.payments) != 2)) | |
970 | 853 | then throw("2 pmnts expd") | |
971 | 854 | else { | |
972 | - | let gx = toBigInt(value(dV.payments[0]).amount) | |
973 | - | let gy = toBigInt(value(dV.payments[1]).amount) | |
974 | - | let eO = eH(gx, gy, toBigInt(0)) | |
975 | - | if ((eO == eO)) | |
855 | + | let fM = dM(toString(dK.caller), toBase58String(dK.transactionId), AttachedPayment(value(dK.payments[0]).assetId, value(dK.payments[0]).amount), dK.payments[1], fH, true, false, true, 0, "") | |
856 | + | let dp = fM._2 | |
857 | + | let fN = fM._7 | |
858 | + | let cG = fM._9 | |
859 | + | let dq = fM._10 | |
860 | + | let dr = fM._11 | |
861 | + | let co = fM._12 | |
862 | + | let cp = fM._13 | |
863 | + | let dc = invoke(aF, "emit", [dp], nil) | |
864 | + | if ((dc == dc)) | |
976 | 865 | then { | |
977 | - | let | |
978 | - | let | |
979 | - | | |
980 | - | | |
981 | - | let | |
982 | - | | |
983 | - | | |
984 | - | | |
985 | - | | |
986 | - | if (( | |
866 | + | let fO = { | |
867 | + | let ax = dc | |
868 | + | if ($isInstanceOf(ax, "Address")) | |
869 | + | then { | |
870 | + | let fP = ax | |
871 | + | invoke(fP, "emit", [dp], nil) | |
872 | + | } | |
873 | + | else unit | |
874 | + | } | |
875 | + | if ((fO == fO)) | |
987 | 876 | then { | |
988 | - | let gB = { | |
989 | - | let aE = dk | |
990 | - | if ($isInstanceOf(aE, "Address")) | |
991 | - | then { | |
992 | - | let gC = aE | |
993 | - | invoke(gC, "emit", [dx], nil) | |
994 | - | } | |
995 | - | else unit | |
996 | - | } | |
997 | - | if ((gB == gB)) | |
877 | + | let fQ = if ((dq > 0)) | |
878 | + | then invoke(fL, "put", nil, [AttachedPayment(co, dq)]) | |
879 | + | else nil | |
880 | + | if ((fQ == fQ)) | |
998 | 881 | then { | |
999 | - | let | |
1000 | - | then invoke( | |
882 | + | let fR = if ((dr > 0)) | |
883 | + | then invoke(fL, "put", nil, [AttachedPayment(cp, dr)]) | |
1001 | 884 | else nil | |
1002 | - | if (( | |
885 | + | if ((fR == fR)) | |
1003 | 886 | then { | |
1004 | - | let gE = if ((dz > 0)) | |
1005 | - | then invoke(gw, "put", nil, [AttachedPayment(cx, dz)]) | |
1006 | - | else nil | |
1007 | - | if ((gE == gE)) | |
887 | + | let fS = if (fI) | |
1008 | 888 | then { | |
1009 | - | let gF = if (gt) | |
1010 | - | then { | |
1011 | - | let gG = invoke(gv, "stake", nil, [AttachedPayment(gA, dx)]) | |
1012 | - | if ((gG == gG)) | |
1013 | - | then nil | |
1014 | - | else throw("Strict value is not equal to itself.") | |
1015 | - | } | |
1016 | - | else [ScriptTransfer(dV.caller, dx, gA)] | |
1017 | - | let gH = eP(0, 0, 0) | |
1018 | - | let gg = gH._1 | |
1019 | - | let eG = gH._2 | |
1020 | - | let gh = eT(eO, eG) | |
1021 | - | if ((gh == gh)) | |
1022 | - | then ((cO ++ gF) ++ gg) | |
889 | + | let fT = invoke(fK, "stake", nil, [AttachedPayment(fN, dp)]) | |
890 | + | if ((fT == fT)) | |
891 | + | then nil | |
1023 | 892 | else throw("Strict value is not equal to itself.") | |
1024 | 893 | } | |
1025 | - | else throw("Strict value is not equal to itself.") | |
894 | + | else [ScriptTransfer(dK.caller, dp, fN)] | |
895 | + | (cG ++ fS) | |
1026 | 896 | } | |
1027 | 897 | else throw("Strict value is not equal to itself.") | |
1028 | 898 | } | |
1029 | 899 | else throw("Strict value is not equal to itself.") | |
1030 | 900 | } | |
1031 | 901 | else throw("Strict value is not equal to itself.") | |
1032 | 902 | } | |
1033 | 903 | else throw("Strict value is not equal to itself.") | |
1034 | 904 | } | |
1035 | 905 | } | |
1036 | 906 | ||
1037 | 907 | ||
1038 | 908 | ||
1039 | - | @Callable( | |
1040 | - | func putOneTknV2 ( | |
1041 | - | let | |
1042 | - | let | |
1043 | - | if ($isInstanceOf( | |
1044 | - | then | |
1045 | - | else throw(($getType( | |
909 | + | @Callable(dK) | |
910 | + | func putOneTknV2 (fe,fI) = { | |
911 | + | let fU = { | |
912 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
913 | + | if ($isInstanceOf(fm, "Boolean")) | |
914 | + | then fm | |
915 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1046 | 916 | } | |
1047 | - | let | |
917 | + | let fV = if (if (if (aH()) | |
1048 | 918 | then true | |
1049 | - | else ( | |
919 | + | else (aW == o)) | |
1050 | 920 | then true | |
1051 | - | else ( | |
921 | + | else (aW == q)) | |
1052 | 922 | then true | |
1053 | - | else | |
1054 | - | let | |
923 | + | else fU | |
924 | + | let fW = [if (if (!(fV)) | |
1055 | 925 | then true | |
1056 | - | else | |
926 | + | else fA(dK)) | |
1057 | 927 | then true | |
1058 | - | else | |
928 | + | else aD("put operation is blocked by admin"), if ((size(dK.payments) == 1)) | |
1059 | 929 | then true | |
1060 | - | else | |
1061 | - | if (( | |
930 | + | else aD("exactly 1 payment are expected")] | |
931 | + | if ((fW == fW)) | |
1062 | 932 | then { | |
1063 | - | let | |
1064 | - | let | |
1065 | - | let | |
1066 | - | let | |
1067 | - | let | |
1068 | - | let | |
1069 | - | let | |
1070 | - | then | |
1071 | - | else | |
1072 | - | let | |
1073 | - | let | |
1074 | - | let | |
1075 | - | let | |
1076 | - | if (( | |
933 | + | let aS = aK() | |
934 | + | let co = aS[u] | |
935 | + | let cp = aS[v] | |
936 | + | let cn = fromBase58String(aS[t]) | |
937 | + | let fi = parseIntValue(aS[w]) | |
938 | + | let fj = parseIntValue(aS[x]) | |
939 | + | let cm = if ((dK.caller == this)) | |
940 | + | then dK.originCaller | |
941 | + | else dK.caller | |
942 | + | let dL = value(dK.payments[0]) | |
943 | + | let ck = toBase58String(value(dL.assetId)) | |
944 | + | let cQ = dL.amount | |
945 | + | let fX = eF(cQ, ck, toString(cm), toBase58String(dK.transactionId), true) | |
946 | + | if ((fX == fX)) | |
1077 | 947 | then { | |
1078 | - | let | |
1079 | - | let | |
1080 | - | let | |
1081 | - | let | |
1082 | - | then ( | |
948 | + | let ch = fX._3 | |
949 | + | let cG = fX._2 | |
950 | + | let fY = fX._1 | |
951 | + | let dp = if (if ((fe > 0)) | |
952 | + | then (fe > fY) | |
1083 | 953 | else false) | |
1084 | - | then | |
1085 | - | else | |
1086 | - | let | |
1087 | - | if (( | |
954 | + | then aD(makeString(["amount to receive is less than ", toString(fe)], "")) | |
955 | + | else fY | |
956 | + | let fM = invoke(aF, "emit", [dp], nil) | |
957 | + | if ((fM == fM)) | |
1088 | 958 | then { | |
1089 | - | let | |
1090 | - | let | |
1091 | - | if ($isInstanceOf( | |
959 | + | let fO = { | |
960 | + | let ax = fM | |
961 | + | if ($isInstanceOf(ax, "Address")) | |
1092 | 962 | then { | |
1093 | - | let | |
1094 | - | invoke( | |
963 | + | let fP = ax | |
964 | + | invoke(fP, "emit", [dp], nil) | |
1095 | 965 | } | |
1096 | 966 | else unit | |
1097 | 967 | } | |
1098 | - | if (( | |
968 | + | if ((fO == fO)) | |
1099 | 969 | then { | |
1100 | - | let | |
970 | + | let fS = if (fI) | |
1101 | 971 | then { | |
1102 | - | let | |
1103 | - | if (( | |
972 | + | let fT = invoke(be, "stake", nil, [AttachedPayment(cn, dp)]) | |
973 | + | if ((fT == fT)) | |
1104 | 974 | then nil | |
1105 | 975 | else throw("Strict value is not equal to itself.") | |
1106 | 976 | } | |
1107 | - | else [ScriptTransfer( | |
1108 | - | let | |
1109 | - | then [ScriptTransfer( | |
977 | + | else [ScriptTransfer(dK.caller, dp, cn)] | |
978 | + | let fv = if ((ch > 0)) | |
979 | + | then [ScriptTransfer(aJ, ch, fromBase58String(ck))] | |
1110 | 980 | else nil | |
1111 | - | let gN = if ((this == aR)) | |
1112 | - | then $Tuple2(0, 0) | |
1113 | - | else { | |
1114 | - | let gO = if ((fg.assetId == bg)) | |
1115 | - | then true | |
1116 | - | else false | |
1117 | - | if (gO) | |
1118 | - | then $Tuple2(-(cp), 0) | |
1119 | - | else $Tuple2(0, -(cp)) | |
1120 | - | } | |
1121 | - | let eQ = gN._1 | |
1122 | - | let eR = gN._2 | |
1123 | - | let gP = eP(eQ, eR, 0) | |
1124 | - | let gg = gP._1 | |
1125 | - | let eG = gP._2 | |
1126 | - | $Tuple2((((cO ++ gF) ++ ga) ++ gg), dx) | |
981 | + | $Tuple2(((cG ++ fS) ++ fv), dp) | |
1127 | 982 | } | |
1128 | 983 | else throw("Strict value is not equal to itself.") | |
1129 | 984 | } | |
1130 | 985 | else throw("Strict value is not equal to itself.") | |
1131 | 986 | } | |
1132 | 987 | else throw("Strict value is not equal to itself.") | |
1133 | 988 | } | |
1134 | 989 | else throw("Strict value is not equal to itself.") | |
1135 | 990 | } | |
1136 | 991 | ||
1137 | 992 | ||
1138 | 993 | ||
1139 | - | @Callable( | |
1140 | - | func putForFree ( | |
994 | + | @Callable(dK) | |
995 | + | func putForFree (fZ) = if ((0 > fZ)) | |
1141 | 996 | then throw("Wrong slpg") | |
1142 | - | else if ((size( | |
997 | + | else if ((size(dK.payments) != 2)) | |
1143 | 998 | then throw("2 pmnts expd") | |
1144 | 999 | else { | |
1145 | - | let gR = fh(toString(dV.caller), toBase58String(dV.transactionId), AttachedPayment(value(dV.payments[0]).assetId, value(dV.payments[0]).amount), dV.payments[1], gQ, false, false, true, 0, "") | |
1146 | - | let cO = gR._9 | |
1147 | - | let gx = toBigInt(value(dV.payments[0]).amount) | |
1148 | - | let gy = toBigInt(value(dV.payments[1]).amount) | |
1149 | - | let eO = eH(gx, gy, toBigInt(0)) | |
1150 | - | if ((eO == eO)) | |
1151 | - | then { | |
1152 | - | let gS = eP(0, 0, 0) | |
1153 | - | let gg = gS._1 | |
1154 | - | let eG = gS._2 | |
1155 | - | let gh = eT(eO, eG) | |
1156 | - | if ((gh == gh)) | |
1157 | - | then (cO ++ gg) | |
1158 | - | else throw("Strict value is not equal to itself.") | |
1159 | - | } | |
1160 | - | else throw("Strict value is not equal to itself.") | |
1000 | + | let ga = dM(toString(dK.caller), toBase58String(dK.transactionId), AttachedPayment(value(dK.payments[0]).assetId, value(dK.payments[0]).amount), dK.payments[1], fZ, false, false, true, 0, "") | |
1001 | + | ga._9 | |
1161 | 1002 | } | |
1162 | 1003 | ||
1163 | 1004 | ||
1164 | 1005 | ||
1165 | - | @Callable( | |
1006 | + | @Callable(dK) | |
1166 | 1007 | func get () = { | |
1167 | - | let dk = ff(dV) | |
1168 | - | let gT = dk._1 | |
1169 | - | let cN = dk._2 | |
1170 | - | let cY = dk._3 | |
1171 | - | let cs = dk._4 | |
1172 | - | let cO = dk._5 | |
1173 | - | let ew = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
1174 | - | if ((ew == ew)) | |
1008 | + | let dc = dJ(dK) | |
1009 | + | let gb = dc._1 | |
1010 | + | let cF = dc._2 | |
1011 | + | let cQ = dc._3 | |
1012 | + | let ck = dc._4 | |
1013 | + | let cG = dc._5 | |
1014 | + | let ez = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
1015 | + | if ((ez == ez)) | |
1016 | + | then cG | |
1017 | + | else throw("Strict value is not equal to itself.") | |
1018 | + | } | |
1019 | + | ||
1020 | + | ||
1021 | + | ||
1022 | + | @Callable(dK) | |
1023 | + | func getOneTknV2 (fd,fe) = { | |
1024 | + | let fU = { | |
1025 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1026 | + | if ($isInstanceOf(fm, "Boolean")) | |
1027 | + | then fm | |
1028 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1029 | + | } | |
1030 | + | let gc = if (if (aH()) | |
1031 | + | then true | |
1032 | + | else (aW == q)) | |
1033 | + | then true | |
1034 | + | else fU | |
1035 | + | let fW = [if (if (!(gc)) | |
1036 | + | then true | |
1037 | + | else fA(dK)) | |
1038 | + | then true | |
1039 | + | else aD("get operation is blocked by admin"), if ((size(dK.payments) == 1)) | |
1040 | + | then true | |
1041 | + | else aD("exactly 1 payment are expected")] | |
1042 | + | if ((fW == fW)) | |
1175 | 1043 | then { | |
1176 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(cY)) | |
1177 | - | let gU = eP(-(gT), -(cN), 0) | |
1178 | - | let gg = gU._1 | |
1179 | - | let eG = gU._2 | |
1180 | - | let gh = eT(eO, eG) | |
1181 | - | if ((gh == gh)) | |
1182 | - | then (cO ++ gg) | |
1183 | - | else throw("Strict value is not equal to itself.") | |
1044 | + | let gd = fc(fd, fe, dK.payments, dK.caller, dK.originCaller, dK.transactionId) | |
1045 | + | let cG = gd._1 | |
1046 | + | let fo = gd._2 | |
1047 | + | $Tuple2(cG, fo) | |
1184 | 1048 | } | |
1185 | 1049 | else throw("Strict value is not equal to itself.") | |
1186 | 1050 | } | |
1187 | 1051 | ||
1188 | 1052 | ||
1189 | 1053 | ||
1190 | - | @Callable(dV) | |
1191 | - | func getOneTknV2 (fI,fJ) = { | |
1192 | - | let gI = { | |
1193 | - | let fR = invoke(aN, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1194 | - | if ($isInstanceOf(fR, "Boolean")) | |
1195 | - | then fR | |
1196 | - | else throw(($getType(fR) + " couldn't be cast to Boolean")) | |
1197 | - | } | |
1198 | - | let gV = if (if (aP()) | |
1199 | - | then true | |
1200 | - | else (be == s)) | |
1201 | - | then true | |
1202 | - | else gI | |
1203 | - | let gK = [if (if (!(gV)) | |
1204 | - | then true | |
1205 | - | else gl(dV)) | |
1206 | - | then true | |
1207 | - | else aK("get operation is blocked by admin"), if ((size(dV.payments) == 1)) | |
1208 | - | then true | |
1209 | - | else aK("exactly 1 payment are expected")] | |
1210 | - | if ((gK == gK)) | |
1211 | - | then { | |
1212 | - | let gW = fH(fI, fJ, dV.payments, dV.caller, dV.originCaller, dV.transactionId) | |
1213 | - | let cO = gW._1 | |
1214 | - | let fT = gW._2 | |
1215 | - | $Tuple2(cO, fT) | |
1216 | - | } | |
1217 | - | else throw("Strict value is not equal to itself.") | |
1054 | + | @Callable(dK) | |
1055 | + | func getOneTknV2READONLY (fd,ge) = { | |
1056 | + | let aS = aK() | |
1057 | + | let co = aS[u] | |
1058 | + | let cp = aS[v] | |
1059 | + | let cn = aS[t] | |
1060 | + | let dR = [toBigInt(bx(co)), toBigInt(bx(cp))] | |
1061 | + | let gf = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cn)), "invalid lp asset").quantity) | |
1062 | + | let bK = dQ(dR) | |
1063 | + | let bJ = (bK - fraction(toBigInt(ge), bK, gf)) | |
1064 | + | let gg = if ((fd == co)) | |
1065 | + | then 0 | |
1066 | + | else if ((fd == cp)) | |
1067 | + | then 1 | |
1068 | + | else throw("invalid out asset id") | |
1069 | + | let gh = ev(dR, gg, bJ) | |
1070 | + | let gi = (dR[gg] - gh) | |
1071 | + | let gj = max([0, toInt((gi - f))]) | |
1072 | + | let gk = cf(gj) | |
1073 | + | let fn = gk._1 | |
1074 | + | let ch = gk._2 | |
1075 | + | $Tuple2(nil, $Tuple2(fn, ch)) | |
1218 | 1076 | } | |
1219 | 1077 | ||
1220 | 1078 | ||
1221 | 1079 | ||
1222 | - | @Callable(dV) | |
1223 | - | func refreshDLp () = { | |
1224 | - | let gX = valueOrElse(getInteger(al), 0) | |
1225 | - | let gY = if (((height - gX) >= ao)) | |
1226 | - | then unit | |
1227 | - | else aK(makeString([toString(ao), " blocks have not passed since the previous call"], "")) | |
1228 | - | if ((gY == gY)) | |
1229 | - | then { | |
1230 | - | let fa = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ak), "0")), aM("invalid dLp")) | |
1231 | - | let gZ = eP(0, 0, 0) | |
1232 | - | let ha = gZ._1 | |
1233 | - | let eG = gZ._2 | |
1234 | - | let eS = if ((fa != eG)) | |
1235 | - | then ha | |
1236 | - | else aK("nothing to refresh") | |
1237 | - | $Tuple2(eS, toString(eG)) | |
1238 | - | } | |
1239 | - | else throw("Strict value is not equal to itself.") | |
1080 | + | @Callable(dK) | |
1081 | + | func getOneTknV2WithBonusREADONLY (fd,ge) = { | |
1082 | + | let aS = aK() | |
1083 | + | let co = aS[u] | |
1084 | + | let cp = aS[v] | |
1085 | + | let cn = aS[t] | |
1086 | + | let cu = bx(co) | |
1087 | + | let cw = bx(cp) | |
1088 | + | let gl = { | |
1089 | + | let fm = invoke(this, "getOneTknV2READONLY", [fd, ge], nil) | |
1090 | + | if ($isInstanceOf(fm, "(Int, Int)")) | |
1091 | + | then fm | |
1092 | + | else throw(($getType(fm) + " couldn't be cast to (Int, Int)")) | |
1093 | + | } | |
1094 | + | let fn = gl._1 | |
1095 | + | let ch = gl._2 | |
1096 | + | let dc = ci("", cn, ge, this) | |
1097 | + | let cE = dc._1 | |
1098 | + | let cF = dc._2 | |
1099 | + | let gm = (cE + cF) | |
1100 | + | let fb = if ((gm == 0)) | |
1101 | + | then if ((fn == 0)) | |
1102 | + | then 0 | |
1103 | + | else throw("bonus calculation error") | |
1104 | + | else fraction((fn - gm), a, gm) | |
1105 | + | $Tuple2(nil, $Tuple3(fn, ch, fb)) | |
1240 | 1106 | } | |
1241 | 1107 | ||
1242 | 1108 | ||
1243 | 1109 | ||
1244 | - | @Callable(dV) | |
1245 | - | func getOneTknV2READONLY (fI,hb) = { | |
1246 | - | let ba = aS() | |
1247 | - | let cw = ba[w] | |
1248 | - | let cx = ba[x] | |
1249 | - | let cv = ba[v] | |
1250 | - | let dF = [toBigInt(bF(cw)), toBigInt(bF(cx))] | |
1251 | - | let eF = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cv)), "invalid lp asset").quantity) | |
1252 | - | let bS = dE(dF) | |
1253 | - | let bR = (bS - fraction(toBigInt(hb), bS, eF)) | |
1254 | - | let hc = if ((fI == cw)) | |
1255 | - | then 0 | |
1256 | - | else if ((fI == cx)) | |
1257 | - | then 1 | |
1258 | - | else throw("invalid out asset id") | |
1259 | - | let hd = es(dF, hc, bR) | |
1260 | - | let he = (dF[hc] - hd) | |
1261 | - | let hf = max([0, toInt((he - f))]) | |
1262 | - | let hg = cn(hf) | |
1263 | - | let fS = hg._1 | |
1264 | - | let cp = hg._2 | |
1265 | - | $Tuple2(nil, $Tuple2(fS, cp)) | |
1266 | - | } | |
1267 | - | ||
1268 | - | ||
1269 | - | ||
1270 | - | @Callable(dV) | |
1271 | - | func getOneTknV2WithBonusREADONLY (fI,hb) = { | |
1272 | - | let ba = aS() | |
1273 | - | let cw = ba[w] | |
1274 | - | let cx = ba[x] | |
1275 | - | let cv = ba[v] | |
1276 | - | let cC = bF(cw) | |
1277 | - | let cE = bF(cx) | |
1278 | - | let hh = { | |
1279 | - | let fR = invoke(this, "getOneTknV2READONLY", [fI, hb], nil) | |
1280 | - | if ($isInstanceOf(fR, "(Int, Int)")) | |
1281 | - | then fR | |
1282 | - | else throw(($getType(fR) + " couldn't be cast to (Int, Int)")) | |
1283 | - | } | |
1284 | - | let fS = hh._1 | |
1285 | - | let cp = hh._2 | |
1286 | - | let dk = cq("", cv, hb, this) | |
1287 | - | let cM = dk._1 | |
1288 | - | let cN = dk._2 | |
1289 | - | let hi = (cM + cN) | |
1290 | - | let fG = if ((hi == 0)) | |
1291 | - | then if ((fS == 0)) | |
1292 | - | then 0 | |
1293 | - | else throw("bonus calculation error") | |
1294 | - | else fraction((fS - hi), a, hi) | |
1295 | - | $Tuple2(nil, $Tuple3(fS, cp, fG)) | |
1296 | - | } | |
1297 | - | ||
1298 | - | ||
1299 | - | ||
1300 | - | @Callable(dV) | |
1301 | - | func getNoLess (hj,hk) = { | |
1302 | - | let dk = ff(dV) | |
1303 | - | let cM = dk._1 | |
1304 | - | let cN = dk._2 | |
1305 | - | let cY = dk._3 | |
1306 | - | let cs = dk._4 | |
1307 | - | let cO = dk._5 | |
1308 | - | if ((hj > cM)) | |
1309 | - | then throw(((("Failed: " + toString(cM)) + " < ") + toString(hj))) | |
1310 | - | else if ((hk > cN)) | |
1311 | - | then throw(((("Failed: " + toString(cN)) + " < ") + toString(hk))) | |
1110 | + | @Callable(dK) | |
1111 | + | func getNoLess (gn,go) = { | |
1112 | + | let dc = dJ(dK) | |
1113 | + | let cE = dc._1 | |
1114 | + | let cF = dc._2 | |
1115 | + | let cQ = dc._3 | |
1116 | + | let ck = dc._4 | |
1117 | + | let cG = dc._5 | |
1118 | + | if ((gn > cE)) | |
1119 | + | then throw(((("Failed: " + toString(cE)) + " < ") + toString(gn))) | |
1120 | + | else if ((go > cF)) | |
1121 | + | then throw(((("Failed: " + toString(cF)) + " < ") + toString(go))) | |
1312 | 1122 | else { | |
1313 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(cY)) | |
1314 | - | let hl = invoke(aN, "burn", [cY], [AttachedPayment(cs, cY)]) | |
1315 | - | if ((hl == hl)) | |
1316 | - | then { | |
1317 | - | let hm = eP(-(cM), -(cN), 0) | |
1318 | - | let gg = hm._1 | |
1319 | - | let eG = hm._2 | |
1320 | - | let gh = eT(eO, eG) | |
1321 | - | if ((gh == gh)) | |
1322 | - | then (cO ++ gg) | |
1323 | - | else throw("Strict value is not equal to itself.") | |
1324 | - | } | |
1123 | + | let gp = invoke(aF, "burn", [cQ], [AttachedPayment(ck, cQ)]) | |
1124 | + | if ((gp == gp)) | |
1125 | + | then cG | |
1325 | 1126 | else throw("Strict value is not equal to itself.") | |
1326 | 1127 | } | |
1327 | 1128 | } | |
1328 | 1129 | ||
1329 | 1130 | ||
1330 | 1131 | ||
1331 | - | @Callable( | |
1332 | - | func unstakeAndGet ( | |
1333 | - | let | |
1132 | + | @Callable(dK) | |
1133 | + | func unstakeAndGet (cg) = { | |
1134 | + | let gq = if ((size(dK.payments) != 0)) | |
1334 | 1135 | then throw("No pmnts expd") | |
1335 | 1136 | else true | |
1336 | - | if (( | |
1137 | + | if ((gq == gq)) | |
1337 | 1138 | then { | |
1338 | - | let ce = aS() | |
1339 | - | let ho = bk() | |
1340 | - | let gA = fromBase58String(ce[v]) | |
1341 | - | let hp = valueOrErrorMessage(addressFromString(ho[C]), "Wr st addr") | |
1342 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1343 | - | let hq = invoke(hp, "unstake", [toBase58String(gA), co], nil) | |
1344 | - | if ((hq == hq)) | |
1139 | + | let bW = aK() | |
1140 | + | let gr = bc() | |
1141 | + | let fN = fromBase58String(bW[t]) | |
1142 | + | let gs = valueOrErrorMessage(addressFromString(gr[A]), "Wr st addr") | |
1143 | + | let gt = invoke(gs, "unstake", [toBase58String(fN), cg], nil) | |
1144 | + | if ((gt == gt)) | |
1345 | 1145 | then { | |
1346 | - | let dk = cq(toBase58String(dV.transactionId), toBase58String(gA), co, dV.caller) | |
1347 | - | let cM = dk._1 | |
1348 | - | let cN = dk._2 | |
1349 | - | let cA = parseIntValue(dk._9) | |
1350 | - | let cO = dk._10 | |
1351 | - | let hr = if (if (aP()) | |
1146 | + | let dc = ci(toBase58String(dK.transactionId), toBase58String(fN), cg, dK.caller) | |
1147 | + | let cs = parseIntValue(dc._9) | |
1148 | + | let cG = dc._10 | |
1149 | + | let gu = if (if (aH()) | |
1352 | 1150 | then true | |
1353 | - | else ( | |
1354 | - | then throw(("Blocked: " + toString( | |
1151 | + | else (cs == q)) | |
1152 | + | then throw(("Blocked: " + toString(cs))) | |
1355 | 1153 | else true | |
1356 | - | if (( | |
1154 | + | if ((gu == gu)) | |
1357 | 1155 | then { | |
1358 | - | let hs = invoke(aN, "burn", [co], [AttachedPayment(gA, co)]) | |
1359 | - | if ((hs == hs)) | |
1360 | - | then { | |
1361 | - | let ht = eP(-(cM), -(cN), 0) | |
1362 | - | let gg = ht._1 | |
1363 | - | let eG = ht._2 | |
1364 | - | let gh = eT(eO, eG) | |
1365 | - | if ((gh == gh)) | |
1366 | - | then (cO ++ gg) | |
1367 | - | else throw("Strict value is not equal to itself.") | |
1368 | - | } | |
1156 | + | let gv = invoke(aF, "burn", [cg], [AttachedPayment(fN, cg)]) | |
1157 | + | if ((gv == gv)) | |
1158 | + | then cG | |
1369 | 1159 | else throw("Strict value is not equal to itself.") | |
1370 | 1160 | } | |
1371 | 1161 | else throw("Strict value is not equal to itself.") | |
1372 | 1162 | } | |
1373 | 1163 | else throw("Strict value is not equal to itself.") | |
1374 | 1164 | } | |
1375 | 1165 | else throw("Strict value is not equal to itself.") | |
1376 | 1166 | } | |
1377 | 1167 | ||
1378 | 1168 | ||
1379 | 1169 | ||
1380 | - | @Callable( | |
1381 | - | func unstakeAndGetNoLess ( | |
1382 | - | let | |
1170 | + | @Callable(dK) | |
1171 | + | func unstakeAndGetNoLess (gw,gx,go) = { | |
1172 | + | let gc = if (aH()) | |
1383 | 1173 | then true | |
1384 | - | else ( | |
1385 | - | let | |
1174 | + | else (aW == q) | |
1175 | + | let fW = [if (!(gc)) | |
1386 | 1176 | then true | |
1387 | - | else throw("get operation is blocked by admin"), if ((size( | |
1177 | + | else throw("get operation is blocked by admin"), if ((size(dK.payments) == 0)) | |
1388 | 1178 | then true | |
1389 | 1179 | else throw("no payments are expected")] | |
1390 | - | if (( | |
1180 | + | if ((fW == fW)) | |
1391 | 1181 | then { | |
1392 | - | let eO = eH(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1393 | - | let hq = invoke(bm, "unstake", [toBase58String(bf), hu], nil) | |
1394 | - | if ((hq == hq)) | |
1182 | + | let gt = invoke(be, "unstake", [toBase58String(aX), gw], nil) | |
1183 | + | if ((gt == gt)) | |
1395 | 1184 | then { | |
1396 | - | let | |
1397 | - | let | |
1398 | - | let | |
1399 | - | let | |
1400 | - | let | |
1185 | + | let gy = ci(toBase58String(dK.transactionId), toBase58String(aX), gw, dK.caller) | |
1186 | + | let cE = gy._1 | |
1187 | + | let cF = gy._2 | |
1188 | + | let cG = gy._10 | |
1189 | + | let gz = [if ((cE >= gx)) | |
1401 | 1190 | then true | |
1402 | - | else throw(makeString(["amount asset amount to receive is less than ", toString( | |
1191 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(gx)], "")), if ((cF >= go)) | |
1403 | 1192 | then true | |
1404 | - | else throw(makeString(["price asset amount to receive is less than ", toString( | |
1405 | - | if (( | |
1193 | + | else throw(makeString(["price asset amount to receive is less than ", toString(go)], ""))] | |
1194 | + | if ((gz == gz)) | |
1406 | 1195 | then { | |
1407 | - | let hl = invoke(aN, "burn", [hu], [AttachedPayment(bf, hu)]) | |
1408 | - | if ((hl == hl)) | |
1409 | - | then { | |
1410 | - | let hy = eP(-(cM), -(cN), 0) | |
1411 | - | let gg = hy._1 | |
1412 | - | let eG = hy._2 | |
1413 | - | let gh = eT(eO, eG) | |
1414 | - | if ((gh == gh)) | |
1415 | - | then (cO ++ gg) | |
1416 | - | else throw("Strict value is not equal to itself.") | |
1417 | - | } | |
1196 | + | let gp = invoke(aF, "burn", [gw], [AttachedPayment(aX, gw)]) | |
1197 | + | if ((gp == gp)) | |
1198 | + | then cG | |
1418 | 1199 | else throw("Strict value is not equal to itself.") | |
1419 | 1200 | } | |
1420 | 1201 | else throw("Strict value is not equal to itself.") | |
1421 | 1202 | } | |
1422 | 1203 | else throw("Strict value is not equal to itself.") | |
1423 | 1204 | } | |
1424 | 1205 | else throw("Strict value is not equal to itself.") | |
1425 | 1206 | } | |
1426 | 1207 | ||
1427 | 1208 | ||
1428 | 1209 | ||
1429 | - | @Callable( | |
1430 | - | func unstakeAndGetOneTknV2 ( | |
1431 | - | let | |
1432 | - | let | |
1433 | - | if ($isInstanceOf( | |
1434 | - | then | |
1435 | - | else throw(($getType( | |
1210 | + | @Callable(dK) | |
1211 | + | func unstakeAndGetOneTknV2 (gw,fd,fe) = { | |
1212 | + | let fU = { | |
1213 | + | let fm = invoke(aF, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1214 | + | if ($isInstanceOf(fm, "Boolean")) | |
1215 | + | then fm | |
1216 | + | else throw(($getType(fm) + " couldn't be cast to Boolean")) | |
1436 | 1217 | } | |
1437 | - | let | |
1218 | + | let gc = if (if (aH()) | |
1438 | 1219 | then true | |
1439 | - | else ( | |
1220 | + | else (aW == q)) | |
1440 | 1221 | then true | |
1441 | - | else | |
1442 | - | let | |
1222 | + | else fU | |
1223 | + | let fW = [if (if (!(gc)) | |
1443 | 1224 | then true | |
1444 | - | else | |
1225 | + | else fA(dK)) | |
1445 | 1226 | then true | |
1446 | - | else | |
1227 | + | else aD("get operation is blocked by admin"), if ((size(dK.payments) == 0)) | |
1447 | 1228 | then true | |
1448 | - | else | |
1449 | - | if (( | |
1229 | + | else aD("no payments are expected")] | |
1230 | + | if ((fW == fW)) | |
1450 | 1231 | then { | |
1451 | - | let | |
1452 | - | let | |
1453 | - | let | |
1454 | - | let | |
1455 | - | let | |
1456 | - | if (( | |
1232 | + | let bW = aK() | |
1233 | + | let gr = bc() | |
1234 | + | let fN = fromBase58String(bW[t]) | |
1235 | + | let gs = valueOrErrorMessage(addressFromString(gr[A]), "Wr st addr") | |
1236 | + | let gt = invoke(gs, "unstake", [toBase58String(fN), gw], nil) | |
1237 | + | if ((gt == gt)) | |
1457 | 1238 | then { | |
1458 | - | let | |
1459 | - | let | |
1460 | - | let | |
1461 | - | $Tuple2( | |
1239 | + | let gA = fc(fd, fe, [AttachedPayment(fN, gw)], dK.caller, dK.originCaller, dK.transactionId) | |
1240 | + | let cG = gA._1 | |
1241 | + | let fo = gA._2 | |
1242 | + | $Tuple2(cG, fo) | |
1462 | 1243 | } | |
1463 | 1244 | else throw("Strict value is not equal to itself.") | |
1464 | 1245 | } | |
1465 | 1246 | else throw("Strict value is not equal to itself.") | |
1466 | 1247 | } | |
1467 | 1248 | ||
1468 | 1249 | ||
1469 | 1250 | ||
1470 | - | @Callable( | |
1471 | - | func putOneTknV2WithBonusREADONLY ( | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1479 | - | let | |
1480 | - | let | |
1481 | - | $Tuple2(nil, $Tuple3( | |
1251 | + | @Callable(dK) | |
1252 | + | func putOneTknV2WithBonusREADONLY (gB,gC) = { | |
1253 | + | let aS = aK() | |
1254 | + | let co = aS[u] | |
1255 | + | let cp = aS[v] | |
1256 | + | let cn = aS[t] | |
1257 | + | let gD = eF(gB, gC, "", "", true) | |
1258 | + | let eW = gD._1 | |
1259 | + | let cG = gD._2 | |
1260 | + | let ch = gD._3 | |
1261 | + | let fb = gD._4 | |
1262 | + | $Tuple2(nil, $Tuple3(eW, ch, fb)) | |
1482 | 1263 | } | |
1483 | 1264 | ||
1484 | 1265 | ||
1485 | 1266 | ||
1486 | - | @Callable( | |
1487 | - | func putOneTknV2WithoutTakeFeeREADONLY ( | |
1488 | - | let | |
1489 | - | let | |
1490 | - | let | |
1491 | - | let | |
1492 | - | let | |
1493 | - | let | |
1494 | - | let | |
1495 | - | let | |
1496 | - | let | |
1497 | - | $Tuple2(nil, $Tuple3( | |
1267 | + | @Callable(dK) | |
1268 | + | func putOneTknV2WithoutTakeFeeREADONLY (gB,gC) = { | |
1269 | + | let aS = aK() | |
1270 | + | let co = aS[u] | |
1271 | + | let cp = aS[v] | |
1272 | + | let cn = aS[t] | |
1273 | + | let gE = eF(gB, gC, "", "", false) | |
1274 | + | let eW = gE._1 | |
1275 | + | let cG = gE._2 | |
1276 | + | let ch = gE._3 | |
1277 | + | let fb = gE._4 | |
1278 | + | $Tuple2(nil, $Tuple3(eW, ch, fb)) | |
1498 | 1279 | } | |
1499 | 1280 | ||
1500 | 1281 | ||
1501 | 1282 | ||
1502 | - | @Callable( | |
1503 | - | func activate ( | |
1283 | + | @Callable(dK) | |
1284 | + | func activate (gF,gG) = if ((toString(dK.caller) != toString(aF))) | |
1504 | 1285 | then throw("denied") | |
1505 | - | else $Tuple2([StringEntry( | |
1286 | + | else $Tuple2([StringEntry(ac(), gF), StringEntry(ad(), gG)], "success") | |
1506 | 1287 | ||
1507 | 1288 | ||
1508 | 1289 | ||
1509 | - | @Callable( | |
1510 | - | func setS ( | |
1511 | - | then | |
1512 | - | else [StringEntry( | |
1290 | + | @Callable(dK) | |
1291 | + | func setS (gH,gu) = if ((toString(dK.caller) != az(this, af()))) | |
1292 | + | then fz | |
1293 | + | else [StringEntry(gH, gu)] | |
1513 | 1294 | ||
1514 | 1295 | ||
1515 | 1296 | ||
1516 | - | @Callable( | |
1517 | - | func setI ( | |
1518 | - | then | |
1519 | - | else [IntegerEntry( | |
1297 | + | @Callable(dK) | |
1298 | + | func setI (gH,gu) = if ((toString(dK.caller) != az(this, af()))) | |
1299 | + | then fz | |
1300 | + | else [IntegerEntry(gH, gu)] | |
1520 | 1301 | ||
1521 | 1302 | ||
1522 | 1303 | ||
1523 | - | @Callable( | |
1524 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, | |
1304 | + | @Callable(dK) | |
1305 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aK()) | |
1525 | 1306 | ||
1526 | 1307 | ||
1527 | 1308 | ||
1528 | - | @Callable( | |
1529 | - | func getAccBalanceWrapperREADONLY ( | |
1309 | + | @Callable(dK) | |
1310 | + | func getAccBalanceWrapperREADONLY (by) = $Tuple2(nil, bx(by)) | |
1530 | 1311 | ||
1531 | 1312 | ||
1532 | 1313 | ||
1533 | - | @Callable( | |
1534 | - | func calcPricesWrapperREADONLY ( | |
1535 | - | let | |
1536 | - | $Tuple2(nil, [toString( | |
1314 | + | @Callable(dK) | |
1315 | + | func calcPricesWrapperREADONLY (bQ,bR,bV) = { | |
1316 | + | let gI = bU(bQ, bR, bV) | |
1317 | + | $Tuple2(nil, [toString(gI[0]), toString(gI[1]), toString(gI[2])]) | |
1537 | 1318 | } | |
1538 | 1319 | ||
1539 | 1320 | ||
1540 | 1321 | ||
1541 | - | @Callable( | |
1542 | - | func fromX18WrapperREADONLY ( | |
1322 | + | @Callable(dK) | |
1323 | + | func fromX18WrapperREADONLY (J,gJ) = $Tuple2(nil, I(parseBigIntValue(J), gJ)) | |
1543 | 1324 | ||
1544 | 1325 | ||
1545 | 1326 | ||
1546 | - | @Callable( | |
1547 | - | func toX18WrapperREADONLY ( | |
1327 | + | @Callable(dK) | |
1328 | + | func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H))) | |
1548 | 1329 | ||
1549 | 1330 | ||
1550 | 1331 | ||
1551 | - | @Callable( | |
1552 | - | func calcPriceBigIntWrapperREADONLY ( | |
1332 | + | @Callable(dK) | |
1333 | + | func calcPriceBigIntWrapperREADONLY (bA,bB) = $Tuple2(nil, toString(bz(parseBigIntValue(bA), parseBigIntValue(bB)))) | |
1553 | 1334 | ||
1554 | 1335 | ||
1555 | 1336 | ||
1556 | - | @Callable( | |
1557 | - | func estimatePutOperationWrapperREADONLY ( | |
1337 | + | @Callable(dK) | |
1338 | + | func estimatePutOperationWrapperREADONLY (cj,bF,cI,cJ,cK,cL,gK,cM,cN) = $Tuple2(nil, cH(cj, bF, cI, cJ, cK, cL, gK, cM, cN, true, false, 0, "")) | |
1558 | 1339 | ||
1559 | 1340 | ||
1560 | 1341 | ||
1561 | - | @Callable( | |
1562 | - | func estimateGetOperationWrapperREADONLY ( | |
1563 | - | let | |
1564 | - | $Tuple2(nil, $Tuple10( | |
1342 | + | @Callable(dK) | |
1343 | + | func estimateGetOperationWrapperREADONLY (cj,gL,cl,gK) = { | |
1344 | + | let dc = ci(cj, gL, cl, addressFromStringValue(gK)) | |
1345 | + | $Tuple2(nil, $Tuple10(dc._1, dc._2, dc._3, dc._4, dc._5, dc._6, dc._7, toString(dc._8), dc._9, dc._10)) | |
1565 | 1346 | } | |
1566 | 1347 | ||
1567 | 1348 | ||
1568 | 1349 | ||
1569 | - | @Callable( | |
1570 | - | func getFeeREADONLY () = $Tuple2(nil, | |
1350 | + | @Callable(dK) | |
1351 | + | func getFeeREADONLY () = $Tuple2(nil, ah) | |
1571 | 1352 | ||
1572 | 1353 | ||
1573 | - | @Verifier( | |
1574 | - | func | |
1575 | - | let | |
1576 | - | let | |
1577 | - | if ($isInstanceOf( | |
1354 | + | @Verifier(gM) | |
1355 | + | func gN () = { | |
1356 | + | let gO = { | |
1357 | + | let ax = fx() | |
1358 | + | if ($isInstanceOf(ax, "ByteVector")) | |
1578 | 1359 | then { | |
1579 | - | let | |
1580 | - | | |
1360 | + | let fB = ax | |
1361 | + | fB | |
1581 | 1362 | } | |
1582 | - | else if ($isInstanceOf( | |
1583 | - | then | |
1363 | + | else if ($isInstanceOf(ax, "Unit")) | |
1364 | + | then gM.senderPublicKey | |
1584 | 1365 | else throw("Match error") | |
1585 | 1366 | } | |
1586 | - | let | |
1587 | - | if ($isInstanceOf( | |
1367 | + | let ax = gM | |
1368 | + | if ($isInstanceOf(ax, "Order")) | |
1588 | 1369 | then { | |
1589 | - | let | |
1590 | - | let | |
1591 | - | let | |
1592 | - | let | |
1593 | - | let | |
1594 | - | if (if (if ( | |
1595 | - | then | |
1370 | + | let dx = ax | |
1371 | + | let gP = aI() | |
1372 | + | let gQ = dw(dx) | |
1373 | + | let gR = sigVerify(dx.bodyBytes, dx.proofs[0], dx.senderPublicKey) | |
1374 | + | let gS = sigVerify(dx.bodyBytes, dx.proofs[1], gP) | |
1375 | + | if (if (if (gQ) | |
1376 | + | then gR | |
1596 | 1377 | else false) | |
1597 | - | then | |
1378 | + | then gS | |
1598 | 1379 | else false) | |
1599 | 1380 | then true | |
1600 | - | else | |
1381 | + | else as(gQ, gR, gS) | |
1601 | 1382 | } | |
1602 | - | else if ($isInstanceOf( | |
1383 | + | else if ($isInstanceOf(ax, "SetScriptTransaction")) | |
1603 | 1384 | then { | |
1604 | - | let | |
1605 | - | let | |
1606 | - | let | |
1607 | - | let | |
1608 | - | if (if (( | |
1609 | - | then ( | |
1385 | + | let dX = ax | |
1386 | + | let gT = blake2b256(value(dX.script)) | |
1387 | + | let gU = fromBase64String(value(getString(aF, aq()))) | |
1388 | + | let gV = scriptHash(this) | |
1389 | + | if (if ((gU == gT)) | |
1390 | + | then (gV != gT) | |
1610 | 1391 | else false) | |
1611 | 1392 | then true | |
1612 | - | else sigVerify( | |
1393 | + | else sigVerify(gM.bodyBytes, gM.proofs[0], gO) | |
1613 | 1394 | } | |
1614 | - | else sigVerify( | |
1395 | + | else sigVerify(gM.bodyBytes, gM.proofs[0], gO) | |
1615 | 1396 | } | |
1616 | 1397 |
github/deemru/w8io/169f3d6 448.40 ms ◑