tx · GDKW3UDDBE6382rTSZo4yK5ZTPhWHDHpKEdvS7t8516c

3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS:  -0.01300000 Waves

2023.03.30 12:34 [2512505] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves

{ "type": 13, "id": "GDKW3UDDBE6382rTSZo4yK5ZTPhWHDHpKEdvS7t8516c", "fee": 1300000, "feeAssetId": null, "timestamp": 1680168870148, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "3n9Sb5gR9PRxf1ng35EPFxjidcwKAPv5hM5tNiWx5cRYvt8T6MDR9CHK4K5E85UdqqdFAudqdoEpH7Li9vrbMwKw" ], "script": "base64:BgIcCAISBQoDCAEIEgMKAQgSAwoBCBIHCgUICAEBASkAC1NGX1BPU19UWVBFAgJTRgALV1hfUE9TX1RZUEUCAldYAAZTQ0FMRTgAgMLXLwAKRkVFX1NDQUxFNgDAhD0AFGtTRlBvb2xBQXNzZXRCYWxhbmNlAg9BX2Fzc2V0X2JhbGFuY2UAFGtTRlBvb2xCQXNzZXRCYWxhbmNlAg9CX2Fzc2V0X2JhbGFuY2UAD2tTRlBvb2xBQXNzZXRJZAIKQV9hc3NldF9pZAAPa1NGUG9vbEJBc3NldElkAgpCX2Fzc2V0X2lkAA5rU0ZQb29sU2hhcmVJZAIOc2hhcmVfYXNzZXRfaWQAEGtTRkZhcm1pbmdTdGFrZWQCFF9zaGFyZV90b2tlbnNfbG9ja2VkAA1rVXNlclBvc2l0aW9uAg5fdXNlcl9wb3NpdGlvbgARa1VzZXJQb3NpdGlvblR5cGUCE191c2VyX3Bvc2l0aW9uX3R5cGUAEGtVc2VyUG9zaXRpb25OdW0CFV91c2VyX3Bvc2l0aW9uX251bWJlcgAOa1RvdGFsUG9zaXRpb24CD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ZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmoGuyN", "height": 2512505, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 46drfk4cqfd98yHBmxgEe9oJDMQ4by34r7Nw4bgQoGFp Next: 7W9rSazdqpfwrYAQFrUZxSrVEtRZUeS1At15QEx6x1wd Diff:
OldNewDifferences
1919
2020 let i = "share_asset_id"
2121
22-let j = "version"
22+let j = "_share_tokens_locked"
2323
24-let k = "_share_tokens_locked"
24+let k = "_user_position"
2525
26-let l = "_user_position"
26+let l = "_user_position_type"
2727
28-let m = "_user_position_type"
28+let m = "_user_position_number"
2929
30-let n = "_user_position_number"
30+let n = "_total_position"
3131
32-let o = "_total_position"
32+let o = "_axly_fee_without_loan"
3333
34-let p = "_axly_fee_without_loan"
34+let p = "_axly_fee_with_loan"
3535
36-let q = "_axly_fee_with_loan"
36+let q = "_axly_fee_cap"
3737
38-let r = "_axly_fee_cap"
38+let r = "_request_id"
3939
40-let s = "_request_id"
40+let s = "requests_iter"
4141
42-let t = "requests_iter"
42+let t = "pool_"
4343
44-let u = "pool_"
44+let u = "axly_money_box"
4545
46-let v = "axly_money_box"
46+let v = "swopfi_farming_addr"
4747
48-let w = "swopfi_farming_addr"
48+let w = "lend_service_addr"
4949
50-let x = "lend_service_addr"
50+let x = "price_oracle"
5151
52-let y = Address(fromBase58String(valueOrErrorMessage(getString(this, v), "No axly moneyBox address")))
52+let y = Address(fromBase58String(valueOrErrorMessage(getString(this, u), "No axly moneyBox address")))
5353
54-func z (A) = if ((A.caller == this))
54+let z = Address(fromBase58String(valueOrErrorMessage(getString(this, x), "No price oracle address")))
55+
56+func A (B) = if ((B.caller == this))
5557 then unit
5658 else throw("Only contract itself can call this function")
5759
5860
59-func B (C) = {
60- let D = C
61- if ($isInstanceOf(D, "ByteVector"))
61+func C (D) = {
62+ let E = D
63+ if ($isInstanceOf(E, "ByteVector"))
6264 then {
63- let E = D
64- assetBalance(this, E)
65+ let F = E
66+ assetBalance(this, F)
6567 }
66- else if ($isInstanceOf(D, "Unit"))
68+ else if ($isInstanceOf(E, "Unit"))
6769 then {
68- let F = D
70+ let G = E
6971 wavesBalance(this).available
7072 }
7173 else throw("Match error")
7274 }
7375
7476
75-func G (H) = $Tuple5(valueOrErrorMessage(getString(H, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(H, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(H, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(H, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(H, i), "Can't get share asset id"))
77+func H (I) = $Tuple5(valueOrErrorMessage(getString(I, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(I, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(I, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(I, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(I, i), "Can't get share asset id"))
7678
7779
78-func I (H) = $Tuple5(valueOrErrorMessage(getString(H, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(H, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(H, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(H, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(H, i), "Can't get share asset id"))
80+func J (I) = {
81+ let K = {
82+ let L = invoke(I, "getPoolConfigWrapperREADONLY", nil, nil)
83+ if ($isInstanceOf(L, "List[Any]"))
84+ then L
85+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
86+ }
87+ if ((K == K))
88+ then $Tuple5(valueOrErrorMessage({
89+ let L = K[4]
90+ if ($isInstanceOf(L, "String"))
91+ then L
92+ else unit
93+ }, "Can't get pool A asset id"), valueOrErrorMessage({
94+ let L = K[5]
95+ if ($isInstanceOf(L, "String"))
96+ then L
97+ else unit
98+ }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({
99+ let L = K[3]
100+ if ($isInstanceOf(L, "String"))
101+ then L
102+ else unit
103+ }, "Can't get pool LP asset id"))
104+ else throw("Strict value is not equal to itself.")
105+ }
79106
80107
81-func J (K) = valueOrElse(getInteger(this, (K + o)), 0)
108+func M (N) = valueOrElse(getInteger(this, (N + n)), 0)
82109
83110
84-func L (K,M) = (valueOrElse(getInteger(this, (((K + "_") + M) + n)), 0) + 1)
111+func O (N,P) = (valueOrElse(getInteger(this, (((N + "_") + P) + m)), 0) + 1)
85112
86113
87-func N (K,O) = if (O)
88- then getIntegerValue(this, (K + q))
89- else getIntegerValue(this, (K + p))
114+func Q (N,R) = if (R)
115+ then getIntegerValue(this, (N + p))
116+ else getIntegerValue(this, (N + o))
90117
91118
92-func P () = Address(fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get swopfi farming addr")))
119+func S () = Address(fromBase58String(valueOrErrorMessage(getString(this, v), "Can't get swopfi farming addr")))
93120
94121
95-func Q () = Address(fromBase58String(valueOrErrorMessage(getString(this, x), "Can't get lend service addr")))
122+func T (I) = {
123+ let U = Address(fromBase58String(valueOrElse(getString(I, "%s__factoryContract"), "Can't get WX factory contract addr")))
124+ let V = split(valueOrElse(getString(U, "%s__factoryConfig"), "Can't get WX factory cfg"), "__")
125+ Address(fromBase58String(V[1]))
126+ }
96127
97128
98-func R (C) = {
99- let D = C
100- if ($isInstanceOf(D, "ByteVector"))
129+func W () = Address(fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get lend service addr")))
130+
131+
132+func X (D) = {
133+ let E = D
134+ if ($isInstanceOf(E, "ByteVector"))
101135 then {
102- let E = D
103- toBase58String(E)
136+ let F = E
137+ toBase58String(F)
104138 }
105- else if ($isInstanceOf(D, "Unit"))
139+ else if ($isInstanceOf(E, "Unit"))
106140 then {
107- let F = D
141+ let G = E
108142 "WAVES"
109143 }
110144 else throw("Match error")
111145 }
112146
113147
114-func S (C) = if ((C == "WAVES"))
148+func Y (D) = if ((D == "WAVES"))
115149 then unit
116- else fromBase58String(C)
150+ else fromBase58String(D)
117151
118152
119-func T (M,K,O,U,V,W,X,Y,Z,aa,ab,ac) = {
120- let ad = B(fromBase58String(aa))
121- if ((ad == ad))
153+func Z (D) = if ((D == "WAVES"))
154+ then 8
155+ else {
156+ let E = assetInfo(fromBase58String(D))
157+ if ($isInstanceOf(E, "Asset"))
158+ then {
159+ let aa = E
160+ aa.decimals
161+ }
162+ else throw("Can't find asset")
163+ }
164+
165+
166+func ab (P,N,R,ac,ad,ae,af,ag,ah,ai) = {
167+ let aj = C(fromBase58String(ai))
168+ if ((aj == aj))
122169 then {
123- let H = Address(fromBase58String(K))
124- let ae = fraction(c, U, Y)
125- let af = fraction(c, W, Z)
126- let ag = if ((af > ae))
170+ let I = Address(fromBase58String(N))
171+ let ak = fraction(c, ac, ag)
172+ let al = fraction(c, ae, ah)
173+ let am = if ((al > ak))
127174 then {
128- let ah = fraction(Z, ae, c, CEILING)
129- $Tuple4(U, ah, (W - ah), X)
175+ let an = fraction(ah, ak, c, CEILING)
176+ $Tuple4(ac, an, (ae - an), af)
130177 }
131178 else {
132- let ah = fraction(Y, af, c, CEILING)
133- $Tuple4(ah, W, (U - ah), V)
179+ let an = fraction(ag, al, c, CEILING)
180+ $Tuple4(an, ae, (ac - an), ad)
134181 }
135- let ai = ag._1
136- let aj = ag._2
137- let ak = ag._3
138- let al = ag._4
139- let am = getStringValue(H, "version")
140- let an = if (if ((ai > 0))
141- then (aj > 0)
182+ let ao = am._1
183+ let ap = am._2
184+ let aq = am._3
185+ let ar = am._4
186+ let as = if (if ((ao > 0))
187+ then (ap > 0)
142188 else false)
143189 then {
144- let ao = [AttachedPayment(S(V), ai), AttachedPayment(S(X), aj)]
145- if ((am == "1.0.0"))
146- then invoke(H, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], ao)
147- else if ((am == "2.0.0"))
148- then invoke(H, "replenishWithTwoTokensV2", [false, 0], ao)
149- else throw("Wrong pool type")
190+ let at = [AttachedPayment(Y(ad), ao), AttachedPayment(Y(af), ap)]
191+ invoke(I, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], at)
150192 }
151193 else 0
152- if ((an == an))
194+ if ((as == as))
153195 then {
154- let ap = if ((ak > 0))
196+ let au = if ((aq > 0))
155197 then {
156- let ao = [AttachedPayment(S(al), ak)]
157- if ((am == "1.0.0"))
158- then {
159- let aq = ["0", "false", "0"]
160- invoke(H, "callFunction", ["replenishWithOneToken", aq], ao)
161- }
162- else if ((am == "2.0.0"))
163- then {
164- let aq = [ab, ac, false, 0]
165- invoke(H, "replenishWithOneTokenV2", [false, 0], ao)
166- }
167- else throw("Wrong pool type")
198+ let at = [AttachedPayment(Y(ar), aq)]
199+ let av = ["0", "false", "0"]
200+ invoke(I, "replenishWithOneTokenV2", [false, 0], at)
168201 }
169202 else 0
170- if ((ap == ap))
203+ if ((au == au))
171204 then {
172- let ar = B(fromBase58String(aa))
173- let as = (ar - ad)
174- let at = fraction(as, N(K, O), d)
175- let au = (as - at)
176- if ((0 >= au))
205+ let aw = C(fromBase58String(ai))
206+ let ax = (aw - aj)
207+ let ay = fraction(ax, Q(N, R), d)
208+ let az = (ax - ay)
209+ if ((0 >= az))
177210 then throw("amount of staked sharetokens must be > 0")
178211 else {
179- let av = invoke(P(), "lockShareTokens", [K, 0], [AttachedPayment(fromBase58String(aa), au)])
180- if ((av == av))
212+ let aA = invoke(S(), "lockShareTokens", [N, 0], [AttachedPayment(fromBase58String(ai), az)])
213+ if ((aA == aA))
181214 then {
182- let aw = J(K)
183- let ax = L(K, M)
184- $Tuple2([IntegerEntry((K + o), (aw + au)), IntegerEntry((((((K + "_") + M) + "_") + toString(ax)) + l), au), StringEntry((((((K + "_") + M) + "_") + toString(ax)) + m), a), IntegerEntry((((K + "_") + M) + n), ax), ScriptTransfer(y, at, fromBase58String(aa))], au)
215+ let aB = M(N)
216+ let aC = O(N, P)
217+ let aD = [IntegerEntry((N + n), (aB + az)), IntegerEntry((((((N + "_") + P) + "_") + toString(aC)) + k), az), StringEntry((((((N + "_") + P) + "_") + toString(aC)) + l), a), IntegerEntry((((N + "_") + P) + m), aC), ScriptTransfer(y, ay, fromBase58String(ai))]
218+ $Tuple2(aD, az)
185219 }
186220 else throw("Strict value is not equal to itself.")
187221 }
194228 }
195229
196230
197-func ay (M,K,O,U,V,W,X,Y,Z,aa,ab,ac) = nil
198-
199-
200-@Callable(A)
201-func replanish (K,az,aA,ab,ac) = {
202- let aB = valueOrErrorMessage(getString(this, (u + K)), "Pool is not inited")
203- let aC = if ((aB == a))
204- then G(Address(fromBase58String(K)))
205- else if ((aB == b))
206- then I(Address(fromBase58String(K)))
207- else throw("Wrong pool type")
208- let aD = aC._1
209- let aE = aC._2
210- let Y = aC._3
211- let Z = aC._4
212- let aa = aC._5
213- let aF = if ((size(A.payments) == 2))
214- then if ((R(A.payments[0].assetId) != aD))
215- then throw("Wrong payment asset A")
216- else if ((R(A.payments[1].assetId) != aE))
217- then throw("Wrong payment asset B")
218- else $Tuple4(A.payments[0].amount, aD, A.payments[1].amount, aE)
219- else if ((size(A.payments) == 1))
220- then if ((R(A.payments[0].assetId) == aD))
221- then $Tuple4(A.payments[0].amount, aD, 0, aE)
222- else if ((R(A.payments[0].assetId) == aE))
223- then $Tuple4(0, aD, A.payments[0].amount, aE)
224- else throw("Wrong payment")
225- else throw("One or two payments expected")
226- let U = aF._1
227- let V = aF._2
228- let W = aF._3
229- let X = aF._4
230- if ((az > 0))
231+func aE (P,N,R,ac,ad,ae,af,ai) = {
232+ let I = Address(fromBase58String(N))
233+ let aF = if (if ((ac > 0))
234+ then (ae > 0)
235+ else false)
231236 then {
232- let aG = makeString([aB, toString(A.caller), K, toString(U), V, toString(W), X, toString(Y), toString(Z), aa, toString(ab), toString(ac), aA, toString(az)], ",")
233- let aH = {
234- let aI = invoke(this, "createNewRequest", [aG], nil)
235- if ($isInstanceOf(aI, "Int"))
236- then aI
237- else unit
237+ let aG = {
238+ let L = invoke(I, "evaluatePutByAmountAssetREADONLY", [ac], nil)
239+ if ($isInstanceOf(L, "List[Any]"))
240+ then L
241+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
238242 }
239- if ((aH == aH))
243+ if ((aG == aG))
240244 then {
241- let aJ = [toString(A.caller), aa, aA, az, toString(this), "replanishFromLand", toString(valueOrErrorMessage(aH, "Can't create new request"))]
242- let aK = reentrantInvoke(Q(), "flashPosition", aJ, nil)
243- nil
245+ let aH = {
246+ let L = invoke(I, "evaluatePutByPriceAssetREADONLY", [ae], nil)
247+ if ($isInstanceOf(L, "List[Any]"))
248+ then L
249+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
250+ }
251+ if ((aH == aH))
252+ then {
253+ let aI = {
254+ let L = aG[0]
255+ if ($isInstanceOf(L, "Int"))
256+ then L
257+ else throw(($getType(L) + " couldn't be cast to Int"))
258+ }
259+ let aJ = {
260+ let L = aH[0]
261+ if ($isInstanceOf(L, "Int"))
262+ then L
263+ else throw(($getType(L) + " couldn't be cast to Int"))
264+ }
265+ if ((aI > aJ))
266+ then {
267+ let aK = {
268+ let L = aH[7]
269+ if ($isInstanceOf(L, "Int"))
270+ then L
271+ else throw(($getType(L) + " couldn't be cast to Int"))
272+ }
273+ $Tuple4(ac, aK, (ae - aK), af)
274+ }
275+ else {
276+ let aL = {
277+ let L = aH[6]
278+ if ($isInstanceOf(L, "Int"))
279+ then L
280+ else throw(($getType(L) + " couldn't be cast to Int"))
281+ }
282+ $Tuple4(aL, ae, (ac - aL), ad)
283+ }
284+ }
285+ else throw("Strict value is not equal to itself.")
244286 }
245287 else throw("Strict value is not equal to itself.")
246288 }
247- else if ((aB == a))
248- then T(toString(A.caller), K, false, U, V, W, X, Y, Z, aa, ab, ac)
249- else throw("Cant wx")
289+ else if ((ac > 0))
290+ then $Tuple4(ac, ae, ac, ad)
291+ else if ((ae > 0))
292+ then $Tuple4(ac, ae, ae, af)
293+ else throw("pmts must be > 0")
294+ let ao = aF._1
295+ let ap = aF._2
296+ let aq = aF._3
297+ let ar = aF._4
298+ let aj = C(fromBase58String(ai))
299+ if ((aj == aj))
300+ then {
301+ let as = if (if ((ao > 0))
302+ then (ap > 0)
303+ else false)
304+ then {
305+ let at = [AttachedPayment(Y(ad), ao), AttachedPayment(Y(af), ap)]
306+ invoke(I, "put", [1, false], at)
307+ }
308+ else 0
309+ if ((as == as))
310+ then {
311+ let au = if ((aq > 0))
312+ then {
313+ let at = [AttachedPayment(Y(ar), aq)]
314+ invoke(I, "putOneTkn", [0, false], at)
315+ }
316+ else 0
317+ if ((au == au))
318+ then {
319+ let aw = C(fromBase58String(ai))
320+ let ax = (aw - aj)
321+ let ay = fraction(ax, Q(N, R), d)
322+ let az = (ax - ay)
323+ if ((0 >= az))
324+ then throw("amount of staked sharetokens must be > 0")
325+ else {
326+ let aA = invoke(T(I), "stake", nil, [AttachedPayment(fromBase58String(ai), az)])
327+ if ((aA == aA))
328+ then {
329+ let aB = M(N)
330+ let aC = O(N, P)
331+ $Tuple2([IntegerEntry((N + n), (aB + az)), IntegerEntry((((((N + "_") + P) + "_") + toString(aC)) + k), az), StringEntry((((((N + "_") + P) + "_") + toString(aC)) + l), a), IntegerEntry((((N + "_") + P) + m), aC), ScriptTransfer(y, ay, fromBase58String(ai))], az)
332+ }
333+ else throw("Strict value is not equal to itself.")
334+ }
335+ }
336+ else throw("Strict value is not equal to itself.")
337+ }
338+ else throw("Strict value is not equal to itself.")
339+ }
340+ else throw("Strict value is not equal to itself.")
250341 }
251342
252343
344+@Callable(B)
345+func replanish (N,aM,aN) = if (if ((100 > aM))
346+ then true
347+ else (aM > 300))
348+ then throw("Leverage can't be <100 and >300")
349+ else {
350+ let aO = valueOrErrorMessage(getString(this, (t + N)), "Pool is not inited")
351+ let aP = if ((aO == a))
352+ then H(Address(fromBase58String(N)))
353+ else if ((aO == b))
354+ then J(Address(fromBase58String(N)))
355+ else throw("Wrong pool type")
356+ let aQ = aP._1
357+ let aR = aP._2
358+ let ag = aP._3
359+ let ah = aP._4
360+ let ai = aP._5
361+ let aS = if ((size(B.payments) == 2))
362+ then if ((X(B.payments[0].assetId) != aQ))
363+ then throw("Wrong payment asset A")
364+ else if ((X(B.payments[1].assetId) != aR))
365+ then throw("Wrong payment asset B")
366+ else $Tuple4(B.payments[0].amount, aQ, B.payments[1].amount, aR)
367+ else if ((size(B.payments) == 1))
368+ then if ((X(B.payments[0].assetId) == aQ))
369+ then $Tuple4(B.payments[0].amount, aQ, 0, aR)
370+ else if ((X(B.payments[0].assetId) == aR))
371+ then $Tuple4(0, aQ, B.payments[0].amount, aR)
372+ else throw("Wrong payment")
373+ else throw("One or two payments expected")
374+ let ac = aS._1
375+ let ad = aS._2
376+ let ae = aS._3
377+ let af = aS._4
378+ if ((aM > 100))
379+ then {
380+ let aT = {
381+ let L = invoke(z, "getTWAP60", [ad, false], nil)
382+ if ($isInstanceOf(L, "Int"))
383+ then L
384+ else throw(($getType(L) + " couldn't be cast to Int"))
385+ }
386+ let aU = {
387+ let L = invoke(z, "getTWAP60", [af, false], nil)
388+ if ($isInstanceOf(L, "Int"))
389+ then L
390+ else throw(($getType(L) + " couldn't be cast to Int"))
391+ }
392+ let aV = (fraction(aT, ac, pow(10, 0, Z(ad), 0, 0, DOWN)) + fraction(aU, ae, pow(10, 0, Z(af), 0, 0, DOWN)))
393+ let aW = fraction(aV, (aM - 100), 100)
394+ let aX = makeString([aO, toString(B.caller), N, toString(ac), ad, toString(ae), af, toString(ag), toString(ah), ai, aN, toString(aW)], ",")
395+ let aY = {
396+ let L = invoke(this, "createNewRequest", [aX], nil)
397+ if ($isInstanceOf(L, "Int"))
398+ then L
399+ else unit
400+ }
401+ if ((aY == aY))
402+ then {
403+ let aZ = [toString(B.caller), ai, aN, aW, toString(this), "replanishFromLand", toString(valueOrErrorMessage(aY, "Can't create new request"))]
404+ let ba = reentrantInvoke(W(), "flashPosition", aZ, nil)
405+ nil
406+ }
407+ else throw("Strict value is not equal to itself.")
408+ }
409+ else if ((aO == a))
410+ then ab(toString(B.caller), N, false, ac, ad, ae, af, ag, ah, ai)
411+ else aE(toString(B.caller), N, false, ac, ad, ae, af, ai)
412+ }
253413
254-@Callable(A)
255-func replanishFromLand (aL) = {
256- let aG = split(valueOrErrorMessage(getString(this, (aL + s)), ("No request with id " + aL)), ",")
257- if ((size(A.payments) != 1))
414+
415+
416+@Callable(B)
417+func replanishFromLand (bb) = {
418+ let aX = split(valueOrErrorMessage(getString(this, (bb + r)), ("No request with id " + bb)), ",")
419+ if ((size(B.payments) != 1))
258420 then throw("Wrong payment size")
259- else if (if ((R(A.payments[0].assetId) != aG[12]))
421+ else if (if ((X(B.payments[0].assetId) != aX[12]))
260422 then true
261- else (A.payments[0].amount != parseIntValue(aG[13])))
423+ else (B.payments[0].amount != parseIntValue(aX[13])))
262424 then throw("Wrong payment")
263425 else {
264- let U = if ((aG[4] == R(A.payments[0].assetId)))
265- then (parseIntValue(aG[3]) + A.payments[0].amount)
266- else parseIntValue(aG[3])
267- let W = if ((aG[6] == R(A.payments[0].assetId)))
268- then (parseIntValue(aG[5]) + A.payments[0].amount)
269- else parseIntValue(aG[3])
270- if ((aG[0] == a))
426+ let ac = if ((aX[4] == X(B.payments[0].assetId)))
427+ then (parseIntValue(aX[3]) + B.payments[0].amount)
428+ else parseIntValue(aX[3])
429+ let ae = if ((aX[6] == X(B.payments[0].assetId)))
430+ then (parseIntValue(aX[5]) + B.payments[0].amount)
431+ else parseIntValue(aX[3])
432+ if ((aX[0] == a))
271433 then {
272- let aM = T(aG[1], aG[2], true, U, aG[4], W, aG[6], parseIntValue(aG[7]), parseIntValue(aG[8]), aG[9], parseIntValue(aG[10]), parseIntValue(aG[11]))
273- let aN = aM._1
274- let aO = aM._2
275- $Tuple2((aN :+ DeleteEntry((aL + s))), aO)
434+ let bc = ab(aX[1], aX[2], true, ac, aX[4], ae, aX[6], parseIntValue(aX[7]), parseIntValue(aX[8]), aX[9])
435+ let bd = bc._1
436+ let be = bc._2
437+ $Tuple2((bd :+ DeleteEntry((bb + r))), be)
276438 }
277- else throw("Cant wx")
439+ else if ((aX[0] == a))
440+ then {
441+ let bf = aE(aX[1], aX[2], true, ac, aX[4], ae, aX[6], aX[9])
442+ let bd = bf._1
443+ let be = bf._2
444+ $Tuple2((bd :+ DeleteEntry((bb + r))), be)
445+ }
446+ else throw("Wrong request type")
278447 }
279448 }
280449
281450
282451
283-@Callable(A)
284-func createNewRequest (aP) = valueOrElse(z(A), {
285- let aH = (valueOrElse(getInteger(this, t), 0) + 1)
286- $Tuple2([StringEntry((toString(aH) + s), aP)], aH)
452+@Callable(B)
453+func createNewRequest (bg) = valueOrElse(A(B), {
454+ let aY = (valueOrElse(getInteger(this, s), 0) + 1)
455+ $Tuple2([StringEntry((toString(aY) + r), bg)], aY)
287456 })
288457
289458
290459
291-@Callable(A)
292-func initNewPool (aB,H,aQ,aR,aS) = if (if ((aB != a))
293- then (aB != b)
460+@Callable(B)
461+func initNewPool (aO,I,bh,bi,bj) = if (if ((aO != a))
462+ then (aO != b)
294463 else false)
295464 then throw("Wrong type")
296- else [IntegerEntry((H + p), aQ), IntegerEntry((H + q), aR), IntegerEntry((H + r), aS), StringEntry((u + H), aB)]
465+ else [IntegerEntry((I + o), bh), IntegerEntry((I + p), bi), IntegerEntry((I + q), bj), StringEntry((t + I), aO)]
297466
298467
299-@Verifier(aT)
300-func aU () = sigVerify(aT.bodyBytes, aT.proofs[0], aT.senderPublicKey)
468+@Verifier(bk)
469+func bl () = sigVerify(bk.bodyBytes, bk.proofs[0], bk.senderPublicKey)
301470
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "SF"
55
66 let b = "WX"
77
88 let c = 100000000
99
1010 let d = 1000000
1111
1212 let e = "A_asset_balance"
1313
1414 let f = "B_asset_balance"
1515
1616 let g = "A_asset_id"
1717
1818 let h = "B_asset_id"
1919
2020 let i = "share_asset_id"
2121
22-let j = "version"
22+let j = "_share_tokens_locked"
2323
24-let k = "_share_tokens_locked"
24+let k = "_user_position"
2525
26-let l = "_user_position"
26+let l = "_user_position_type"
2727
28-let m = "_user_position_type"
28+let m = "_user_position_number"
2929
30-let n = "_user_position_number"
30+let n = "_total_position"
3131
32-let o = "_total_position"
32+let o = "_axly_fee_without_loan"
3333
34-let p = "_axly_fee_without_loan"
34+let p = "_axly_fee_with_loan"
3535
36-let q = "_axly_fee_with_loan"
36+let q = "_axly_fee_cap"
3737
38-let r = "_axly_fee_cap"
38+let r = "_request_id"
3939
40-let s = "_request_id"
40+let s = "requests_iter"
4141
42-let t = "requests_iter"
42+let t = "pool_"
4343
44-let u = "pool_"
44+let u = "axly_money_box"
4545
46-let v = "axly_money_box"
46+let v = "swopfi_farming_addr"
4747
48-let w = "swopfi_farming_addr"
48+let w = "lend_service_addr"
4949
50-let x = "lend_service_addr"
50+let x = "price_oracle"
5151
52-let y = Address(fromBase58String(valueOrErrorMessage(getString(this, v), "No axly moneyBox address")))
52+let y = Address(fromBase58String(valueOrErrorMessage(getString(this, u), "No axly moneyBox address")))
5353
54-func z (A) = if ((A.caller == this))
54+let z = Address(fromBase58String(valueOrErrorMessage(getString(this, x), "No price oracle address")))
55+
56+func A (B) = if ((B.caller == this))
5557 then unit
5658 else throw("Only contract itself can call this function")
5759
5860
59-func B (C) = {
60- let D = C
61- if ($isInstanceOf(D, "ByteVector"))
61+func C (D) = {
62+ let E = D
63+ if ($isInstanceOf(E, "ByteVector"))
6264 then {
63- let E = D
64- assetBalance(this, E)
65+ let F = E
66+ assetBalance(this, F)
6567 }
66- else if ($isInstanceOf(D, "Unit"))
68+ else if ($isInstanceOf(E, "Unit"))
6769 then {
68- let F = D
70+ let G = E
6971 wavesBalance(this).available
7072 }
7173 else throw("Match error")
7274 }
7375
7476
75-func G (H) = $Tuple5(valueOrErrorMessage(getString(H, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(H, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(H, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(H, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(H, i), "Can't get share asset id"))
77+func H (I) = $Tuple5(valueOrErrorMessage(getString(I, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(I, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(I, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(I, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(I, i), "Can't get share asset id"))
7678
7779
78-func I (H) = $Tuple5(valueOrErrorMessage(getString(H, g), "Can't get pool A asset id"), valueOrErrorMessage(getString(H, h), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(H, e), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(H, f), "Can't get pool B asset balance"), valueOrErrorMessage(getString(H, i), "Can't get share asset id"))
80+func J (I) = {
81+ let K = {
82+ let L = invoke(I, "getPoolConfigWrapperREADONLY", nil, nil)
83+ if ($isInstanceOf(L, "List[Any]"))
84+ then L
85+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
86+ }
87+ if ((K == K))
88+ then $Tuple5(valueOrErrorMessage({
89+ let L = K[4]
90+ if ($isInstanceOf(L, "String"))
91+ then L
92+ else unit
93+ }, "Can't get pool A asset id"), valueOrErrorMessage({
94+ let L = K[5]
95+ if ($isInstanceOf(L, "String"))
96+ then L
97+ else unit
98+ }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({
99+ let L = K[3]
100+ if ($isInstanceOf(L, "String"))
101+ then L
102+ else unit
103+ }, "Can't get pool LP asset id"))
104+ else throw("Strict value is not equal to itself.")
105+ }
79106
80107
81-func J (K) = valueOrElse(getInteger(this, (K + o)), 0)
108+func M (N) = valueOrElse(getInteger(this, (N + n)), 0)
82109
83110
84-func L (K,M) = (valueOrElse(getInteger(this, (((K + "_") + M) + n)), 0) + 1)
111+func O (N,P) = (valueOrElse(getInteger(this, (((N + "_") + P) + m)), 0) + 1)
85112
86113
87-func N (K,O) = if (O)
88- then getIntegerValue(this, (K + q))
89- else getIntegerValue(this, (K + p))
114+func Q (N,R) = if (R)
115+ then getIntegerValue(this, (N + p))
116+ else getIntegerValue(this, (N + o))
90117
91118
92-func P () = Address(fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get swopfi farming addr")))
119+func S () = Address(fromBase58String(valueOrErrorMessage(getString(this, v), "Can't get swopfi farming addr")))
93120
94121
95-func Q () = Address(fromBase58String(valueOrErrorMessage(getString(this, x), "Can't get lend service addr")))
122+func T (I) = {
123+ let U = Address(fromBase58String(valueOrElse(getString(I, "%s__factoryContract"), "Can't get WX factory contract addr")))
124+ let V = split(valueOrElse(getString(U, "%s__factoryConfig"), "Can't get WX factory cfg"), "__")
125+ Address(fromBase58String(V[1]))
126+ }
96127
97128
98-func R (C) = {
99- let D = C
100- if ($isInstanceOf(D, "ByteVector"))
129+func W () = Address(fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get lend service addr")))
130+
131+
132+func X (D) = {
133+ let E = D
134+ if ($isInstanceOf(E, "ByteVector"))
101135 then {
102- let E = D
103- toBase58String(E)
136+ let F = E
137+ toBase58String(F)
104138 }
105- else if ($isInstanceOf(D, "Unit"))
139+ else if ($isInstanceOf(E, "Unit"))
106140 then {
107- let F = D
141+ let G = E
108142 "WAVES"
109143 }
110144 else throw("Match error")
111145 }
112146
113147
114-func S (C) = if ((C == "WAVES"))
148+func Y (D) = if ((D == "WAVES"))
115149 then unit
116- else fromBase58String(C)
150+ else fromBase58String(D)
117151
118152
119-func T (M,K,O,U,V,W,X,Y,Z,aa,ab,ac) = {
120- let ad = B(fromBase58String(aa))
121- if ((ad == ad))
153+func Z (D) = if ((D == "WAVES"))
154+ then 8
155+ else {
156+ let E = assetInfo(fromBase58String(D))
157+ if ($isInstanceOf(E, "Asset"))
158+ then {
159+ let aa = E
160+ aa.decimals
161+ }
162+ else throw("Can't find asset")
163+ }
164+
165+
166+func ab (P,N,R,ac,ad,ae,af,ag,ah,ai) = {
167+ let aj = C(fromBase58String(ai))
168+ if ((aj == aj))
122169 then {
123- let H = Address(fromBase58String(K))
124- let ae = fraction(c, U, Y)
125- let af = fraction(c, W, Z)
126- let ag = if ((af > ae))
170+ let I = Address(fromBase58String(N))
171+ let ak = fraction(c, ac, ag)
172+ let al = fraction(c, ae, ah)
173+ let am = if ((al > ak))
127174 then {
128- let ah = fraction(Z, ae, c, CEILING)
129- $Tuple4(U, ah, (W - ah), X)
175+ let an = fraction(ah, ak, c, CEILING)
176+ $Tuple4(ac, an, (ae - an), af)
130177 }
131178 else {
132- let ah = fraction(Y, af, c, CEILING)
133- $Tuple4(ah, W, (U - ah), V)
179+ let an = fraction(ag, al, c, CEILING)
180+ $Tuple4(an, ae, (ac - an), ad)
134181 }
135- let ai = ag._1
136- let aj = ag._2
137- let ak = ag._3
138- let al = ag._4
139- let am = getStringValue(H, "version")
140- let an = if (if ((ai > 0))
141- then (aj > 0)
182+ let ao = am._1
183+ let ap = am._2
184+ let aq = am._3
185+ let ar = am._4
186+ let as = if (if ((ao > 0))
187+ then (ap > 0)
142188 else false)
143189 then {
144- let ao = [AttachedPayment(S(V), ai), AttachedPayment(S(X), aj)]
145- if ((am == "1.0.0"))
146- then invoke(H, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], ao)
147- else if ((am == "2.0.0"))
148- then invoke(H, "replenishWithTwoTokensV2", [false, 0], ao)
149- else throw("Wrong pool type")
190+ let at = [AttachedPayment(Y(ad), ao), AttachedPayment(Y(af), ap)]
191+ invoke(I, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], at)
150192 }
151193 else 0
152- if ((an == an))
194+ if ((as == as))
153195 then {
154- let ap = if ((ak > 0))
196+ let au = if ((aq > 0))
155197 then {
156- let ao = [AttachedPayment(S(al), ak)]
157- if ((am == "1.0.0"))
158- then {
159- let aq = ["0", "false", "0"]
160- invoke(H, "callFunction", ["replenishWithOneToken", aq], ao)
161- }
162- else if ((am == "2.0.0"))
163- then {
164- let aq = [ab, ac, false, 0]
165- invoke(H, "replenishWithOneTokenV2", [false, 0], ao)
166- }
167- else throw("Wrong pool type")
198+ let at = [AttachedPayment(Y(ar), aq)]
199+ let av = ["0", "false", "0"]
200+ invoke(I, "replenishWithOneTokenV2", [false, 0], at)
168201 }
169202 else 0
170- if ((ap == ap))
203+ if ((au == au))
171204 then {
172- let ar = B(fromBase58String(aa))
173- let as = (ar - ad)
174- let at = fraction(as, N(K, O), d)
175- let au = (as - at)
176- if ((0 >= au))
205+ let aw = C(fromBase58String(ai))
206+ let ax = (aw - aj)
207+ let ay = fraction(ax, Q(N, R), d)
208+ let az = (ax - ay)
209+ if ((0 >= az))
177210 then throw("amount of staked sharetokens must be > 0")
178211 else {
179- let av = invoke(P(), "lockShareTokens", [K, 0], [AttachedPayment(fromBase58String(aa), au)])
180- if ((av == av))
212+ let aA = invoke(S(), "lockShareTokens", [N, 0], [AttachedPayment(fromBase58String(ai), az)])
213+ if ((aA == aA))
181214 then {
182- let aw = J(K)
183- let ax = L(K, M)
184- $Tuple2([IntegerEntry((K + o), (aw + au)), IntegerEntry((((((K + "_") + M) + "_") + toString(ax)) + l), au), StringEntry((((((K + "_") + M) + "_") + toString(ax)) + m), a), IntegerEntry((((K + "_") + M) + n), ax), ScriptTransfer(y, at, fromBase58String(aa))], au)
215+ let aB = M(N)
216+ let aC = O(N, P)
217+ let aD = [IntegerEntry((N + n), (aB + az)), IntegerEntry((((((N + "_") + P) + "_") + toString(aC)) + k), az), StringEntry((((((N + "_") + P) + "_") + toString(aC)) + l), a), IntegerEntry((((N + "_") + P) + m), aC), ScriptTransfer(y, ay, fromBase58String(ai))]
218+ $Tuple2(aD, az)
185219 }
186220 else throw("Strict value is not equal to itself.")
187221 }
188222 }
189223 else throw("Strict value is not equal to itself.")
190224 }
191225 else throw("Strict value is not equal to itself.")
192226 }
193227 else throw("Strict value is not equal to itself.")
194228 }
195229
196230
197-func ay (M,K,O,U,V,W,X,Y,Z,aa,ab,ac) = nil
198-
199-
200-@Callable(A)
201-func replanish (K,az,aA,ab,ac) = {
202- let aB = valueOrErrorMessage(getString(this, (u + K)), "Pool is not inited")
203- let aC = if ((aB == a))
204- then G(Address(fromBase58String(K)))
205- else if ((aB == b))
206- then I(Address(fromBase58String(K)))
207- else throw("Wrong pool type")
208- let aD = aC._1
209- let aE = aC._2
210- let Y = aC._3
211- let Z = aC._4
212- let aa = aC._5
213- let aF = if ((size(A.payments) == 2))
214- then if ((R(A.payments[0].assetId) != aD))
215- then throw("Wrong payment asset A")
216- else if ((R(A.payments[1].assetId) != aE))
217- then throw("Wrong payment asset B")
218- else $Tuple4(A.payments[0].amount, aD, A.payments[1].amount, aE)
219- else if ((size(A.payments) == 1))
220- then if ((R(A.payments[0].assetId) == aD))
221- then $Tuple4(A.payments[0].amount, aD, 0, aE)
222- else if ((R(A.payments[0].assetId) == aE))
223- then $Tuple4(0, aD, A.payments[0].amount, aE)
224- else throw("Wrong payment")
225- else throw("One or two payments expected")
226- let U = aF._1
227- let V = aF._2
228- let W = aF._3
229- let X = aF._4
230- if ((az > 0))
231+func aE (P,N,R,ac,ad,ae,af,ai) = {
232+ let I = Address(fromBase58String(N))
233+ let aF = if (if ((ac > 0))
234+ then (ae > 0)
235+ else false)
231236 then {
232- let aG = makeString([aB, toString(A.caller), K, toString(U), V, toString(W), X, toString(Y), toString(Z), aa, toString(ab), toString(ac), aA, toString(az)], ",")
233- let aH = {
234- let aI = invoke(this, "createNewRequest", [aG], nil)
235- if ($isInstanceOf(aI, "Int"))
236- then aI
237- else unit
237+ let aG = {
238+ let L = invoke(I, "evaluatePutByAmountAssetREADONLY", [ac], nil)
239+ if ($isInstanceOf(L, "List[Any]"))
240+ then L
241+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
238242 }
239- if ((aH == aH))
243+ if ((aG == aG))
240244 then {
241- let aJ = [toString(A.caller), aa, aA, az, toString(this), "replanishFromLand", toString(valueOrErrorMessage(aH, "Can't create new request"))]
242- let aK = reentrantInvoke(Q(), "flashPosition", aJ, nil)
243- nil
245+ let aH = {
246+ let L = invoke(I, "evaluatePutByPriceAssetREADONLY", [ae], nil)
247+ if ($isInstanceOf(L, "List[Any]"))
248+ then L
249+ else throw(($getType(L) + " couldn't be cast to List[Any]"))
250+ }
251+ if ((aH == aH))
252+ then {
253+ let aI = {
254+ let L = aG[0]
255+ if ($isInstanceOf(L, "Int"))
256+ then L
257+ else throw(($getType(L) + " couldn't be cast to Int"))
258+ }
259+ let aJ = {
260+ let L = aH[0]
261+ if ($isInstanceOf(L, "Int"))
262+ then L
263+ else throw(($getType(L) + " couldn't be cast to Int"))
264+ }
265+ if ((aI > aJ))
266+ then {
267+ let aK = {
268+ let L = aH[7]
269+ if ($isInstanceOf(L, "Int"))
270+ then L
271+ else throw(($getType(L) + " couldn't be cast to Int"))
272+ }
273+ $Tuple4(ac, aK, (ae - aK), af)
274+ }
275+ else {
276+ let aL = {
277+ let L = aH[6]
278+ if ($isInstanceOf(L, "Int"))
279+ then L
280+ else throw(($getType(L) + " couldn't be cast to Int"))
281+ }
282+ $Tuple4(aL, ae, (ac - aL), ad)
283+ }
284+ }
285+ else throw("Strict value is not equal to itself.")
244286 }
245287 else throw("Strict value is not equal to itself.")
246288 }
247- else if ((aB == a))
248- then T(toString(A.caller), K, false, U, V, W, X, Y, Z, aa, ab, ac)
249- else throw("Cant wx")
289+ else if ((ac > 0))
290+ then $Tuple4(ac, ae, ac, ad)
291+ else if ((ae > 0))
292+ then $Tuple4(ac, ae, ae, af)
293+ else throw("pmts must be > 0")
294+ let ao = aF._1
295+ let ap = aF._2
296+ let aq = aF._3
297+ let ar = aF._4
298+ let aj = C(fromBase58String(ai))
299+ if ((aj == aj))
300+ then {
301+ let as = if (if ((ao > 0))
302+ then (ap > 0)
303+ else false)
304+ then {
305+ let at = [AttachedPayment(Y(ad), ao), AttachedPayment(Y(af), ap)]
306+ invoke(I, "put", [1, false], at)
307+ }
308+ else 0
309+ if ((as == as))
310+ then {
311+ let au = if ((aq > 0))
312+ then {
313+ let at = [AttachedPayment(Y(ar), aq)]
314+ invoke(I, "putOneTkn", [0, false], at)
315+ }
316+ else 0
317+ if ((au == au))
318+ then {
319+ let aw = C(fromBase58String(ai))
320+ let ax = (aw - aj)
321+ let ay = fraction(ax, Q(N, R), d)
322+ let az = (ax - ay)
323+ if ((0 >= az))
324+ then throw("amount of staked sharetokens must be > 0")
325+ else {
326+ let aA = invoke(T(I), "stake", nil, [AttachedPayment(fromBase58String(ai), az)])
327+ if ((aA == aA))
328+ then {
329+ let aB = M(N)
330+ let aC = O(N, P)
331+ $Tuple2([IntegerEntry((N + n), (aB + az)), IntegerEntry((((((N + "_") + P) + "_") + toString(aC)) + k), az), StringEntry((((((N + "_") + P) + "_") + toString(aC)) + l), a), IntegerEntry((((N + "_") + P) + m), aC), ScriptTransfer(y, ay, fromBase58String(ai))], az)
332+ }
333+ else throw("Strict value is not equal to itself.")
334+ }
335+ }
336+ else throw("Strict value is not equal to itself.")
337+ }
338+ else throw("Strict value is not equal to itself.")
339+ }
340+ else throw("Strict value is not equal to itself.")
250341 }
251342
252343
344+@Callable(B)
345+func replanish (N,aM,aN) = if (if ((100 > aM))
346+ then true
347+ else (aM > 300))
348+ then throw("Leverage can't be <100 and >300")
349+ else {
350+ let aO = valueOrErrorMessage(getString(this, (t + N)), "Pool is not inited")
351+ let aP = if ((aO == a))
352+ then H(Address(fromBase58String(N)))
353+ else if ((aO == b))
354+ then J(Address(fromBase58String(N)))
355+ else throw("Wrong pool type")
356+ let aQ = aP._1
357+ let aR = aP._2
358+ let ag = aP._3
359+ let ah = aP._4
360+ let ai = aP._5
361+ let aS = if ((size(B.payments) == 2))
362+ then if ((X(B.payments[0].assetId) != aQ))
363+ then throw("Wrong payment asset A")
364+ else if ((X(B.payments[1].assetId) != aR))
365+ then throw("Wrong payment asset B")
366+ else $Tuple4(B.payments[0].amount, aQ, B.payments[1].amount, aR)
367+ else if ((size(B.payments) == 1))
368+ then if ((X(B.payments[0].assetId) == aQ))
369+ then $Tuple4(B.payments[0].amount, aQ, 0, aR)
370+ else if ((X(B.payments[0].assetId) == aR))
371+ then $Tuple4(0, aQ, B.payments[0].amount, aR)
372+ else throw("Wrong payment")
373+ else throw("One or two payments expected")
374+ let ac = aS._1
375+ let ad = aS._2
376+ let ae = aS._3
377+ let af = aS._4
378+ if ((aM > 100))
379+ then {
380+ let aT = {
381+ let L = invoke(z, "getTWAP60", [ad, false], nil)
382+ if ($isInstanceOf(L, "Int"))
383+ then L
384+ else throw(($getType(L) + " couldn't be cast to Int"))
385+ }
386+ let aU = {
387+ let L = invoke(z, "getTWAP60", [af, false], nil)
388+ if ($isInstanceOf(L, "Int"))
389+ then L
390+ else throw(($getType(L) + " couldn't be cast to Int"))
391+ }
392+ let aV = (fraction(aT, ac, pow(10, 0, Z(ad), 0, 0, DOWN)) + fraction(aU, ae, pow(10, 0, Z(af), 0, 0, DOWN)))
393+ let aW = fraction(aV, (aM - 100), 100)
394+ let aX = makeString([aO, toString(B.caller), N, toString(ac), ad, toString(ae), af, toString(ag), toString(ah), ai, aN, toString(aW)], ",")
395+ let aY = {
396+ let L = invoke(this, "createNewRequest", [aX], nil)
397+ if ($isInstanceOf(L, "Int"))
398+ then L
399+ else unit
400+ }
401+ if ((aY == aY))
402+ then {
403+ let aZ = [toString(B.caller), ai, aN, aW, toString(this), "replanishFromLand", toString(valueOrErrorMessage(aY, "Can't create new request"))]
404+ let ba = reentrantInvoke(W(), "flashPosition", aZ, nil)
405+ nil
406+ }
407+ else throw("Strict value is not equal to itself.")
408+ }
409+ else if ((aO == a))
410+ then ab(toString(B.caller), N, false, ac, ad, ae, af, ag, ah, ai)
411+ else aE(toString(B.caller), N, false, ac, ad, ae, af, ai)
412+ }
253413
254-@Callable(A)
255-func replanishFromLand (aL) = {
256- let aG = split(valueOrErrorMessage(getString(this, (aL + s)), ("No request with id " + aL)), ",")
257- if ((size(A.payments) != 1))
414+
415+
416+@Callable(B)
417+func replanishFromLand (bb) = {
418+ let aX = split(valueOrErrorMessage(getString(this, (bb + r)), ("No request with id " + bb)), ",")
419+ if ((size(B.payments) != 1))
258420 then throw("Wrong payment size")
259- else if (if ((R(A.payments[0].assetId) != aG[12]))
421+ else if (if ((X(B.payments[0].assetId) != aX[12]))
260422 then true
261- else (A.payments[0].amount != parseIntValue(aG[13])))
423+ else (B.payments[0].amount != parseIntValue(aX[13])))
262424 then throw("Wrong payment")
263425 else {
264- let U = if ((aG[4] == R(A.payments[0].assetId)))
265- then (parseIntValue(aG[3]) + A.payments[0].amount)
266- else parseIntValue(aG[3])
267- let W = if ((aG[6] == R(A.payments[0].assetId)))
268- then (parseIntValue(aG[5]) + A.payments[0].amount)
269- else parseIntValue(aG[3])
270- if ((aG[0] == a))
426+ let ac = if ((aX[4] == X(B.payments[0].assetId)))
427+ then (parseIntValue(aX[3]) + B.payments[0].amount)
428+ else parseIntValue(aX[3])
429+ let ae = if ((aX[6] == X(B.payments[0].assetId)))
430+ then (parseIntValue(aX[5]) + B.payments[0].amount)
431+ else parseIntValue(aX[3])
432+ if ((aX[0] == a))
271433 then {
272- let aM = T(aG[1], aG[2], true, U, aG[4], W, aG[6], parseIntValue(aG[7]), parseIntValue(aG[8]), aG[9], parseIntValue(aG[10]), parseIntValue(aG[11]))
273- let aN = aM._1
274- let aO = aM._2
275- $Tuple2((aN :+ DeleteEntry((aL + s))), aO)
434+ let bc = ab(aX[1], aX[2], true, ac, aX[4], ae, aX[6], parseIntValue(aX[7]), parseIntValue(aX[8]), aX[9])
435+ let bd = bc._1
436+ let be = bc._2
437+ $Tuple2((bd :+ DeleteEntry((bb + r))), be)
276438 }
277- else throw("Cant wx")
439+ else if ((aX[0] == a))
440+ then {
441+ let bf = aE(aX[1], aX[2], true, ac, aX[4], ae, aX[6], aX[9])
442+ let bd = bf._1
443+ let be = bf._2
444+ $Tuple2((bd :+ DeleteEntry((bb + r))), be)
445+ }
446+ else throw("Wrong request type")
278447 }
279448 }
280449
281450
282451
283-@Callable(A)
284-func createNewRequest (aP) = valueOrElse(z(A), {
285- let aH = (valueOrElse(getInteger(this, t), 0) + 1)
286- $Tuple2([StringEntry((toString(aH) + s), aP)], aH)
452+@Callable(B)
453+func createNewRequest (bg) = valueOrElse(A(B), {
454+ let aY = (valueOrElse(getInteger(this, s), 0) + 1)
455+ $Tuple2([StringEntry((toString(aY) + r), bg)], aY)
287456 })
288457
289458
290459
291-@Callable(A)
292-func initNewPool (aB,H,aQ,aR,aS) = if (if ((aB != a))
293- then (aB != b)
460+@Callable(B)
461+func initNewPool (aO,I,bh,bi,bj) = if (if ((aO != a))
462+ then (aO != b)
294463 else false)
295464 then throw("Wrong type")
296- else [IntegerEntry((H + p), aQ), IntegerEntry((H + q), aR), IntegerEntry((H + r), aS), StringEntry((u + H), aB)]
465+ else [IntegerEntry((I + o), bh), IntegerEntry((I + p), bi), IntegerEntry((I + q), bj), StringEntry((t + I), aO)]
297466
298467
299-@Verifier(aT)
300-func aU () = sigVerify(aT.bodyBytes, aT.proofs[0], aT.senderPublicKey)
468+@Verifier(bk)
469+func bl () = sigVerify(bk.bodyBytes, bk.proofs[0], bk.senderPublicKey)
301470

github/deemru/w8io/169f3d6 
104.73 ms