tx · 9922meKgC3fkWX2itfeaHUKhNTCJ5GfdoasNvt4pE4S6

3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8:  -0.01400000 Waves

2022.09.14 15:20 [2228759] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves

{ "type": 13, "id": "9922meKgC3fkWX2itfeaHUKhNTCJ5GfdoasNvt4pE4S6", "fee": 1400000, "feeAssetId": null, "timestamp": 1663158058314, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "3xB47gTJRaPveqRQgDoPsp7YsPug3pQCYLLw6xTSZd8Ejw4m8BCSWfp1PH151KrMWg79CeJc3fro1fuRFqikZsd3", "3cTj4XZknxCuXJfRjX7DQk1qQkUMYe9PKCm7FiJQshmwFy4BbUWijg8bfDTTNbL25g6oCBL6nnXQs88H3WN2vaf9" ], "script": "base64:BgIQCAISCAoGGBgRERgBEgASACYAB2tBY3RpdmUCBmFjdGl2ZQAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQANa1Bvb2xJbk9yYWNsZQIFcG9vbF8ADmtVc2VyU3dvcEluR292AgxfU1dPUF9hbW91bnQACmtEaXNjb3VudHMCCWRpc2NvdW50cwAPa0Rpc2NvdW50VmFsdWVzAg9kaXNjb3VudF92YWx1ZXMAC2tSb3V0aW5nRmVlAgtyb3V0aW5nX2ZlZQANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwAQa01vbmV5Qm94QWRkcmVzcwIRbW9uZXlfYm94X2FkZHJlc3MAC2tHb3ZBZGRyZXNzAhJnb3Zlcm5hbmNlX2FkZHJlc3MABGtGZWUCCmNvbW1pc3Npb24AEmtNdWx0eUFzc2V0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nl0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4BRNtdWx0aVNpZ25lZEJ5QWRtaW5zgk6e/A==", "height": 2228759, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H4VGBBU9ZmrA8XG9vmczGMcjAAV8SKNLbViTLz48Mfym Next: 71JE7V6wKjCbGbgtWhk4gSeV2duKEy4aX6qT6RKthMpk Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "active"
2727
2828 let m = "commission"
2929
30-let n = 8
30+let n = "_balance"
3131
32-let o = 100000000
32+let o = 8
3333
34-let p = 10000000000000000
34+let p = 100000000
3535
36-let q = 50
36+let q = 10000000000000000
3737
38-let r = 2
38+let r = 50
3939
40-let s = 4600000000000000
40+let s = 2
4141
42-let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
42+let t = 4600000000000000
4343
44-func u (v) = {
45- let w = getString(t, v)
46- if ($isInstanceOf(w, "String"))
44+let u = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
45+
46+func v (w) = {
47+ let x = getString(u, w)
48+ if ($isInstanceOf(x, "String"))
4749 then {
48- let x = w
49- fromBase58String(x)
50+ let y = x
51+ fromBase58String(y)
5052 }
5153 else {
52- let y = w
53- throw((v + "is empty"))
54+ let z = x
55+ throw((w + "is empty"))
5456 }
5557 }
5658
5759
58-let z = u(h)
60+let A = v(h)
5961
60-let A = u(i)
62+let B = v(i)
6163
62-let B = u(j)
64+let C = v(j)
6365
64-let C = Address(u(k))
66+let D = Address(v(k))
6567
66-let D = Address(u(l))
68+let E = Address(v(l))
6769
68-let E = valueOrElse(getBoolean(this, a), true)
70+let F = valueOrElse(getBoolean(this, a), true)
6971
70-let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty")
72+let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty")
7173
72-let G = 1000000
74+let H = 1000000
7375
74-func H () = if (E)
76+func I () = if (F)
7577 then unit
7678 else throw("DApp is inactive at this moment")
7779
7880
79-func I (J) = if (containsElement([z, A, B], J.callerPublicKey))
81+func J (K) = if (containsElement([A, B, C], K.callerPublicKey))
8082 then unit
8183 else throw("Only admin can call this function")
8284
8385
84-func K () = throw("DApp is already active")
86+func L () = throw("DApp is already active")
8587
8688
87-func L (M) = [BooleanEntry(a, false), StringEntry(b, M)]
89+func M (N) = [BooleanEntry(a, false), StringEntry(b, N)]
8890
8991
90-func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2)
92+func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2)
9193
9294
93-func Q (O,P) = {
94- let R = N(O, P)
95- (fraction((O + P), p, pow(R, n, q, r, n, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(O), toBigInt(P), toBigInt(o)), 0, toBigInt(5), 1, (n / 2), DOWN)), pow((R - s), n, q, r, n, DOWN), o)))
95+func R (P,Q) = {
96+ let S = O(P, Q)
97+ (fraction((P + Q), q, pow(S, o, r, s, o, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(P), toBigInt(Q), toBigInt(p)), 0, toBigInt(5), 1, (o / 2), DOWN)), pow((S - t), o, r, s, o, DOWN), p)))
9698 }
9799
98100
99-func S (T) = {
100- let U = valueOrElse(getInteger(D, (toString(T) + d)), 0)
101- let V = split(getStringValue(t, f), ",")
102- let W = split(getStringValue(t, e), ",")
103- if (if ((U >= parseIntValue(V[0])))
104- then (parseIntValue(V[1]) > U)
101+func T (U) = {
102+ let V = valueOrElse(getInteger(E, (toString(U) + d)), 0)
103+ let W = split(getStringValue(u, f), ",")
104+ let X = split(getStringValue(u, e), ",")
105+ if (if ((V >= parseIntValue(W[0])))
106+ then (parseIntValue(W[1]) > V)
105107 else false)
106- then (G - parseIntValue(W[0]))
107- else if (if ((U >= parseIntValue(V[1])))
108- then (parseIntValue(V[2]) > U)
108+ then (H - parseIntValue(X[0]))
109+ else if (if ((V >= parseIntValue(W[1])))
110+ then (parseIntValue(W[2]) > V)
109111 else false)
110- then (G - parseIntValue(W[1]))
111- else if (if ((U >= parseIntValue(V[2])))
112- then (parseIntValue(V[3]) > U)
112+ then (H - parseIntValue(X[1]))
113+ else if (if ((V >= parseIntValue(W[2])))
114+ then (parseIntValue(W[3]) > V)
113115 else false)
114- then (G - parseIntValue(W[2]))
115- else if (if ((U >= parseIntValue(V[3])))
116- then (parseIntValue(V[4]) > U)
116+ then (H - parseIntValue(X[2]))
117+ else if (if ((V >= parseIntValue(W[3])))
118+ then (parseIntValue(W[4]) > V)
117119 else false)
118- then (G - parseIntValue(W[3]))
119- else if ((U >= parseIntValue(V[4])))
120- then (G - parseIntValue(W[4]))
121- else G
120+ then (H - parseIntValue(X[3]))
121+ else if ((V >= parseIntValue(W[4])))
122+ then (H - parseIntValue(X[4]))
123+ else H
122124 }
123125
124126
125-func X (Y,Z,aa,ab,ac,ad,ae,af) = {
126- let ag = getIntegerValue(addressFromStringValue(ab[0]), ad[0])
127- let ah = getIntegerValue(addressFromStringValue(ab[0]), ad[1])
128- let ai = getIntegerValue(addressFromStringValue(ab[1]), ad[2])
129- let aj = getIntegerValue(addressFromStringValue(ab[1]), ad[3])
130- let ak = S(Y)
131- let al = if ((ac[0] == "cpmm"))
127+func Y (Z,aa,ab,ac,ad,ae,af,ag) = {
128+ let ah = T(Z)
129+ let ai = if ((ad[0] == "curveMultyFlat"))
132130 then {
133- let am = getIntegerValue(addressFromStringValue(ab[0]), m)
134- let an = fraction(ah, Z, (Z + ag))
135- fraction(an, (G - fraction(am, ak, G)), G)
131+ let aj = {
132+ let ak = invoke(addressFromStringValue(ac[0]), "getDy", [ae[0], ae[1], aa, toString(Z)], nil)
133+ if ($isInstanceOf(ak, "(Int, Int)"))
134+ then ak
135+ else throw(($getType(invoke(addressFromStringValue(ac[0]), "getDy", [ae[0], ae[1], aa, toString(Z)], nil)) + " couldn't be cast to (Int, Int)"))
136+ }
137+ if ((aj == aj))
138+ then aj._1
139+ else throw("Strict value is not equal to itself.")
136140 }
137- else if ((ac[0] == "flat"))
138- then {
139- let ao = Q(ag, ah)
140- let ap = af[0]
141- let aq = Q((ag + Z), (ah - ap))
142- if ((aq >= ao))
143- then ap
144- else throw("Flat contract: invariantNew < invariant")
141+ else {
142+ let al = getIntegerValue(addressFromStringValue(ac[0]), ae[0])
143+ let am = getIntegerValue(addressFromStringValue(ac[0]), ae[1])
144+ if ((ad[0] == "cpmm"))
145+ then {
146+ let an = getIntegerValue(addressFromStringValue(ac[0]), m)
147+ let ao = fraction(am, aa, (aa + al))
148+ fraction(ao, (H - fraction(an, ah, H)), H)
149+ }
150+ else if ((ad[0] == "flat"))
151+ then {
152+ let ap = R(al, am)
153+ let aq = ag[0]
154+ let ar = R((al + aa), (am - aq))
155+ if ((ar >= ap))
156+ then aq
157+ else throw("Flat contract: invariantNew < invariant")
158+ }
159+ else throw("Incorrect exchange type")
160+ }
161+ let as = if ((ad[1] == "curveMultyFlat"))
162+ then {
163+ let aj = {
164+ let ak = invoke(addressFromStringValue(ac[1]), "getDy", [ae[2], ae[3], ai, toString(Z)], nil)
165+ if ($isInstanceOf(ak, "(Int, Int)"))
166+ then ak
167+ else throw(($getType(invoke(addressFromStringValue(ac[1]), "getDy", [ae[2], ae[3], ai, toString(Z)], nil)) + " couldn't be cast to (Int, Int)"))
145168 }
146- else throw("Incorrect exchange type")
147- let ar = if ((ac[1] == "cpmm"))
148- then {
149- let as = fraction(aj, al, (al + ai))
150- let am = getIntegerValue(addressFromStringValue(ab[0]), m)
151- fraction(as, (G - fraction(am, ak, G)), G)
169+ if ((aj == aj))
170+ then aj._1
171+ else throw("Strict value is not equal to itself.")
152172 }
153- else if ((ac[1] == "flat"))
154- then {
155- let ao = Q(ai, aj)
156- let at = af[1]
157- let aq = Q((ai + al), (aj - at))
158- if ((aq >= ao))
159- then at
160- else throw("Flat contract: invariantNew < invariant")
161- }
162- else throw("Incorrect exchange type")
163- (ar >= aa)
173+ else {
174+ let at = getIntegerValue(addressFromStringValue(ac[1]), ae[2])
175+ let au = getIntegerValue(addressFromStringValue(ac[1]), ae[3])
176+ if ((ad[1] == "cpmm"))
177+ then {
178+ let av = fraction(au, ai, (ai + at))
179+ let an = getIntegerValue(addressFromStringValue(ac[1]), m)
180+ fraction(av, (H - fraction(an, ah, H)), H)
181+ }
182+ else if ((ad[1] == "flat"))
183+ then {
184+ let ap = R(at, au)
185+ let aw = ag[1]
186+ let ar = R((at + ai), (au - aw))
187+ if ((ar >= ap))
188+ then aw
189+ else throw("Flat contract: invariantNew < invariant")
190+ }
191+ else throw("Incorrect exchange type")
192+ }
193+ (as >= ab)
164194 }
165195
166196
167-@Callable(J)
168-func routingTrade (ab,ac,ae,af,ad,aa) = valueOrElse(H(), {
169- let au = $Tuple2(J.payments[0].amount, J.payments[0].assetId)
170- let Z = au._1
171- let av = au._2
172- if (!(X(J.caller, Z, aa, ab, ac, ad, ae, af)))
197+@Callable(K)
198+func routingTrade (ac,ad,af,ag,ae,ab) = valueOrElse(I(), {
199+ let ax = $Tuple2(K.payments[0].amount, K.payments[0].assetId)
200+ let aa = ax._1
201+ let ay = ax._2
202+ if (!(Y(K.caller, aa, ab, ac, ad, ae, af, ag)))
173203 then throw("Check transaction possibilty: declined")
174- else if (if (!(isDefined(getString(t, (c + ab[0])))))
204+ else if (if (!(isDefined(getString(u, (c + ac[0])))))
175205 then true
176- else !(isDefined(getString(t, (c + ab[1])))))
206+ else !(isDefined(getString(u, (c + ac[1])))))
177207 then throw("Pool is not in oracle")
178208 else {
179- let aw = size(ab)
180- func ax (ay,az) = {
181- let aA = ay
182- let aB = aA._1
183- let aC = aA._2
184- let aD = aA._3
185- let aE = if ((aB == 0))
186- then $Tuple2(av, Z)
187- else $Tuple2(aD, aC)
188- let aF = aE._1
189- let aG = aE._2
190- if (((if ((aB >= 0))
191- then (aw > aB)
209+ let az = size(ac)
210+ func aA (aB,aC) = {
211+ let aD = aB
212+ let aE = aD._1
213+ let aF = aD._2
214+ let aG = aD._3
215+ let aH = if ((aE == 0))
216+ then $Tuple2(ay, aa)
217+ else $Tuple2(aG, aF)
218+ let aI = aH._1
219+ let aJ = aH._2
220+ if (((if ((aE >= 0))
221+ then (az > aE)
192222 else false) == true))
193223 then {
194- let aH = addressFromStringValue(az)
195- let aI = if ((ac[aB] == "cpmm"))
196- then invoke(aH, "exchange", [ae[aB]], [AttachedPayment(aF, aG)])
197- else if ((ac[aB] == "flat"))
198- then invoke(aH, "exchange", [ae[aB], af[aB]], [AttachedPayment(aF, aG)])
199- else throw("Incorrect exchange type")
200- if ((aI == aI))
224+ let aK = addressFromStringValue(aC)
225+ if ((ad[aE] == "cpmm"))
201226 then {
202- let w = aI
203- if (if ($isInstanceOf(w, "(Int, Unit)"))
204- then true
205- else $isInstanceOf(w, "(Int, ByteVector)"))
227+ let aL = {
228+ let ak = invoke(aK, "exchange", [af[aE]], [AttachedPayment(aI, aJ)])
229+ if ($isInstanceOf(ak, "(Int, Int)"))
230+ then ak
231+ else throw(($getType(invoke(aK, "exchange", [af[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to (Int, Int)"))
232+ }
233+ if ((aL == aL))
206234 then {
207- let aI = w
208- let aJ = aI
209- let aK = aJ._1
210- let aL = aJ._2
211- $Tuple3((aB + 1), aK, aL)
235+ let aM = aL._2
236+ let aN = aL._1
237+ $Tuple3((aE + 1), aN, aM)
212238 }
213- else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
239+ else throw("Strict value is not equal to itself.")
214240 }
215- else throw("Strict value is not equal to itself.")
241+ else if ((ad[aE] == "flat"))
242+ then {
243+ let aj = {
244+ let ak = invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])
245+ if ($isInstanceOf(ak, "List[Any]"))
246+ then ak
247+ else throw(($getType(invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
248+ }
249+ if ((aj == aj))
250+ then $Tuple3((aE + 1), aj[0], aj[1])
251+ else throw("Strict value is not equal to itself.")
252+ }
253+ else if ((ad[aE] == "curveMultyFlat"))
254+ then {
255+ let aj = {
256+ let ak = invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])
257+ if ($isInstanceOf(ak, "List[Any]"))
258+ then ak
259+ else throw(($getType(invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
260+ }
261+ if ((aj == aj))
262+ then $Tuple3((aE + 1), aj[0], aj[1])
263+ else throw("Strict value is not equal to itself.")
264+ }
265+ else throw("Incorrect exchange type")
216266 }
217- else ay
267+ else aB
218268 }
219269
220- let aM = {
221- let aN = ab
222- let aO = size(aN)
223- let aP = $Tuple3(0, 0, base58'')
224- func aQ (aR,aS) = if ((aS >= aO))
225- then aR
226- else ax(aR, aN[aS])
270+ let aO = {
271+ let aP = ac
272+ let aQ = size(aP)
273+ let aR = $Tuple3(0, 0, base58'')
274+ func aS (aT,aU) = if ((aU >= aQ))
275+ then aT
276+ else aA(aT, aP[aU])
227277
228- func aT (aR,aS) = if ((aS >= aO))
229- then aR
278+ func aV (aT,aU) = if ((aU >= aQ))
279+ then aT
230280 else throw("List size exceeds 3")
231281
232- aT(aQ(aQ(aQ(aP, 0), 1), 2), 3)
282+ aV(aS(aS(aS(aR, 0), 1), 2), 3)
233283 }
234- let aB = aM._1
235- let aU = aM._2
236- let aL = aM._3
237- let aK = fraction(aU, (G - F), G)
238- if (if ((aB == aw))
239- then (aK >= aa)
284+ let aE = aO._1
285+ let aW = aO._2
286+ let aX = aO._3
287+ let aY = fraction(aW, (H - G), H)
288+ if (if ((aE == az))
289+ then (aY >= ab)
240290 else false)
241- then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)]
291+ then [ScriptTransfer(K.caller, aY, aX), ScriptTransfer(D, (aW - aY), aX)]
242292 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
243293 }
244294 })
245295
246296
247297
248-@Callable(J)
249-func shutdown () = valueOrElse(I(J), if (!(E))
298+@Callable(K)
299+func shutdown () = valueOrElse(J(K), if (!(F))
250300 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified")))
251- else L("Paused by admin"))
301+ else M("Paused by admin"))
252302
253303
254304
255-@Callable(J)
256-func activate () = valueOrElse(I(J), if (E)
257- then K()
305+@Callable(K)
306+func activate () = valueOrElse(J(K), if (F)
307+ then L()
258308 else [BooleanEntry(a, true), DeleteEntry(b)])
259309
260310
261-@Verifier(aV)
262-func aW () = {
263- let aX = {
264- let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z))
311+@Verifier(aZ)
312+func ba () = {
313+ let bb = {
314+ let bc = if (sigVerify(aZ.bodyBytes, aZ.proofs[0], A))
265315 then 1
266316 else 0
267- let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A))
317+ let bd = if (sigVerify(aZ.bodyBytes, aZ.proofs[1], B))
268318 then 1
269319 else 0
270- let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B))
320+ let be = if (sigVerify(aZ.bodyBytes, aZ.proofs[2], C))
271321 then 1
272322 else 0
273- (((aY + aZ) + ba) >= 2)
323+ (((bc + bd) + be) >= 2)
274324 }
275- let w = aV
276- aX
325+ let x = aZ
326+ bb
277327 }
278328
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "active"
55
66 let b = "shutdown_cause"
77
88 let c = "pool_"
99
1010 let d = "_SWOP_amount"
1111
1212 let e = "discounts"
1313
1414 let f = "discount_values"
1515
1616 let g = "routing_fee"
1717
1818 let h = "admin_pub_1"
1919
2020 let i = "admin_pub_2"
2121
2222 let j = "admin_pub_3"
2323
2424 let k = "money_box_address"
2525
2626 let l = "governance_address"
2727
2828 let m = "commission"
2929
30-let n = 8
30+let n = "_balance"
3131
32-let o = 100000000
32+let o = 8
3333
34-let p = 10000000000000000
34+let p = 100000000
3535
36-let q = 50
36+let q = 10000000000000000
3737
38-let r = 2
38+let r = 50
3939
40-let s = 4600000000000000
40+let s = 2
4141
42-let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
42+let t = 4600000000000000
4343
44-func u (v) = {
45- let w = getString(t, v)
46- if ($isInstanceOf(w, "String"))
44+let u = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
45+
46+func v (w) = {
47+ let x = getString(u, w)
48+ if ($isInstanceOf(x, "String"))
4749 then {
48- let x = w
49- fromBase58String(x)
50+ let y = x
51+ fromBase58String(y)
5052 }
5153 else {
52- let y = w
53- throw((v + "is empty"))
54+ let z = x
55+ throw((w + "is empty"))
5456 }
5557 }
5658
5759
58-let z = u(h)
60+let A = v(h)
5961
60-let A = u(i)
62+let B = v(i)
6163
62-let B = u(j)
64+let C = v(j)
6365
64-let C = Address(u(k))
66+let D = Address(v(k))
6567
66-let D = Address(u(l))
68+let E = Address(v(l))
6769
68-let E = valueOrElse(getBoolean(this, a), true)
70+let F = valueOrElse(getBoolean(this, a), true)
6971
70-let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty")
72+let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty")
7173
72-let G = 1000000
74+let H = 1000000
7375
74-func H () = if (E)
76+func I () = if (F)
7577 then unit
7678 else throw("DApp is inactive at this moment")
7779
7880
79-func I (J) = if (containsElement([z, A, B], J.callerPublicKey))
81+func J (K) = if (containsElement([A, B, C], K.callerPublicKey))
8082 then unit
8183 else throw("Only admin can call this function")
8284
8385
84-func K () = throw("DApp is already active")
86+func L () = throw("DApp is already active")
8587
8688
87-func L (M) = [BooleanEntry(a, false), StringEntry(b, M)]
89+func M (N) = [BooleanEntry(a, false), StringEntry(b, N)]
8890
8991
90-func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2)
92+func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2)
9193
9294
93-func Q (O,P) = {
94- let R = N(O, P)
95- (fraction((O + P), p, pow(R, n, q, r, n, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(O), toBigInt(P), toBigInt(o)), 0, toBigInt(5), 1, (n / 2), DOWN)), pow((R - s), n, q, r, n, DOWN), o)))
95+func R (P,Q) = {
96+ let S = O(P, Q)
97+ (fraction((P + Q), q, pow(S, o, r, s, o, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(P), toBigInt(Q), toBigInt(p)), 0, toBigInt(5), 1, (o / 2), DOWN)), pow((S - t), o, r, s, o, DOWN), p)))
9698 }
9799
98100
99-func S (T) = {
100- let U = valueOrElse(getInteger(D, (toString(T) + d)), 0)
101- let V = split(getStringValue(t, f), ",")
102- let W = split(getStringValue(t, e), ",")
103- if (if ((U >= parseIntValue(V[0])))
104- then (parseIntValue(V[1]) > U)
101+func T (U) = {
102+ let V = valueOrElse(getInteger(E, (toString(U) + d)), 0)
103+ let W = split(getStringValue(u, f), ",")
104+ let X = split(getStringValue(u, e), ",")
105+ if (if ((V >= parseIntValue(W[0])))
106+ then (parseIntValue(W[1]) > V)
105107 else false)
106- then (G - parseIntValue(W[0]))
107- else if (if ((U >= parseIntValue(V[1])))
108- then (parseIntValue(V[2]) > U)
108+ then (H - parseIntValue(X[0]))
109+ else if (if ((V >= parseIntValue(W[1])))
110+ then (parseIntValue(W[2]) > V)
109111 else false)
110- then (G - parseIntValue(W[1]))
111- else if (if ((U >= parseIntValue(V[2])))
112- then (parseIntValue(V[3]) > U)
112+ then (H - parseIntValue(X[1]))
113+ else if (if ((V >= parseIntValue(W[2])))
114+ then (parseIntValue(W[3]) > V)
113115 else false)
114- then (G - parseIntValue(W[2]))
115- else if (if ((U >= parseIntValue(V[3])))
116- then (parseIntValue(V[4]) > U)
116+ then (H - parseIntValue(X[2]))
117+ else if (if ((V >= parseIntValue(W[3])))
118+ then (parseIntValue(W[4]) > V)
117119 else false)
118- then (G - parseIntValue(W[3]))
119- else if ((U >= parseIntValue(V[4])))
120- then (G - parseIntValue(W[4]))
121- else G
120+ then (H - parseIntValue(X[3]))
121+ else if ((V >= parseIntValue(W[4])))
122+ then (H - parseIntValue(X[4]))
123+ else H
122124 }
123125
124126
125-func X (Y,Z,aa,ab,ac,ad,ae,af) = {
126- let ag = getIntegerValue(addressFromStringValue(ab[0]), ad[0])
127- let ah = getIntegerValue(addressFromStringValue(ab[0]), ad[1])
128- let ai = getIntegerValue(addressFromStringValue(ab[1]), ad[2])
129- let aj = getIntegerValue(addressFromStringValue(ab[1]), ad[3])
130- let ak = S(Y)
131- let al = if ((ac[0] == "cpmm"))
127+func Y (Z,aa,ab,ac,ad,ae,af,ag) = {
128+ let ah = T(Z)
129+ let ai = if ((ad[0] == "curveMultyFlat"))
132130 then {
133- let am = getIntegerValue(addressFromStringValue(ab[0]), m)
134- let an = fraction(ah, Z, (Z + ag))
135- fraction(an, (G - fraction(am, ak, G)), G)
131+ let aj = {
132+ let ak = invoke(addressFromStringValue(ac[0]), "getDy", [ae[0], ae[1], aa, toString(Z)], nil)
133+ if ($isInstanceOf(ak, "(Int, Int)"))
134+ then ak
135+ else throw(($getType(invoke(addressFromStringValue(ac[0]), "getDy", [ae[0], ae[1], aa, toString(Z)], nil)) + " couldn't be cast to (Int, Int)"))
136+ }
137+ if ((aj == aj))
138+ then aj._1
139+ else throw("Strict value is not equal to itself.")
136140 }
137- else if ((ac[0] == "flat"))
138- then {
139- let ao = Q(ag, ah)
140- let ap = af[0]
141- let aq = Q((ag + Z), (ah - ap))
142- if ((aq >= ao))
143- then ap
144- else throw("Flat contract: invariantNew < invariant")
141+ else {
142+ let al = getIntegerValue(addressFromStringValue(ac[0]), ae[0])
143+ let am = getIntegerValue(addressFromStringValue(ac[0]), ae[1])
144+ if ((ad[0] == "cpmm"))
145+ then {
146+ let an = getIntegerValue(addressFromStringValue(ac[0]), m)
147+ let ao = fraction(am, aa, (aa + al))
148+ fraction(ao, (H - fraction(an, ah, H)), H)
149+ }
150+ else if ((ad[0] == "flat"))
151+ then {
152+ let ap = R(al, am)
153+ let aq = ag[0]
154+ let ar = R((al + aa), (am - aq))
155+ if ((ar >= ap))
156+ then aq
157+ else throw("Flat contract: invariantNew < invariant")
158+ }
159+ else throw("Incorrect exchange type")
160+ }
161+ let as = if ((ad[1] == "curveMultyFlat"))
162+ then {
163+ let aj = {
164+ let ak = invoke(addressFromStringValue(ac[1]), "getDy", [ae[2], ae[3], ai, toString(Z)], nil)
165+ if ($isInstanceOf(ak, "(Int, Int)"))
166+ then ak
167+ else throw(($getType(invoke(addressFromStringValue(ac[1]), "getDy", [ae[2], ae[3], ai, toString(Z)], nil)) + " couldn't be cast to (Int, Int)"))
145168 }
146- else throw("Incorrect exchange type")
147- let ar = if ((ac[1] == "cpmm"))
148- then {
149- let as = fraction(aj, al, (al + ai))
150- let am = getIntegerValue(addressFromStringValue(ab[0]), m)
151- fraction(as, (G - fraction(am, ak, G)), G)
169+ if ((aj == aj))
170+ then aj._1
171+ else throw("Strict value is not equal to itself.")
152172 }
153- else if ((ac[1] == "flat"))
154- then {
155- let ao = Q(ai, aj)
156- let at = af[1]
157- let aq = Q((ai + al), (aj - at))
158- if ((aq >= ao))
159- then at
160- else throw("Flat contract: invariantNew < invariant")
161- }
162- else throw("Incorrect exchange type")
163- (ar >= aa)
173+ else {
174+ let at = getIntegerValue(addressFromStringValue(ac[1]), ae[2])
175+ let au = getIntegerValue(addressFromStringValue(ac[1]), ae[3])
176+ if ((ad[1] == "cpmm"))
177+ then {
178+ let av = fraction(au, ai, (ai + at))
179+ let an = getIntegerValue(addressFromStringValue(ac[1]), m)
180+ fraction(av, (H - fraction(an, ah, H)), H)
181+ }
182+ else if ((ad[1] == "flat"))
183+ then {
184+ let ap = R(at, au)
185+ let aw = ag[1]
186+ let ar = R((at + ai), (au - aw))
187+ if ((ar >= ap))
188+ then aw
189+ else throw("Flat contract: invariantNew < invariant")
190+ }
191+ else throw("Incorrect exchange type")
192+ }
193+ (as >= ab)
164194 }
165195
166196
167-@Callable(J)
168-func routingTrade (ab,ac,ae,af,ad,aa) = valueOrElse(H(), {
169- let au = $Tuple2(J.payments[0].amount, J.payments[0].assetId)
170- let Z = au._1
171- let av = au._2
172- if (!(X(J.caller, Z, aa, ab, ac, ad, ae, af)))
197+@Callable(K)
198+func routingTrade (ac,ad,af,ag,ae,ab) = valueOrElse(I(), {
199+ let ax = $Tuple2(K.payments[0].amount, K.payments[0].assetId)
200+ let aa = ax._1
201+ let ay = ax._2
202+ if (!(Y(K.caller, aa, ab, ac, ad, ae, af, ag)))
173203 then throw("Check transaction possibilty: declined")
174- else if (if (!(isDefined(getString(t, (c + ab[0])))))
204+ else if (if (!(isDefined(getString(u, (c + ac[0])))))
175205 then true
176- else !(isDefined(getString(t, (c + ab[1])))))
206+ else !(isDefined(getString(u, (c + ac[1])))))
177207 then throw("Pool is not in oracle")
178208 else {
179- let aw = size(ab)
180- func ax (ay,az) = {
181- let aA = ay
182- let aB = aA._1
183- let aC = aA._2
184- let aD = aA._3
185- let aE = if ((aB == 0))
186- then $Tuple2(av, Z)
187- else $Tuple2(aD, aC)
188- let aF = aE._1
189- let aG = aE._2
190- if (((if ((aB >= 0))
191- then (aw > aB)
209+ let az = size(ac)
210+ func aA (aB,aC) = {
211+ let aD = aB
212+ let aE = aD._1
213+ let aF = aD._2
214+ let aG = aD._3
215+ let aH = if ((aE == 0))
216+ then $Tuple2(ay, aa)
217+ else $Tuple2(aG, aF)
218+ let aI = aH._1
219+ let aJ = aH._2
220+ if (((if ((aE >= 0))
221+ then (az > aE)
192222 else false) == true))
193223 then {
194- let aH = addressFromStringValue(az)
195- let aI = if ((ac[aB] == "cpmm"))
196- then invoke(aH, "exchange", [ae[aB]], [AttachedPayment(aF, aG)])
197- else if ((ac[aB] == "flat"))
198- then invoke(aH, "exchange", [ae[aB], af[aB]], [AttachedPayment(aF, aG)])
199- else throw("Incorrect exchange type")
200- if ((aI == aI))
224+ let aK = addressFromStringValue(aC)
225+ if ((ad[aE] == "cpmm"))
201226 then {
202- let w = aI
203- if (if ($isInstanceOf(w, "(Int, Unit)"))
204- then true
205- else $isInstanceOf(w, "(Int, ByteVector)"))
227+ let aL = {
228+ let ak = invoke(aK, "exchange", [af[aE]], [AttachedPayment(aI, aJ)])
229+ if ($isInstanceOf(ak, "(Int, Int)"))
230+ then ak
231+ else throw(($getType(invoke(aK, "exchange", [af[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to (Int, Int)"))
232+ }
233+ if ((aL == aL))
206234 then {
207- let aI = w
208- let aJ = aI
209- let aK = aJ._1
210- let aL = aJ._2
211- $Tuple3((aB + 1), aK, aL)
235+ let aM = aL._2
236+ let aN = aL._1
237+ $Tuple3((aE + 1), aN, aM)
212238 }
213- else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
239+ else throw("Strict value is not equal to itself.")
214240 }
215- else throw("Strict value is not equal to itself.")
241+ else if ((ad[aE] == "flat"))
242+ then {
243+ let aj = {
244+ let ak = invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])
245+ if ($isInstanceOf(ak, "List[Any]"))
246+ then ak
247+ else throw(($getType(invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
248+ }
249+ if ((aj == aj))
250+ then $Tuple3((aE + 1), aj[0], aj[1])
251+ else throw("Strict value is not equal to itself.")
252+ }
253+ else if ((ad[aE] == "curveMultyFlat"))
254+ then {
255+ let aj = {
256+ let ak = invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])
257+ if ($isInstanceOf(ak, "List[Any]"))
258+ then ak
259+ else throw(($getType(invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
260+ }
261+ if ((aj == aj))
262+ then $Tuple3((aE + 1), aj[0], aj[1])
263+ else throw("Strict value is not equal to itself.")
264+ }
265+ else throw("Incorrect exchange type")
216266 }
217- else ay
267+ else aB
218268 }
219269
220- let aM = {
221- let aN = ab
222- let aO = size(aN)
223- let aP = $Tuple3(0, 0, base58'')
224- func aQ (aR,aS) = if ((aS >= aO))
225- then aR
226- else ax(aR, aN[aS])
270+ let aO = {
271+ let aP = ac
272+ let aQ = size(aP)
273+ let aR = $Tuple3(0, 0, base58'')
274+ func aS (aT,aU) = if ((aU >= aQ))
275+ then aT
276+ else aA(aT, aP[aU])
227277
228- func aT (aR,aS) = if ((aS >= aO))
229- then aR
278+ func aV (aT,aU) = if ((aU >= aQ))
279+ then aT
230280 else throw("List size exceeds 3")
231281
232- aT(aQ(aQ(aQ(aP, 0), 1), 2), 3)
282+ aV(aS(aS(aS(aR, 0), 1), 2), 3)
233283 }
234- let aB = aM._1
235- let aU = aM._2
236- let aL = aM._3
237- let aK = fraction(aU, (G - F), G)
238- if (if ((aB == aw))
239- then (aK >= aa)
284+ let aE = aO._1
285+ let aW = aO._2
286+ let aX = aO._3
287+ let aY = fraction(aW, (H - G), H)
288+ if (if ((aE == az))
289+ then (aY >= ab)
240290 else false)
241- then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)]
291+ then [ScriptTransfer(K.caller, aY, aX), ScriptTransfer(D, (aW - aY), aX)]
242292 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
243293 }
244294 })
245295
246296
247297
248-@Callable(J)
249-func shutdown () = valueOrElse(I(J), if (!(E))
298+@Callable(K)
299+func shutdown () = valueOrElse(J(K), if (!(F))
250300 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified")))
251- else L("Paused by admin"))
301+ else M("Paused by admin"))
252302
253303
254304
255-@Callable(J)
256-func activate () = valueOrElse(I(J), if (E)
257- then K()
305+@Callable(K)
306+func activate () = valueOrElse(J(K), if (F)
307+ then L()
258308 else [BooleanEntry(a, true), DeleteEntry(b)])
259309
260310
261-@Verifier(aV)
262-func aW () = {
263- let aX = {
264- let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z))
311+@Verifier(aZ)
312+func ba () = {
313+ let bb = {
314+ let bc = if (sigVerify(aZ.bodyBytes, aZ.proofs[0], A))
265315 then 1
266316 else 0
267- let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A))
317+ let bd = if (sigVerify(aZ.bodyBytes, aZ.proofs[1], B))
268318 then 1
269319 else 0
270- let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B))
320+ let be = if (sigVerify(aZ.bodyBytes, aZ.proofs[2], C))
271321 then 1
272322 else 0
273- (((aY + aZ) + ba) >= 2)
323+ (((bc + bd) + be) >= 2)
274324 }
275- let w = aV
276- aX
325+ let x = aZ
326+ bb
277327 }
278328

github/deemru/w8io/026f985 
89.76 ms