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