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