tx · 4pR4WMVkoy5Vdw78TFaDcVzNet1D6njooHyMwMbnMvMH

3MwgVcc26F1kRAfYdaHr3ZXkWCmRi3bPcAY:  -0.04200000 Waves

2023.07.19 15:53 [2672772] smart account 3MwgVcc26F1kRAfYdaHr3ZXkWCmRi3bPcAY > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
320.63 ms