tx · H4VGBBU9ZmrA8XG9vmczGMcjAAV8SKNLbViTLz48Mfym

3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8:  -0.01500000 Waves

2022.09.14 14:41 [2228723] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves

{ "type": 13, "id": "H4VGBBU9ZmrA8XG9vmczGMcjAAV8SKNLbViTLz48Mfym", "fee": 1500000, "feeAssetId": null, "timestamp": 1663155683206, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "2tHzUwUA1Bx9KomMZrNV1yghfcHw6qbBnmjA9ttHCX4zDiD77qt6s3XYQQ47wnkHxg2m722UhB2q8TFmBToLrq42", "3TPKwowN1pSR8b4kaWpfq9XEXL4LcJRBqfWvsseweiVL5HtkWfZa6hsdMyzfhUV1zjk9MDo8vB4s9DxjSqn9ZCQb" ], "script": "base64:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJQAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABF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AAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAIEAAAAByRtYXRjaDAFAAAAAnR4BQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5zm9b11w==", "height": 2228723, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8aZNzeXShrL1Rw5LTm67zxmAZmUidW3Ju65FeooUdt64 Next: 9922meKgC3fkWX2itfeaHUKhNTCJ5GfdoasNvt4pE4S6 Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "active"
2727
2828 let m = "commission"
2929
30-let n = "_balance"
30+let n = 8
3131
32-let o = 8
32+let o = 100000000
3333
34-let p = 100000000
34+let p = 10000000000000000
3535
36-let q = 10000000000000000
36+let q = 50
3737
38-let r = 50
38+let r = 2
3939
40-let s = 2
40+let s = 4600000000000000
4141
42-let t = 4600000000000000
42+let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
4343
44-let u = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
45-
46-func v (w) = {
47- let x = getString(u, w)
48- if ($isInstanceOf(x, "String"))
44+func u (v) = {
45+ let w = getString(t, v)
46+ if ($isInstanceOf(w, "String"))
4947 then {
50- let y = x
51- fromBase58String(y)
48+ let x = w
49+ fromBase58String(x)
5250 }
5351 else {
54- let z = x
55- throw((w + "is empty"))
52+ let y = w
53+ throw((v + "is empty"))
5654 }
5755 }
5856
5957
60-let A = v(h)
58+let z = u(h)
6159
62-let B = v(i)
60+let A = u(i)
6361
64-let C = v(j)
62+let B = u(j)
6563
66-let D = Address(v(k))
64+let C = Address(u(k))
6765
68-let E = Address(v(l))
66+let D = Address(u(l))
6967
70-let F = valueOrElse(getBoolean(this, a), true)
68+let E = valueOrElse(getBoolean(this, a), true)
7169
72-let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty")
70+let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty")
7371
74-let H = 1000000
72+let G = 1000000
7573
76-func I () = if (F)
74+func H () = if (E)
7775 then unit
7876 else throw("DApp is inactive at this moment")
7977
8078
81-func J (K) = if (containsElement([A, B, C], K.callerPublicKey))
79+func I (J) = if (containsElement([z, A, B], J.callerPublicKey))
8280 then unit
8381 else throw("Only admin can call this function")
8482
8583
86-func L () = throw("DApp is already active")
84+func K () = throw("DApp is already active")
8785
8886
89-func M (N) = [BooleanEntry(a, false), StringEntry(b, N)]
87+func L (M) = [BooleanEntry(a, false), StringEntry(b, M)]
9088
9189
92-func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2)
90+func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2)
9391
9492
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)))
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)))
9896 }
9997
10098
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)
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)
107105 else false)
108- then (H - parseIntValue(X[0]))
109- else if (if ((V >= parseIntValue(W[1])))
110- then (parseIntValue(W[2]) > V)
106+ then (G - parseIntValue(W[0]))
107+ else if (if ((U >= parseIntValue(V[1])))
108+ then (parseIntValue(V[2]) > U)
111109 else false)
112- then (H - parseIntValue(X[1]))
113- else if (if ((V >= parseIntValue(W[2])))
114- then (parseIntValue(W[3]) > V)
110+ then (G - parseIntValue(W[1]))
111+ else if (if ((U >= parseIntValue(V[2])))
112+ then (parseIntValue(V[3]) > U)
115113 else false)
116- then (H - parseIntValue(X[2]))
117- else if (if ((V >= parseIntValue(W[3])))
118- then (parseIntValue(W[4]) > V)
114+ then (G - parseIntValue(W[2]))
115+ else if (if ((U >= parseIntValue(V[3])))
116+ then (parseIntValue(V[4]) > U)
119117 else false)
120- then (H - parseIntValue(X[3]))
121- else if ((V >= parseIntValue(W[4])))
122- then (H - parseIntValue(X[4]))
123- else H
118+ then (G - parseIntValue(W[3]))
119+ else if ((U >= parseIntValue(V[4])))
120+ then (G - parseIntValue(W[4]))
121+ else G
124122 }
125123
126124
127-func Y (Z,aa,ab,ac,ad,ae,af,ag) = {
128- let ah = T(Z)
129- let ai = if ((ad[0] == "curveMultyFlat"))
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"))
130132 then {
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)"))
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)
136+ }
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")
136145 }
137- if ((aj == aj))
138- then aj._1
139- else throw("Strict value is not equal to itself.")
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)
140152 }
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)"))
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")
168161 }
169- if ((aj == aj))
170- then aj._1
171- else throw("Strict value is not equal to itself.")
172- }
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)
162+ else throw("Incorrect exchange type")
163+ (ar >= aa)
194164 }
195165
196166
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)))
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)))
203173 then throw("Check transaction possibilty: declined")
204- else if (if (!(isDefined(getString(u, (c + ac[0])))))
174+ else if (if (!(isDefined(getString(t, (c + ab[0])))))
205175 then true
206- else !(isDefined(getString(u, (c + ac[1])))))
176+ else !(isDefined(getString(t, (c + ab[1])))))
207177 then throw("Pool is not in oracle")
208178 else {
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)
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)
222192 else false) == true))
223193 then {
224- let aK = addressFromStringValue(aC)
225- if ((ad[aE] == "cpmm"))
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))
226201 then {
227- let aj = {
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 ((aj == aj))
234- then $Tuple3((aE + 1), aj._1, aj._2)
235- else throw("Strict value is not equal to itself.")
202+ let w = aI
203+ if (if ($isInstanceOf(w, "(Int, Unit)"))
204+ then true
205+ else $isInstanceOf(w, "(Int, ByteVector)"))
206+ 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)
212+ }
213+ else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
236214 }
237- else if ((ad[aE] == "flat"))
238- then {
239- let aj = {
240- let ak = invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])
241- if ($isInstanceOf(ak, "List[Any]"))
242- then ak
243- else throw(($getType(invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
244- }
245- if ((aj == aj))
246- then $Tuple3((aE + 1), aj[0], aj[1])
247- else throw("Strict value is not equal to itself.")
248- }
249- else if ((ad[aE] == "curveMultyFlat"))
250- then {
251- let aj = {
252- let ak = invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])
253- if ($isInstanceOf(ak, "List[Any]"))
254- then ak
255- else throw(($getType(invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
256- }
257- if ((aj == aj))
258- then $Tuple3((aE + 1), aj[0], aj[1])
259- else throw("Strict value is not equal to itself.")
260- }
261- else throw("Incorrect exchange type")
215+ else throw("Strict value is not equal to itself.")
262216 }
263- else aB
217+ else ay
264218 }
265219
266- let aL = {
267- let aM = ac
268- let aN = size(aM)
269- let aO = $Tuple3(0, 0, base58'')
270- func aP (aQ,aR) = if ((aR >= aN))
271- then aQ
272- else aA(aQ, aM[aR])
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])
273227
274- func aS (aQ,aR) = if ((aR >= aN))
275- then aQ
228+ func aT (aR,aS) = if ((aS >= aO))
229+ then aR
276230 else throw("List size exceeds 3")
277231
278- aS(aP(aP(aP(aO, 0), 1), 2), 3)
232+ aT(aQ(aQ(aQ(aP, 0), 1), 2), 3)
279233 }
280- let aE = aL._1
281- let aT = aL._2
282- let aU = aL._3
283- let aV = fraction(aT, (H - G), H)
284- if (if ((aE == az))
285- then (aV >= ab)
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)
286240 else false)
287- then [ScriptTransfer(K.caller, aV, aU), ScriptTransfer(D, (aT - aV), aU)]
241+ then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)]
288242 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
289243 }
290244 })
291245
292246
293247
294-@Callable(K)
295-func shutdown () = valueOrElse(J(K), if (!(F))
248+@Callable(J)
249+func shutdown () = valueOrElse(I(J), if (!(E))
296250 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified")))
297- else M("Paused by admin"))
251+ else L("Paused by admin"))
298252
299253
300254
301-@Callable(K)
302-func activate () = valueOrElse(J(K), if (F)
303- then L()
255+@Callable(J)
256+func activate () = valueOrElse(I(J), if (E)
257+ then K()
304258 else [BooleanEntry(a, true), DeleteEntry(b)])
305259
306260
307-@Verifier(aW)
308-func aX () = {
309- let aY = {
310- let aZ = if (sigVerify(aW.bodyBytes, aW.proofs[0], A))
261+@Verifier(aV)
262+func aW () = {
263+ let aX = {
264+ let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z))
311265 then 1
312266 else 0
313- let ba = if (sigVerify(aW.bodyBytes, aW.proofs[1], B))
267+ let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A))
314268 then 1
315269 else 0
316- let bb = if (sigVerify(aW.bodyBytes, aW.proofs[2], C))
270+ let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B))
317271 then 1
318272 else 0
319- (((aZ + ba) + bb) >= 2)
273+ (((aY + aZ) + ba) >= 2)
320274 }
321- let x = aW
322- aY
275+ let w = aV
276+ aX
323277 }
324278
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
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 = "_balance"
30+let n = 8
3131
32-let o = 8
32+let o = 100000000
3333
34-let p = 100000000
34+let p = 10000000000000000
3535
36-let q = 10000000000000000
36+let q = 50
3737
38-let r = 50
38+let r = 2
3939
40-let s = 2
40+let s = 4600000000000000
4141
42-let t = 4600000000000000
42+let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
4343
44-let u = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
45-
46-func v (w) = {
47- let x = getString(u, w)
48- if ($isInstanceOf(x, "String"))
44+func u (v) = {
45+ let w = getString(t, v)
46+ if ($isInstanceOf(w, "String"))
4947 then {
50- let y = x
51- fromBase58String(y)
48+ let x = w
49+ fromBase58String(x)
5250 }
5351 else {
54- let z = x
55- throw((w + "is empty"))
52+ let y = w
53+ throw((v + "is empty"))
5654 }
5755 }
5856
5957
60-let A = v(h)
58+let z = u(h)
6159
62-let B = v(i)
60+let A = u(i)
6361
64-let C = v(j)
62+let B = u(j)
6563
66-let D = Address(v(k))
64+let C = Address(u(k))
6765
68-let E = Address(v(l))
66+let D = Address(u(l))
6967
70-let F = valueOrElse(getBoolean(this, a), true)
68+let E = valueOrElse(getBoolean(this, a), true)
7169
72-let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty")
70+let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty")
7371
74-let H = 1000000
72+let G = 1000000
7573
76-func I () = if (F)
74+func H () = if (E)
7775 then unit
7876 else throw("DApp is inactive at this moment")
7977
8078
81-func J (K) = if (containsElement([A, B, C], K.callerPublicKey))
79+func I (J) = if (containsElement([z, A, B], J.callerPublicKey))
8280 then unit
8381 else throw("Only admin can call this function")
8482
8583
86-func L () = throw("DApp is already active")
84+func K () = throw("DApp is already active")
8785
8886
89-func M (N) = [BooleanEntry(a, false), StringEntry(b, N)]
87+func L (M) = [BooleanEntry(a, false), StringEntry(b, M)]
9088
9189
92-func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2)
90+func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2)
9391
9492
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)))
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)))
9896 }
9997
10098
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)
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)
107105 else false)
108- then (H - parseIntValue(X[0]))
109- else if (if ((V >= parseIntValue(W[1])))
110- then (parseIntValue(W[2]) > V)
106+ then (G - parseIntValue(W[0]))
107+ else if (if ((U >= parseIntValue(V[1])))
108+ then (parseIntValue(V[2]) > U)
111109 else false)
112- then (H - parseIntValue(X[1]))
113- else if (if ((V >= parseIntValue(W[2])))
114- then (parseIntValue(W[3]) > V)
110+ then (G - parseIntValue(W[1]))
111+ else if (if ((U >= parseIntValue(V[2])))
112+ then (parseIntValue(V[3]) > U)
115113 else false)
116- then (H - parseIntValue(X[2]))
117- else if (if ((V >= parseIntValue(W[3])))
118- then (parseIntValue(W[4]) > V)
114+ then (G - parseIntValue(W[2]))
115+ else if (if ((U >= parseIntValue(V[3])))
116+ then (parseIntValue(V[4]) > U)
119117 else false)
120- then (H - parseIntValue(X[3]))
121- else if ((V >= parseIntValue(W[4])))
122- then (H - parseIntValue(X[4]))
123- else H
118+ then (G - parseIntValue(W[3]))
119+ else if ((U >= parseIntValue(V[4])))
120+ then (G - parseIntValue(W[4]))
121+ else G
124122 }
125123
126124
127-func Y (Z,aa,ab,ac,ad,ae,af,ag) = {
128- let ah = T(Z)
129- let ai = if ((ad[0] == "curveMultyFlat"))
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"))
130132 then {
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)"))
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)
136+ }
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")
136145 }
137- if ((aj == aj))
138- then aj._1
139- else throw("Strict value is not equal to itself.")
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)
140152 }
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)"))
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")
168161 }
169- if ((aj == aj))
170- then aj._1
171- else throw("Strict value is not equal to itself.")
172- }
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)
162+ else throw("Incorrect exchange type")
163+ (ar >= aa)
194164 }
195165
196166
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)))
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)))
203173 then throw("Check transaction possibilty: declined")
204- else if (if (!(isDefined(getString(u, (c + ac[0])))))
174+ else if (if (!(isDefined(getString(t, (c + ab[0])))))
205175 then true
206- else !(isDefined(getString(u, (c + ac[1])))))
176+ else !(isDefined(getString(t, (c + ab[1])))))
207177 then throw("Pool is not in oracle")
208178 else {
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)
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)
222192 else false) == true))
223193 then {
224- let aK = addressFromStringValue(aC)
225- if ((ad[aE] == "cpmm"))
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))
226201 then {
227- let aj = {
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 ((aj == aj))
234- then $Tuple3((aE + 1), aj._1, aj._2)
235- else throw("Strict value is not equal to itself.")
202+ let w = aI
203+ if (if ($isInstanceOf(w, "(Int, Unit)"))
204+ then true
205+ else $isInstanceOf(w, "(Int, ByteVector)"))
206+ 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)
212+ }
213+ else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend")
236214 }
237- else if ((ad[aE] == "flat"))
238- then {
239- let aj = {
240- let ak = invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])
241- if ($isInstanceOf(ak, "List[Any]"))
242- then ak
243- else throw(($getType(invoke(aK, "exchange", [af[aE], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
244- }
245- if ((aj == aj))
246- then $Tuple3((aE + 1), aj[0], aj[1])
247- else throw("Strict value is not equal to itself.")
248- }
249- else if ((ad[aE] == "curveMultyFlat"))
250- then {
251- let aj = {
252- let ak = invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])
253- if ($isInstanceOf(ak, "List[Any]"))
254- then ak
255- else throw(($getType(invoke(aK, "exchange", [ae[((aE * 2) + 1)], ag[aE]], [AttachedPayment(aI, aJ)])) + " couldn't be cast to List[Any]"))
256- }
257- if ((aj == aj))
258- then $Tuple3((aE + 1), aj[0], aj[1])
259- else throw("Strict value is not equal to itself.")
260- }
261- else throw("Incorrect exchange type")
215+ else throw("Strict value is not equal to itself.")
262216 }
263- else aB
217+ else ay
264218 }
265219
266- let aL = {
267- let aM = ac
268- let aN = size(aM)
269- let aO = $Tuple3(0, 0, base58'')
270- func aP (aQ,aR) = if ((aR >= aN))
271- then aQ
272- else aA(aQ, aM[aR])
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])
273227
274- func aS (aQ,aR) = if ((aR >= aN))
275- then aQ
228+ func aT (aR,aS) = if ((aS >= aO))
229+ then aR
276230 else throw("List size exceeds 3")
277231
278- aS(aP(aP(aP(aO, 0), 1), 2), 3)
232+ aT(aQ(aQ(aQ(aP, 0), 1), 2), 3)
279233 }
280- let aE = aL._1
281- let aT = aL._2
282- let aU = aL._3
283- let aV = fraction(aT, (H - G), H)
284- if (if ((aE == az))
285- then (aV >= ab)
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)
286240 else false)
287- then [ScriptTransfer(K.caller, aV, aU), ScriptTransfer(D, (aT - aV), aU)]
241+ then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)]
288242 else throw("routing != routingSize or amountToRecieve < minAmountToReceive")
289243 }
290244 })
291245
292246
293247
294-@Callable(K)
295-func shutdown () = valueOrElse(J(K), if (!(F))
248+@Callable(J)
249+func shutdown () = valueOrElse(I(J), if (!(E))
296250 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified")))
297- else M("Paused by admin"))
251+ else L("Paused by admin"))
298252
299253
300254
301-@Callable(K)
302-func activate () = valueOrElse(J(K), if (F)
303- then L()
255+@Callable(J)
256+func activate () = valueOrElse(I(J), if (E)
257+ then K()
304258 else [BooleanEntry(a, true), DeleteEntry(b)])
305259
306260
307-@Verifier(aW)
308-func aX () = {
309- let aY = {
310- let aZ = if (sigVerify(aW.bodyBytes, aW.proofs[0], A))
261+@Verifier(aV)
262+func aW () = {
263+ let aX = {
264+ let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z))
311265 then 1
312266 else 0
313- let ba = if (sigVerify(aW.bodyBytes, aW.proofs[1], B))
267+ let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A))
314268 then 1
315269 else 0
316- let bb = if (sigVerify(aW.bodyBytes, aW.proofs[2], C))
270+ let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B))
317271 then 1
318272 else 0
319- (((aZ + ba) + bb) >= 2)
273+ (((aY + aZ) + ba) >= 2)
320274 }
321- let x = aW
322- aY
275+ let w = aV
276+ aX
323277 }
324278

github/deemru/w8io/169f3d6 
91.75 ms