tx · FCgGzRvw6fdH5SmPd5M5JNpfGPqa99GziSpQ8X6sGo1A

3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT:  -0.03200000 Waves

2023.02.27 12:42 [2467950] smart account 3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT > SELF 0.00000000 Waves

{ "type": 13, "id": "FCgGzRvw6fdH5SmPd5M5JNpfGPqa99GziSpQ8X6sGo1A", "fee": 3200000, "feeAssetId": null, "timestamp": 1677490954751, "version": 1, "sender": "3NAefciWv6f9fWvEXdGgpHfanJFG8HqfjuT", "senderPublicKey": "D1BL65meykxFZTCuq7jq9HSGLLnWvQamQPUNrguW5w39", "proofs": [ "4VXRnbE8FJ1A6mb4pn6CtHagCGPFt3uXZgjcr1K8R1pHYRsm8fivvx5UHyK5EHGsvNFMvZfKivi9nqQxRe7V7TCt" ], "script": "base64:BgK/IggCEgMKAQgSAwoBCBIAEgQKAgEEEgQKAgEEEgMKAQESABIECgIIARIECgIIARIECgIIARIECgIBARIDCgEBEgUKAwEBARIFCgMBCAESBAoCAQgSBAoCAQgSBAoCCAgSBAoCCAgSBAoCCAESABIDCgEIEgUKAwEBARIECgIIARIECgIBARIECgIICBILCgkIAQECAQIIBAQSBgoECAgBCCIGc2NhbGU4IgxzY2FsZThCaWdJbnQiB3NjYWxlMTgiCnplcm9CaWdJbnQiBGJpZzAiBGJpZzEiBGJpZzIiCnNsaXBwYWdlNEQiC3dhdmVzU3RyaW5nIgVBbXVsdCIFRGNvbnYiA1NFUCIFRU1QVFkiClBvb2xBY3RpdmUiClBvb2xQdXREaXMiDlBvb2xNYXRjaGVyRGlzIgxQb29sU2h1dGRvd24iDmlkeFBvb2xBZGRyZXNzIglpZHhQb29sU3QiCWlkeExQQXNJZCIJaWR4QW1Bc0lkIglpZHhQckFzSWQiC2lkeEFtdEFzRGNtIg1pZHhQcmljZUFzRGNtIgtpZHhJQW10QXNJZCINaWR4SVByaWNlQXNJZCIPaWR4RmFjdFN0YWtDbnRyIhJp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JsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgQCYXYFAmdPAwkAAQIFAmF2AgVPcmRlcgQCZHoFAmF2BAJnUgkBAmFKAAQCZ1MJAQJkeQEFAmR6BAJnVAkA9AMDCAUCZHoJYm9keUJ5dGVzCQCRAwIIBQJkegZwcm9vZnMAAAgFAmR6D3NlbmRlclB1YmxpY0tleQQCZ1UJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAEFAmdSAwMDBQJnUwUCZ1QHBQJnVQcGCQECYXEDBQJnUwUCZ1QFAmdVAwkAAQIFAmF2AhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZFoFAmF2BAJnVgkA9gMBCQEFdmFsdWUBCAUCZFoGc2NyaXB0BAJnVwkA2wQBCQEFdmFsdWUBCQCdCAIFAmFECQECYW8ABAJnWAkA8QcBBQR0aGlzAwMJAAACBQJnVwUCZ1YJAQIhPQIFAmdYBQJnVgcGCQD0AwMIBQJnTwlib2R5Qnl0ZXMJAJEDAggFAmdPBnByb29mcwAABQJnUQkA9AMDCAUCZ08JYm9keUJ5dGVzCQCRAwIIBQJnTwZwcm9vZnMAAAUCZ1GEykE/", "chainId": 84, "height": 2467950, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2vZHFhDbkCCjV4QTWnhMjjpBiGJjeB1Sqb7A2VcJShT1 Next: Gm59MEY78Hw4gwPA5rhY7dMdDAVeZw3BX9kVG1962tmP Diff:
OldNewDifferences
1515
1616 let g = toBigInt(2)
1717
18-let h = toBigInt(3)
18+let h = toBigInt((a - ((a * 1) / a)))
1919
20-let i = toBigInt(4)
20+let i = "WAVES"
2121
22-let j = toBigInt((a - ((a * 1) / a)))
22+let j = "100"
2323
24-let k = "WAVES"
24+let k = "1"
2525
26-let l = "100"
26+let l = "__"
2727
28-let m = "1"
28+let m = ""
2929
30-let n = "__"
30+let n = 1
3131
32-let o = ""
32+let o = 2
3333
34-let p = 1
34+let p = 3
3535
36-let q = 2
36+let q = 4
3737
38-let r = 3
38+let r = 1
3939
40-let s = 4
40+let s = 2
4141
42-let t = 1
42+let t = 3
4343
44-let u = 2
44+let u = 4
4545
46-let v = 3
46+let v = 5
4747
48-let w = 4
48+let w = 6
4949
50-let x = 5
50+let x = 7
5151
52-let y = 6
52+let y = 8
5353
54-let z = 7
54+let z = 9
5555
56-let A = 8
56+let A = 1
5757
58-let B = 9
58+let B = 6
5959
60-let C = 1
60+let C = 7
6161
62-let D = 6
62+let D = 10
6363
64-let E = 7
64+let E = fraction(10, a, 10000)
6565
66-let F = 10
67-
68-let G = fraction(10, a, 10000)
69-
70-func H (I,J) = fraction(toBigInt(I), c, toBigInt(J))
66+func F (G,H) = fraction(toBigInt(G), c, toBigInt(H))
7167
7268
73-func K (I,J) = fraction(I, c, J)
69+func I (J,K) = toInt(fraction(J, toBigInt(K), c))
7470
7571
76-func L (M,N) = toInt(fraction(M, toBigInt(N), c))
72+func L (M,N,O) = fraction(M, N, O)
7773
7874
79-func O (M,N,P) = toInt(fraction(M, toBigInt(N), c, P))
75+func P (J) = if ((d > J))
76+ then -(J)
77+ else J
8078
8179
82-func Q (I,J) = fraction(I, c, toBigInt(J))
80+func Q (J) = if ((d > J))
81+ then -(J)
82+ else J
8383
8484
85-func R (M,N) = fraction(M, toBigInt(N), c)
85+func R () = "%s__factoryContract"
8686
8787
88-func S (T,U,V) = fraction(T, U, V)
88+func S () = "%s__managerPublicKey"
8989
9090
91-func W (M) = if ((d > M))
92- then -(M)
93- else M
91+func T () = "%s__pendingManagerPublicKey"
9492
9593
96-func X (M) = if ((d > M))
97- then -(M)
98- else M
94+func U () = "%s%s__price__last"
9995
10096
101-func Y () = "%s__factoryContract"
97+func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l)
10298
10399
104-func Z () = "%s__managerPublicKey"
100+func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa)
105101
106102
107-func aa () = "%s__pendingManagerPublicKey"
103+func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa)
108104
109105
110-func ab () = "%s%s__price__last"
106+func ac () = "%s__amountAsset"
111107
112108
113-func ac (ad,ae) = makeString(["%s%s%d%d__price__history", toString(ad), toString(ae)], n)
109+func ad () = "%s__priceAsset"
114110
115111
116-func af (ag,ah) = ((("%s%s%s__P__" + ag) + "__") + ah)
112+func ae () = "%s__amp"
117113
118114
119-func ai (ag,ah) = ((("%s%s%s__G__" + ag) + "__") + ah)
115+func af () = "%s__addonAddr"
120116
121117
122-func aj () = "%s__amountAsset"
118+func ag () = "%s__factoryConfig"
123119
124120
125-func ak () = "%s__priceAsset"
121+func ah () = "%s%s__matcher__publicKey"
126122
127123
128-func al () = "%s__amp"
124+func ai (aj,ak) = (((("%d%d%s__" + aj) + "__") + ak) + "__config")
129125
130126
131-func am () = "%s__addonAddr"
127+func al (am) = ("%s%s%s__mappings__baseAsset2internalId__" + am)
132128
133129
134-let an = "%s__fee"
135-
136-let ao = valueOrElse(getInteger(this, an), G)
137-
138-let ap = makeString(["%s", "dLp"], n)
139-
140-let aq = makeString(["%s", "dLpRefreshedHeight"], n)
141-
142-let ar = makeString(["%s", "refreshDLpDelay"], n)
143-
144-let as = 30
145-
146-let at = valueOrElse(getInteger(this, ar), as)
147-
148-func au () = "%s__factoryConfig"
130+func an () = "%s__shutdown"
149131
150132
151-func av () = "%s%s__matcher__publicKey"
133+func ao () = "%s__allowedLpStableScriptHash"
152134
153135
154-func aw (ax,ay) = (((("%d%d%s__" + ax) + "__") + ay) + "__config")
136+func ap () = "%s__feeCollectorAddress"
155137
156138
157-func az (aA) = ("%s%s%s__mappings__baseAsset2internalId__" + aA)
139+func aq (ar,as,at) = throw(((((("Failed: ordValid=" + toString(ar)) + " sndrValid=") + toString(as)) + " mtchrValid=") + toString(at)))
158140
159141
160-func aB () = "%s__shutdown"
161-
162-
163-func aC () = "%s__allowedLpStableScriptHash"
164-
165-
166-func aD () = "%s__feeCollectorAddress"
167-
168-
169-func aE (aF,aG,aH,aI) = throw((((((((("order validation failed: orderValid=" + toString(aF)) + " (") + aG) + ")") + " senderValid=") + toString(aH)) + " matcherValid=") + toString(aI)))
170-
171-
172-func aJ (aK,aL) = valueOrErrorMessage(getString(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], ""))
173-
174-
175-func aM (aK,aL) = valueOrErrorMessage(getInteger(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], ""))
176-
177-
178-func aN (aO) = throw(makeString(["lp_stable.ride:", aO], " "))
179-
180-
181-func aP (aO) = makeString(["lp_stable.ride:", aO], " ")
182-
183-
184-let aQ = addressFromStringValue(aJ(this, Y()))
185-
186-let aR = {
187- let aS = invoke(aQ, "getInFeeREADONLY", [toString(this)], nil)
188- if ($isInstanceOf(aS, "Int"))
189- then aS
190- else throw(($getType(aS) + " couldn't be cast to Int"))
191- }
192-
193-let aT = {
194- let aS = invoke(aQ, "getOutFeeREADONLY", [toString(this)], nil)
195- if ($isInstanceOf(aS, "Int"))
196- then aS
197- else throw(($getType(aS) + " couldn't be cast to Int"))
198- }
199-
200-let aU = aJ(this, al())
201-
202-func aV () = valueOrElse(getBoolean(aQ, aB()), false)
203-
204-
205-func aW () = fromBase58String(aJ(aQ, av()))
206-
207-
208-let aX = addressFromStringValue(aJ(aQ, aD()))
209-
210-func aY () = {
211- let aZ = aJ(this, aj())
212- let ba = aJ(this, ak())
213- let bb = aM(aQ, az(ba))
214- let ax = aM(aQ, az(aZ))
215- split(aJ(aQ, aw(toString(ax), toString(bb))), n)
142+func au (J) = {
143+ let av = J
144+ if ($isInstanceOf(av, "String"))
145+ then {
146+ let aw = av
147+ aw
148+ }
149+ else throw("fail cast to String")
216150 }
217151
218152
219-func bc (bd) = if ((bd == k))
220- then unit
221- else fromBase58String(bd)
153+func ax (ay,az) = valueOrErrorMessage(getString(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], ""))
222154
223155
224-func be (bd) = if ((bd == unit))
225- then k
226- else toBase58String(value(bd))
156+func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], ""))
227157
228158
229-func bf (bg) = $Tuple9(addressFromStringValue(bg[t]), parseIntValue(bg[u]), fromBase58String(bg[v]), bc(bg[w]), bc(bg[x]), parseIntValue(bg[y]), parseIntValue(bg[z]), fromBase58String(bg[A]), fromBase58String(bg[B]))
159+func aB (aC) = throw(makeString(["lp_stable.ride:", aC], " "))
230160
231161
232-let bh = bf(aY())
162+let aD = addressFromStringValue(ax(this, R()))
233163
234-let bi = bh
164+let aE = {
165+ let aF = invoke(aD, "getInFeeREADONLY", [toString(this)], nil)
166+ if ($isInstanceOf(aF, "Int"))
167+ then aF
168+ else throw(($getType(aF) + " couldn't be cast to Int"))
169+ }
235170
236-let bj = bi._1
171+let aG = {
172+ let aF = invoke(aD, "getOutFeeREADONLY", [toString(this)], nil)
173+ if ($isInstanceOf(aF, "Int"))
174+ then aF
175+ else throw(($getType(aF) + " couldn't be cast to Int"))
176+ }
237177
238-let bk = bi._2
178+let aH = ax(this, ae())
239179
240-let bl = bi._3
241-
242-let bm = bi._4
243-
244-let bn = bi._5
245-
246-let bo = bi._6
247-
248-let bp = bi._7
249-
250-let bq = bi._8
251-
252-let br = bi._9
253-
254-func bs () = split(aJ(aQ, au()), n)
180+func aI () = valueOrElse(getBoolean(aD, an()), false)
255181
256182
257-let bt = bs()
258-
259-let bu = valueOrErrorMessage(addressFromString(bt[C]), "Invalid staking contract address")
260-
261-let bv = valueOrErrorMessage(addressFromString(bt[E]), "Invalid slipage contract address")
262-
263-let bw = valueOrErrorMessage(addressFromString(bt[F]), "Invalid gwx contract address")
264-
265-let bx = valueOrErrorMessage(addressFromString(bt[D]), "Invalid gwx contract address")
266-
267-func by (bz,bA,bB,bC,bD,bE,bF,bG,bH,bI) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE), toString(bF), toString(bG), toString(bH), toString(bI)], n)
183+func aJ () = fromBase58String(ax(aD, ah()))
268184
269185
270-func bJ (bK,bL,bM,bC,bF,bG) = makeString(["%d%d%d%d%d%d", toString(bK), toString(bL), toString(bM), toString(bC), toString(bF), toString(bG)], n)
186+let aK = addressFromStringValue(ax(aD, ap()))
271187
272-
273-func bN (bO) = if ((bO == "WAVES"))
274- then wavesBalance(this).available
275- else assetBalance(this, fromBase58String(bO))
276-
277-
278-func bP (bQ,bR) = fraction(bQ, c, bR)
279-
280-
281-func bS (bQ,bR,P) = fraction(bQ, c, bR, P)
282-
283-
284-func bT (bU,bV,bW) = {
285- let bX = fraction((bU - bV), b, bV)
286- let bY = ((bW - W(bX)) > d)
287- if (!(bY))
288- then throw(("Big slpg: " + toString(bX)))
289- else $Tuple2(bY, min([bU, bV]))
188+func aL () = {
189+ let aM = ax(this, ac())
190+ let aN = ax(this, ad())
191+ let aO = aA(aD, al(aN))
192+ let aj = aA(aD, al(aM))
193+ split(ax(aD, ai(toString(aj), toString(aO))), l)
290194 }
291195
292196
293-func bZ (ca,cb,cc) = {
294- let bX = fraction(cb, b, ca)
295- let cd = (cc > bX)
296- if (if (cd)
297- then true
298- else (cb > ca))
299- then throw(((((((toString(cb) + " ") + toString(ca)) + " ") + toString(bX)) + " ") + toString(cc)))
300- else cd
197+func aP (aQ) = if ((aQ == i))
198+ then unit
199+ else fromBase58String(aQ)
200+
201+
202+func aR (aQ) = if ((aQ == unit))
203+ then i
204+ else toBase58String(value(aQ))
205+
206+
207+func aS (aT) = $Tuple7(addressFromStringValue(aT[r]), parseIntValue(aT[s]), fromBase58String(aT[t]), aP(aT[u]), aP(aT[v]), parseIntValue(aT[w]), parseIntValue(aT[x]))
208+
209+
210+let aU = aS(aL())
211+
212+let aV = aU
213+
214+let aW = aV._1
215+
216+let aX = aV._2
217+
218+let aY = aV._3
219+
220+let aZ = aV._4
221+
222+let ba = aV._5
223+
224+let bb = aV._6
225+
226+let bc = aV._7
227+
228+func bd () = split(ax(aD, ag()), l)
229+
230+
231+let be = bd()
232+
233+let bf = valueOrErrorMessage(addressFromString(be[A]), "Invalid staking contract address")
234+
235+let bg = valueOrErrorMessage(addressFromString(be[C]), "Invalid slipage contract address")
236+
237+let bh = valueOrErrorMessage(addressFromString(be[D]), "Invalid gwx contract address")
238+
239+let bi = valueOrErrorMessage(addressFromString(be[B]), "Invalid gwx contract address")
240+
241+func bj (bk,bl,bm,bn,bo,bp,bq,br,bs,bt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs), toString(bt)], l)
242+
243+
244+func bu (bv,bw,bx,bn,bq,br) = makeString(["%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(bn), toString(bq), toString(br)], l)
245+
246+
247+func by (bz) = if ((bz == "WAVES"))
248+ then wavesBalance(this).available
249+ else assetBalance(this, fromBase58String(bz))
250+
251+
252+func bA (bB,bC) = fraction(bB, c, bC)
253+
254+
255+func bD (bE,bF,bG) = {
256+ let bH = fraction((bE - bF), b, bF)
257+ let bI = ((bG - P(bH)) > d)
258+ if (!(bI))
259+ then throw(("Big slpg: " + toString(bH)))
260+ else $Tuple2(bI, min([bE, bF]))
301261 }
302262
303263
304-func ce (cf,cg,ch,ci) = {
305- let cj = H(ch, cf)
306- let ck = H(ci, cg)
307- bP(ck, cj)
264+func bJ (bK,bL,bM) = {
265+ let bH = fraction(bL, b, bK)
266+ let bN = (bM > bH)
267+ if (if (bN)
268+ then true
269+ else (bL > bK))
270+ then throw(((((((toString(bL) + " ") + toString(bK)) + " ") + toString(bH)) + " ") + toString(bM)))
271+ else bN
308272 }
309273
310274
311-func cl (ch,ci,cm) = {
312- let cn = bo
313- let co = bp
314- let cp = ce(cn, co, ch, ci)
315- let bR = H(ch, cn)
316- let bQ = H(ci, co)
317- let cq = H(cm, a)
318- let cr = bP(bR, cq)
319- let cs = bP(bQ, cq)
320-[cp, cr, cs]
275+func bO (bP,bQ,bR,bS) = {
276+ let bT = F(bR, bP)
277+ let bU = F(bS, bQ)
278+ bA(bU, bT)
321279 }
322280
323281
324-func ct (ch,ci,cm) = {
325- let cu = cl(ch, ci, cm)
326-[L(cu[0], a), L(cu[1], a), L(cu[2], a)]
282+func bV (bR,bS,bW) = {
283+ let bX = aL()
284+ let bY = parseIntValue(bX[w])
285+ let bZ = parseIntValue(bX[x])
286+ let ca = bO(bY, bZ, bR, bS)
287+ let bC = F(bR, bY)
288+ let bB = F(bS, bZ)
289+ let cb = F(bW, a)
290+ let cc = bA(bC, cb)
291+ let cd = bA(bB, cb)
292+[ca, cc, cd]
327293 }
328294
329295
330-func cv (cw,ao) = {
331- let cx = if ((ao == 0))
332- then 0
333- else fraction(cw, ao, a)
334- $Tuple2((cw - cx), cx)
296+func ce (bR,bS,bW) = {
297+ let cf = bV(bR, bS, bW)
298+[I(cf[0], a), I(cf[1], a), I(cf[2], a)]
335299 }
336300
337301
338-func cy (cz) = {
339- let cA = cz[0]
340- let cB = cz[1]
341- let cC = (cA + cB)
342- if ((cC == e))
343- then e
302+func cg (ch,ci) = {
303+ let cj = if ((ci == 0))
304+ then 0
305+ else fraction(ch, ci, a)
306+ $Tuple2((ch - cj), cj)
307+ }
308+
309+
310+func ck (cl,cm,cn,co) = {
311+ let bX = aL()
312+ let cp = bX[t]
313+ let cq = bX[u]
314+ let cr = bX[v]
315+ let cs = parseIntValue(bX[w])
316+ let ct = parseIntValue(bX[x])
317+ let cu = bX[s]
318+ let cv = valueOrErrorMessage(assetInfo(fromBase58String(cp)), "Wrong LP id").quantity
319+ if ((cp != cm))
320+ then throw("Wrong pmt asset")
344321 else {
345- let cD = parseIntValue(aU)
346- let cE = (cD * 2)
347- let cu = fraction(cA, cB, f)
348- let cF = fraction(cu, i, f)
349- let cG = fraction(toBigInt(cE), cC, f)
350- let cH = toBigInt((cE - 1))
351- func cI (cJ) = {
352- let cK = fraction(cJ, cJ, f)
353- let cL = fraction(cK, cJ, f)
354- let cM = fraction(cL, f, cF)
355- fraction((cG + fraction(cM, g, f)), cJ, (fraction(cH, cJ, f) + fraction(h, cM, f)))
356- }
357-
358- func cN (cO,cP) = if (cO._2)
359- then cO
360- else {
361- let cJ = cO._1
362- let cQ = cI(cJ)
363- let cR = (cQ - value(cJ))
364- let cS = if ((e > cR))
365- then -(cR)
366- else cR
367- if ((f >= cS))
368- then $Tuple2(cQ, true)
369- else $Tuple2(cQ, false)
370- }
371-
372- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
373- let cU = {
374- let cV = cT
375- let cW = size(cV)
376- let cX = $Tuple2(cC, false)
377- func cY (cZ,da) = if ((da >= cW))
378- then cZ
379- else cN(cZ, cV[da])
380-
381- func db (cZ,da) = if ((da >= cW))
382- then cZ
383- else throw("List size exceeds 18")
384-
385- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18)
386- }
387- let cJ = cU._1
388- let dc = cU._2
389- if (dc)
390- then cJ
391- else throw(("D calculation error, D = " + toString(cJ)))
322+ let cw = by(cq)
323+ let cx = F(cw, cs)
324+ let cy = by(cr)
325+ let cz = F(cy, ct)
326+ let cA = bA(cz, cx)
327+ let cB = I(cA, a)
328+ let cC = F(cn, a)
329+ let cD = F(cv, a)
330+ let cE = fraction(cx, cC, cD)
331+ let cF = fraction(cz, cC, cD)
332+ let cG = I(cE, cs)
333+ let cH = I(cF, ct)
334+ let cI = if ((cl == ""))
335+ then nil
336+ else [ScriptTransfer(co, cG, if ((cq == "WAVES"))
337+ then unit
338+ else fromBase58String(cq)), ScriptTransfer(co, cH, if ((cr == "WAVES"))
339+ then unit
340+ else fromBase58String(cr)), StringEntry(ab(toString(co), cl), bu(cG, cH, cn, cB, height, lastBlock.timestamp)), IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB)]
341+ $Tuple10(cG, cH, cq, cr, cw, cy, cv, cA, cu, cI)
392342 }
393343 }
394344
395345
396-func dd (de,df,dg,dh) = {
397- let di = bl
398- let dj = toBase58String(value(bm))
399- let dk = toBase58String(value(bn))
400- let dl = bo
401- let dm = bp
402- let dn = toString(bk)
403- let do = valueOrErrorMessage(assetInfo(di), "Wrong LP id").quantity
404- if ((toBase58String(di) != df))
405- then throw("Wrong pmt asset")
346+func cJ (cl,bG,cK,cL,cM,cN,co,cO,cP,cQ,cR,cS,cT) = {
347+ let bX = aL()
348+ let cp = fromBase58String(bX[t])
349+ let cU = bX[u]
350+ let cV = bX[v]
351+ let cW = bX[y]
352+ let cX = bX[z]
353+ let cY = parseIntValue(bX[w])
354+ let cZ = parseIntValue(bX[x])
355+ let cu = bX[s]
356+ let da = valueOrErrorMessage(assetInfo(cp), "Wr lp as").quantity
357+ let cw = if (cO)
358+ then by(cU)
359+ else if (if (cQ)
360+ then (cT == cU)
361+ else false)
362+ then (by(cU) - cS)
363+ else if (cQ)
364+ then by(cU)
365+ else (by(cU) - cK)
366+ let cy = if (cO)
367+ then by(cV)
368+ else if (if (cQ)
369+ then (cT == cV)
370+ else false)
371+ then (by(cV) - cS)
372+ else if (cQ)
373+ then by(cV)
374+ else (by(cV) - cM)
375+ let db = F(cK, cY)
376+ let dc = F(cM, cZ)
377+ let dd = bA(dc, db)
378+ let cx = F(cw, cY)
379+ let cz = F(cy, cZ)
380+ let de = if ((da == 0))
381+ then {
382+ let cA = d
383+ let df = d
384+ let cb = pow((db * dc), 0, toBigInt(5), 1, 0, DOWN)
385+ $Tuple5(I(cb, a), I(db, cY), I(dc, cZ), bA((cz + dc), (cx + db)), df)
386+ }
406387 else {
407- let dp = bN(dj)
408- let dq = H(dp, dl)
409- let dr = bN(dk)
410- let ds = H(dr, dm)
411- let dt = bP(ds, dq)
412- let du = L(dt, a)
413- let dv = H(dg, a)
414- let dw = H(do, a)
415- let dx = fraction(dq, dv, dw)
416- let dy = fraction(ds, dv, dw)
417- let dz = O(dx, dl, FLOOR)
418- let dA = O(dy, dm, FLOOR)
419- let dB = if ((de == ""))
420- then nil
421- else [ScriptTransfer(dh, dz, if ((dj == "WAVES"))
422- then unit
423- else fromBase58String(dj)), ScriptTransfer(dh, dA, if ((dk == "WAVES"))
424- then unit
425- else fromBase58String(dk)), StringEntry(ai(toString(dh), de), bJ(dz, dA, dg, du, height, lastBlock.timestamp)), IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du)]
426- $Tuple10(dz, dA, dj, dk, dp, dr, do, dt, dn, dB)
388+ let cA = bA(cz, cx)
389+ let dg = fraction(P((cA - dd)), c, cA)
390+ let df = F(bG, a)
391+ if (if (if (cR)
392+ then (cA != d)
393+ else false)
394+ then (dg > df)
395+ else false)
396+ then throw(((("Price slippage " + toString(dg)) + " > ") + toString(df)))
397+ else {
398+ let dh = F(da, a)
399+ let di = fraction(db, cA, c)
400+ let dj = fraction(dc, c, cA)
401+ let dk = if ((di > dc))
402+ then $Tuple2(dj, dc)
403+ else $Tuple2(db, di)
404+ let dl = dk._1
405+ let dm = dk._2
406+ let cb = fraction(dh, dm, cz)
407+ $Tuple5(I(cb, a), I(dl, cY), I(dm, cZ), cA, df)
408+ }
409+ }
410+ let dn = de._1
411+ let do = de._2
412+ let dp = de._3
413+ let cB = I(de._4, a)
414+ let dq = I(de._5, a)
415+ if ((0 >= dn))
416+ then throw("LP <= 0")
417+ else {
418+ let dr = if (!(cP))
419+ then 0
420+ else dn
421+ let ds = (cK - do)
422+ let dt = (cM - dp)
423+ let du = if (if (cQ)
424+ then (cT == cU)
425+ else false)
426+ then $Tuple2(cS, 0)
427+ else if (if (cQ)
428+ then (cT == cV)
429+ else false)
430+ then $Tuple2(0, cS)
431+ else $Tuple2(do, dp)
432+ let dv = du._1
433+ let dw = du._2
434+ let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, cl), bj(dv, dw, dr, cB, bG, dq, height, lastBlock.timestamp, ds, dt))]
435+ $Tuple13(dn, dr, cB, cw, cy, da, cp, cu, dx, ds, dt, cL, cN)
427436 }
428437 }
429438
430439
431-func dC (de,bW,dD,dE,dF,dG,dh,dH,dI,dJ,dK,dL,dM) = {
432- let di = bl
433- let dN = toBase58String(value(bm))
434- let dO = toBase58String(value(bn))
435- let dP = bq
436- let dQ = br
437- let dR = bo
438- let dS = bp
439- let dn = toString(bk)
440- let dT = valueOrErrorMessage(assetInfo(di), "Wr lp as").quantity
441- let dp = if (dH)
442- then bN(dN)
443- else if (if (dJ)
444- then (dM == dN)
445- else false)
446- then (bN(dN) - dL)
447- else if (dJ)
448- then bN(dN)
449- else (bN(dN) - dD)
450- let dr = if (dH)
451- then bN(dO)
452- else if (if (dJ)
453- then (dM == dO)
454- else false)
455- then (bN(dO) - dL)
456- else if (dJ)
457- then bN(dO)
458- else (bN(dO) - dF)
459- let dU = H(dD, dR)
460- let dV = H(dF, dS)
461- let dW = bP(dV, dU)
462- let dq = H(dp, dR)
463- let ds = H(dr, dS)
464- let cb = cy([dq, ds])
465- let dX = if ((dT == 0))
466- then {
467- let ca = cy([(dq + dU), (ds + dV)])
468- let dY = if ((ca > cb))
440+func dy (dz) = {
441+ let bX = aL()
442+ let dA = bX[u]
443+ let dB = bX[v]
444+ let cu = parseIntValue(bX[s])
445+ let bY = parseIntValue(bX[w])
446+ let bZ = parseIntValue(bX[x])
447+ let dC = by(dA)
448+ let dD = by(dB)
449+ let cA = if ((dz.orderType == Buy))
450+ then bO(bY, bZ, (dC + dz.amount), dD)
451+ else bO(bY, bZ, (dC - dz.amount), dD)
452+ let cB = I(cA, a)
453+ if (if (if (aI())
454+ then true
455+ else (cu == p))
456+ then true
457+ else (cu == q))
458+ then throw("Admin blocked")
459+ else {
460+ let dE = dz.assetPair.amountAsset
461+ let dF = if ((dE == unit))
462+ then "WAVES"
463+ else toBase58String(value(dE))
464+ let dG = dz.assetPair.priceAsset
465+ let dH = if ((dG == unit))
466+ then "WAVES"
467+ else toBase58String(value(dG))
468+ if (if ((dF != dA))
469469 then true
470- else throw("D1 should be greater than D0")
471- if ((dY == dY))
472- then {
473- let dt = d
474- let dZ = d
475- let cq = ca
476- $Tuple5(L(cq, a), L(dU, dR), L(dV, dS), bP((ds + dV), (dq + dU)), dZ)
470+ else (dH != dB))
471+ then throw("Wr assets")
472+ else {
473+ let dI = dz.price
474+ let cZ = fraction(a, bZ, bY)
475+ let dJ = L(dI, a, cZ)
476+ let dK = if ((dz.orderType == Buy))
477+ then (cB >= dJ)
478+ else (dJ >= cB)
479+ true
477480 }
478- else throw("Strict value is not equal to itself.")
479- }
480- else {
481- let dt = bP(ds, dq)
482- let ea = fraction(W((dt - dW)), c, dt)
483- let dZ = H(bW, a)
484- if (if (if (dK)
485- then (dt != d)
486- else false)
487- then (ea > dZ)
488- else false)
489- then throw(((("Price slippage " + toString(ea)) + " > ") + toString(dZ)))
490- else {
491- let eb = H(dT, a)
492- let ec = fraction(dU, bS(ds, dq, CEILING), c, CEILING)
493- let ed = fraction(dV, c, bS(ds, dq, FLOOR), CEILING)
494- let ee = if ((ec > dV))
495- then $Tuple2(ed, dV)
496- else $Tuple2(dU, ec)
497- let ef = ee._1
498- let eg = ee._2
499- let ca = cy([(dq + ef), (ds + eg)])
500- let dY = if ((ca > cb))
501- then true
502- else throw("D1 should be greater than D0")
503- if ((dY == dY))
504- then {
505- let cq = fraction(eb, (ca - cb), cb)
506- $Tuple5(O(cq, a, FLOOR), O(ef, dR, CEILING), O(eg, dS, CEILING), dt, dZ)
507- }
508- else throw("Strict value is not equal to itself.")
509- }
510- }
511- let eh = dX._1
512- let ei = dX._2
513- let ej = dX._3
514- let du = L(dX._4, a)
515- let ek = L(dX._5, a)
516- if ((0 >= eh))
517- then throw("LP <= 0")
518- else {
519- let el = if (!(dI))
520- then 0
521- else eh
522- let em = (dD - ei)
523- let en = (dF - ej)
524- let eo = if (if (dJ)
525- then (dM == dN)
526- else false)
527- then $Tuple2(dL, 0)
528- else if (if (dJ)
529- then (dM == dO)
530- else false)
531- then $Tuple2(0, dL)
532- else $Tuple2(ei, ej)
533- let ep = eo._1
534- let eq = eo._2
535- let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, de), by(ep, eq, el, du, bW, ek, height, lastBlock.timestamp, em, en))]
536- $Tuple13(eh, el, du, dp, dr, dT, di, dn, er, em, en, dE, dG)
537481 }
538482 }
539483
540484
541-func es (cz,cP,et) = {
542- let eu = g
543- let ev = cz[if ((cP == 0))
485+func dL (dM) = if ((size(dM.payments) != 1))
486+ then throw("1 pmnt exp")
487+ else {
488+ let dN = value(dM.payments[0])
489+ let cm = value(dN.assetId)
490+ let cS = dN.amount
491+ let de = ck(toBase58String(dM.transactionId), toBase58String(cm), cS, dM.caller)
492+ let cG = de._1
493+ let cH = de._2
494+ let cu = parseIntValue(de._9)
495+ let cI = de._10
496+ if (if (aI())
497+ then true
498+ else (cu == q))
499+ then throw(("Admin blocked: " + toString(cu)))
500+ else $Tuple5(cG, cH, cS, cm, cI)
501+ }
502+
503+
504+func dO (dP,aa,dQ,dR,bG,cP,cQ,cR,cS,cT) = {
505+ let de = cJ(aa, bG, value(dQ).amount, value(dQ).assetId, value(dR).amount, value(dR).assetId, dP, (aa == ""), cP, cQ, cR, cS, cT)
506+ let cu = parseIntValue(de._8)
507+ if (if (if (aI())
508+ then true
509+ else (cu == o))
510+ then true
511+ else (cu == q))
512+ then throw(("Blocked:" + toString(cu)))
513+ else de
514+ }
515+
516+
517+func dS (dT) = {
518+ let dU = g
519+ let dV = dT[0]
520+ let dW = dT[1]
521+ let dX = parseBigIntValue(j)
522+ let dY = (parseBigIntValue(aH) * dX)
523+ let dZ = (dV + dW)
524+ if ((dZ == e))
525+ then e
526+ else {
527+ let ea = (dY * dU)
528+ let eb = (((dV * dW) * dU) * dU)
529+ let ec = ((ea * dZ) / dX)
530+ let ed = (ea - dX)
531+ let ee = (dU + f)
532+ func ef (eg,eh) = {
533+ let ei = eg
534+ let ej = ei._1
535+ let ek = ei._2
536+ if ((ek != unit))
537+ then eg
538+ else {
539+ let el = (((ej * ej) * ej) / eb)
540+ let em = (((ec + (el * dU)) * ej) / (((ed * ej) / dX) + (ee * el)))
541+ let en = Q((em - value(ej)))
542+ if ((f >= en))
543+ then $Tuple2(em, eh)
544+ else $Tuple2(em, unit)
545+ }
546+ }
547+
548+ let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
549+ let ep = {
550+ let eq = eo
551+ let er = size(eq)
552+ let es = $Tuple2(dZ, unit)
553+ func et (eu,ev) = if ((ev >= er))
554+ then eu
555+ else ef(eu, eq[ev])
556+
557+ func ew (eu,ev) = if ((ev >= er))
558+ then eu
559+ else throw("List size exceeds 15")
560+
561+ ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
562+ }
563+ let ej = ep._1
564+ let ek = ep._2
565+ if ((ek != unit))
566+ then ej
567+ else throw(("D calculation error, D = " + toString(ej)))
568+ }
569+ }
570+
571+
572+func ex (dT,dM,ey) = {
573+ let dU = g
574+ let ez = dT[if ((dM == 0))
544575 then 1
545576 else 0]
546- let ew = parseBigIntValue(l)
547- let cD = (parseBigIntValue(aU) * ew)
548- let cC = ev
549- let cE = (cD * eu)
550- let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu))
551- let ey = ((cC + ((et * ew) / cE)) - et)
552- func cN (cO,ez) = {
553- let eA = cO
554- let eB = eA._1
555- let dc = eA._2
556- if ((dc != unit))
557- then cO
577+ let dX = parseBigIntValue(j)
578+ let dY = (parseBigIntValue(aH) * dX)
579+ let dZ = ez
580+ let ea = (dY * dU)
581+ let eA = (((((ey * ey) / (ez * dU)) * ey) * dX) / (ea * dU))
582+ let eB = ((dZ + ((ey * dX) / ea)) - ey)
583+ func ef (eg,eh) = {
584+ let eC = eg
585+ let eD = eC._1
586+ let ek = eC._2
587+ if ((ek != unit))
588+ then eg
558589 else {
559- let eC = (((eB * eB) + ex) / ((g * eB) + ey))
560- let eD = X((eC - value(eB)))
561- if ((f >= eD))
562- then $Tuple2(eC, ez)
563- else $Tuple2(eC, unit)
590+ let eE = (((eD * eD) + eA) / ((g * eD) + eB))
591+ let eF = Q((eE - value(eD)))
592+ if ((f >= eF))
593+ then $Tuple2(eE, eh)
594+ else $Tuple2(eE, unit)
564595 }
565596 }
566597
567- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
568- let eE = {
569- let cV = cT
570- let cW = size(cV)
571- let cX = $Tuple2(et, unit)
572- func cY (cZ,da) = if ((da >= cW))
573- then cZ
574- else cN(cZ, cV[da])
598+ let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
599+ let eG = {
600+ let eq = eo
601+ let er = size(eq)
602+ let es = $Tuple2(ey, unit)
603+ func et (eu,ev) = if ((ev >= er))
604+ then eu
605+ else ef(eu, eq[ev])
575606
576- func db (cZ,da) = if ((da >= cW))
577- then cZ
607+ func ew (eu,ev) = if ((ev >= er))
608+ then eu
578609 else throw("List size exceeds 15")
579610
580- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
611+ ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
581612 }
582- let eB = eE._1
583- let dc = eE._2
584- if ((dc != unit))
585- then eB
586- else throw(("Y calculation error, Y = " + toString(eB)))
613+ let eD = eG._1
614+ let ek = eG._2
615+ if ((ek != unit))
616+ then eD
617+ else throw(("Y calculation error, Y = " + toString(eD)))
587618 }
588619
589620
590-func eF (eG,eH,eI) = {
591- let eJ = fraction(cy([K(eG, toBigInt(bo)), K(eH, toBigInt(bp))]), c, eI)
592- if ((eI == e))
593- then e
594- else eJ
595- }
596-
597-
598-func eK (eL,eM,eN) = {
599- let eO = (toBigInt(bN(be(bm))) - eL)
600- let eP = (toBigInt(bN(be(bn))) - eM)
601- let eQ = (toBigInt(value(assetInfo(bl)).quantity) - eN)
602- let eR = eF(eO, eP, eQ)
603- eR
604- }
605-
606-
607-func eS (eT,eU,eN) = {
608- let eO = (bN(be(bm)) + eT)
609- let eP = (bN(be(bn)) + eU)
610- let eQ = (value(assetInfo(bl)).quantity + eN)
611- let eJ = eF(toBigInt(eO), toBigInt(eP), toBigInt(eQ))
612- let eV = [IntegerEntry(aq, height), StringEntry(ap, toString(eJ))]
613- $Tuple2(eV, eJ)
614- }
615-
616-
617-func eW (eX,eJ) = if ((eJ >= eX))
618- then true
619- else aN("updated DLp lower than current DLp")
620-
621-
622-func eY (eZ) = {
623- let eO = bN(be(bm))
624- let eP = bN(be(bn))
625- let fa = eZ.amount
626- let fb = fraction(eZ.amount, eZ.price, a, FLOOR)
627- let fc = if ((eZ.orderType == Buy))
628- then $Tuple2(fa, -(fb))
629- else $Tuple2(-(fa), fb)
630- let eT = fc._1
631- let eU = fc._2
632- if (if (if (aV())
633- then true
634- else (bk == r))
635- then true
636- else (bk == s))
637- then throw("Admin blocked")
638- else if (if ((eZ.assetPair.amountAsset != bm))
639- then true
640- else (eZ.assetPair.priceAsset != bn))
641- then throw("Wr assets")
642- else {
643- let fd = parseBigIntValue(valueOrElse(getString(this, ap), "0"))
644- let fe = eS(eT, eU, 0)
645- let ff = fe._1
646- let fg = fe._2
647- let fh = (fg >= fd)
648- let fi = makeString(["dLp=", toString(fd), " dLpNew=", toString(fg), " amountAssetBalance=", toString(eO), " priceAssetBalance=", toString(eP), " amountAssetBalanceDelta=", toString(eT), " priceAssetBalanceDelta=", toString(eU), " height=", toString(height)], "")
649- $Tuple2(fh, fi)
650- }
651- }
652-
653-
654-func fj (cP) = if ((size(cP.payments) != 1))
655- then throw("1 pmnt exp")
656- else {
657- let fk = value(cP.payments[0])
658- let df = value(fk.assetId)
659- let dL = fk.amount
660- let dX = dd(toBase58String(cP.transactionId), toBase58String(df), dL, cP.caller)
661- let dz = dX._1
662- let dA = dX._2
663- let dn = parseIntValue(dX._9)
664- let dB = dX._10
665- if (if (aV())
666- then true
667- else (dn == s))
668- then throw(("Admin blocked: " + toString(dn)))
669- else $Tuple5(dz, dA, dL, df, dB)
670- }
671-
672-
673-func fl (fm,ah,fn,fo,bW,dI,dJ,dK,dL,dM) = {
674- let dX = dC(ah, bW, value(fn).amount, value(fn).assetId, value(fo).amount, value(fo).assetId, fm, (ah == ""), dI, dJ, dK, dL, dM)
675- let dn = parseIntValue(dX._8)
676- if (if (if (aV())
677- then true
678- else (dn == q))
679- then true
680- else (dn == s))
681- then throw(("Blocked:" + toString(dn)))
682- else dX
683- }
684-
685-
686-func fp (fq,df,dh,ah,fr) = {
687- let dj = toBase58String(value(bm))
688- let dk = toBase58String(value(bn))
689- let di = bl
690- let dR = bo
691- let dS = bp
692- let eQ = toBigInt(valueOrErrorMessage(assetInfo(di), "invalid lp asset").quantity)
693- let fs = if ((eQ > e))
621+func eH (eI,cm,co,aa,eJ) = {
622+ let aT = aL()
623+ let cq = aT[u]
624+ let cr = aT[v]
625+ let cp = aT[t]
626+ let cY = parseIntValue(aT[w])
627+ let cZ = parseIntValue(aT[x])
628+ let eK = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity)
629+ let eL = if ((eK > e))
694630 then true
695631 else throw("initial deposit requires all coins")
696- if ((fs == fs))
632+ if ((eL == eL))
697633 then {
698- let dp = bN(dj)
699- let dr = bN(dk)
700- let ft = if ((ah == ""))
701- then $Tuple2(dp, dr)
702- else if ((df == dj))
703- then if ((fq > dp))
634+ let cw = by(cq)
635+ let cy = by(cr)
636+ let eM = if ((aa == ""))
637+ then $Tuple2(cw, cy)
638+ else if ((cm == cq))
639+ then if ((eI > cw))
704640 then throw("invalid payment amount")
705- else $Tuple2((dp - fq), dr)
706- else if ((df == dk))
707- then if ((fq > dr))
641+ else $Tuple2((cw - eI), cy)
642+ else if ((cm == cr))
643+ then if ((eI > cy))
708644 then throw("invalid payment amount")
709- else $Tuple2(dp, (dr - fq))
645+ else $Tuple2(cw, (cy - eI))
710646 else throw("wrong pmtAssetId")
711- let fu = ft._1
712- let fv = ft._2
713- let fw = if ((df == dj))
714- then $Tuple2(fq, 0)
715- else if ((df == dk))
716- then $Tuple2(0, fq)
647+ let eN = eM._1
648+ let eO = eM._2
649+ let eP = if ((cm == cq))
650+ then $Tuple2(eI, 0)
651+ else if ((cm == cr))
652+ then $Tuple2(0, eI)
717653 else throw("invalid payment")
718- let fx = fw._1
719- let fy = fw._2
720- let fz = if (fr)
721- then $Tuple3(cv(fx, aR)._1, cv(fy, aR)._1, cv(fq, aR)._2)
722- else $Tuple3(fx, fy, 0)
723- let fA = fz._1
724- let fB = fz._2
725- let cx = fz._3
726- let fC = (fu + fA)
727- let fD = (fv + fB)
728- let cb = cy([H(fu, bo), H(fv, bp)])
729- let ca = cy([H(fC, bo), H(fD, bp)])
730- let dY = if ((ca > cb))
654+ let eQ = eP._1
655+ let eR = eP._2
656+ let eS = if (eJ)
657+ then $Tuple3(cg(eQ, aE)._1, cg(eR, aE)._1, cg(eI, aE)._2)
658+ else $Tuple3(eQ, eR, 0)
659+ let eT = eS._1
660+ let eU = eS._2
661+ let cj = eS._3
662+ let eV = (eN + eT)
663+ let eW = (eO + eU)
664+ let bL = dS([toBigInt(eN), toBigInt(eO)])
665+ let bK = dS([toBigInt(eV), toBigInt(eW)])
666+ let eX = if ((bK > bL))
731667 then true
732668 else throw()
733- if ((dY == dY))
669+ if ((eX == eX))
734670 then {
735- let fE = fraction(eQ, (ca - cb), cb, FLOOR)
736- let du = L(bP(H(fD, dS), H(fC, dR)), a)
737- let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, ah), by(fx, fy, toInt(fE), du, 0, 0, height, lastBlock.timestamp, 0, 0))]
738- let fF = fraction(fv, a, fu)
739- let fG = fraction(fq, a, (fF + a))
740- let fH = (fq - fG)
741- let fI = fraction(eQ, toBigInt(fH), toBigInt(fv))
742- let fJ = toInt(fraction((fE - fI), b, fI))
743- $Tuple4(toInt(fE), er, cx, fJ)
671+ let eY = fraction(eK, (bK - bL), bL)
672+ let cB = I(bA(F(eW, cZ), F(eV, cY)), a)
673+ let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, aa), bj(eQ, eR, toInt(eY), cB, 0, 0, height, lastBlock.timestamp, 0, 0))]
674+ let eZ = fraction(eO, a, eN)
675+ let fa = fraction(eI, a, (eZ + a))
676+ let fb = (eI - fa)
677+ let fc = fraction(eK, toBigInt(fb), toBigInt(eO))
678+ let fd = toInt(fraction((eY - fc), b, fc))
679+ $Tuple4(toInt(eY), dx, cj, fd)
744680 }
745681 else throw("Strict value is not equal to itself.")
746682 }
748684 }
749685
750686
751-func fK (fL,fM,fN,fm,fO,fP) = {
752- let di = toBase58String(value(bl))
753- let dj = toBase58String(value(bm))
754- let dk = toBase58String(value(bn))
755- let fQ = bo
756- let fR = bp
757- let fS = bk
758- let dh = if ((fm == bx))
759- then fO
760- else fm
761- let fk = value(fN[0])
762- let df = value(fk.assetId)
763- let dL = fk.amount
764- let eR = eK(e, e, e)
765- if ((eR == eR))
766- then {
767- let de = toBase58String(fP)
768- if ((di != toBase58String(df)))
769- then throw("Wrong LP")
770- else {
771- let dp = bN(dj)
772- let dr = bN(dk)
773- let fT = {
774- let aS = invoke(this, "getOneTknV2READONLY", [fL, dL], nil)
775- if ($isInstanceOf(aS, "(Int, Int)"))
776- then aS
777- else throw(($getType(aS) + " couldn't be cast to (Int, Int)"))
778- }
779- if ((fT == fT))
687+func fe (ff,fg,fh,dP,fi,fj) = {
688+ let aT = aL()
689+ let cp = aT[t]
690+ let cq = aT[u]
691+ let cr = aT[v]
692+ let fk = parseIntValue(aT[w])
693+ let fl = parseIntValue(aT[x])
694+ let fm = aT[s]
695+ let co = if ((dP == bi))
696+ then fi
697+ else dP
698+ let dN = value(fh[0])
699+ let cm = value(dN.assetId)
700+ let cS = dN.amount
701+ let cl = toBase58String(fj)
702+ if ((cp != toBase58String(cm)))
703+ then throw("Wrong LP")
704+ else {
705+ let cw = by(cq)
706+ let cy = by(cr)
707+ let fn = {
708+ let aF = invoke(this, "getOneTknV2READONLY", [ff, cS], nil)
709+ if ($isInstanceOf(aF, "(Int, Int)"))
710+ then aF
711+ else throw(($getType(aF) + " couldn't be cast to (Int, Int)"))
712+ }
713+ if ((fn == fn))
714+ then {
715+ let cj = fn._2
716+ let fo = fn._1
717+ let fp = if (if ((fg > 0))
718+ then (fg > fo)
719+ else false)
720+ then aB(makeString(["amount to receive is less than ", toString(fg)], ""))
721+ else fo
722+ let fq = if ((ff == cq))
723+ then $Tuple4(fp, 0, ((cw - fp) - cj), cy)
724+ else if ((ff == cr))
725+ then $Tuple4(0, fp, cw, ((cy - fp) - cj))
726+ else throw("invalid out asset id")
727+ let fr = fq._1
728+ let fs = fq._2
729+ let eV = fq._3
730+ let eW = fq._4
731+ let ft = bA(F(eW, fl), F(eV, fk))
732+ let fu = I(ft, a)
733+ let fv = if ((ff == "WAVES"))
734+ then unit
735+ else fromBase58String(ff)
736+ let fw = if ((cj > 0))
737+ then [ScriptTransfer(aK, cj, fv)]
738+ else nil
739+ let cI = ([ScriptTransfer(co, fp, fv), StringEntry(ab(toString(co), cl), bu(fr, fs, cS, fu, height, lastBlock.timestamp)), IntegerEntry(U(), fu), IntegerEntry(V(height, lastBlock.timestamp), fu)] ++ fw)
740+ if ((cI == cI))
780741 then {
781- let cx = fT._2
782- let fU = fT._1
783- let fV = if (if ((fM > 0))
784- then (fM > fU)
785- else false)
786- then aN(makeString(["amount to receive is less than ", toString(fM)], ""))
787- else fU
788- let fW = if ((fL == dj))
789- then $Tuple4(fV, 0, ((dp - fV) - cx), dr)
790- else if ((fL == dk))
791- then $Tuple4(0, fV, dp, ((dr - fV) - cx))
792- else throw("invalid out asset id")
793- let fX = fW._1
794- let fY = fW._2
795- let fC = fW._3
796- let fD = fW._4
797- let fZ = bP(H(fD, fR), H(fC, fQ))
798- let ga = L(fZ, a)
799- let gb = if ((fL == "WAVES"))
800- then unit
801- else fromBase58String(fL)
802- let gc = if ((cx > 0))
803- then [ScriptTransfer(aX, cx, gb)]
804- else nil
805- let dB = ([ScriptTransfer(dh, fV, gb), StringEntry(ai(toString(dh), de), bJ(fX, fY, dL, ga, height, lastBlock.timestamp)), IntegerEntry(ab(), ga), IntegerEntry(ac(height, lastBlock.timestamp), ga)] ++ gc)
806- if ((dB == dB))
807- then {
808- let gd = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
809- if ((gd == gd))
810- then {
811- let ge = {
812- let gf = if ((this == aX))
813- then 0
814- else cx
815- let gg = if ((bc(fL) == bm))
816- then true
817- else false
818- if (gg)
819- then $Tuple2(-((fU + gf)), 0)
820- else $Tuple2(0, -((fU + gf)))
821- }
822- let eT = ge._1
823- let eU = ge._2
824- let gh = eS(eT, eU, 0)
825- let gi = gh._1
826- let eJ = gh._2
827- let gj = eW(eR, eJ)
828- if ((gj == gj))
829- then $Tuple2((dB ++ gi), fV)
830- else throw("Strict value is not equal to itself.")
831- }
832- else throw("Strict value is not equal to itself.")
833- }
742+ let fx = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
743+ if ((fx == fx))
744+ then $Tuple2(cI, fp)
834745 else throw("Strict value is not equal to itself.")
835746 }
836747 else throw("Strict value is not equal to itself.")
837748 }
749+ else throw("Strict value is not equal to itself.")
838750 }
839- else throw("Strict value is not equal to itself.")
840751 }
841752
842753
843-func gk () = {
844- let gl = getString(Z())
845- if ($isInstanceOf(gl, "String"))
754+func fy () = {
755+ let av = getString(S())
756+ if ($isInstanceOf(av, "String"))
846757 then {
847- let cC = gl
848- fromBase58String(cC)
758+ let dZ = av
759+ fromBase58String(dZ)
849760 }
850- else if ($isInstanceOf(gl, "Unit"))
761+ else if ($isInstanceOf(av, "Unit"))
851762 then unit
852763 else throw("Match error")
853764 }
854765
855766
856-func gm () = {
857- let gl = getString(aa())
858- if ($isInstanceOf(gl, "String"))
767+func fz () = {
768+ let av = getString(T())
769+ if ($isInstanceOf(av, "String"))
859770 then {
860- let cC = gl
861- fromBase58String(cC)
771+ let dZ = av
772+ fromBase58String(dZ)
862773 }
863- else if ($isInstanceOf(gl, "Unit"))
774+ else if ($isInstanceOf(av, "Unit"))
864775 then unit
865776 else throw("Match error")
866777 }
867778
868779
869-let gn = throw("Permission denied")
780+let fA = throw("Permission denied")
870781
871-func go (cP) = {
872- let gl = gk()
873- if ($isInstanceOf(gl, "ByteVector"))
782+func fB (dM) = {
783+ let av = fy()
784+ if ($isInstanceOf(av, "ByteVector"))
874785 then {
875- let gp = gl
876- (cP.callerPublicKey == gp)
786+ let fC = av
787+ (dM.callerPublicKey == fC)
877788 }
878- else if ($isInstanceOf(gl, "Unit"))
879- then (cP.caller == this)
789+ else if ($isInstanceOf(av, "Unit"))
790+ then (dM.caller == this)
880791 else throw("Match error")
881792 }
882793
883794
884-func gq (cP) = {
885- let gl = gk()
886- if ($isInstanceOf(gl, "ByteVector"))
795+func fD (dM) = {
796+ let av = fy()
797+ if ($isInstanceOf(av, "ByteVector"))
887798 then {
888- let gp = gl
889- if ((cP.callerPublicKey == gp))
799+ let fC = av
800+ if ((dM.callerPublicKey == fC))
890801 then true
891- else gn
802+ else fA
892803 }
893- else if ($isInstanceOf(gl, "Unit"))
894- then if ((cP.caller == this))
804+ else if ($isInstanceOf(av, "Unit"))
805+ then if ((dM.caller == this))
895806 then true
896- else gn
807+ else fA
897808 else throw("Match error")
898809 }
899810
900811
901-func gr (gs,et,gt) = {
902- let bg = aY()
903- let dj = bg[w]
904- let dk = bg[x]
905- let eu = g
906- let ew = parseBigIntValue(l)
907- let cD = (parseBigIntValue(aU) * ew)
908- let cz = if ((gs == false))
909- then [(toBigInt(bN(dj)) + gt), toBigInt(bN(dk))]
910- else [(toBigInt(bN(dk)) + gt), toBigInt(bN(dj))]
911- let ev = cz[0]
912- let cC = ev
913- let cE = (cD * eu)
914- let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu))
915- let ey = ((cC + ((et * ew) / cE)) - et)
916- func cN (cO,ez) = {
917- let gu = cO
918- let eB = gu._1
919- let dc = gu._2
920- if ((dc != unit))
921- then cO
922- else {
923- let eC = (((eB * eB) + ex) / ((g * eB) + ey))
924- let eD = X((eC - value(eB)))
925- if ((f >= eD))
926- then $Tuple2(eC, ez)
927- else $Tuple2(eC, unit)
928- }
929- }
930-
931- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
932- let gv = {
933- let cV = cT
934- let cW = size(cV)
935- let cX = $Tuple2(et, unit)
936- func cY (cZ,da) = if ((da >= cW))
937- then cZ
938- else cN(cZ, cV[da])
939-
940- func db (cZ,da) = if ((da >= cW))
941- then cZ
942- else throw("List size exceeds 15")
943-
944- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
945- }
946- let eB = gv._1
947- let dc = gv._2
948- if ((dc != unit))
949- then eB
950- else throw(("Y calculation error, Y = " + toString(eB)))
951- }
952-
953-
954-@Callable(cP)
955-func calculateAmountOutForSwapREADONLY (gw,gs,gx) = {
956- let gy = if ((gs == false))
957- then {
958- let gz = aJ(this, ak())
959- let gt = (toBigInt(bN(aJ(this, aj()))) + toBigInt(gw))
960- $Tuple2(gz, gt)
961- }
962- else {
963- let gz = aJ(this, aj())
964- let gt = (toBigInt(bN(aJ(this, ak()))) + toBigInt(gw))
965- $Tuple2(gz, gt)
966- }
967- let gz = gy._1
968- let gt = gy._2
969- let bg = aY()
970- let dj = bg[w]
971- let dk = bg[x]
972- let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))]
973- let et = cy(cz)
974- let eB = gr(gs, et, toBigInt(gw))
975- let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1))
976- let gB = max([0, toInt(gA)])
977- let gC = if ((gs == false))
978- then [((toBigInt(bN(dj)) + toBigInt(gw)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)]
979- else [(toBigInt(bN(dj)) - gA), ((toBigInt(bN(dk)) + toBigInt(gw)) + toBigInt(gx))]
980- let gD = cy(gC)
981- let dY = if ((gD >= et))
982- then true
983- else throw(makeString(["new D is fewer error", toString(et), toString(gD)], "__"))
984- if ((dY == dY))
985- then $Tuple2(nil, gB)
812+@Callable(dM)
813+func constructor (R) = {
814+ let eA = fD(dM)
815+ if ((eA == eA))
816+ then [StringEntry(R(), R)]
986817 else throw("Strict value is not equal to itself.")
987818 }
988819
989820
990821
991-@Callable(cP)
992-func calculateAmountOutForSwapAndSendTokens (gw,gs,gE,gF,gx) = {
993- let gG = {
994- let aS = invoke(aQ, "getSwapContractREADONLY", nil, nil)
995- if ($isInstanceOf(aS, "String"))
996- then aS
997- else throw(($getType(aS) + " couldn't be cast to String"))
998- }
999- let gH = [if ((value(cP.payments[0]).amount >= gw))
1000- then true
1001- else aN("Wrong amount"), if ((cP.caller == addressFromStringValue(gG)))
1002- then true
1003- else aN("Permission denied")]
1004- if ((gH == gH))
822+@Callable(dM)
823+func setManager (fE) = {
824+ let eA = fD(dM)
825+ if ((eA == eA))
1005826 then {
1006- let fk = value(cP.payments[0])
1007- let gI = be(fk.assetId)
1008- let gJ = if ((gs == false))
1009- then {
1010- let gz = aJ(this, ak())
1011- let gt = (bN(gI) - value(cP.payments[0]).amount)
1012- $Tuple2(gz, gt)
1013- }
1014- else {
1015- let gz = aJ(this, aj())
1016- let gt = (bN(gI) - value(cP.payments[0]).amount)
1017- $Tuple2(gz, gt)
1018- }
1019- let gz = gJ._1
1020- let gt = gJ._2
1021- let bg = aY()
1022- let dj = bg[w]
1023- let dk = bg[x]
1024- let cz = if ((gs == false))
1025- then [(toBigInt(bN(dj)) - toBigInt(value(cP.payments[0]).amount)), toBigInt(bN(dk))]
1026- else [toBigInt(bN(dj)), (toBigInt(bN(dk)) - toBigInt(value(cP.payments[0]).amount))]
1027- let et = cy(cz)
1028- let eB = gr(gs, et, toBigInt(0))
1029- let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1))
1030- let gB = max([0, toInt(gA)])
1031- let gK = if ((gB >= gE))
1032- then true
1033- else throw("Exchange result is fewer coins than expected")
1034- if ((gK == gK))
1035- then {
1036- let gC = if ((gs == false))
1037- then [(toBigInt(bN(dj)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)]
1038- else [(toBigInt(bN(dj)) - gA), (toBigInt(bN(dk)) + toBigInt(gx))]
1039- let gD = cy(gC)
1040- let dY = if ((gD >= et))
1041- then true
1042- else throw("new D is fewer error")
1043- if ((dY == dY))
1044- then $Tuple2([ScriptTransfer(addressFromStringValue(gF), gB, bc(gz))], gB)
1045- else throw("Strict value is not equal to itself.")
1046- }
827+ let fF = fromBase58String(fE)
828+ if ((fF == fF))
829+ then [StringEntry(T(), fE)]
1047830 else throw("Strict value is not equal to itself.")
1048831 }
1049832 else throw("Strict value is not equal to itself.")
1051834
1052835
1053836
1054-@Callable(cP)
1055-func constructor (Y) = {
1056- let ex = gq(cP)
1057- if ((ex == ex))
1058- then [StringEntry(Y(), Y)]
1059- else throw("Strict value is not equal to itself.")
1060- }
1061-
1062-
1063-
1064-@Callable(cP)
1065-func setManager (gL) = {
1066- let ex = gq(cP)
1067- if ((ex == ex))
837+@Callable(dM)
838+func confirmManager () = {
839+ let cf = fz()
840+ let fG = if (isDefined(cf))
841+ then true
842+ else throw("No pending manager")
843+ if ((fG == fG))
1068844 then {
1069- let gM = fromBase58String(gL)
1070- if ((gM == gM))
1071- then [StringEntry(aa(), gL)]
845+ let fH = if ((dM.callerPublicKey == value(cf)))
846+ then true
847+ else throw("You are not pending manager")
848+ if ((fH == fH))
849+ then [StringEntry(S(), toBase58String(value(cf))), DeleteEntry(T())]
1072850 else throw("Strict value is not equal to itself.")
1073851 }
1074852 else throw("Strict value is not equal to itself.")
1076854
1077855
1078856
1079-@Callable(cP)
1080-func confirmManager () = {
1081- let cu = gm()
1082- let gN = if (isDefined(cu))
1083- then true
1084- else throw("No pending manager")
1085- if ((gN == gN))
1086- then {
1087- let gO = if ((cP.callerPublicKey == value(cu)))
1088- then true
1089- else throw("You are not pending manager")
1090- if ((gO == gO))
1091- then [StringEntry(Z(), toBase58String(value(cu))), DeleteEntry(aa())]
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(cP)
1100-func put (gP,gQ) = {
1101- let gR = bs()
1102- let gS = valueOrErrorMessage(addressFromString(gR[C]), "Wr st addr")
1103- let gT = valueOrErrorMessage(addressFromString(gR[E]), "Wr sl addr")
1104- if ((0 > gP))
857+@Callable(dM)
858+func put (fI,fJ) = {
859+ let fK = bd()
860+ let fL = valueOrErrorMessage(addressFromString(fK[A]), "Wr st addr")
861+ let fM = valueOrErrorMessage(addressFromString(fK[C]), "Wr sl addr")
862+ if ((0 > fI))
1105863 then throw("Wrong slippage")
1106- else if ((size(cP.payments) != 2))
864+ else if ((size(dM.payments) != 2))
1107865 then throw("2 pmnts expd")
1108866 else {
1109- let gU = toBigInt(value(cP.payments[0]).amount)
1110- let gV = toBigInt(value(cP.payments[1]).amount)
1111- let eO = (toBigInt(bN(be(bm))) - gU)
1112- if ((eO == eO))
867+ let fN = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], fI, true, false, true, 0, "")
868+ let dr = fN._2
869+ let fO = fN._7
870+ let cI = fN._9
871+ let ds = fN._10
872+ let dt = fN._11
873+ let cq = fN._12
874+ let cr = fN._13
875+ let de = invoke(aD, "emit", [dr], nil)
876+ if ((de == de))
1113877 then {
1114- let eP = (toBigInt(bN(be(bn))) - gV)
1115- if ((eP == eP))
878+ let fP = {
879+ let av = de
880+ if ($isInstanceOf(av, "Address"))
881+ then {
882+ let fQ = av
883+ invoke(fQ, "emit", [dr], nil)
884+ }
885+ else unit
886+ }
887+ if ((fP == fP))
1116888 then {
1117- let eQ = toBigInt(value(assetInfo(bl)).quantity)
1118- if ((eQ == eQ))
889+ let fR = if ((ds > 0))
890+ then invoke(fM, "put", nil, [AttachedPayment(cq, ds)])
891+ else nil
892+ if ((fR == fR))
1119893 then {
1120- let eR = eK(gU, gV, toBigInt(0))
1121- if ((eR == eR))
894+ let fS = if ((dt > 0))
895+ then invoke(fM, "put", nil, [AttachedPayment(cr, dt)])
896+ else nil
897+ if ((fS == fS))
1122898 then {
1123- let gW = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], gP, true, false, true, 0, "")
1124- let el = gW._2
1125- let gX = gW._7
1126- let dB = gW._9
1127- let em = gW._10
1128- let en = gW._11
1129- let dj = gW._12
1130- let dk = gW._13
1131- let dX = invoke(aQ, "emit", [el], nil)
1132- if ((dX == dX))
899+ let fT = if (fJ)
1133900 then {
1134- let gY = {
1135- let gl = dX
1136- if ($isInstanceOf(gl, "Address"))
1137- then {
1138- let gZ = gl
1139- invoke(gZ, "emit", [el], nil)
1140- }
1141- else unit
1142- }
1143- if ((gY == gY))
1144- then {
1145- let ha = if ((em > 0))
1146- then invoke(gT, "put", nil, [AttachedPayment(dj, em)])
1147- else nil
1148- if ((ha == ha))
1149- then {
1150- let hb = if ((en > 0))
1151- then invoke(gT, "put", nil, [AttachedPayment(dk, en)])
1152- else nil
1153- if ((hb == hb))
1154- then {
1155- let hc = if (gQ)
1156- then {
1157- let hd = invoke(gS, "stake", nil, [AttachedPayment(gX, el)])
1158- if ((hd == hd))
1159- then nil
1160- else throw("Strict value is not equal to itself.")
1161- }
1162- else [ScriptTransfer(cP.caller, el, gX)]
1163- let he = eS(0, 0, 0)
1164- let gi = he._1
1165- let eJ = he._2
1166- let hf = if ((eJ >= eR))
1167- then true
1168- else aN(makeString(["updated DLp lower than current DLp", toString(eO), toString(eP), toString(eQ), toString(eR), toString(eJ), toString(em), toString(en)], " "))
1169- if ((hf == hf))
1170- then {
1171- let hg = value(assetInfo(bl)).quantity
1172- if ((hg == hg))
1173- then ((dB ++ hc) ++ gi)
1174- else throw("Strict value is not equal to itself.")
1175- }
1176- else throw("Strict value is not equal to itself.")
1177- }
1178- else throw("Strict value is not equal to itself.")
1179- }
1180- else throw("Strict value is not equal to itself.")
1181- }
901+ let fU = invoke(fL, "stake", nil, [AttachedPayment(fO, dr)])
902+ if ((fU == fU))
903+ then nil
1182904 else throw("Strict value is not equal to itself.")
1183905 }
1184- else throw("Strict value is not equal to itself.")
906+ else [ScriptTransfer(dM.caller, dr, fO)]
907+ (cI ++ fT)
1185908 }
1186909 else throw("Strict value is not equal to itself.")
1187910 }
1195918
1196919
1197920
1198-@Callable(cP)
1199-func putOneTknV2 (fM,gQ) = {
1200- let hh = {
1201- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1202- if ($isInstanceOf(aS, "Boolean"))
1203- then aS
1204- else throw(($getType(aS) + " couldn't be cast to Boolean"))
921+@Callable(dM)
922+func putOneTknV2 (fg,fJ) = {
923+ let fV = {
924+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
925+ if ($isInstanceOf(aF, "Boolean"))
926+ then aF
927+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
1205928 }
1206- let hi = if (if (if (aV())
929+ let fW = if (if (if (aI())
1207930 then true
1208- else (bk == q))
931+ else (aX == o))
1209932 then true
1210- else (bk == s))
933+ else (aX == q))
1211934 then true
1212- else hh
1213- let gH = [if (if (!(hi))
935+ else fV
936+ let fX = [if (if (!(fW))
1214937 then true
1215- else go(cP))
938+ else fB(dM))
1216939 then true
1217- else aN("put operation is blocked by admin"), if ((size(cP.payments) == 1))
940+ else aB("put operation is blocked by admin"), if ((size(dM.payments) == 1))
1218941 then true
1219- else aN("exactly 1 payment are expected")]
1220- if ((gH == gH))
942+ else aB("exactly 1 payment are expected")]
943+ if ((fX == fX))
1221944 then {
1222- let dj = toBase58String(value(bm))
1223- let dk = toBase58String(value(bn))
1224- let di = bl
1225- let fQ = bo
1226- let fR = bp
1227- let dh = if ((cP.caller == this))
1228- then cP.originCaller
1229- else cP.caller
1230- let fk = value(cP.payments[0])
1231- let df = toBase58String(value(fk.assetId))
1232- let dL = fk.amount
1233- let eR = if ((fk.assetId == bm))
1234- then eK(toBigInt(dL), toBigInt(0), toBigInt(0))
1235- else eK(toBigInt(0), toBigInt(dL), toBigInt(0))
1236- if ((eR == eR))
945+ let aT = aL()
946+ let cq = aT[u]
947+ let cr = aT[v]
948+ let cp = fromBase58String(aT[t])
949+ let fk = parseIntValue(aT[w])
950+ let fl = parseIntValue(aT[x])
951+ let co = if ((dM.caller == this))
952+ then dM.originCaller
953+ else dM.caller
954+ let dN = value(dM.payments[0])
955+ let cm = toBase58String(value(dN.assetId))
956+ let cS = dN.amount
957+ let fY = eH(cS, cm, toString(co), toBase58String(dM.transactionId), true)
958+ if ((fY == fY))
1237959 then {
1238- let hj = fp(dL, df, toString(dh), toBase58String(cP.transactionId), true)
1239- if ((hj == hj))
960+ let cj = fY._3
961+ let cI = fY._2
962+ let fZ = fY._1
963+ let dr = if (if ((fg > 0))
964+ then (fg > fZ)
965+ else false)
966+ then aB(makeString(["amount to receive is less than ", toString(fg)], ""))
967+ else fZ
968+ let fN = invoke(aD, "emit", [dr], nil)
969+ if ((fN == fN))
1240970 then {
1241- let cx = hj._3
1242- let dB = hj._2
1243- let hk = hj._1
1244- let el = if (if ((fM > 0))
1245- then (fM > hk)
1246- else false)
1247- then aN(makeString(["amount to receive is less than ", toString(fM)], ""))
1248- else hk
1249- let gW = invoke(aQ, "emit", [el], nil)
1250- if ((gW == gW))
971+ let fP = {
972+ let av = fN
973+ if ($isInstanceOf(av, "Address"))
974+ then {
975+ let fQ = av
976+ invoke(fQ, "emit", [dr], nil)
977+ }
978+ else unit
979+ }
980+ if ((fP == fP))
1251981 then {
1252- let gY = {
1253- let gl = gW
1254- if ($isInstanceOf(gl, "Address"))
1255- then {
1256- let gZ = gl
1257- invoke(gZ, "emit", [el], nil)
1258- }
1259- else unit
1260- }
1261- if ((gY == gY))
982+ let fT = if (fJ)
1262983 then {
1263- let hc = if (gQ)
1264- then {
1265- let hd = invoke(bu, "stake", nil, [AttachedPayment(di, el)])
1266- if ((hd == hd))
1267- then nil
1268- else throw("Strict value is not equal to itself.")
1269- }
1270- else [ScriptTransfer(cP.caller, el, di)]
1271- let gc = if ((cx > 0))
1272- then [ScriptTransfer(aX, cx, fromBase58String(df))]
1273- else nil
1274- let hl = if ((this == aX))
1275- then $Tuple2(0, 0)
1276- else {
1277- let hm = if ((fk.assetId == bm))
1278- then true
1279- else false
1280- if (hm)
1281- then $Tuple2(-(cx), 0)
1282- else $Tuple2(0, -(cx))
1283- }
1284- let eT = hl._1
1285- let eU = hl._2
1286- let hn = eS(eT, eU, 0)
1287- let gi = hn._1
1288- let eJ = hn._2
1289- let gj = eW(eR, eJ)
1290- if ((gj == gj))
1291- then $Tuple2((((dB ++ hc) ++ gc) ++ gi), el)
984+ let fU = invoke(bf, "stake", nil, [AttachedPayment(cp, dr)])
985+ if ((fU == fU))
986+ then nil
1292987 else throw("Strict value is not equal to itself.")
1293988 }
1294- else throw("Strict value is not equal to itself.")
989+ else [ScriptTransfer(dM.caller, dr, cp)]
990+ let fw = if ((cj > 0))
991+ then [ScriptTransfer(aK, cj, fromBase58String(cm))]
992+ else nil
993+ $Tuple2(((cI ++ fT) ++ fw), dr)
1295994 }
1296995 else throw("Strict value is not equal to itself.")
1297996 }
13041003
13051004
13061005
1307-@Callable(cP)
1308-func putForFree (ho) = if ((0 > ho))
1006+@Callable(dM)
1007+func putForFree (ga) = if ((0 > ga))
13091008 then throw("Wrong slpg")
1310- else if ((size(cP.payments) != 2))
1009+ else if ((size(dM.payments) != 2))
13111010 then throw("2 pmnts expd")
13121011 else {
1313- let hp = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], ho, false, false, true, 0, "")
1314- let dB = hp._9
1315- let gU = toBigInt(value(cP.payments[0]).amount)
1316- let gV = toBigInt(value(cP.payments[1]).amount)
1317- let eR = eK(gU, gV, toBigInt(0))
1318- if ((eR == eR))
1319- then {
1320- let hq = eS(0, 0, 0)
1321- let gi = hq._1
1322- let eJ = hq._2
1323- let gj = eW(eR, eJ)
1324- if ((gj == gj))
1325- then (dB ++ gi)
1326- else throw("Strict value is not equal to itself.")
1327- }
1328- else throw("Strict value is not equal to itself.")
1012+ let gb = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], ga, false, false, true, 0, "")
1013+ gb._9
13291014 }
13301015
13311016
13321017
1333-@Callable(cP)
1018+@Callable(dM)
13341019 func get () = {
1335- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1336- if ((eR == eR))
1020+ let de = dL(dM)
1021+ let gc = de._1
1022+ let cH = de._2
1023+ let cS = de._3
1024+ let cm = de._4
1025+ let cI = de._5
1026+ let eB = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
1027+ if ((eB == eB))
1028+ then cI
1029+ else throw("Strict value is not equal to itself.")
1030+ }
1031+
1032+
1033+
1034+@Callable(dM)
1035+func getOneTknV2 (ff,fg) = {
1036+ let fV = {
1037+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1038+ if ($isInstanceOf(aF, "Boolean"))
1039+ then aF
1040+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
1041+ }
1042+ let gd = if (if (aI())
1043+ then true
1044+ else (aX == q))
1045+ then true
1046+ else fV
1047+ let fX = [if (if (!(gd))
1048+ then true
1049+ else fB(dM))
1050+ then true
1051+ else aB("get operation is blocked by admin"), if ((size(dM.payments) == 1))
1052+ then true
1053+ else aB("exactly 1 payment are expected")]
1054+ if ((fX == fX))
13371055 then {
1338- let dX = fj(cP)
1339- let hr = dX._1
1340- let dA = dX._2
1341- let dL = dX._3
1342- let df = dX._4
1343- let dB = dX._5
1344- let ey = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
1345- if ((ey == ey))
1346- then {
1347- let hs = eS(-(hr), -(dA), 0)
1348- let gi = hs._1
1349- let eJ = hs._2
1350- let gj = eW(eR, eJ)
1351- if ((gj == gj))
1352- then (dB ++ gi)
1353- else throw("Strict value is not equal to itself.")
1354- }
1355- else throw("Strict value is not equal to itself.")
1056+ let ge = fe(ff, fg, dM.payments, dM.caller, dM.originCaller, dM.transactionId)
1057+ let cI = ge._1
1058+ let fp = ge._2
1059+ $Tuple2(cI, fp)
13561060 }
13571061 else throw("Strict value is not equal to itself.")
13581062 }
13591063
13601064
13611065
1362-@Callable(cP)
1363-func getOneTknV2 (fL,fM) = {
1364- let hh = {
1365- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1366- if ($isInstanceOf(aS, "Boolean"))
1367- then aS
1368- else throw(($getType(aS) + " couldn't be cast to Boolean"))
1369- }
1370- let ht = if (if (aV())
1371- then true
1372- else (bk == s))
1373- then true
1374- else hh
1375- let gH = [if (if (!(ht))
1376- then true
1377- else go(cP))
1378- then true
1379- else aN("get operation is blocked by admin"), if ((size(cP.payments) == 1))
1380- then true
1381- else aN("exactly 1 payment are expected")]
1382- if ((gH == gH))
1383- then {
1384- let hu = fK(fL, fM, cP.payments, cP.caller, cP.originCaller, cP.transactionId)
1385- let dB = hu._1
1386- let fV = hu._2
1387- $Tuple2(dB, fV)
1388- }
1389- else throw("Strict value is not equal to itself.")
1066+@Callable(dM)
1067+func getOneTknV2READONLY (ff,gf) = {
1068+ let aT = aL()
1069+ let cq = aT[u]
1070+ let cr = aT[v]
1071+ let cp = aT[t]
1072+ let dT = [toBigInt(by(cq)), toBigInt(by(cr))]
1073+ let gg = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity)
1074+ let bL = dS(dT)
1075+ let bK = (bL - fraction(toBigInt(gf), bL, gg))
1076+ let gh = if ((ff == cq))
1077+ then 0
1078+ else if ((ff == cr))
1079+ then 1
1080+ else throw("invalid out asset id")
1081+ let gi = ex(dT, gh, bK)
1082+ let gj = (dT[gh] - gi)
1083+ let gk = max([0, toInt((gj - f))])
1084+ let gl = cg(gk, aG)
1085+ let fo = gl._1
1086+ let cj = gl._2
1087+ $Tuple2(nil, $Tuple2(fo, cj))
13901088 }
13911089
13921090
13931091
1394-@Callable(cP)
1395-func refreshDLp () = {
1396- let hv = valueOrElse(getInteger(aq), 0)
1397- let hw = if (((height - hv) >= at))
1398- then unit
1399- else aN(makeString([toString(at), " blocks have not passed since the previous call"], ""))
1400- if ((hw == hw))
1401- then {
1402- let fd = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ap), "0")), aP("invalid dLp"))
1403- let hx = eS(0, 0, 0)
1404- let hy = hx._1
1405- let eJ = hx._2
1406- let eV = if ((fd != eJ))
1407- then hy
1408- else aN("nothing to refresh")
1409- $Tuple2(eV, toString(eJ))
1410- }
1411- else throw("Strict value is not equal to itself.")
1092+@Callable(dM)
1093+func getOneTknV2WithBonusREADONLY (ff,gf) = {
1094+ let aT = aL()
1095+ let cq = aT[u]
1096+ let cr = aT[v]
1097+ let cp = aT[t]
1098+ let cw = by(cq)
1099+ let cy = by(cr)
1100+ let gm = {
1101+ let aF = invoke(this, "getOneTknV2READONLY", [ff, gf], nil)
1102+ if ($isInstanceOf(aF, "(Int, Int)"))
1103+ then aF
1104+ else throw(($getType(aF) + " couldn't be cast to (Int, Int)"))
1105+ }
1106+ let fo = gm._1
1107+ let cj = gm._2
1108+ let de = ck("", cp, gf, this)
1109+ let cG = de._1
1110+ let cH = de._2
1111+ let gn = (cG + cH)
1112+ let fd = if ((gn == 0))
1113+ then if ((fo == 0))
1114+ then 0
1115+ else throw("bonus calculation error")
1116+ else fraction((fo - gn), a, gn)
1117+ $Tuple2(nil, $Tuple3(fo, cj, fd))
14121118 }
14131119
14141120
14151121
1416-@Callable(cP)
1417-func getOneTknV2READONLY (fL,hz) = {
1418- let dj = toBase58String(value(bm))
1419- let dk = toBase58String(value(bn))
1420- let di = toBase58String(value(bl))
1421- let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))]
1422- let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(di)), "invalid lp asset").quantity)
1423- let cb = cy(cz)
1424- let ca = (cb - fraction(toBigInt(hz), cb, eI))
1425- let hA = if ((fL == dj))
1426- then 0
1427- else if ((fL == dk))
1428- then 1
1429- else throw("invalid out asset id")
1430- let hB = es(cz, hA, ca)
1431- let gA = (cz[hA] - hB)
1432- let gB = max([0, toInt((gA - f))])
1433- let hC = cv(gB, aT)
1434- let fU = hC._1
1435- let cx = hC._2
1436- $Tuple2(nil, $Tuple2(fU, cx))
1437- }
1438-
1439-
1440-
1441-@Callable(cP)
1442-func getOneTknV2WithBonusREADONLY (fL,hz) = {
1443- let dj = toBase58String(value(bm))
1444- let dk = toBase58String(value(bn))
1445- let di = toBase58String(value(bl))
1446- let dp = bN(dj)
1447- let dr = bN(dk)
1448- let hD = {
1449- let aS = invoke(this, "getOneTknV2READONLY", [fL, hz], nil)
1450- if ($isInstanceOf(aS, "(Int, Int)"))
1451- then aS
1452- else throw(($getType(aS) + " couldn't be cast to (Int, Int)"))
1453- }
1454- let fU = hD._1
1455- let cx = hD._2
1456- let dX = dd("", di, hz, this)
1457- let dz = dX._1
1458- let dA = dX._2
1459- let hE = (dz + dA)
1460- let fJ = if ((hE == 0))
1461- then if ((fU == 0))
1462- then 0
1463- else throw("bonus calculation error")
1464- else fraction((fU - hE), a, hE)
1465- $Tuple2(nil, $Tuple3(fU, cx, fJ))
1466- }
1467-
1468-
1469-
1470-@Callable(cP)
1471-func getNoLess (hF,hG) = {
1472- let dX = fj(cP)
1473- let dz = dX._1
1474- let dA = dX._2
1475- let dL = dX._3
1476- let df = dX._4
1477- let dB = dX._5
1478- if ((hF > dz))
1479- then throw(((("Failed: " + toString(dz)) + " < ") + toString(hF)))
1480- else if ((hG > dA))
1481- then throw(((("Failed: " + toString(dA)) + " < ") + toString(hG)))
1122+@Callable(dM)
1123+func getNoLess (go,gp) = {
1124+ let de = dL(dM)
1125+ let cG = de._1
1126+ let cH = de._2
1127+ let cS = de._3
1128+ let cm = de._4
1129+ let cI = de._5
1130+ if ((go > cG))
1131+ then throw(((("Failed: " + toString(cG)) + " < ") + toString(go)))
1132+ else if ((gp > cH))
1133+ then throw(((("Failed: " + toString(cH)) + " < ") + toString(gp)))
14821134 else {
1483- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1484- if ((eR == eR))
1485- then {
1486- let hH = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
1487- if ((hH == hH))
1488- then {
1489- let hI = eS(-(dz), -(dA), 0)
1490- let gi = hI._1
1491- let eJ = hI._2
1492- let gj = eW(eR, eJ)
1493- if ((gj == gj))
1494- then (dB ++ gi)
1495- else throw("Strict value is not equal to itself.")
1496- }
1497- else throw("Strict value is not equal to itself.")
1498- }
1135+ let gq = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
1136+ if ((gq == gq))
1137+ then cI
14991138 else throw("Strict value is not equal to itself.")
15001139 }
15011140 }
15021141
15031142
15041143
1505-@Callable(cP)
1506-func unstakeAndGet (cw) = {
1507- let hJ = if ((size(cP.payments) != 0))
1144+@Callable(dM)
1145+func unstakeAndGet (ch) = {
1146+ let gr = if ((size(dM.payments) != 0))
15081147 then throw("No pmnts expd")
15091148 else true
1510- if ((hJ == hJ))
1149+ if ((gr == gr))
15111150 then {
1512- let hK = bs()
1513- let gX = bl
1514- let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr")
1515- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1516- if ((eR == eR))
1151+ let bX = aL()
1152+ let gs = bd()
1153+ let fO = fromBase58String(bX[t])
1154+ let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr")
1155+ let gu = invoke(gt, "unstake", [toBase58String(fO), ch], nil)
1156+ if ((gu == gu))
15171157 then {
1518- let hM = invoke(hL, "unstake", [toBase58String(gX), cw], nil)
1519- if ((hM == hM))
1158+ let de = ck(toBase58String(dM.transactionId), toBase58String(fO), ch, dM.caller)
1159+ let cu = parseIntValue(de._9)
1160+ let cI = de._10
1161+ let gv = if (if (aI())
1162+ then true
1163+ else (cu == q))
1164+ then throw(("Blocked: " + toString(cu)))
1165+ else true
1166+ if ((gv == gv))
15201167 then {
1521- let dX = dd(toBase58String(cP.transactionId), toBase58String(gX), cw, cP.caller)
1522- let dz = dX._1
1523- let dA = dX._2
1524- let dn = parseIntValue(dX._9)
1525- let dB = dX._10
1526- let hN = if (if (aV())
1527- then true
1528- else (dn == s))
1529- then throw(("Blocked: " + toString(dn)))
1530- else true
1531- if ((hN == hN))
1532- then {
1533- let hO = invoke(aQ, "burn", [cw], [AttachedPayment(gX, cw)])
1534- if ((hO == hO))
1535- then {
1536- let hP = eS(-(dz), -(dA), 0)
1537- let gi = hP._1
1538- let eJ = hP._2
1539- let gj = eW(eR, eJ)
1540- if ((gj == gj))
1541- then (dB ++ gi)
1542- else throw("Strict value is not equal to itself.")
1543- }
1544- else throw("Strict value is not equal to itself.")
1545- }
1168+ let gw = invoke(aD, "burn", [ch], [AttachedPayment(fO, ch)])
1169+ if ((gw == gw))
1170+ then cI
15461171 else throw("Strict value is not equal to itself.")
15471172 }
15481173 else throw("Strict value is not equal to itself.")
15541179
15551180
15561181
1557-@Callable(cP)
1558-func unstakeAndGetNoLess (hQ,hR,hG) = {
1559- let ht = if (aV())
1182+@Callable(dM)
1183+func unstakeAndGetNoLess (gx,gy,gp) = {
1184+ let gd = if (aI())
15601185 then true
1561- else (bk == s)
1562- let gH = [if (!(ht))
1186+ else (aX == q)
1187+ let fX = [if (!(gd))
15631188 then true
1564- else throw("get operation is blocked by admin"), if ((size(cP.payments) == 0))
1189+ else throw("get operation is blocked by admin"), if ((size(dM.payments) == 0))
15651190 then true
15661191 else throw("no payments are expected")]
1567- if ((gH == gH))
1192+ if ((fX == fX))
15681193 then {
1569- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1570- if ((eR == eR))
1194+ let gu = invoke(bf, "unstake", [toBase58String(aY), gx], nil)
1195+ if ((gu == gu))
15711196 then {
1572- let hM = invoke(bu, "unstake", [toBase58String(bl), hQ], nil)
1573- if ((hM == hM))
1197+ let gz = ck(toBase58String(dM.transactionId), toBase58String(aY), gx, dM.caller)
1198+ let cG = gz._1
1199+ let cH = gz._2
1200+ let cI = gz._10
1201+ let gA = [if ((cG >= gy))
1202+ then true
1203+ else throw(makeString(["amount asset amount to receive is less than ", toString(gy)], "")), if ((cH >= gp))
1204+ then true
1205+ else throw(makeString(["price asset amount to receive is less than ", toString(gp)], ""))]
1206+ if ((gA == gA))
15741207 then {
1575- let hS = dd(toBase58String(cP.transactionId), toBase58String(bl), hQ, cP.caller)
1576- let dz = hS._1
1577- let dA = hS._2
1578- let dB = hS._10
1579- let hT = [if ((dz >= hR))
1580- then true
1581- else throw(makeString(["amount asset amount to receive is less than ", toString(hR)], "")), if ((dA >= hG))
1582- then true
1583- else throw(makeString(["price asset amount to receive is less than ", toString(hG)], ""))]
1584- if ((hT == hT))
1585- then {
1586- let hH = invoke(aQ, "burn", [hQ], [AttachedPayment(bl, hQ)])
1587- if ((hH == hH))
1588- then {
1589- let hU = eS(-(dz), -(dA), 0)
1590- let gi = hU._1
1591- let eJ = hU._2
1592- let gj = eW(eR, eJ)
1593- if ((gj == gj))
1594- then (dB ++ gi)
1595- else throw("Strict value is not equal to itself.")
1596- }
1597- else throw("Strict value is not equal to itself.")
1598- }
1208+ let gq = invoke(aD, "burn", [gx], [AttachedPayment(aY, gx)])
1209+ if ((gq == gq))
1210+ then cI
15991211 else throw("Strict value is not equal to itself.")
16001212 }
16011213 else throw("Strict value is not equal to itself.")
16071219
16081220
16091221
1610-@Callable(cP)
1611-func unstakeAndGetOneTknV2 (hQ,fL,fM) = {
1612- let hh = {
1613- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1614- if ($isInstanceOf(aS, "Boolean"))
1615- then aS
1616- else throw(($getType(aS) + " couldn't be cast to Boolean"))
1222+@Callable(dM)
1223+func unstakeAndGetOneTknV2 (gx,ff,fg) = {
1224+ let fV = {
1225+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1226+ if ($isInstanceOf(aF, "Boolean"))
1227+ then aF
1228+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
16171229 }
1618- let ht = if (if (aV())
1230+ let gd = if (if (aI())
16191231 then true
1620- else (bk == s))
1232+ else (aX == q))
16211233 then true
1622- else hh
1623- let gH = [if (if (!(ht))
1234+ else fV
1235+ let fX = [if (if (!(gd))
16241236 then true
1625- else go(cP))
1237+ else fB(dM))
16261238 then true
1627- else aN("get operation is blocked by admin"), if ((size(cP.payments) == 0))
1239+ else aB("get operation is blocked by admin"), if ((size(dM.payments) == 0))
16281240 then true
1629- else aN("no payments are expected")]
1630- if ((gH == gH))
1241+ else aB("no payments are expected")]
1242+ if ((fX == fX))
16311243 then {
1632- let hK = bs()
1633- let gX = bl
1634- let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr")
1635- let hM = invoke(hL, "unstake", [toBase58String(gX), hQ], nil)
1636- if ((hM == hM))
1244+ let bX = aL()
1245+ let gs = bd()
1246+ let fO = fromBase58String(bX[t])
1247+ let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr")
1248+ let co = dM.caller
1249+ let gB = this
1250+ let gu = invoke(gt, "unstakeINTERNAL", [fO, gx, co.bytes, gB.bytes], nil)
1251+ if ((gu == gu))
16371252 then {
1638- let hV = fK(fL, fM, [AttachedPayment(gX, hQ)], cP.caller, cP.originCaller, cP.transactionId)
1639- let dB = hV._1
1640- let fV = hV._2
1641- $Tuple2(dB, fV)
1253+ let gC = fe(ff, fg, [AttachedPayment(fO, gx)], dM.caller, dM.originCaller, dM.transactionId)
1254+ let cI = gC._1
1255+ let fp = gC._2
1256+ $Tuple2(cI, fp)
16421257 }
16431258 else throw("Strict value is not equal to itself.")
16441259 }
16471262
16481263
16491264
1650-@Callable(cP)
1651-func putOneTknV2WithBonusREADONLY (hW,hX) = {
1652- let hY = fp(hW, hX, "", "", true)
1653- let fE = hY._1
1654- let dB = hY._2
1655- let cx = hY._3
1656- let fJ = hY._4
1657- $Tuple2(nil, $Tuple3(fE, cx, fJ))
1265+@Callable(dM)
1266+func putOneTknV2WithBonusREADONLY (gD,gE) = {
1267+ let aT = aL()
1268+ let cq = aT[u]
1269+ let cr = aT[v]
1270+ let cp = aT[t]
1271+ let gF = eH(gD, gE, "", "", true)
1272+ let eY = gF._1
1273+ let cI = gF._2
1274+ let cj = gF._3
1275+ let fd = gF._4
1276+ $Tuple2(nil, $Tuple3(eY, cj, fd))
16581277 }
16591278
16601279
16611280
1662-@Callable(cP)
1663-func putOneTknV2WithoutTakeFeeREADONLY (hW,hX) = {
1664- let hZ = fp(hW, hX, "", "", false)
1665- let fE = hZ._1
1666- let dB = hZ._2
1667- let cx = hZ._3
1668- let fJ = hZ._4
1669- $Tuple2(nil, $Tuple3(fE, cx, fJ))
1281+@Callable(dM)
1282+func putOneTknV2WithoutTakeFeeREADONLY (gD,gE) = {
1283+ let aT = aL()
1284+ let cq = aT[u]
1285+ let cr = aT[v]
1286+ let cp = aT[t]
1287+ let gG = eH(gD, gE, "", "", false)
1288+ let eY = gG._1
1289+ let cI = gG._2
1290+ let cj = gG._3
1291+ let fd = gG._4
1292+ $Tuple2(nil, $Tuple3(eY, cj, fd))
16701293 }
16711294
16721295
16731296
1674-@Callable(cP)
1675-func activate (ia,ib) = if ((toString(cP.caller) != toString(aQ)))
1297+@Callable(dM)
1298+func activate (gH,gI) = if ((toString(dM.caller) != toString(aD)))
16761299 then throw("denied")
1677- else $Tuple2([StringEntry(aj(), ia), StringEntry(ak(), ib)], "success")
1300+ else $Tuple2([StringEntry(ac(), gH), StringEntry(ad(), gI)], "success")
16781301
16791302
16801303
1681-@Callable(cP)
1682-func setS (ic,hN) = if ((toString(cP.caller) != aJ(this, am())))
1683- then gn
1684- else [StringEntry(ic, hN)]
1304+@Callable(dM)
1305+func setS (gJ,gv) = if ((toString(dM.caller) != ax(this, af())))
1306+ then fA
1307+ else [StringEntry(gJ, gv)]
16851308
16861309
16871310
1688-@Callable(cP)
1689-func setI (ic,hN) = if ((toString(cP.caller) != aJ(this, am())))
1690- then gn
1691- else [IntegerEntry(ic, hN)]
1311+@Callable(dM)
1312+func setI (gJ,gv) = if ((toString(dM.caller) != ax(this, af())))
1313+ then fA
1314+ else [IntegerEntry(gJ, gv)]
16921315
16931316
16941317
1695-@Callable(cP)
1696-func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aY())
1318+@Callable(dM)
1319+func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aL())
16971320
16981321
16991322
1700-@Callable(cP)
1701-func getAccBalanceWrapperREADONLY (bO) = $Tuple2(nil, bN(bO))
1323+@Callable(dM)
1324+func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz))
17021325
17031326
17041327
1705-@Callable(cP)
1706-func calcPricesWrapperREADONLY (ch,ci,cm) = {
1707- let id = cl(ch, ci, cm)
1708- $Tuple2(nil, [toString(id[0]), toString(id[1]), toString(id[2])])
1328+@Callable(dM)
1329+func calcPricesWrapperREADONLY (bR,bS,bW) = {
1330+ let gK = bV(bR, bS, bW)
1331+ $Tuple2(nil, [toString(gK[0]), toString(gK[1]), toString(gK[2])])
17091332 }
17101333
17111334
17121335
1713-@Callable(cP)
1714-func fromX18WrapperREADONLY (M,ie) = $Tuple2(nil, L(parseBigIntValue(M), ie))
1336+@Callable(dM)
1337+func fromX18WrapperREADONLY (J,gL) = $Tuple2(nil, I(parseBigIntValue(J), gL))
17151338
17161339
17171340
1718-@Callable(cP)
1719-func toX18WrapperREADONLY (I,J) = $Tuple2(nil, toString(H(I, J)))
1341+@Callable(dM)
1342+func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H)))
17201343
17211344
17221345
1723-@Callable(cP)
1724-func calcPriceBigIntWrapperREADONLY (bQ,bR) = $Tuple2(nil, toString(bP(parseBigIntValue(bQ), parseBigIntValue(bR))))
1346+@Callable(dM)
1347+func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC))))
17251348
17261349
17271350
1728-@Callable(cP)
1729-func estimatePutOperationWrapperREADONLY (de,bW,dD,dE,dF,dG,if,dH,dI) = $Tuple2(nil, dC(de, bW, dD, dE, dF, dG, if, dH, dI, true, false, 0, ""))
1351+@Callable(dM)
1352+func estimatePutOperationWrapperREADONLY (cl,bG,cK,cL,cM,cN,gM,cO,cP) = $Tuple2(nil, cJ(cl, bG, cK, cL, cM, cN, gM, cO, cP, true, false, 0, ""))
17301353
17311354
17321355
1733-@Callable(cP)
1734-func estimateGetOperationWrapperREADONLY (de,ig,dg,if) = {
1735- let dX = dd(de, ig, dg, addressFromStringValue(if))
1736- $Tuple2(nil, $Tuple10(dX._1, dX._2, dX._3, dX._4, dX._5, dX._6, dX._7, toString(dX._8), dX._9, dX._10))
1356+@Callable(dM)
1357+func estimateGetOperationWrapperREADONLY (cl,gN,cn,gM) = {
1358+ let de = ck(cl, gN, cn, addressFromStringValue(gM))
1359+ $Tuple2(nil, $Tuple10(de._1, de._2, de._3, de._4, de._5, de._6, de._7, toString(de._8), de._9, de._10))
17371360 }
17381361
17391362
1740-@Verifier(ih)
1741-func ii () = {
1742- let ij = {
1743- let gl = gk()
1744- if ($isInstanceOf(gl, "ByteVector"))
1363+@Verifier(gO)
1364+func gP () = {
1365+ let gQ = {
1366+ let av = fy()
1367+ if ($isInstanceOf(av, "ByteVector"))
17451368 then {
1746- let gp = gl
1747- gp
1369+ let fC = av
1370+ fC
17481371 }
1749- else if ($isInstanceOf(gl, "Unit"))
1750- then ih.senderPublicKey
1372+ else if ($isInstanceOf(av, "Unit"))
1373+ then gO.senderPublicKey
17511374 else throw("Match error")
17521375 }
1753- let gl = ih
1754- if ($isInstanceOf(gl, "Order"))
1376+ let av = gO
1377+ if ($isInstanceOf(av, "Order"))
17551378 then {
1756- let eZ = gl
1757- let ik = aW()
1758- let il = eY(eZ)
1759- let aF = il._1
1760- let aG = il._2
1761- let aH = sigVerify(eZ.bodyBytes, eZ.proofs[0], eZ.senderPublicKey)
1762- let aI = sigVerify(eZ.bodyBytes, eZ.proofs[1], ik)
1763- if (if (if (aF)
1764- then aH
1379+ let dz = av
1380+ let gR = aJ()
1381+ let gS = dy(dz)
1382+ let gT = sigVerify(dz.bodyBytes, dz.proofs[0], dz.senderPublicKey)
1383+ let gU = sigVerify(dz.bodyBytes, dz.proofs[1], gR)
1384+ if (if (if (gS)
1385+ then gT
17651386 else false)
1766- then aI
1387+ then gU
17671388 else false)
17681389 then true
1769- else aE(aF, aG, aH, aI)
1390+ else aq(gS, gT, gU)
17701391 }
1771- else if ($isInstanceOf(gl, "SetScriptTransaction"))
1392+ else if ($isInstanceOf(av, "SetScriptTransaction"))
17721393 then {
1773- let cC = gl
1774- if (sigVerify(ih.bodyBytes, ih.proofs[0], ij))
1394+ let dZ = av
1395+ let gV = blake2b256(value(dZ.script))
1396+ let gW = fromBase64String(value(getString(aD, ao())))
1397+ let gX = scriptHash(this)
1398+ if (if ((gW == gV))
1399+ then (gX != gV)
1400+ else false)
17751401 then true
1776- else {
1777- let im = blake2b256(value(cC.script))
1778- let in = fromBase64String(value(getString(aQ, aC())))
1779- let io = scriptHash(this)
1780- if ((in == im))
1781- then (io != im)
1782- else false
1783- }
1402+ else sigVerify(gO.bodyBytes, gO.proofs[0], gQ)
17841403 }
1785- else sigVerify(ih.bodyBytes, ih.proofs[0], ij)
1404+ else sigVerify(gO.bodyBytes, gO.proofs[0], gQ)
17861405 }
17871406
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 100000000
55
66 let b = toBigInt(100000000)
77
88 let c = toBigInt(1000000000000000000)
99
1010 let d = toBigInt(0)
1111
1212 let e = toBigInt(0)
1313
1414 let f = toBigInt(1)
1515
1616 let g = toBigInt(2)
1717
18-let h = toBigInt(3)
18+let h = toBigInt((a - ((a * 1) / a)))
1919
20-let i = toBigInt(4)
20+let i = "WAVES"
2121
22-let j = toBigInt((a - ((a * 1) / a)))
22+let j = "100"
2323
24-let k = "WAVES"
24+let k = "1"
2525
26-let l = "100"
26+let l = "__"
2727
28-let m = "1"
28+let m = ""
2929
30-let n = "__"
30+let n = 1
3131
32-let o = ""
32+let o = 2
3333
34-let p = 1
34+let p = 3
3535
36-let q = 2
36+let q = 4
3737
38-let r = 3
38+let r = 1
3939
40-let s = 4
40+let s = 2
4141
42-let t = 1
42+let t = 3
4343
44-let u = 2
44+let u = 4
4545
46-let v = 3
46+let v = 5
4747
48-let w = 4
48+let w = 6
4949
50-let x = 5
50+let x = 7
5151
52-let y = 6
52+let y = 8
5353
54-let z = 7
54+let z = 9
5555
56-let A = 8
56+let A = 1
5757
58-let B = 9
58+let B = 6
5959
60-let C = 1
60+let C = 7
6161
62-let D = 6
62+let D = 10
6363
64-let E = 7
64+let E = fraction(10, a, 10000)
6565
66-let F = 10
67-
68-let G = fraction(10, a, 10000)
69-
70-func H (I,J) = fraction(toBigInt(I), c, toBigInt(J))
66+func F (G,H) = fraction(toBigInt(G), c, toBigInt(H))
7167
7268
73-func K (I,J) = fraction(I, c, J)
69+func I (J,K) = toInt(fraction(J, toBigInt(K), c))
7470
7571
76-func L (M,N) = toInt(fraction(M, toBigInt(N), c))
72+func L (M,N,O) = fraction(M, N, O)
7773
7874
79-func O (M,N,P) = toInt(fraction(M, toBigInt(N), c, P))
75+func P (J) = if ((d > J))
76+ then -(J)
77+ else J
8078
8179
82-func Q (I,J) = fraction(I, c, toBigInt(J))
80+func Q (J) = if ((d > J))
81+ then -(J)
82+ else J
8383
8484
85-func R (M,N) = fraction(M, toBigInt(N), c)
85+func R () = "%s__factoryContract"
8686
8787
88-func S (T,U,V) = fraction(T, U, V)
88+func S () = "%s__managerPublicKey"
8989
9090
91-func W (M) = if ((d > M))
92- then -(M)
93- else M
91+func T () = "%s__pendingManagerPublicKey"
9492
9593
96-func X (M) = if ((d > M))
97- then -(M)
98- else M
94+func U () = "%s%s__price__last"
9995
10096
101-func Y () = "%s__factoryContract"
97+func V (W,X) = makeString(["%s%s%d%d__price__history", toString(W), toString(X)], l)
10298
10399
104-func Z () = "%s__managerPublicKey"
100+func Y (Z,aa) = ((("%s%s%s__P__" + Z) + "__") + aa)
105101
106102
107-func aa () = "%s__pendingManagerPublicKey"
103+func ab (Z,aa) = ((("%s%s%s__G__" + Z) + "__") + aa)
108104
109105
110-func ab () = "%s%s__price__last"
106+func ac () = "%s__amountAsset"
111107
112108
113-func ac (ad,ae) = makeString(["%s%s%d%d__price__history", toString(ad), toString(ae)], n)
109+func ad () = "%s__priceAsset"
114110
115111
116-func af (ag,ah) = ((("%s%s%s__P__" + ag) + "__") + ah)
112+func ae () = "%s__amp"
117113
118114
119-func ai (ag,ah) = ((("%s%s%s__G__" + ag) + "__") + ah)
115+func af () = "%s__addonAddr"
120116
121117
122-func aj () = "%s__amountAsset"
118+func ag () = "%s__factoryConfig"
123119
124120
125-func ak () = "%s__priceAsset"
121+func ah () = "%s%s__matcher__publicKey"
126122
127123
128-func al () = "%s__amp"
124+func ai (aj,ak) = (((("%d%d%s__" + aj) + "__") + ak) + "__config")
129125
130126
131-func am () = "%s__addonAddr"
127+func al (am) = ("%s%s%s__mappings__baseAsset2internalId__" + am)
132128
133129
134-let an = "%s__fee"
135-
136-let ao = valueOrElse(getInteger(this, an), G)
137-
138-let ap = makeString(["%s", "dLp"], n)
139-
140-let aq = makeString(["%s", "dLpRefreshedHeight"], n)
141-
142-let ar = makeString(["%s", "refreshDLpDelay"], n)
143-
144-let as = 30
145-
146-let at = valueOrElse(getInteger(this, ar), as)
147-
148-func au () = "%s__factoryConfig"
130+func an () = "%s__shutdown"
149131
150132
151-func av () = "%s%s__matcher__publicKey"
133+func ao () = "%s__allowedLpStableScriptHash"
152134
153135
154-func aw (ax,ay) = (((("%d%d%s__" + ax) + "__") + ay) + "__config")
136+func ap () = "%s__feeCollectorAddress"
155137
156138
157-func az (aA) = ("%s%s%s__mappings__baseAsset2internalId__" + aA)
139+func aq (ar,as,at) = throw(((((("Failed: ordValid=" + toString(ar)) + " sndrValid=") + toString(as)) + " mtchrValid=") + toString(at)))
158140
159141
160-func aB () = "%s__shutdown"
161-
162-
163-func aC () = "%s__allowedLpStableScriptHash"
164-
165-
166-func aD () = "%s__feeCollectorAddress"
167-
168-
169-func aE (aF,aG,aH,aI) = throw((((((((("order validation failed: orderValid=" + toString(aF)) + " (") + aG) + ")") + " senderValid=") + toString(aH)) + " matcherValid=") + toString(aI)))
170-
171-
172-func aJ (aK,aL) = valueOrErrorMessage(getString(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], ""))
173-
174-
175-func aM (aK,aL) = valueOrErrorMessage(getInteger(aK, aL), makeString(["mandatory ", toString(aK), ".", aL, " not defined"], ""))
176-
177-
178-func aN (aO) = throw(makeString(["lp_stable.ride:", aO], " "))
179-
180-
181-func aP (aO) = makeString(["lp_stable.ride:", aO], " ")
182-
183-
184-let aQ = addressFromStringValue(aJ(this, Y()))
185-
186-let aR = {
187- let aS = invoke(aQ, "getInFeeREADONLY", [toString(this)], nil)
188- if ($isInstanceOf(aS, "Int"))
189- then aS
190- else throw(($getType(aS) + " couldn't be cast to Int"))
191- }
192-
193-let aT = {
194- let aS = invoke(aQ, "getOutFeeREADONLY", [toString(this)], nil)
195- if ($isInstanceOf(aS, "Int"))
196- then aS
197- else throw(($getType(aS) + " couldn't be cast to Int"))
198- }
199-
200-let aU = aJ(this, al())
201-
202-func aV () = valueOrElse(getBoolean(aQ, aB()), false)
203-
204-
205-func aW () = fromBase58String(aJ(aQ, av()))
206-
207-
208-let aX = addressFromStringValue(aJ(aQ, aD()))
209-
210-func aY () = {
211- let aZ = aJ(this, aj())
212- let ba = aJ(this, ak())
213- let bb = aM(aQ, az(ba))
214- let ax = aM(aQ, az(aZ))
215- split(aJ(aQ, aw(toString(ax), toString(bb))), n)
142+func au (J) = {
143+ let av = J
144+ if ($isInstanceOf(av, "String"))
145+ then {
146+ let aw = av
147+ aw
148+ }
149+ else throw("fail cast to String")
216150 }
217151
218152
219-func bc (bd) = if ((bd == k))
220- then unit
221- else fromBase58String(bd)
153+func ax (ay,az) = valueOrErrorMessage(getString(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], ""))
222154
223155
224-func be (bd) = if ((bd == unit))
225- then k
226- else toBase58String(value(bd))
156+func aA (ay,az) = valueOrErrorMessage(getInteger(ay, az), makeString(["mandatory ", toString(ay), ".", az, " not defined"], ""))
227157
228158
229-func bf (bg) = $Tuple9(addressFromStringValue(bg[t]), parseIntValue(bg[u]), fromBase58String(bg[v]), bc(bg[w]), bc(bg[x]), parseIntValue(bg[y]), parseIntValue(bg[z]), fromBase58String(bg[A]), fromBase58String(bg[B]))
159+func aB (aC) = throw(makeString(["lp_stable.ride:", aC], " "))
230160
231161
232-let bh = bf(aY())
162+let aD = addressFromStringValue(ax(this, R()))
233163
234-let bi = bh
164+let aE = {
165+ let aF = invoke(aD, "getInFeeREADONLY", [toString(this)], nil)
166+ if ($isInstanceOf(aF, "Int"))
167+ then aF
168+ else throw(($getType(aF) + " couldn't be cast to Int"))
169+ }
235170
236-let bj = bi._1
171+let aG = {
172+ let aF = invoke(aD, "getOutFeeREADONLY", [toString(this)], nil)
173+ if ($isInstanceOf(aF, "Int"))
174+ then aF
175+ else throw(($getType(aF) + " couldn't be cast to Int"))
176+ }
237177
238-let bk = bi._2
178+let aH = ax(this, ae())
239179
240-let bl = bi._3
241-
242-let bm = bi._4
243-
244-let bn = bi._5
245-
246-let bo = bi._6
247-
248-let bp = bi._7
249-
250-let bq = bi._8
251-
252-let br = bi._9
253-
254-func bs () = split(aJ(aQ, au()), n)
180+func aI () = valueOrElse(getBoolean(aD, an()), false)
255181
256182
257-let bt = bs()
258-
259-let bu = valueOrErrorMessage(addressFromString(bt[C]), "Invalid staking contract address")
260-
261-let bv = valueOrErrorMessage(addressFromString(bt[E]), "Invalid slipage contract address")
262-
263-let bw = valueOrErrorMessage(addressFromString(bt[F]), "Invalid gwx contract address")
264-
265-let bx = valueOrErrorMessage(addressFromString(bt[D]), "Invalid gwx contract address")
266-
267-func by (bz,bA,bB,bC,bD,bE,bF,bG,bH,bI) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bz), toString(bA), toString(bB), toString(bC), toString(bD), toString(bE), toString(bF), toString(bG), toString(bH), toString(bI)], n)
183+func aJ () = fromBase58String(ax(aD, ah()))
268184
269185
270-func bJ (bK,bL,bM,bC,bF,bG) = makeString(["%d%d%d%d%d%d", toString(bK), toString(bL), toString(bM), toString(bC), toString(bF), toString(bG)], n)
186+let aK = addressFromStringValue(ax(aD, ap()))
271187
272-
273-func bN (bO) = if ((bO == "WAVES"))
274- then wavesBalance(this).available
275- else assetBalance(this, fromBase58String(bO))
276-
277-
278-func bP (bQ,bR) = fraction(bQ, c, bR)
279-
280-
281-func bS (bQ,bR,P) = fraction(bQ, c, bR, P)
282-
283-
284-func bT (bU,bV,bW) = {
285- let bX = fraction((bU - bV), b, bV)
286- let bY = ((bW - W(bX)) > d)
287- if (!(bY))
288- then throw(("Big slpg: " + toString(bX)))
289- else $Tuple2(bY, min([bU, bV]))
188+func aL () = {
189+ let aM = ax(this, ac())
190+ let aN = ax(this, ad())
191+ let aO = aA(aD, al(aN))
192+ let aj = aA(aD, al(aM))
193+ split(ax(aD, ai(toString(aj), toString(aO))), l)
290194 }
291195
292196
293-func bZ (ca,cb,cc) = {
294- let bX = fraction(cb, b, ca)
295- let cd = (cc > bX)
296- if (if (cd)
297- then true
298- else (cb > ca))
299- then throw(((((((toString(cb) + " ") + toString(ca)) + " ") + toString(bX)) + " ") + toString(cc)))
300- else cd
197+func aP (aQ) = if ((aQ == i))
198+ then unit
199+ else fromBase58String(aQ)
200+
201+
202+func aR (aQ) = if ((aQ == unit))
203+ then i
204+ else toBase58String(value(aQ))
205+
206+
207+func aS (aT) = $Tuple7(addressFromStringValue(aT[r]), parseIntValue(aT[s]), fromBase58String(aT[t]), aP(aT[u]), aP(aT[v]), parseIntValue(aT[w]), parseIntValue(aT[x]))
208+
209+
210+let aU = aS(aL())
211+
212+let aV = aU
213+
214+let aW = aV._1
215+
216+let aX = aV._2
217+
218+let aY = aV._3
219+
220+let aZ = aV._4
221+
222+let ba = aV._5
223+
224+let bb = aV._6
225+
226+let bc = aV._7
227+
228+func bd () = split(ax(aD, ag()), l)
229+
230+
231+let be = bd()
232+
233+let bf = valueOrErrorMessage(addressFromString(be[A]), "Invalid staking contract address")
234+
235+let bg = valueOrErrorMessage(addressFromString(be[C]), "Invalid slipage contract address")
236+
237+let bh = valueOrErrorMessage(addressFromString(be[D]), "Invalid gwx contract address")
238+
239+let bi = valueOrErrorMessage(addressFromString(be[B]), "Invalid gwx contract address")
240+
241+func bj (bk,bl,bm,bn,bo,bp,bq,br,bs,bt) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bk), toString(bl), toString(bm), toString(bn), toString(bo), toString(bp), toString(bq), toString(br), toString(bs), toString(bt)], l)
242+
243+
244+func bu (bv,bw,bx,bn,bq,br) = makeString(["%d%d%d%d%d%d", toString(bv), toString(bw), toString(bx), toString(bn), toString(bq), toString(br)], l)
245+
246+
247+func by (bz) = if ((bz == "WAVES"))
248+ then wavesBalance(this).available
249+ else assetBalance(this, fromBase58String(bz))
250+
251+
252+func bA (bB,bC) = fraction(bB, c, bC)
253+
254+
255+func bD (bE,bF,bG) = {
256+ let bH = fraction((bE - bF), b, bF)
257+ let bI = ((bG - P(bH)) > d)
258+ if (!(bI))
259+ then throw(("Big slpg: " + toString(bH)))
260+ else $Tuple2(bI, min([bE, bF]))
301261 }
302262
303263
304-func ce (cf,cg,ch,ci) = {
305- let cj = H(ch, cf)
306- let ck = H(ci, cg)
307- bP(ck, cj)
264+func bJ (bK,bL,bM) = {
265+ let bH = fraction(bL, b, bK)
266+ let bN = (bM > bH)
267+ if (if (bN)
268+ then true
269+ else (bL > bK))
270+ then throw(((((((toString(bL) + " ") + toString(bK)) + " ") + toString(bH)) + " ") + toString(bM)))
271+ else bN
308272 }
309273
310274
311-func cl (ch,ci,cm) = {
312- let cn = bo
313- let co = bp
314- let cp = ce(cn, co, ch, ci)
315- let bR = H(ch, cn)
316- let bQ = H(ci, co)
317- let cq = H(cm, a)
318- let cr = bP(bR, cq)
319- let cs = bP(bQ, cq)
320-[cp, cr, cs]
275+func bO (bP,bQ,bR,bS) = {
276+ let bT = F(bR, bP)
277+ let bU = F(bS, bQ)
278+ bA(bU, bT)
321279 }
322280
323281
324-func ct (ch,ci,cm) = {
325- let cu = cl(ch, ci, cm)
326-[L(cu[0], a), L(cu[1], a), L(cu[2], a)]
282+func bV (bR,bS,bW) = {
283+ let bX = aL()
284+ let bY = parseIntValue(bX[w])
285+ let bZ = parseIntValue(bX[x])
286+ let ca = bO(bY, bZ, bR, bS)
287+ let bC = F(bR, bY)
288+ let bB = F(bS, bZ)
289+ let cb = F(bW, a)
290+ let cc = bA(bC, cb)
291+ let cd = bA(bB, cb)
292+[ca, cc, cd]
327293 }
328294
329295
330-func cv (cw,ao) = {
331- let cx = if ((ao == 0))
332- then 0
333- else fraction(cw, ao, a)
334- $Tuple2((cw - cx), cx)
296+func ce (bR,bS,bW) = {
297+ let cf = bV(bR, bS, bW)
298+[I(cf[0], a), I(cf[1], a), I(cf[2], a)]
335299 }
336300
337301
338-func cy (cz) = {
339- let cA = cz[0]
340- let cB = cz[1]
341- let cC = (cA + cB)
342- if ((cC == e))
343- then e
302+func cg (ch,ci) = {
303+ let cj = if ((ci == 0))
304+ then 0
305+ else fraction(ch, ci, a)
306+ $Tuple2((ch - cj), cj)
307+ }
308+
309+
310+func ck (cl,cm,cn,co) = {
311+ let bX = aL()
312+ let cp = bX[t]
313+ let cq = bX[u]
314+ let cr = bX[v]
315+ let cs = parseIntValue(bX[w])
316+ let ct = parseIntValue(bX[x])
317+ let cu = bX[s]
318+ let cv = valueOrErrorMessage(assetInfo(fromBase58String(cp)), "Wrong LP id").quantity
319+ if ((cp != cm))
320+ then throw("Wrong pmt asset")
344321 else {
345- let cD = parseIntValue(aU)
346- let cE = (cD * 2)
347- let cu = fraction(cA, cB, f)
348- let cF = fraction(cu, i, f)
349- let cG = fraction(toBigInt(cE), cC, f)
350- let cH = toBigInt((cE - 1))
351- func cI (cJ) = {
352- let cK = fraction(cJ, cJ, f)
353- let cL = fraction(cK, cJ, f)
354- let cM = fraction(cL, f, cF)
355- fraction((cG + fraction(cM, g, f)), cJ, (fraction(cH, cJ, f) + fraction(h, cM, f)))
356- }
357-
358- func cN (cO,cP) = if (cO._2)
359- then cO
360- else {
361- let cJ = cO._1
362- let cQ = cI(cJ)
363- let cR = (cQ - value(cJ))
364- let cS = if ((e > cR))
365- then -(cR)
366- else cR
367- if ((f >= cS))
368- then $Tuple2(cQ, true)
369- else $Tuple2(cQ, false)
370- }
371-
372- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
373- let cU = {
374- let cV = cT
375- let cW = size(cV)
376- let cX = $Tuple2(cC, false)
377- func cY (cZ,da) = if ((da >= cW))
378- then cZ
379- else cN(cZ, cV[da])
380-
381- func db (cZ,da) = if ((da >= cW))
382- then cZ
383- else throw("List size exceeds 18")
384-
385- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18)
386- }
387- let cJ = cU._1
388- let dc = cU._2
389- if (dc)
390- then cJ
391- else throw(("D calculation error, D = " + toString(cJ)))
322+ let cw = by(cq)
323+ let cx = F(cw, cs)
324+ let cy = by(cr)
325+ let cz = F(cy, ct)
326+ let cA = bA(cz, cx)
327+ let cB = I(cA, a)
328+ let cC = F(cn, a)
329+ let cD = F(cv, a)
330+ let cE = fraction(cx, cC, cD)
331+ let cF = fraction(cz, cC, cD)
332+ let cG = I(cE, cs)
333+ let cH = I(cF, ct)
334+ let cI = if ((cl == ""))
335+ then nil
336+ else [ScriptTransfer(co, cG, if ((cq == "WAVES"))
337+ then unit
338+ else fromBase58String(cq)), ScriptTransfer(co, cH, if ((cr == "WAVES"))
339+ then unit
340+ else fromBase58String(cr)), StringEntry(ab(toString(co), cl), bu(cG, cH, cn, cB, height, lastBlock.timestamp)), IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB)]
341+ $Tuple10(cG, cH, cq, cr, cw, cy, cv, cA, cu, cI)
392342 }
393343 }
394344
395345
396-func dd (de,df,dg,dh) = {
397- let di = bl
398- let dj = toBase58String(value(bm))
399- let dk = toBase58String(value(bn))
400- let dl = bo
401- let dm = bp
402- let dn = toString(bk)
403- let do = valueOrErrorMessage(assetInfo(di), "Wrong LP id").quantity
404- if ((toBase58String(di) != df))
405- then throw("Wrong pmt asset")
346+func cJ (cl,bG,cK,cL,cM,cN,co,cO,cP,cQ,cR,cS,cT) = {
347+ let bX = aL()
348+ let cp = fromBase58String(bX[t])
349+ let cU = bX[u]
350+ let cV = bX[v]
351+ let cW = bX[y]
352+ let cX = bX[z]
353+ let cY = parseIntValue(bX[w])
354+ let cZ = parseIntValue(bX[x])
355+ let cu = bX[s]
356+ let da = valueOrErrorMessage(assetInfo(cp), "Wr lp as").quantity
357+ let cw = if (cO)
358+ then by(cU)
359+ else if (if (cQ)
360+ then (cT == cU)
361+ else false)
362+ then (by(cU) - cS)
363+ else if (cQ)
364+ then by(cU)
365+ else (by(cU) - cK)
366+ let cy = if (cO)
367+ then by(cV)
368+ else if (if (cQ)
369+ then (cT == cV)
370+ else false)
371+ then (by(cV) - cS)
372+ else if (cQ)
373+ then by(cV)
374+ else (by(cV) - cM)
375+ let db = F(cK, cY)
376+ let dc = F(cM, cZ)
377+ let dd = bA(dc, db)
378+ let cx = F(cw, cY)
379+ let cz = F(cy, cZ)
380+ let de = if ((da == 0))
381+ then {
382+ let cA = d
383+ let df = d
384+ let cb = pow((db * dc), 0, toBigInt(5), 1, 0, DOWN)
385+ $Tuple5(I(cb, a), I(db, cY), I(dc, cZ), bA((cz + dc), (cx + db)), df)
386+ }
406387 else {
407- let dp = bN(dj)
408- let dq = H(dp, dl)
409- let dr = bN(dk)
410- let ds = H(dr, dm)
411- let dt = bP(ds, dq)
412- let du = L(dt, a)
413- let dv = H(dg, a)
414- let dw = H(do, a)
415- let dx = fraction(dq, dv, dw)
416- let dy = fraction(ds, dv, dw)
417- let dz = O(dx, dl, FLOOR)
418- let dA = O(dy, dm, FLOOR)
419- let dB = if ((de == ""))
420- then nil
421- else [ScriptTransfer(dh, dz, if ((dj == "WAVES"))
422- then unit
423- else fromBase58String(dj)), ScriptTransfer(dh, dA, if ((dk == "WAVES"))
424- then unit
425- else fromBase58String(dk)), StringEntry(ai(toString(dh), de), bJ(dz, dA, dg, du, height, lastBlock.timestamp)), IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du)]
426- $Tuple10(dz, dA, dj, dk, dp, dr, do, dt, dn, dB)
388+ let cA = bA(cz, cx)
389+ let dg = fraction(P((cA - dd)), c, cA)
390+ let df = F(bG, a)
391+ if (if (if (cR)
392+ then (cA != d)
393+ else false)
394+ then (dg > df)
395+ else false)
396+ then throw(((("Price slippage " + toString(dg)) + " > ") + toString(df)))
397+ else {
398+ let dh = F(da, a)
399+ let di = fraction(db, cA, c)
400+ let dj = fraction(dc, c, cA)
401+ let dk = if ((di > dc))
402+ then $Tuple2(dj, dc)
403+ else $Tuple2(db, di)
404+ let dl = dk._1
405+ let dm = dk._2
406+ let cb = fraction(dh, dm, cz)
407+ $Tuple5(I(cb, a), I(dl, cY), I(dm, cZ), cA, df)
408+ }
409+ }
410+ let dn = de._1
411+ let do = de._2
412+ let dp = de._3
413+ let cB = I(de._4, a)
414+ let dq = I(de._5, a)
415+ if ((0 >= dn))
416+ then throw("LP <= 0")
417+ else {
418+ let dr = if (!(cP))
419+ then 0
420+ else dn
421+ let ds = (cK - do)
422+ let dt = (cM - dp)
423+ let du = if (if (cQ)
424+ then (cT == cU)
425+ else false)
426+ then $Tuple2(cS, 0)
427+ else if (if (cQ)
428+ then (cT == cV)
429+ else false)
430+ then $Tuple2(0, cS)
431+ else $Tuple2(do, dp)
432+ let dv = du._1
433+ let dw = du._2
434+ let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, cl), bj(dv, dw, dr, cB, bG, dq, height, lastBlock.timestamp, ds, dt))]
435+ $Tuple13(dn, dr, cB, cw, cy, da, cp, cu, dx, ds, dt, cL, cN)
427436 }
428437 }
429438
430439
431-func dC (de,bW,dD,dE,dF,dG,dh,dH,dI,dJ,dK,dL,dM) = {
432- let di = bl
433- let dN = toBase58String(value(bm))
434- let dO = toBase58String(value(bn))
435- let dP = bq
436- let dQ = br
437- let dR = bo
438- let dS = bp
439- let dn = toString(bk)
440- let dT = valueOrErrorMessage(assetInfo(di), "Wr lp as").quantity
441- let dp = if (dH)
442- then bN(dN)
443- else if (if (dJ)
444- then (dM == dN)
445- else false)
446- then (bN(dN) - dL)
447- else if (dJ)
448- then bN(dN)
449- else (bN(dN) - dD)
450- let dr = if (dH)
451- then bN(dO)
452- else if (if (dJ)
453- then (dM == dO)
454- else false)
455- then (bN(dO) - dL)
456- else if (dJ)
457- then bN(dO)
458- else (bN(dO) - dF)
459- let dU = H(dD, dR)
460- let dV = H(dF, dS)
461- let dW = bP(dV, dU)
462- let dq = H(dp, dR)
463- let ds = H(dr, dS)
464- let cb = cy([dq, ds])
465- let dX = if ((dT == 0))
466- then {
467- let ca = cy([(dq + dU), (ds + dV)])
468- let dY = if ((ca > cb))
440+func dy (dz) = {
441+ let bX = aL()
442+ let dA = bX[u]
443+ let dB = bX[v]
444+ let cu = parseIntValue(bX[s])
445+ let bY = parseIntValue(bX[w])
446+ let bZ = parseIntValue(bX[x])
447+ let dC = by(dA)
448+ let dD = by(dB)
449+ let cA = if ((dz.orderType == Buy))
450+ then bO(bY, bZ, (dC + dz.amount), dD)
451+ else bO(bY, bZ, (dC - dz.amount), dD)
452+ let cB = I(cA, a)
453+ if (if (if (aI())
454+ then true
455+ else (cu == p))
456+ then true
457+ else (cu == q))
458+ then throw("Admin blocked")
459+ else {
460+ let dE = dz.assetPair.amountAsset
461+ let dF = if ((dE == unit))
462+ then "WAVES"
463+ else toBase58String(value(dE))
464+ let dG = dz.assetPair.priceAsset
465+ let dH = if ((dG == unit))
466+ then "WAVES"
467+ else toBase58String(value(dG))
468+ if (if ((dF != dA))
469469 then true
470- else throw("D1 should be greater than D0")
471- if ((dY == dY))
472- then {
473- let dt = d
474- let dZ = d
475- let cq = ca
476- $Tuple5(L(cq, a), L(dU, dR), L(dV, dS), bP((ds + dV), (dq + dU)), dZ)
470+ else (dH != dB))
471+ then throw("Wr assets")
472+ else {
473+ let dI = dz.price
474+ let cZ = fraction(a, bZ, bY)
475+ let dJ = L(dI, a, cZ)
476+ let dK = if ((dz.orderType == Buy))
477+ then (cB >= dJ)
478+ else (dJ >= cB)
479+ true
477480 }
478- else throw("Strict value is not equal to itself.")
479- }
480- else {
481- let dt = bP(ds, dq)
482- let ea = fraction(W((dt - dW)), c, dt)
483- let dZ = H(bW, a)
484- if (if (if (dK)
485- then (dt != d)
486- else false)
487- then (ea > dZ)
488- else false)
489- then throw(((("Price slippage " + toString(ea)) + " > ") + toString(dZ)))
490- else {
491- let eb = H(dT, a)
492- let ec = fraction(dU, bS(ds, dq, CEILING), c, CEILING)
493- let ed = fraction(dV, c, bS(ds, dq, FLOOR), CEILING)
494- let ee = if ((ec > dV))
495- then $Tuple2(ed, dV)
496- else $Tuple2(dU, ec)
497- let ef = ee._1
498- let eg = ee._2
499- let ca = cy([(dq + ef), (ds + eg)])
500- let dY = if ((ca > cb))
501- then true
502- else throw("D1 should be greater than D0")
503- if ((dY == dY))
504- then {
505- let cq = fraction(eb, (ca - cb), cb)
506- $Tuple5(O(cq, a, FLOOR), O(ef, dR, CEILING), O(eg, dS, CEILING), dt, dZ)
507- }
508- else throw("Strict value is not equal to itself.")
509- }
510- }
511- let eh = dX._1
512- let ei = dX._2
513- let ej = dX._3
514- let du = L(dX._4, a)
515- let ek = L(dX._5, a)
516- if ((0 >= eh))
517- then throw("LP <= 0")
518- else {
519- let el = if (!(dI))
520- then 0
521- else eh
522- let em = (dD - ei)
523- let en = (dF - ej)
524- let eo = if (if (dJ)
525- then (dM == dN)
526- else false)
527- then $Tuple2(dL, 0)
528- else if (if (dJ)
529- then (dM == dO)
530- else false)
531- then $Tuple2(0, dL)
532- else $Tuple2(ei, ej)
533- let ep = eo._1
534- let eq = eo._2
535- let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, de), by(ep, eq, el, du, bW, ek, height, lastBlock.timestamp, em, en))]
536- $Tuple13(eh, el, du, dp, dr, dT, di, dn, er, em, en, dE, dG)
537481 }
538482 }
539483
540484
541-func es (cz,cP,et) = {
542- let eu = g
543- let ev = cz[if ((cP == 0))
485+func dL (dM) = if ((size(dM.payments) != 1))
486+ then throw("1 pmnt exp")
487+ else {
488+ let dN = value(dM.payments[0])
489+ let cm = value(dN.assetId)
490+ let cS = dN.amount
491+ let de = ck(toBase58String(dM.transactionId), toBase58String(cm), cS, dM.caller)
492+ let cG = de._1
493+ let cH = de._2
494+ let cu = parseIntValue(de._9)
495+ let cI = de._10
496+ if (if (aI())
497+ then true
498+ else (cu == q))
499+ then throw(("Admin blocked: " + toString(cu)))
500+ else $Tuple5(cG, cH, cS, cm, cI)
501+ }
502+
503+
504+func dO (dP,aa,dQ,dR,bG,cP,cQ,cR,cS,cT) = {
505+ let de = cJ(aa, bG, value(dQ).amount, value(dQ).assetId, value(dR).amount, value(dR).assetId, dP, (aa == ""), cP, cQ, cR, cS, cT)
506+ let cu = parseIntValue(de._8)
507+ if (if (if (aI())
508+ then true
509+ else (cu == o))
510+ then true
511+ else (cu == q))
512+ then throw(("Blocked:" + toString(cu)))
513+ else de
514+ }
515+
516+
517+func dS (dT) = {
518+ let dU = g
519+ let dV = dT[0]
520+ let dW = dT[1]
521+ let dX = parseBigIntValue(j)
522+ let dY = (parseBigIntValue(aH) * dX)
523+ let dZ = (dV + dW)
524+ if ((dZ == e))
525+ then e
526+ else {
527+ let ea = (dY * dU)
528+ let eb = (((dV * dW) * dU) * dU)
529+ let ec = ((ea * dZ) / dX)
530+ let ed = (ea - dX)
531+ let ee = (dU + f)
532+ func ef (eg,eh) = {
533+ let ei = eg
534+ let ej = ei._1
535+ let ek = ei._2
536+ if ((ek != unit))
537+ then eg
538+ else {
539+ let el = (((ej * ej) * ej) / eb)
540+ let em = (((ec + (el * dU)) * ej) / (((ed * ej) / dX) + (ee * el)))
541+ let en = Q((em - value(ej)))
542+ if ((f >= en))
543+ then $Tuple2(em, eh)
544+ else $Tuple2(em, unit)
545+ }
546+ }
547+
548+ let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
549+ let ep = {
550+ let eq = eo
551+ let er = size(eq)
552+ let es = $Tuple2(dZ, unit)
553+ func et (eu,ev) = if ((ev >= er))
554+ then eu
555+ else ef(eu, eq[ev])
556+
557+ func ew (eu,ev) = if ((ev >= er))
558+ then eu
559+ else throw("List size exceeds 15")
560+
561+ ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
562+ }
563+ let ej = ep._1
564+ let ek = ep._2
565+ if ((ek != unit))
566+ then ej
567+ else throw(("D calculation error, D = " + toString(ej)))
568+ }
569+ }
570+
571+
572+func ex (dT,dM,ey) = {
573+ let dU = g
574+ let ez = dT[if ((dM == 0))
544575 then 1
545576 else 0]
546- let ew = parseBigIntValue(l)
547- let cD = (parseBigIntValue(aU) * ew)
548- let cC = ev
549- let cE = (cD * eu)
550- let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu))
551- let ey = ((cC + ((et * ew) / cE)) - et)
552- func cN (cO,ez) = {
553- let eA = cO
554- let eB = eA._1
555- let dc = eA._2
556- if ((dc != unit))
557- then cO
577+ let dX = parseBigIntValue(j)
578+ let dY = (parseBigIntValue(aH) * dX)
579+ let dZ = ez
580+ let ea = (dY * dU)
581+ let eA = (((((ey * ey) / (ez * dU)) * ey) * dX) / (ea * dU))
582+ let eB = ((dZ + ((ey * dX) / ea)) - ey)
583+ func ef (eg,eh) = {
584+ let eC = eg
585+ let eD = eC._1
586+ let ek = eC._2
587+ if ((ek != unit))
588+ then eg
558589 else {
559- let eC = (((eB * eB) + ex) / ((g * eB) + ey))
560- let eD = X((eC - value(eB)))
561- if ((f >= eD))
562- then $Tuple2(eC, ez)
563- else $Tuple2(eC, unit)
590+ let eE = (((eD * eD) + eA) / ((g * eD) + eB))
591+ let eF = Q((eE - value(eD)))
592+ if ((f >= eF))
593+ then $Tuple2(eE, eh)
594+ else $Tuple2(eE, unit)
564595 }
565596 }
566597
567- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
568- let eE = {
569- let cV = cT
570- let cW = size(cV)
571- let cX = $Tuple2(et, unit)
572- func cY (cZ,da) = if ((da >= cW))
573- then cZ
574- else cN(cZ, cV[da])
598+ let eo = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
599+ let eG = {
600+ let eq = eo
601+ let er = size(eq)
602+ let es = $Tuple2(ey, unit)
603+ func et (eu,ev) = if ((ev >= er))
604+ then eu
605+ else ef(eu, eq[ev])
575606
576- func db (cZ,da) = if ((da >= cW))
577- then cZ
607+ func ew (eu,ev) = if ((ev >= er))
608+ then eu
578609 else throw("List size exceeds 15")
579610
580- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
611+ ew(et(et(et(et(et(et(et(et(et(et(et(et(et(et(et(es, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
581612 }
582- let eB = eE._1
583- let dc = eE._2
584- if ((dc != unit))
585- then eB
586- else throw(("Y calculation error, Y = " + toString(eB)))
613+ let eD = eG._1
614+ let ek = eG._2
615+ if ((ek != unit))
616+ then eD
617+ else throw(("Y calculation error, Y = " + toString(eD)))
587618 }
588619
589620
590-func eF (eG,eH,eI) = {
591- let eJ = fraction(cy([K(eG, toBigInt(bo)), K(eH, toBigInt(bp))]), c, eI)
592- if ((eI == e))
593- then e
594- else eJ
595- }
596-
597-
598-func eK (eL,eM,eN) = {
599- let eO = (toBigInt(bN(be(bm))) - eL)
600- let eP = (toBigInt(bN(be(bn))) - eM)
601- let eQ = (toBigInt(value(assetInfo(bl)).quantity) - eN)
602- let eR = eF(eO, eP, eQ)
603- eR
604- }
605-
606-
607-func eS (eT,eU,eN) = {
608- let eO = (bN(be(bm)) + eT)
609- let eP = (bN(be(bn)) + eU)
610- let eQ = (value(assetInfo(bl)).quantity + eN)
611- let eJ = eF(toBigInt(eO), toBigInt(eP), toBigInt(eQ))
612- let eV = [IntegerEntry(aq, height), StringEntry(ap, toString(eJ))]
613- $Tuple2(eV, eJ)
614- }
615-
616-
617-func eW (eX,eJ) = if ((eJ >= eX))
618- then true
619- else aN("updated DLp lower than current DLp")
620-
621-
622-func eY (eZ) = {
623- let eO = bN(be(bm))
624- let eP = bN(be(bn))
625- let fa = eZ.amount
626- let fb = fraction(eZ.amount, eZ.price, a, FLOOR)
627- let fc = if ((eZ.orderType == Buy))
628- then $Tuple2(fa, -(fb))
629- else $Tuple2(-(fa), fb)
630- let eT = fc._1
631- let eU = fc._2
632- if (if (if (aV())
633- then true
634- else (bk == r))
635- then true
636- else (bk == s))
637- then throw("Admin blocked")
638- else if (if ((eZ.assetPair.amountAsset != bm))
639- then true
640- else (eZ.assetPair.priceAsset != bn))
641- then throw("Wr assets")
642- else {
643- let fd = parseBigIntValue(valueOrElse(getString(this, ap), "0"))
644- let fe = eS(eT, eU, 0)
645- let ff = fe._1
646- let fg = fe._2
647- let fh = (fg >= fd)
648- let fi = makeString(["dLp=", toString(fd), " dLpNew=", toString(fg), " amountAssetBalance=", toString(eO), " priceAssetBalance=", toString(eP), " amountAssetBalanceDelta=", toString(eT), " priceAssetBalanceDelta=", toString(eU), " height=", toString(height)], "")
649- $Tuple2(fh, fi)
650- }
651- }
652-
653-
654-func fj (cP) = if ((size(cP.payments) != 1))
655- then throw("1 pmnt exp")
656- else {
657- let fk = value(cP.payments[0])
658- let df = value(fk.assetId)
659- let dL = fk.amount
660- let dX = dd(toBase58String(cP.transactionId), toBase58String(df), dL, cP.caller)
661- let dz = dX._1
662- let dA = dX._2
663- let dn = parseIntValue(dX._9)
664- let dB = dX._10
665- if (if (aV())
666- then true
667- else (dn == s))
668- then throw(("Admin blocked: " + toString(dn)))
669- else $Tuple5(dz, dA, dL, df, dB)
670- }
671-
672-
673-func fl (fm,ah,fn,fo,bW,dI,dJ,dK,dL,dM) = {
674- let dX = dC(ah, bW, value(fn).amount, value(fn).assetId, value(fo).amount, value(fo).assetId, fm, (ah == ""), dI, dJ, dK, dL, dM)
675- let dn = parseIntValue(dX._8)
676- if (if (if (aV())
677- then true
678- else (dn == q))
679- then true
680- else (dn == s))
681- then throw(("Blocked:" + toString(dn)))
682- else dX
683- }
684-
685-
686-func fp (fq,df,dh,ah,fr) = {
687- let dj = toBase58String(value(bm))
688- let dk = toBase58String(value(bn))
689- let di = bl
690- let dR = bo
691- let dS = bp
692- let eQ = toBigInt(valueOrErrorMessage(assetInfo(di), "invalid lp asset").quantity)
693- let fs = if ((eQ > e))
621+func eH (eI,cm,co,aa,eJ) = {
622+ let aT = aL()
623+ let cq = aT[u]
624+ let cr = aT[v]
625+ let cp = aT[t]
626+ let cY = parseIntValue(aT[w])
627+ let cZ = parseIntValue(aT[x])
628+ let eK = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity)
629+ let eL = if ((eK > e))
694630 then true
695631 else throw("initial deposit requires all coins")
696- if ((fs == fs))
632+ if ((eL == eL))
697633 then {
698- let dp = bN(dj)
699- let dr = bN(dk)
700- let ft = if ((ah == ""))
701- then $Tuple2(dp, dr)
702- else if ((df == dj))
703- then if ((fq > dp))
634+ let cw = by(cq)
635+ let cy = by(cr)
636+ let eM = if ((aa == ""))
637+ then $Tuple2(cw, cy)
638+ else if ((cm == cq))
639+ then if ((eI > cw))
704640 then throw("invalid payment amount")
705- else $Tuple2((dp - fq), dr)
706- else if ((df == dk))
707- then if ((fq > dr))
641+ else $Tuple2((cw - eI), cy)
642+ else if ((cm == cr))
643+ then if ((eI > cy))
708644 then throw("invalid payment amount")
709- else $Tuple2(dp, (dr - fq))
645+ else $Tuple2(cw, (cy - eI))
710646 else throw("wrong pmtAssetId")
711- let fu = ft._1
712- let fv = ft._2
713- let fw = if ((df == dj))
714- then $Tuple2(fq, 0)
715- else if ((df == dk))
716- then $Tuple2(0, fq)
647+ let eN = eM._1
648+ let eO = eM._2
649+ let eP = if ((cm == cq))
650+ then $Tuple2(eI, 0)
651+ else if ((cm == cr))
652+ then $Tuple2(0, eI)
717653 else throw("invalid payment")
718- let fx = fw._1
719- let fy = fw._2
720- let fz = if (fr)
721- then $Tuple3(cv(fx, aR)._1, cv(fy, aR)._1, cv(fq, aR)._2)
722- else $Tuple3(fx, fy, 0)
723- let fA = fz._1
724- let fB = fz._2
725- let cx = fz._3
726- let fC = (fu + fA)
727- let fD = (fv + fB)
728- let cb = cy([H(fu, bo), H(fv, bp)])
729- let ca = cy([H(fC, bo), H(fD, bp)])
730- let dY = if ((ca > cb))
654+ let eQ = eP._1
655+ let eR = eP._2
656+ let eS = if (eJ)
657+ then $Tuple3(cg(eQ, aE)._1, cg(eR, aE)._1, cg(eI, aE)._2)
658+ else $Tuple3(eQ, eR, 0)
659+ let eT = eS._1
660+ let eU = eS._2
661+ let cj = eS._3
662+ let eV = (eN + eT)
663+ let eW = (eO + eU)
664+ let bL = dS([toBigInt(eN), toBigInt(eO)])
665+ let bK = dS([toBigInt(eV), toBigInt(eW)])
666+ let eX = if ((bK > bL))
731667 then true
732668 else throw()
733- if ((dY == dY))
669+ if ((eX == eX))
734670 then {
735- let fE = fraction(eQ, (ca - cb), cb, FLOOR)
736- let du = L(bP(H(fD, dS), H(fC, dR)), a)
737- let er = [IntegerEntry(ab(), du), IntegerEntry(ac(height, lastBlock.timestamp), du), StringEntry(af(dh, ah), by(fx, fy, toInt(fE), du, 0, 0, height, lastBlock.timestamp, 0, 0))]
738- let fF = fraction(fv, a, fu)
739- let fG = fraction(fq, a, (fF + a))
740- let fH = (fq - fG)
741- let fI = fraction(eQ, toBigInt(fH), toBigInt(fv))
742- let fJ = toInt(fraction((fE - fI), b, fI))
743- $Tuple4(toInt(fE), er, cx, fJ)
671+ let eY = fraction(eK, (bK - bL), bL)
672+ let cB = I(bA(F(eW, cZ), F(eV, cY)), a)
673+ let dx = [IntegerEntry(U(), cB), IntegerEntry(V(height, lastBlock.timestamp), cB), StringEntry(Y(co, aa), bj(eQ, eR, toInt(eY), cB, 0, 0, height, lastBlock.timestamp, 0, 0))]
674+ let eZ = fraction(eO, a, eN)
675+ let fa = fraction(eI, a, (eZ + a))
676+ let fb = (eI - fa)
677+ let fc = fraction(eK, toBigInt(fb), toBigInt(eO))
678+ let fd = toInt(fraction((eY - fc), b, fc))
679+ $Tuple4(toInt(eY), dx, cj, fd)
744680 }
745681 else throw("Strict value is not equal to itself.")
746682 }
747683 else throw("Strict value is not equal to itself.")
748684 }
749685
750686
751-func fK (fL,fM,fN,fm,fO,fP) = {
752- let di = toBase58String(value(bl))
753- let dj = toBase58String(value(bm))
754- let dk = toBase58String(value(bn))
755- let fQ = bo
756- let fR = bp
757- let fS = bk
758- let dh = if ((fm == bx))
759- then fO
760- else fm
761- let fk = value(fN[0])
762- let df = value(fk.assetId)
763- let dL = fk.amount
764- let eR = eK(e, e, e)
765- if ((eR == eR))
766- then {
767- let de = toBase58String(fP)
768- if ((di != toBase58String(df)))
769- then throw("Wrong LP")
770- else {
771- let dp = bN(dj)
772- let dr = bN(dk)
773- let fT = {
774- let aS = invoke(this, "getOneTknV2READONLY", [fL, dL], nil)
775- if ($isInstanceOf(aS, "(Int, Int)"))
776- then aS
777- else throw(($getType(aS) + " couldn't be cast to (Int, Int)"))
778- }
779- if ((fT == fT))
687+func fe (ff,fg,fh,dP,fi,fj) = {
688+ let aT = aL()
689+ let cp = aT[t]
690+ let cq = aT[u]
691+ let cr = aT[v]
692+ let fk = parseIntValue(aT[w])
693+ let fl = parseIntValue(aT[x])
694+ let fm = aT[s]
695+ let co = if ((dP == bi))
696+ then fi
697+ else dP
698+ let dN = value(fh[0])
699+ let cm = value(dN.assetId)
700+ let cS = dN.amount
701+ let cl = toBase58String(fj)
702+ if ((cp != toBase58String(cm)))
703+ then throw("Wrong LP")
704+ else {
705+ let cw = by(cq)
706+ let cy = by(cr)
707+ let fn = {
708+ let aF = invoke(this, "getOneTknV2READONLY", [ff, cS], nil)
709+ if ($isInstanceOf(aF, "(Int, Int)"))
710+ then aF
711+ else throw(($getType(aF) + " couldn't be cast to (Int, Int)"))
712+ }
713+ if ((fn == fn))
714+ then {
715+ let cj = fn._2
716+ let fo = fn._1
717+ let fp = if (if ((fg > 0))
718+ then (fg > fo)
719+ else false)
720+ then aB(makeString(["amount to receive is less than ", toString(fg)], ""))
721+ else fo
722+ let fq = if ((ff == cq))
723+ then $Tuple4(fp, 0, ((cw - fp) - cj), cy)
724+ else if ((ff == cr))
725+ then $Tuple4(0, fp, cw, ((cy - fp) - cj))
726+ else throw("invalid out asset id")
727+ let fr = fq._1
728+ let fs = fq._2
729+ let eV = fq._3
730+ let eW = fq._4
731+ let ft = bA(F(eW, fl), F(eV, fk))
732+ let fu = I(ft, a)
733+ let fv = if ((ff == "WAVES"))
734+ then unit
735+ else fromBase58String(ff)
736+ let fw = if ((cj > 0))
737+ then [ScriptTransfer(aK, cj, fv)]
738+ else nil
739+ let cI = ([ScriptTransfer(co, fp, fv), StringEntry(ab(toString(co), cl), bu(fr, fs, cS, fu, height, lastBlock.timestamp)), IntegerEntry(U(), fu), IntegerEntry(V(height, lastBlock.timestamp), fu)] ++ fw)
740+ if ((cI == cI))
780741 then {
781- let cx = fT._2
782- let fU = fT._1
783- let fV = if (if ((fM > 0))
784- then (fM > fU)
785- else false)
786- then aN(makeString(["amount to receive is less than ", toString(fM)], ""))
787- else fU
788- let fW = if ((fL == dj))
789- then $Tuple4(fV, 0, ((dp - fV) - cx), dr)
790- else if ((fL == dk))
791- then $Tuple4(0, fV, dp, ((dr - fV) - cx))
792- else throw("invalid out asset id")
793- let fX = fW._1
794- let fY = fW._2
795- let fC = fW._3
796- let fD = fW._4
797- let fZ = bP(H(fD, fR), H(fC, fQ))
798- let ga = L(fZ, a)
799- let gb = if ((fL == "WAVES"))
800- then unit
801- else fromBase58String(fL)
802- let gc = if ((cx > 0))
803- then [ScriptTransfer(aX, cx, gb)]
804- else nil
805- let dB = ([ScriptTransfer(dh, fV, gb), StringEntry(ai(toString(dh), de), bJ(fX, fY, dL, ga, height, lastBlock.timestamp)), IntegerEntry(ab(), ga), IntegerEntry(ac(height, lastBlock.timestamp), ga)] ++ gc)
806- if ((dB == dB))
807- then {
808- let gd = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
809- if ((gd == gd))
810- then {
811- let ge = {
812- let gf = if ((this == aX))
813- then 0
814- else cx
815- let gg = if ((bc(fL) == bm))
816- then true
817- else false
818- if (gg)
819- then $Tuple2(-((fU + gf)), 0)
820- else $Tuple2(0, -((fU + gf)))
821- }
822- let eT = ge._1
823- let eU = ge._2
824- let gh = eS(eT, eU, 0)
825- let gi = gh._1
826- let eJ = gh._2
827- let gj = eW(eR, eJ)
828- if ((gj == gj))
829- then $Tuple2((dB ++ gi), fV)
830- else throw("Strict value is not equal to itself.")
831- }
832- else throw("Strict value is not equal to itself.")
833- }
742+ let fx = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
743+ if ((fx == fx))
744+ then $Tuple2(cI, fp)
834745 else throw("Strict value is not equal to itself.")
835746 }
836747 else throw("Strict value is not equal to itself.")
837748 }
749+ else throw("Strict value is not equal to itself.")
838750 }
839- else throw("Strict value is not equal to itself.")
840751 }
841752
842753
843-func gk () = {
844- let gl = getString(Z())
845- if ($isInstanceOf(gl, "String"))
754+func fy () = {
755+ let av = getString(S())
756+ if ($isInstanceOf(av, "String"))
846757 then {
847- let cC = gl
848- fromBase58String(cC)
758+ let dZ = av
759+ fromBase58String(dZ)
849760 }
850- else if ($isInstanceOf(gl, "Unit"))
761+ else if ($isInstanceOf(av, "Unit"))
851762 then unit
852763 else throw("Match error")
853764 }
854765
855766
856-func gm () = {
857- let gl = getString(aa())
858- if ($isInstanceOf(gl, "String"))
767+func fz () = {
768+ let av = getString(T())
769+ if ($isInstanceOf(av, "String"))
859770 then {
860- let cC = gl
861- fromBase58String(cC)
771+ let dZ = av
772+ fromBase58String(dZ)
862773 }
863- else if ($isInstanceOf(gl, "Unit"))
774+ else if ($isInstanceOf(av, "Unit"))
864775 then unit
865776 else throw("Match error")
866777 }
867778
868779
869-let gn = throw("Permission denied")
780+let fA = throw("Permission denied")
870781
871-func go (cP) = {
872- let gl = gk()
873- if ($isInstanceOf(gl, "ByteVector"))
782+func fB (dM) = {
783+ let av = fy()
784+ if ($isInstanceOf(av, "ByteVector"))
874785 then {
875- let gp = gl
876- (cP.callerPublicKey == gp)
786+ let fC = av
787+ (dM.callerPublicKey == fC)
877788 }
878- else if ($isInstanceOf(gl, "Unit"))
879- then (cP.caller == this)
789+ else if ($isInstanceOf(av, "Unit"))
790+ then (dM.caller == this)
880791 else throw("Match error")
881792 }
882793
883794
884-func gq (cP) = {
885- let gl = gk()
886- if ($isInstanceOf(gl, "ByteVector"))
795+func fD (dM) = {
796+ let av = fy()
797+ if ($isInstanceOf(av, "ByteVector"))
887798 then {
888- let gp = gl
889- if ((cP.callerPublicKey == gp))
799+ let fC = av
800+ if ((dM.callerPublicKey == fC))
890801 then true
891- else gn
802+ else fA
892803 }
893- else if ($isInstanceOf(gl, "Unit"))
894- then if ((cP.caller == this))
804+ else if ($isInstanceOf(av, "Unit"))
805+ then if ((dM.caller == this))
895806 then true
896- else gn
807+ else fA
897808 else throw("Match error")
898809 }
899810
900811
901-func gr (gs,et,gt) = {
902- let bg = aY()
903- let dj = bg[w]
904- let dk = bg[x]
905- let eu = g
906- let ew = parseBigIntValue(l)
907- let cD = (parseBigIntValue(aU) * ew)
908- let cz = if ((gs == false))
909- then [(toBigInt(bN(dj)) + gt), toBigInt(bN(dk))]
910- else [(toBigInt(bN(dk)) + gt), toBigInt(bN(dj))]
911- let ev = cz[0]
912- let cC = ev
913- let cE = (cD * eu)
914- let ex = (((((et * et) / (ev * eu)) * et) * ew) / (cE * eu))
915- let ey = ((cC + ((et * ew) / cE)) - et)
916- func cN (cO,ez) = {
917- let gu = cO
918- let eB = gu._1
919- let dc = gu._2
920- if ((dc != unit))
921- then cO
922- else {
923- let eC = (((eB * eB) + ex) / ((g * eB) + ey))
924- let eD = X((eC - value(eB)))
925- if ((f >= eD))
926- then $Tuple2(eC, ez)
927- else $Tuple2(eC, unit)
928- }
929- }
930-
931- let cT = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
932- let gv = {
933- let cV = cT
934- let cW = size(cV)
935- let cX = $Tuple2(et, unit)
936- func cY (cZ,da) = if ((da >= cW))
937- then cZ
938- else cN(cZ, cV[da])
939-
940- func db (cZ,da) = if ((da >= cW))
941- then cZ
942- else throw("List size exceeds 15")
943-
944- db(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cY(cX, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15)
945- }
946- let eB = gv._1
947- let dc = gv._2
948- if ((dc != unit))
949- then eB
950- else throw(("Y calculation error, Y = " + toString(eB)))
951- }
952-
953-
954-@Callable(cP)
955-func calculateAmountOutForSwapREADONLY (gw,gs,gx) = {
956- let gy = if ((gs == false))
957- then {
958- let gz = aJ(this, ak())
959- let gt = (toBigInt(bN(aJ(this, aj()))) + toBigInt(gw))
960- $Tuple2(gz, gt)
961- }
962- else {
963- let gz = aJ(this, aj())
964- let gt = (toBigInt(bN(aJ(this, ak()))) + toBigInt(gw))
965- $Tuple2(gz, gt)
966- }
967- let gz = gy._1
968- let gt = gy._2
969- let bg = aY()
970- let dj = bg[w]
971- let dk = bg[x]
972- let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))]
973- let et = cy(cz)
974- let eB = gr(gs, et, toBigInt(gw))
975- let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1))
976- let gB = max([0, toInt(gA)])
977- let gC = if ((gs == false))
978- then [((toBigInt(bN(dj)) + toBigInt(gw)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)]
979- else [(toBigInt(bN(dj)) - gA), ((toBigInt(bN(dk)) + toBigInt(gw)) + toBigInt(gx))]
980- let gD = cy(gC)
981- let dY = if ((gD >= et))
982- then true
983- else throw(makeString(["new D is fewer error", toString(et), toString(gD)], "__"))
984- if ((dY == dY))
985- then $Tuple2(nil, gB)
812+@Callable(dM)
813+func constructor (R) = {
814+ let eA = fD(dM)
815+ if ((eA == eA))
816+ then [StringEntry(R(), R)]
986817 else throw("Strict value is not equal to itself.")
987818 }
988819
989820
990821
991-@Callable(cP)
992-func calculateAmountOutForSwapAndSendTokens (gw,gs,gE,gF,gx) = {
993- let gG = {
994- let aS = invoke(aQ, "getSwapContractREADONLY", nil, nil)
995- if ($isInstanceOf(aS, "String"))
996- then aS
997- else throw(($getType(aS) + " couldn't be cast to String"))
998- }
999- let gH = [if ((value(cP.payments[0]).amount >= gw))
1000- then true
1001- else aN("Wrong amount"), if ((cP.caller == addressFromStringValue(gG)))
1002- then true
1003- else aN("Permission denied")]
1004- if ((gH == gH))
822+@Callable(dM)
823+func setManager (fE) = {
824+ let eA = fD(dM)
825+ if ((eA == eA))
1005826 then {
1006- let fk = value(cP.payments[0])
1007- let gI = be(fk.assetId)
1008- let gJ = if ((gs == false))
1009- then {
1010- let gz = aJ(this, ak())
1011- let gt = (bN(gI) - value(cP.payments[0]).amount)
1012- $Tuple2(gz, gt)
1013- }
1014- else {
1015- let gz = aJ(this, aj())
1016- let gt = (bN(gI) - value(cP.payments[0]).amount)
1017- $Tuple2(gz, gt)
1018- }
1019- let gz = gJ._1
1020- let gt = gJ._2
1021- let bg = aY()
1022- let dj = bg[w]
1023- let dk = bg[x]
1024- let cz = if ((gs == false))
1025- then [(toBigInt(bN(dj)) - toBigInt(value(cP.payments[0]).amount)), toBigInt(bN(dk))]
1026- else [toBigInt(bN(dj)), (toBigInt(bN(dk)) - toBigInt(value(cP.payments[0]).amount))]
1027- let et = cy(cz)
1028- let eB = gr(gs, et, toBigInt(0))
1029- let gA = ((toBigInt(bN(gz)) - eB) - toBigInt(1))
1030- let gB = max([0, toInt(gA)])
1031- let gK = if ((gB >= gE))
1032- then true
1033- else throw("Exchange result is fewer coins than expected")
1034- if ((gK == gK))
1035- then {
1036- let gC = if ((gs == false))
1037- then [(toBigInt(bN(dj)) + toBigInt(gx)), (toBigInt(bN(dk)) - gA)]
1038- else [(toBigInt(bN(dj)) - gA), (toBigInt(bN(dk)) + toBigInt(gx))]
1039- let gD = cy(gC)
1040- let dY = if ((gD >= et))
1041- then true
1042- else throw("new D is fewer error")
1043- if ((dY == dY))
1044- then $Tuple2([ScriptTransfer(addressFromStringValue(gF), gB, bc(gz))], gB)
1045- else throw("Strict value is not equal to itself.")
1046- }
827+ let fF = fromBase58String(fE)
828+ if ((fF == fF))
829+ then [StringEntry(T(), fE)]
1047830 else throw("Strict value is not equal to itself.")
1048831 }
1049832 else throw("Strict value is not equal to itself.")
1050833 }
1051834
1052835
1053836
1054-@Callable(cP)
1055-func constructor (Y) = {
1056- let ex = gq(cP)
1057- if ((ex == ex))
1058- then [StringEntry(Y(), Y)]
1059- else throw("Strict value is not equal to itself.")
1060- }
1061-
1062-
1063-
1064-@Callable(cP)
1065-func setManager (gL) = {
1066- let ex = gq(cP)
1067- if ((ex == ex))
837+@Callable(dM)
838+func confirmManager () = {
839+ let cf = fz()
840+ let fG = if (isDefined(cf))
841+ then true
842+ else throw("No pending manager")
843+ if ((fG == fG))
1068844 then {
1069- let gM = fromBase58String(gL)
1070- if ((gM == gM))
1071- then [StringEntry(aa(), gL)]
845+ let fH = if ((dM.callerPublicKey == value(cf)))
846+ then true
847+ else throw("You are not pending manager")
848+ if ((fH == fH))
849+ then [StringEntry(S(), toBase58String(value(cf))), DeleteEntry(T())]
1072850 else throw("Strict value is not equal to itself.")
1073851 }
1074852 else throw("Strict value is not equal to itself.")
1075853 }
1076854
1077855
1078856
1079-@Callable(cP)
1080-func confirmManager () = {
1081- let cu = gm()
1082- let gN = if (isDefined(cu))
1083- then true
1084- else throw("No pending manager")
1085- if ((gN == gN))
1086- then {
1087- let gO = if ((cP.callerPublicKey == value(cu)))
1088- then true
1089- else throw("You are not pending manager")
1090- if ((gO == gO))
1091- then [StringEntry(Z(), toBase58String(value(cu))), DeleteEntry(aa())]
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(cP)
1100-func put (gP,gQ) = {
1101- let gR = bs()
1102- let gS = valueOrErrorMessage(addressFromString(gR[C]), "Wr st addr")
1103- let gT = valueOrErrorMessage(addressFromString(gR[E]), "Wr sl addr")
1104- if ((0 > gP))
857+@Callable(dM)
858+func put (fI,fJ) = {
859+ let fK = bd()
860+ let fL = valueOrErrorMessage(addressFromString(fK[A]), "Wr st addr")
861+ let fM = valueOrErrorMessage(addressFromString(fK[C]), "Wr sl addr")
862+ if ((0 > fI))
1105863 then throw("Wrong slippage")
1106- else if ((size(cP.payments) != 2))
864+ else if ((size(dM.payments) != 2))
1107865 then throw("2 pmnts expd")
1108866 else {
1109- let gU = toBigInt(value(cP.payments[0]).amount)
1110- let gV = toBigInt(value(cP.payments[1]).amount)
1111- let eO = (toBigInt(bN(be(bm))) - gU)
1112- if ((eO == eO))
867+ let fN = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], fI, true, false, true, 0, "")
868+ let dr = fN._2
869+ let fO = fN._7
870+ let cI = fN._9
871+ let ds = fN._10
872+ let dt = fN._11
873+ let cq = fN._12
874+ let cr = fN._13
875+ let de = invoke(aD, "emit", [dr], nil)
876+ if ((de == de))
1113877 then {
1114- let eP = (toBigInt(bN(be(bn))) - gV)
1115- if ((eP == eP))
878+ let fP = {
879+ let av = de
880+ if ($isInstanceOf(av, "Address"))
881+ then {
882+ let fQ = av
883+ invoke(fQ, "emit", [dr], nil)
884+ }
885+ else unit
886+ }
887+ if ((fP == fP))
1116888 then {
1117- let eQ = toBigInt(value(assetInfo(bl)).quantity)
1118- if ((eQ == eQ))
889+ let fR = if ((ds > 0))
890+ then invoke(fM, "put", nil, [AttachedPayment(cq, ds)])
891+ else nil
892+ if ((fR == fR))
1119893 then {
1120- let eR = eK(gU, gV, toBigInt(0))
1121- if ((eR == eR))
894+ let fS = if ((dt > 0))
895+ then invoke(fM, "put", nil, [AttachedPayment(cr, dt)])
896+ else nil
897+ if ((fS == fS))
1122898 then {
1123- let gW = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], gP, true, false, true, 0, "")
1124- let el = gW._2
1125- let gX = gW._7
1126- let dB = gW._9
1127- let em = gW._10
1128- let en = gW._11
1129- let dj = gW._12
1130- let dk = gW._13
1131- let dX = invoke(aQ, "emit", [el], nil)
1132- if ((dX == dX))
899+ let fT = if (fJ)
1133900 then {
1134- let gY = {
1135- let gl = dX
1136- if ($isInstanceOf(gl, "Address"))
1137- then {
1138- let gZ = gl
1139- invoke(gZ, "emit", [el], nil)
1140- }
1141- else unit
1142- }
1143- if ((gY == gY))
1144- then {
1145- let ha = if ((em > 0))
1146- then invoke(gT, "put", nil, [AttachedPayment(dj, em)])
1147- else nil
1148- if ((ha == ha))
1149- then {
1150- let hb = if ((en > 0))
1151- then invoke(gT, "put", nil, [AttachedPayment(dk, en)])
1152- else nil
1153- if ((hb == hb))
1154- then {
1155- let hc = if (gQ)
1156- then {
1157- let hd = invoke(gS, "stake", nil, [AttachedPayment(gX, el)])
1158- if ((hd == hd))
1159- then nil
1160- else throw("Strict value is not equal to itself.")
1161- }
1162- else [ScriptTransfer(cP.caller, el, gX)]
1163- let he = eS(0, 0, 0)
1164- let gi = he._1
1165- let eJ = he._2
1166- let hf = if ((eJ >= eR))
1167- then true
1168- else aN(makeString(["updated DLp lower than current DLp", toString(eO), toString(eP), toString(eQ), toString(eR), toString(eJ), toString(em), toString(en)], " "))
1169- if ((hf == hf))
1170- then {
1171- let hg = value(assetInfo(bl)).quantity
1172- if ((hg == hg))
1173- then ((dB ++ hc) ++ gi)
1174- else throw("Strict value is not equal to itself.")
1175- }
1176- else throw("Strict value is not equal to itself.")
1177- }
1178- else throw("Strict value is not equal to itself.")
1179- }
1180- else throw("Strict value is not equal to itself.")
1181- }
901+ let fU = invoke(fL, "stake", nil, [AttachedPayment(fO, dr)])
902+ if ((fU == fU))
903+ then nil
1182904 else throw("Strict value is not equal to itself.")
1183905 }
1184- else throw("Strict value is not equal to itself.")
906+ else [ScriptTransfer(dM.caller, dr, fO)]
907+ (cI ++ fT)
1185908 }
1186909 else throw("Strict value is not equal to itself.")
1187910 }
1188911 else throw("Strict value is not equal to itself.")
1189912 }
1190913 else throw("Strict value is not equal to itself.")
1191914 }
1192915 else throw("Strict value is not equal to itself.")
1193916 }
1194917 }
1195918
1196919
1197920
1198-@Callable(cP)
1199-func putOneTknV2 (fM,gQ) = {
1200- let hh = {
1201- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1202- if ($isInstanceOf(aS, "Boolean"))
1203- then aS
1204- else throw(($getType(aS) + " couldn't be cast to Boolean"))
921+@Callable(dM)
922+func putOneTknV2 (fg,fJ) = {
923+ let fV = {
924+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
925+ if ($isInstanceOf(aF, "Boolean"))
926+ then aF
927+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
1205928 }
1206- let hi = if (if (if (aV())
929+ let fW = if (if (if (aI())
1207930 then true
1208- else (bk == q))
931+ else (aX == o))
1209932 then true
1210- else (bk == s))
933+ else (aX == q))
1211934 then true
1212- else hh
1213- let gH = [if (if (!(hi))
935+ else fV
936+ let fX = [if (if (!(fW))
1214937 then true
1215- else go(cP))
938+ else fB(dM))
1216939 then true
1217- else aN("put operation is blocked by admin"), if ((size(cP.payments) == 1))
940+ else aB("put operation is blocked by admin"), if ((size(dM.payments) == 1))
1218941 then true
1219- else aN("exactly 1 payment are expected")]
1220- if ((gH == gH))
942+ else aB("exactly 1 payment are expected")]
943+ if ((fX == fX))
1221944 then {
1222- let dj = toBase58String(value(bm))
1223- let dk = toBase58String(value(bn))
1224- let di = bl
1225- let fQ = bo
1226- let fR = bp
1227- let dh = if ((cP.caller == this))
1228- then cP.originCaller
1229- else cP.caller
1230- let fk = value(cP.payments[0])
1231- let df = toBase58String(value(fk.assetId))
1232- let dL = fk.amount
1233- let eR = if ((fk.assetId == bm))
1234- then eK(toBigInt(dL), toBigInt(0), toBigInt(0))
1235- else eK(toBigInt(0), toBigInt(dL), toBigInt(0))
1236- if ((eR == eR))
945+ let aT = aL()
946+ let cq = aT[u]
947+ let cr = aT[v]
948+ let cp = fromBase58String(aT[t])
949+ let fk = parseIntValue(aT[w])
950+ let fl = parseIntValue(aT[x])
951+ let co = if ((dM.caller == this))
952+ then dM.originCaller
953+ else dM.caller
954+ let dN = value(dM.payments[0])
955+ let cm = toBase58String(value(dN.assetId))
956+ let cS = dN.amount
957+ let fY = eH(cS, cm, toString(co), toBase58String(dM.transactionId), true)
958+ if ((fY == fY))
1237959 then {
1238- let hj = fp(dL, df, toString(dh), toBase58String(cP.transactionId), true)
1239- if ((hj == hj))
960+ let cj = fY._3
961+ let cI = fY._2
962+ let fZ = fY._1
963+ let dr = if (if ((fg > 0))
964+ then (fg > fZ)
965+ else false)
966+ then aB(makeString(["amount to receive is less than ", toString(fg)], ""))
967+ else fZ
968+ let fN = invoke(aD, "emit", [dr], nil)
969+ if ((fN == fN))
1240970 then {
1241- let cx = hj._3
1242- let dB = hj._2
1243- let hk = hj._1
1244- let el = if (if ((fM > 0))
1245- then (fM > hk)
1246- else false)
1247- then aN(makeString(["amount to receive is less than ", toString(fM)], ""))
1248- else hk
1249- let gW = invoke(aQ, "emit", [el], nil)
1250- if ((gW == gW))
971+ let fP = {
972+ let av = fN
973+ if ($isInstanceOf(av, "Address"))
974+ then {
975+ let fQ = av
976+ invoke(fQ, "emit", [dr], nil)
977+ }
978+ else unit
979+ }
980+ if ((fP == fP))
1251981 then {
1252- let gY = {
1253- let gl = gW
1254- if ($isInstanceOf(gl, "Address"))
1255- then {
1256- let gZ = gl
1257- invoke(gZ, "emit", [el], nil)
1258- }
1259- else unit
1260- }
1261- if ((gY == gY))
982+ let fT = if (fJ)
1262983 then {
1263- let hc = if (gQ)
1264- then {
1265- let hd = invoke(bu, "stake", nil, [AttachedPayment(di, el)])
1266- if ((hd == hd))
1267- then nil
1268- else throw("Strict value is not equal to itself.")
1269- }
1270- else [ScriptTransfer(cP.caller, el, di)]
1271- let gc = if ((cx > 0))
1272- then [ScriptTransfer(aX, cx, fromBase58String(df))]
1273- else nil
1274- let hl = if ((this == aX))
1275- then $Tuple2(0, 0)
1276- else {
1277- let hm = if ((fk.assetId == bm))
1278- then true
1279- else false
1280- if (hm)
1281- then $Tuple2(-(cx), 0)
1282- else $Tuple2(0, -(cx))
1283- }
1284- let eT = hl._1
1285- let eU = hl._2
1286- let hn = eS(eT, eU, 0)
1287- let gi = hn._1
1288- let eJ = hn._2
1289- let gj = eW(eR, eJ)
1290- if ((gj == gj))
1291- then $Tuple2((((dB ++ hc) ++ gc) ++ gi), el)
984+ let fU = invoke(bf, "stake", nil, [AttachedPayment(cp, dr)])
985+ if ((fU == fU))
986+ then nil
1292987 else throw("Strict value is not equal to itself.")
1293988 }
1294- else throw("Strict value is not equal to itself.")
989+ else [ScriptTransfer(dM.caller, dr, cp)]
990+ let fw = if ((cj > 0))
991+ then [ScriptTransfer(aK, cj, fromBase58String(cm))]
992+ else nil
993+ $Tuple2(((cI ++ fT) ++ fw), dr)
1295994 }
1296995 else throw("Strict value is not equal to itself.")
1297996 }
1298997 else throw("Strict value is not equal to itself.")
1299998 }
1300999 else throw("Strict value is not equal to itself.")
13011000 }
13021001 else throw("Strict value is not equal to itself.")
13031002 }
13041003
13051004
13061005
1307-@Callable(cP)
1308-func putForFree (ho) = if ((0 > ho))
1006+@Callable(dM)
1007+func putForFree (ga) = if ((0 > ga))
13091008 then throw("Wrong slpg")
1310- else if ((size(cP.payments) != 2))
1009+ else if ((size(dM.payments) != 2))
13111010 then throw("2 pmnts expd")
13121011 else {
1313- let hp = fl(toString(cP.caller), toBase58String(cP.transactionId), AttachedPayment(value(cP.payments[0]).assetId, value(cP.payments[0]).amount), cP.payments[1], ho, false, false, true, 0, "")
1314- let dB = hp._9
1315- let gU = toBigInt(value(cP.payments[0]).amount)
1316- let gV = toBigInt(value(cP.payments[1]).amount)
1317- let eR = eK(gU, gV, toBigInt(0))
1318- if ((eR == eR))
1319- then {
1320- let hq = eS(0, 0, 0)
1321- let gi = hq._1
1322- let eJ = hq._2
1323- let gj = eW(eR, eJ)
1324- if ((gj == gj))
1325- then (dB ++ gi)
1326- else throw("Strict value is not equal to itself.")
1327- }
1328- else throw("Strict value is not equal to itself.")
1012+ let gb = dO(toString(dM.caller), toBase58String(dM.transactionId), AttachedPayment(value(dM.payments[0]).assetId, value(dM.payments[0]).amount), dM.payments[1], ga, false, false, true, 0, "")
1013+ gb._9
13291014 }
13301015
13311016
13321017
1333-@Callable(cP)
1018+@Callable(dM)
13341019 func get () = {
1335- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1336- if ((eR == eR))
1020+ let de = dL(dM)
1021+ let gc = de._1
1022+ let cH = de._2
1023+ let cS = de._3
1024+ let cm = de._4
1025+ let cI = de._5
1026+ let eB = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
1027+ if ((eB == eB))
1028+ then cI
1029+ else throw("Strict value is not equal to itself.")
1030+ }
1031+
1032+
1033+
1034+@Callable(dM)
1035+func getOneTknV2 (ff,fg) = {
1036+ let fV = {
1037+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1038+ if ($isInstanceOf(aF, "Boolean"))
1039+ then aF
1040+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
1041+ }
1042+ let gd = if (if (aI())
1043+ then true
1044+ else (aX == q))
1045+ then true
1046+ else fV
1047+ let fX = [if (if (!(gd))
1048+ then true
1049+ else fB(dM))
1050+ then true
1051+ else aB("get operation is blocked by admin"), if ((size(dM.payments) == 1))
1052+ then true
1053+ else aB("exactly 1 payment are expected")]
1054+ if ((fX == fX))
13371055 then {
1338- let dX = fj(cP)
1339- let hr = dX._1
1340- let dA = dX._2
1341- let dL = dX._3
1342- let df = dX._4
1343- let dB = dX._5
1344- let ey = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
1345- if ((ey == ey))
1346- then {
1347- let hs = eS(-(hr), -(dA), 0)
1348- let gi = hs._1
1349- let eJ = hs._2
1350- let gj = eW(eR, eJ)
1351- if ((gj == gj))
1352- then (dB ++ gi)
1353- else throw("Strict value is not equal to itself.")
1354- }
1355- else throw("Strict value is not equal to itself.")
1056+ let ge = fe(ff, fg, dM.payments, dM.caller, dM.originCaller, dM.transactionId)
1057+ let cI = ge._1
1058+ let fp = ge._2
1059+ $Tuple2(cI, fp)
13561060 }
13571061 else throw("Strict value is not equal to itself.")
13581062 }
13591063
13601064
13611065
1362-@Callable(cP)
1363-func getOneTknV2 (fL,fM) = {
1364- let hh = {
1365- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1366- if ($isInstanceOf(aS, "Boolean"))
1367- then aS
1368- else throw(($getType(aS) + " couldn't be cast to Boolean"))
1369- }
1370- let ht = if (if (aV())
1371- then true
1372- else (bk == s))
1373- then true
1374- else hh
1375- let gH = [if (if (!(ht))
1376- then true
1377- else go(cP))
1378- then true
1379- else aN("get operation is blocked by admin"), if ((size(cP.payments) == 1))
1380- then true
1381- else aN("exactly 1 payment are expected")]
1382- if ((gH == gH))
1383- then {
1384- let hu = fK(fL, fM, cP.payments, cP.caller, cP.originCaller, cP.transactionId)
1385- let dB = hu._1
1386- let fV = hu._2
1387- $Tuple2(dB, fV)
1388- }
1389- else throw("Strict value is not equal to itself.")
1066+@Callable(dM)
1067+func getOneTknV2READONLY (ff,gf) = {
1068+ let aT = aL()
1069+ let cq = aT[u]
1070+ let cr = aT[v]
1071+ let cp = aT[t]
1072+ let dT = [toBigInt(by(cq)), toBigInt(by(cr))]
1073+ let gg = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(cp)), "invalid lp asset").quantity)
1074+ let bL = dS(dT)
1075+ let bK = (bL - fraction(toBigInt(gf), bL, gg))
1076+ let gh = if ((ff == cq))
1077+ then 0
1078+ else if ((ff == cr))
1079+ then 1
1080+ else throw("invalid out asset id")
1081+ let gi = ex(dT, gh, bK)
1082+ let gj = (dT[gh] - gi)
1083+ let gk = max([0, toInt((gj - f))])
1084+ let gl = cg(gk, aG)
1085+ let fo = gl._1
1086+ let cj = gl._2
1087+ $Tuple2(nil, $Tuple2(fo, cj))
13901088 }
13911089
13921090
13931091
1394-@Callable(cP)
1395-func refreshDLp () = {
1396- let hv = valueOrElse(getInteger(aq), 0)
1397- let hw = if (((height - hv) >= at))
1398- then unit
1399- else aN(makeString([toString(at), " blocks have not passed since the previous call"], ""))
1400- if ((hw == hw))
1401- then {
1402- let fd = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ap), "0")), aP("invalid dLp"))
1403- let hx = eS(0, 0, 0)
1404- let hy = hx._1
1405- let eJ = hx._2
1406- let eV = if ((fd != eJ))
1407- then hy
1408- else aN("nothing to refresh")
1409- $Tuple2(eV, toString(eJ))
1410- }
1411- else throw("Strict value is not equal to itself.")
1092+@Callable(dM)
1093+func getOneTknV2WithBonusREADONLY (ff,gf) = {
1094+ let aT = aL()
1095+ let cq = aT[u]
1096+ let cr = aT[v]
1097+ let cp = aT[t]
1098+ let cw = by(cq)
1099+ let cy = by(cr)
1100+ let gm = {
1101+ let aF = invoke(this, "getOneTknV2READONLY", [ff, gf], nil)
1102+ if ($isInstanceOf(aF, "(Int, Int)"))
1103+ then aF
1104+ else throw(($getType(aF) + " couldn't be cast to (Int, Int)"))
1105+ }
1106+ let fo = gm._1
1107+ let cj = gm._2
1108+ let de = ck("", cp, gf, this)
1109+ let cG = de._1
1110+ let cH = de._2
1111+ let gn = (cG + cH)
1112+ let fd = if ((gn == 0))
1113+ then if ((fo == 0))
1114+ then 0
1115+ else throw("bonus calculation error")
1116+ else fraction((fo - gn), a, gn)
1117+ $Tuple2(nil, $Tuple3(fo, cj, fd))
14121118 }
14131119
14141120
14151121
1416-@Callable(cP)
1417-func getOneTknV2READONLY (fL,hz) = {
1418- let dj = toBase58String(value(bm))
1419- let dk = toBase58String(value(bn))
1420- let di = toBase58String(value(bl))
1421- let cz = [toBigInt(bN(dj)), toBigInt(bN(dk))]
1422- let eI = toBigInt(valueOrErrorMessage(assetInfo(fromBase58String(di)), "invalid lp asset").quantity)
1423- let cb = cy(cz)
1424- let ca = (cb - fraction(toBigInt(hz), cb, eI))
1425- let hA = if ((fL == dj))
1426- then 0
1427- else if ((fL == dk))
1428- then 1
1429- else throw("invalid out asset id")
1430- let hB = es(cz, hA, ca)
1431- let gA = (cz[hA] - hB)
1432- let gB = max([0, toInt((gA - f))])
1433- let hC = cv(gB, aT)
1434- let fU = hC._1
1435- let cx = hC._2
1436- $Tuple2(nil, $Tuple2(fU, cx))
1437- }
1438-
1439-
1440-
1441-@Callable(cP)
1442-func getOneTknV2WithBonusREADONLY (fL,hz) = {
1443- let dj = toBase58String(value(bm))
1444- let dk = toBase58String(value(bn))
1445- let di = toBase58String(value(bl))
1446- let dp = bN(dj)
1447- let dr = bN(dk)
1448- let hD = {
1449- let aS = invoke(this, "getOneTknV2READONLY", [fL, hz], nil)
1450- if ($isInstanceOf(aS, "(Int, Int)"))
1451- then aS
1452- else throw(($getType(aS) + " couldn't be cast to (Int, Int)"))
1453- }
1454- let fU = hD._1
1455- let cx = hD._2
1456- let dX = dd("", di, hz, this)
1457- let dz = dX._1
1458- let dA = dX._2
1459- let hE = (dz + dA)
1460- let fJ = if ((hE == 0))
1461- then if ((fU == 0))
1462- then 0
1463- else throw("bonus calculation error")
1464- else fraction((fU - hE), a, hE)
1465- $Tuple2(nil, $Tuple3(fU, cx, fJ))
1466- }
1467-
1468-
1469-
1470-@Callable(cP)
1471-func getNoLess (hF,hG) = {
1472- let dX = fj(cP)
1473- let dz = dX._1
1474- let dA = dX._2
1475- let dL = dX._3
1476- let df = dX._4
1477- let dB = dX._5
1478- if ((hF > dz))
1479- then throw(((("Failed: " + toString(dz)) + " < ") + toString(hF)))
1480- else if ((hG > dA))
1481- then throw(((("Failed: " + toString(dA)) + " < ") + toString(hG)))
1122+@Callable(dM)
1123+func getNoLess (go,gp) = {
1124+ let de = dL(dM)
1125+ let cG = de._1
1126+ let cH = de._2
1127+ let cS = de._3
1128+ let cm = de._4
1129+ let cI = de._5
1130+ if ((go > cG))
1131+ then throw(((("Failed: " + toString(cG)) + " < ") + toString(go)))
1132+ else if ((gp > cH))
1133+ then throw(((("Failed: " + toString(cH)) + " < ") + toString(gp)))
14821134 else {
1483- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1484- if ((eR == eR))
1485- then {
1486- let hH = invoke(aQ, "burn", [dL], [AttachedPayment(df, dL)])
1487- if ((hH == hH))
1488- then {
1489- let hI = eS(-(dz), -(dA), 0)
1490- let gi = hI._1
1491- let eJ = hI._2
1492- let gj = eW(eR, eJ)
1493- if ((gj == gj))
1494- then (dB ++ gi)
1495- else throw("Strict value is not equal to itself.")
1496- }
1497- else throw("Strict value is not equal to itself.")
1498- }
1135+ let gq = invoke(aD, "burn", [cS], [AttachedPayment(cm, cS)])
1136+ if ((gq == gq))
1137+ then cI
14991138 else throw("Strict value is not equal to itself.")
15001139 }
15011140 }
15021141
15031142
15041143
1505-@Callable(cP)
1506-func unstakeAndGet (cw) = {
1507- let hJ = if ((size(cP.payments) != 0))
1144+@Callable(dM)
1145+func unstakeAndGet (ch) = {
1146+ let gr = if ((size(dM.payments) != 0))
15081147 then throw("No pmnts expd")
15091148 else true
1510- if ((hJ == hJ))
1149+ if ((gr == gr))
15111150 then {
1512- let hK = bs()
1513- let gX = bl
1514- let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr")
1515- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1516- if ((eR == eR))
1151+ let bX = aL()
1152+ let gs = bd()
1153+ let fO = fromBase58String(bX[t])
1154+ let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr")
1155+ let gu = invoke(gt, "unstake", [toBase58String(fO), ch], nil)
1156+ if ((gu == gu))
15171157 then {
1518- let hM = invoke(hL, "unstake", [toBase58String(gX), cw], nil)
1519- if ((hM == hM))
1158+ let de = ck(toBase58String(dM.transactionId), toBase58String(fO), ch, dM.caller)
1159+ let cu = parseIntValue(de._9)
1160+ let cI = de._10
1161+ let gv = if (if (aI())
1162+ then true
1163+ else (cu == q))
1164+ then throw(("Blocked: " + toString(cu)))
1165+ else true
1166+ if ((gv == gv))
15201167 then {
1521- let dX = dd(toBase58String(cP.transactionId), toBase58String(gX), cw, cP.caller)
1522- let dz = dX._1
1523- let dA = dX._2
1524- let dn = parseIntValue(dX._9)
1525- let dB = dX._10
1526- let hN = if (if (aV())
1527- then true
1528- else (dn == s))
1529- then throw(("Blocked: " + toString(dn)))
1530- else true
1531- if ((hN == hN))
1532- then {
1533- let hO = invoke(aQ, "burn", [cw], [AttachedPayment(gX, cw)])
1534- if ((hO == hO))
1535- then {
1536- let hP = eS(-(dz), -(dA), 0)
1537- let gi = hP._1
1538- let eJ = hP._2
1539- let gj = eW(eR, eJ)
1540- if ((gj == gj))
1541- then (dB ++ gi)
1542- else throw("Strict value is not equal to itself.")
1543- }
1544- else throw("Strict value is not equal to itself.")
1545- }
1168+ let gw = invoke(aD, "burn", [ch], [AttachedPayment(fO, ch)])
1169+ if ((gw == gw))
1170+ then cI
15461171 else throw("Strict value is not equal to itself.")
15471172 }
15481173 else throw("Strict value is not equal to itself.")
15491174 }
15501175 else throw("Strict value is not equal to itself.")
15511176 }
15521177 else throw("Strict value is not equal to itself.")
15531178 }
15541179
15551180
15561181
1557-@Callable(cP)
1558-func unstakeAndGetNoLess (hQ,hR,hG) = {
1559- let ht = if (aV())
1182+@Callable(dM)
1183+func unstakeAndGetNoLess (gx,gy,gp) = {
1184+ let gd = if (aI())
15601185 then true
1561- else (bk == s)
1562- let gH = [if (!(ht))
1186+ else (aX == q)
1187+ let fX = [if (!(gd))
15631188 then true
1564- else throw("get operation is blocked by admin"), if ((size(cP.payments) == 0))
1189+ else throw("get operation is blocked by admin"), if ((size(dM.payments) == 0))
15651190 then true
15661191 else throw("no payments are expected")]
1567- if ((gH == gH))
1192+ if ((fX == fX))
15681193 then {
1569- let eR = eK(toBigInt(0), toBigInt(0), toBigInt(0))
1570- if ((eR == eR))
1194+ let gu = invoke(bf, "unstake", [toBase58String(aY), gx], nil)
1195+ if ((gu == gu))
15711196 then {
1572- let hM = invoke(bu, "unstake", [toBase58String(bl), hQ], nil)
1573- if ((hM == hM))
1197+ let gz = ck(toBase58String(dM.transactionId), toBase58String(aY), gx, dM.caller)
1198+ let cG = gz._1
1199+ let cH = gz._2
1200+ let cI = gz._10
1201+ let gA = [if ((cG >= gy))
1202+ then true
1203+ else throw(makeString(["amount asset amount to receive is less than ", toString(gy)], "")), if ((cH >= gp))
1204+ then true
1205+ else throw(makeString(["price asset amount to receive is less than ", toString(gp)], ""))]
1206+ if ((gA == gA))
15741207 then {
1575- let hS = dd(toBase58String(cP.transactionId), toBase58String(bl), hQ, cP.caller)
1576- let dz = hS._1
1577- let dA = hS._2
1578- let dB = hS._10
1579- let hT = [if ((dz >= hR))
1580- then true
1581- else throw(makeString(["amount asset amount to receive is less than ", toString(hR)], "")), if ((dA >= hG))
1582- then true
1583- else throw(makeString(["price asset amount to receive is less than ", toString(hG)], ""))]
1584- if ((hT == hT))
1585- then {
1586- let hH = invoke(aQ, "burn", [hQ], [AttachedPayment(bl, hQ)])
1587- if ((hH == hH))
1588- then {
1589- let hU = eS(-(dz), -(dA), 0)
1590- let gi = hU._1
1591- let eJ = hU._2
1592- let gj = eW(eR, eJ)
1593- if ((gj == gj))
1594- then (dB ++ gi)
1595- else throw("Strict value is not equal to itself.")
1596- }
1597- else throw("Strict value is not equal to itself.")
1598- }
1208+ let gq = invoke(aD, "burn", [gx], [AttachedPayment(aY, gx)])
1209+ if ((gq == gq))
1210+ then cI
15991211 else throw("Strict value is not equal to itself.")
16001212 }
16011213 else throw("Strict value is not equal to itself.")
16021214 }
16031215 else throw("Strict value is not equal to itself.")
16041216 }
16051217 else throw("Strict value is not equal to itself.")
16061218 }
16071219
16081220
16091221
1610-@Callable(cP)
1611-func unstakeAndGetOneTknV2 (hQ,fL,fM) = {
1612- let hh = {
1613- let aS = invoke(aQ, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1614- if ($isInstanceOf(aS, "Boolean"))
1615- then aS
1616- else throw(($getType(aS) + " couldn't be cast to Boolean"))
1222+@Callable(dM)
1223+func unstakeAndGetOneTknV2 (gx,ff,fg) = {
1224+ let fV = {
1225+ let aF = invoke(aD, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil)
1226+ if ($isInstanceOf(aF, "Boolean"))
1227+ then aF
1228+ else throw(($getType(aF) + " couldn't be cast to Boolean"))
16171229 }
1618- let ht = if (if (aV())
1230+ let gd = if (if (aI())
16191231 then true
1620- else (bk == s))
1232+ else (aX == q))
16211233 then true
1622- else hh
1623- let gH = [if (if (!(ht))
1234+ else fV
1235+ let fX = [if (if (!(gd))
16241236 then true
1625- else go(cP))
1237+ else fB(dM))
16261238 then true
1627- else aN("get operation is blocked by admin"), if ((size(cP.payments) == 0))
1239+ else aB("get operation is blocked by admin"), if ((size(dM.payments) == 0))
16281240 then true
1629- else aN("no payments are expected")]
1630- if ((gH == gH))
1241+ else aB("no payments are expected")]
1242+ if ((fX == fX))
16311243 then {
1632- let hK = bs()
1633- let gX = bl
1634- let hL = valueOrErrorMessage(addressFromString(hK[C]), "Wr st addr")
1635- let hM = invoke(hL, "unstake", [toBase58String(gX), hQ], nil)
1636- if ((hM == hM))
1244+ let bX = aL()
1245+ let gs = bd()
1246+ let fO = fromBase58String(bX[t])
1247+ let gt = valueOrErrorMessage(addressFromString(gs[A]), "Wr st addr")
1248+ let co = dM.caller
1249+ let gB = this
1250+ let gu = invoke(gt, "unstakeINTERNAL", [fO, gx, co.bytes, gB.bytes], nil)
1251+ if ((gu == gu))
16371252 then {
1638- let hV = fK(fL, fM, [AttachedPayment(gX, hQ)], cP.caller, cP.originCaller, cP.transactionId)
1639- let dB = hV._1
1640- let fV = hV._2
1641- $Tuple2(dB, fV)
1253+ let gC = fe(ff, fg, [AttachedPayment(fO, gx)], dM.caller, dM.originCaller, dM.transactionId)
1254+ let cI = gC._1
1255+ let fp = gC._2
1256+ $Tuple2(cI, fp)
16421257 }
16431258 else throw("Strict value is not equal to itself.")
16441259 }
16451260 else throw("Strict value is not equal to itself.")
16461261 }
16471262
16481263
16491264
1650-@Callable(cP)
1651-func putOneTknV2WithBonusREADONLY (hW,hX) = {
1652- let hY = fp(hW, hX, "", "", true)
1653- let fE = hY._1
1654- let dB = hY._2
1655- let cx = hY._3
1656- let fJ = hY._4
1657- $Tuple2(nil, $Tuple3(fE, cx, fJ))
1265+@Callable(dM)
1266+func putOneTknV2WithBonusREADONLY (gD,gE) = {
1267+ let aT = aL()
1268+ let cq = aT[u]
1269+ let cr = aT[v]
1270+ let cp = aT[t]
1271+ let gF = eH(gD, gE, "", "", true)
1272+ let eY = gF._1
1273+ let cI = gF._2
1274+ let cj = gF._3
1275+ let fd = gF._4
1276+ $Tuple2(nil, $Tuple3(eY, cj, fd))
16581277 }
16591278
16601279
16611280
1662-@Callable(cP)
1663-func putOneTknV2WithoutTakeFeeREADONLY (hW,hX) = {
1664- let hZ = fp(hW, hX, "", "", false)
1665- let fE = hZ._1
1666- let dB = hZ._2
1667- let cx = hZ._3
1668- let fJ = hZ._4
1669- $Tuple2(nil, $Tuple3(fE, cx, fJ))
1281+@Callable(dM)
1282+func putOneTknV2WithoutTakeFeeREADONLY (gD,gE) = {
1283+ let aT = aL()
1284+ let cq = aT[u]
1285+ let cr = aT[v]
1286+ let cp = aT[t]
1287+ let gG = eH(gD, gE, "", "", false)
1288+ let eY = gG._1
1289+ let cI = gG._2
1290+ let cj = gG._3
1291+ let fd = gG._4
1292+ $Tuple2(nil, $Tuple3(eY, cj, fd))
16701293 }
16711294
16721295
16731296
1674-@Callable(cP)
1675-func activate (ia,ib) = if ((toString(cP.caller) != toString(aQ)))
1297+@Callable(dM)
1298+func activate (gH,gI) = if ((toString(dM.caller) != toString(aD)))
16761299 then throw("denied")
1677- else $Tuple2([StringEntry(aj(), ia), StringEntry(ak(), ib)], "success")
1300+ else $Tuple2([StringEntry(ac(), gH), StringEntry(ad(), gI)], "success")
16781301
16791302
16801303
1681-@Callable(cP)
1682-func setS (ic,hN) = if ((toString(cP.caller) != aJ(this, am())))
1683- then gn
1684- else [StringEntry(ic, hN)]
1304+@Callable(dM)
1305+func setS (gJ,gv) = if ((toString(dM.caller) != ax(this, af())))
1306+ then fA
1307+ else [StringEntry(gJ, gv)]
16851308
16861309
16871310
1688-@Callable(cP)
1689-func setI (ic,hN) = if ((toString(cP.caller) != aJ(this, am())))
1690- then gn
1691- else [IntegerEntry(ic, hN)]
1311+@Callable(dM)
1312+func setI (gJ,gv) = if ((toString(dM.caller) != ax(this, af())))
1313+ then fA
1314+ else [IntegerEntry(gJ, gv)]
16921315
16931316
16941317
1695-@Callable(cP)
1696-func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aY())
1318+@Callable(dM)
1319+func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aL())
16971320
16981321
16991322
1700-@Callable(cP)
1701-func getAccBalanceWrapperREADONLY (bO) = $Tuple2(nil, bN(bO))
1323+@Callable(dM)
1324+func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz))
17021325
17031326
17041327
1705-@Callable(cP)
1706-func calcPricesWrapperREADONLY (ch,ci,cm) = {
1707- let id = cl(ch, ci, cm)
1708- $Tuple2(nil, [toString(id[0]), toString(id[1]), toString(id[2])])
1328+@Callable(dM)
1329+func calcPricesWrapperREADONLY (bR,bS,bW) = {
1330+ let gK = bV(bR, bS, bW)
1331+ $Tuple2(nil, [toString(gK[0]), toString(gK[1]), toString(gK[2])])
17091332 }
17101333
17111334
17121335
1713-@Callable(cP)
1714-func fromX18WrapperREADONLY (M,ie) = $Tuple2(nil, L(parseBigIntValue(M), ie))
1336+@Callable(dM)
1337+func fromX18WrapperREADONLY (J,gL) = $Tuple2(nil, I(parseBigIntValue(J), gL))
17151338
17161339
17171340
1718-@Callable(cP)
1719-func toX18WrapperREADONLY (I,J) = $Tuple2(nil, toString(H(I, J)))
1341+@Callable(dM)
1342+func toX18WrapperREADONLY (G,H) = $Tuple2(nil, toString(F(G, H)))
17201343
17211344
17221345
1723-@Callable(cP)
1724-func calcPriceBigIntWrapperREADONLY (bQ,bR) = $Tuple2(nil, toString(bP(parseBigIntValue(bQ), parseBigIntValue(bR))))
1346+@Callable(dM)
1347+func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC))))
17251348
17261349
17271350
1728-@Callable(cP)
1729-func estimatePutOperationWrapperREADONLY (de,bW,dD,dE,dF,dG,if,dH,dI) = $Tuple2(nil, dC(de, bW, dD, dE, dF, dG, if, dH, dI, true, false, 0, ""))
1351+@Callable(dM)
1352+func estimatePutOperationWrapperREADONLY (cl,bG,cK,cL,cM,cN,gM,cO,cP) = $Tuple2(nil, cJ(cl, bG, cK, cL, cM, cN, gM, cO, cP, true, false, 0, ""))
17301353
17311354
17321355
1733-@Callable(cP)
1734-func estimateGetOperationWrapperREADONLY (de,ig,dg,if) = {
1735- let dX = dd(de, ig, dg, addressFromStringValue(if))
1736- $Tuple2(nil, $Tuple10(dX._1, dX._2, dX._3, dX._4, dX._5, dX._6, dX._7, toString(dX._8), dX._9, dX._10))
1356+@Callable(dM)
1357+func estimateGetOperationWrapperREADONLY (cl,gN,cn,gM) = {
1358+ let de = ck(cl, gN, cn, addressFromStringValue(gM))
1359+ $Tuple2(nil, $Tuple10(de._1, de._2, de._3, de._4, de._5, de._6, de._7, toString(de._8), de._9, de._10))
17371360 }
17381361
17391362
1740-@Verifier(ih)
1741-func ii () = {
1742- let ij = {
1743- let gl = gk()
1744- if ($isInstanceOf(gl, "ByteVector"))
1363+@Verifier(gO)
1364+func gP () = {
1365+ let gQ = {
1366+ let av = fy()
1367+ if ($isInstanceOf(av, "ByteVector"))
17451368 then {
1746- let gp = gl
1747- gp
1369+ let fC = av
1370+ fC
17481371 }
1749- else if ($isInstanceOf(gl, "Unit"))
1750- then ih.senderPublicKey
1372+ else if ($isInstanceOf(av, "Unit"))
1373+ then gO.senderPublicKey
17511374 else throw("Match error")
17521375 }
1753- let gl = ih
1754- if ($isInstanceOf(gl, "Order"))
1376+ let av = gO
1377+ if ($isInstanceOf(av, "Order"))
17551378 then {
1756- let eZ = gl
1757- let ik = aW()
1758- let il = eY(eZ)
1759- let aF = il._1
1760- let aG = il._2
1761- let aH = sigVerify(eZ.bodyBytes, eZ.proofs[0], eZ.senderPublicKey)
1762- let aI = sigVerify(eZ.bodyBytes, eZ.proofs[1], ik)
1763- if (if (if (aF)
1764- then aH
1379+ let dz = av
1380+ let gR = aJ()
1381+ let gS = dy(dz)
1382+ let gT = sigVerify(dz.bodyBytes, dz.proofs[0], dz.senderPublicKey)
1383+ let gU = sigVerify(dz.bodyBytes, dz.proofs[1], gR)
1384+ if (if (if (gS)
1385+ then gT
17651386 else false)
1766- then aI
1387+ then gU
17671388 else false)
17681389 then true
1769- else aE(aF, aG, aH, aI)
1390+ else aq(gS, gT, gU)
17701391 }
1771- else if ($isInstanceOf(gl, "SetScriptTransaction"))
1392+ else if ($isInstanceOf(av, "SetScriptTransaction"))
17721393 then {
1773- let cC = gl
1774- if (sigVerify(ih.bodyBytes, ih.proofs[0], ij))
1394+ let dZ = av
1395+ let gV = blake2b256(value(dZ.script))
1396+ let gW = fromBase64String(value(getString(aD, ao())))
1397+ let gX = scriptHash(this)
1398+ if (if ((gW == gV))
1399+ then (gX != gV)
1400+ else false)
17751401 then true
1776- else {
1777- let im = blake2b256(value(cC.script))
1778- let in = fromBase64String(value(getString(aQ, aC())))
1779- let io = scriptHash(this)
1780- if ((in == im))
1781- then (io != im)
1782- else false
1783- }
1402+ else sigVerify(gO.bodyBytes, gO.proofs[0], gQ)
17841403 }
1785- else sigVerify(ih.bodyBytes, ih.proofs[0], ij)
1404+ else sigVerify(gO.bodyBytes, gO.proofs[0], gQ)
17861405 }
17871406

github/deemru/w8io/169f3d6 
353.27 ms