tx · AGf5gH31wVmghTYnEYRiYE8sxUGvwXCudkWSEQALvWqj 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8: -0.14000000 Waves 2022.06.02 14:17 [2078639] smart account 3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8 > SELF 0.00000000 Waves
{ "type": 13, "id": "AGf5gH31wVmghTYnEYRiYE8sxUGvwXCudkWSEQALvWqj", "fee": 14000000, "feeAssetId": null, "timestamp": 1654168626410, "version": 2, "chainId": 84, "sender": "3MqDf9VgoL9eqrCPx8F74Au6xBpvdTm9UP8", "senderPublicKey": "4ja2PX5eqM576zv9KGzu5Qe7M92Z3jbuSmkLPdGjK4ue", "proofs": [ "3osEDSHDcgmXiDq5t997vRYKsgS1ZSTw5e8iRBozkoyt7BR2oTYHNyPH6DBok93BF5jXCUwT5o2u674eXwpMhE6o", "3CiHhTi8YU3AmcTRcthEASrZ6SUn4hk1jm314WmXxJ8C52sHfGp8jphcYW6CKynQU3q196cVCy8AV1UAeenk3yhw" ], "script": "base64:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJQAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABFtb25leV9ib3hfY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AAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAIEAAAAByRtYXRjaDAFAAAAAnR4BQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5zm9b11w==", "height": 2078639, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BNksmBfsvFo3wKhqhpG7cR2v3R84wAddhAmrLbQo9QCR Next: 3RmRwRySRNKjzx8kLkRPiDrmVe3woY2LPiJPRsnkcGFH Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let b = "shutdown_cause" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "pool_" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "_SWOP_amount" | |
11 | 11 | ||
12 | - | let e = " | |
12 | + | let e = "discounts" | |
13 | 13 | ||
14 | - | let f = " | |
14 | + | let f = "discount_values" | |
15 | 15 | ||
16 | - | let g = " | |
16 | + | let g = "routing_fee" | |
17 | 17 | ||
18 | - | let h = " | |
18 | + | let h = "admin_pub_1" | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "admin_pub_2" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "admin_pub_3" | |
23 | 23 | ||
24 | - | let k = | |
24 | + | let k = "money_box_address" | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = "governance_address" | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = "commission" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 8 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 100000000 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 10000000000000000 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 50 | |
37 | 37 | ||
38 | - | func r (s) = { | |
39 | - | let t = getString(q, s) | |
40 | - | if ($isInstanceOf(t, "String")) | |
38 | + | let r = 2 | |
39 | + | ||
40 | + | let s = 4600000000000000 | |
41 | + | ||
42 | + | let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | + | ||
44 | + | func u (v) = { | |
45 | + | let w = getString(t, v) | |
46 | + | if ($isInstanceOf(w, "String")) | |
41 | 47 | then { | |
42 | - | let | |
43 | - | fromBase58String( | |
48 | + | let x = w | |
49 | + | fromBase58String(x) | |
44 | 50 | } | |
45 | 51 | else { | |
46 | - | let | |
47 | - | throw(( | |
52 | + | let y = w | |
53 | + | throw((v + "is empty")) | |
48 | 54 | } | |
49 | 55 | } | |
50 | 56 | ||
51 | 57 | ||
52 | - | let | |
58 | + | let z = u(h) | |
53 | 59 | ||
54 | - | let | |
60 | + | let A = u(i) | |
55 | 61 | ||
56 | - | let | |
62 | + | let B = u(j) | |
57 | 63 | ||
58 | - | let | |
64 | + | let C = Address(u(k)) | |
59 | 65 | ||
60 | - | let | |
66 | + | let D = Address(u(l)) | |
61 | 67 | ||
62 | - | let | |
68 | + | let E = valueOrElse(getBoolean(this, a), true) | |
63 | 69 | ||
64 | - | let | |
70 | + | let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty") | |
65 | 71 | ||
66 | - | func D () = if (A) | |
72 | + | let G = 1000000 | |
73 | + | ||
74 | + | func H () = if (E) | |
67 | 75 | then unit | |
68 | 76 | else throw("DApp is inactive at this moment") | |
69 | 77 | ||
70 | 78 | ||
71 | - | func | |
79 | + | func I (J) = if (containsElement([z, A, B], J.callerPublicKey)) | |
72 | 80 | then unit | |
73 | 81 | else throw("Only admin can call this function") | |
74 | 82 | ||
75 | 83 | ||
76 | - | func | |
84 | + | func K () = throw("DApp is already active") | |
77 | 85 | ||
78 | 86 | ||
79 | - | func | |
87 | + | func L (M) = [BooleanEntry(a, false), StringEntry(b, M)] | |
80 | 88 | ||
81 | 89 | ||
82 | - | func | |
90 | + | func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2) | |
83 | 91 | ||
84 | 92 | ||
85 | - | func | |
86 | - | let | |
87 | - | (fraction(( | |
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))) | |
88 | 96 | } | |
89 | 97 | ||
90 | 98 | ||
91 | - | func O (P,Q,R,S,T,U,V) = { | |
92 | - | let W = getIntegerValue(addressFromStringValue(R[0]), T[0]) | |
93 | - | let X = getIntegerValue(addressFromStringValue(R[0]), T[1]) | |
94 | - | let Y = getIntegerValue(addressFromStringValue(R[1]), T[2]) | |
95 | - | let Z = getIntegerValue(addressFromStringValue(R[1]), T[3]) | |
96 | - | let aa = if ((S[0] == "cpmm")) | |
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) | |
105 | + | else false) | |
106 | + | then (G - parseIntValue(W[0])) | |
107 | + | else if (if ((U >= parseIntValue(V[1]))) | |
108 | + | then (parseIntValue(V[2]) > U) | |
109 | + | else false) | |
110 | + | then (G - parseIntValue(W[1])) | |
111 | + | else if (if ((U >= parseIntValue(V[2]))) | |
112 | + | then (parseIntValue(V[3]) > U) | |
113 | + | else false) | |
114 | + | then (G - parseIntValue(W[2])) | |
115 | + | else if (if ((U >= parseIntValue(V[3]))) | |
116 | + | then (parseIntValue(V[4]) > U) | |
117 | + | else false) | |
118 | + | then (G - parseIntValue(W[3])) | |
119 | + | else if ((U >= parseIntValue(V[4]))) | |
120 | + | then (G - parseIntValue(W[4])) | |
121 | + | else G | |
122 | + | } | |
123 | + | ||
124 | + | ||
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")) | |
97 | 132 | then { | |
98 | - | let ab = fraction(X, P, (P + W)) | |
99 | - | fraction(ab, (p - o), p) | |
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) | |
100 | 136 | } | |
101 | - | else if (( | |
137 | + | else if ((ac[0] == "flat")) | |
102 | 138 | then { | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | if (( | |
107 | - | 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 | |
108 | 144 | else throw("Flat contract: invariantNew < invariant") | |
109 | 145 | } | |
110 | 146 | else throw("Incorrect exchange type") | |
111 | - | let | |
147 | + | let ar = if ((ac[1] == "cpmm")) | |
112 | 148 | then { | |
113 | - | let ag = fraction(Z, aa, (aa + Y)) | |
114 | - | fraction(ag, (p - o), p) | |
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) | |
115 | 152 | } | |
116 | - | else if (( | |
153 | + | else if ((ac[1] == "flat")) | |
117 | 154 | then { | |
118 | - | let | |
119 | - | let | |
120 | - | let | |
121 | - | if (( | |
122 | - | 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 | |
123 | 160 | else throw("Flat contract: invariantNew < invariant") | |
124 | 161 | } | |
125 | 162 | else throw("Incorrect exchange type") | |
126 | - | ( | |
163 | + | (ar >= aa) | |
127 | 164 | } | |
128 | 165 | ||
129 | 166 | ||
130 | - | @Callable( | |
131 | - | func routingTrade ( | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | if (!( | |
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))) | |
136 | 173 | then throw("Check transaction possibilty: declined") | |
137 | - | else if (if (!(isDefined(getString( | |
174 | + | else if (if (!(isDefined(getString(t, (c + ab[0]))))) | |
138 | 175 | then true | |
139 | - | else !(isDefined(getString( | |
176 | + | else !(isDefined(getString(t, (c + ab[1]))))) | |
140 | 177 | then throw("Pool is not in oracle") | |
141 | 178 | else { | |
142 | - | let | |
143 | - | func | |
144 | - | let | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | then $Tuple2( | |
150 | - | else $Tuple2( | |
151 | - | let | |
152 | - | let | |
153 | - | if (((if (( | |
154 | - | then ( | |
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) | |
155 | 192 | else false) == true)) | |
156 | 193 | then { | |
157 | - | let | |
158 | - | let | |
159 | - | then invoke( | |
160 | - | else if (( | |
161 | - | then invoke( | |
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)]) | |
162 | 199 | else throw("Incorrect exchange type") | |
163 | - | if (( | |
200 | + | if ((aI == aI)) | |
164 | 201 | then { | |
165 | - | let t = aw | |
166 | - | if ($isInstanceOf(t, "(Int, ByteVector)")) | |
202 | + | let w = aI | |
203 | + | if (if ($isInstanceOf(w, "(Int, Unit)")) | |
204 | + | then true | |
205 | + | else $isInstanceOf(w, "(Int, ByteVector)")) | |
167 | 206 | then { | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | $Tuple3(( | |
207 | + | let aI = w | |
208 | + | let aJ = aI | |
209 | + | let aK = aJ._1 | |
210 | + | let aL = aJ._2 | |
211 | + | $Tuple3((aB + 1), aK, aL) | |
173 | 212 | } | |
174 | 213 | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
175 | 214 | } | |
176 | 215 | else throw("Strict value is not equal to itself.") | |
177 | 216 | } | |
178 | - | else | |
217 | + | else ay | |
179 | 218 | } | |
180 | 219 | ||
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | func | |
186 | - | then | |
187 | - | else | |
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]) | |
188 | 227 | ||
189 | - | func | |
190 | - | then | |
228 | + | func aT (aR,aS) = if ((aS >= aO)) | |
229 | + | then aR | |
191 | 230 | else throw("List size exceeds 3") | |
192 | 231 | ||
193 | - | | |
232 | + | aT(aQ(aQ(aQ(aP, 0), 1), 2), 3) | |
194 | 233 | } | |
195 | - | let | |
196 | - | let | |
197 | - | let | |
198 | - | let | |
199 | - | if (if (( | |
200 | - | then ( | |
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) | |
201 | 240 | else false) | |
202 | - | then [ScriptTransfer( | |
241 | + | then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)] | |
203 | 242 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
204 | 243 | } | |
205 | 244 | }) | |
206 | 245 | ||
207 | 246 | ||
208 | 247 | ||
209 | - | @Callable( | |
210 | - | func shutdown () = valueOrElse( | |
248 | + | @Callable(J) | |
249 | + | func shutdown () = valueOrElse(I(J), if (!(E)) | |
211 | 250 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
212 | - | else | |
251 | + | else L("Paused by admin")) | |
213 | 252 | ||
214 | 253 | ||
215 | 254 | ||
216 | - | @Callable( | |
217 | - | func activate () = valueOrElse( | |
218 | - | then | |
255 | + | @Callable(J) | |
256 | + | func activate () = valueOrElse(I(J), if (E) | |
257 | + | then K() | |
219 | 258 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
220 | 259 | ||
221 | 260 | ||
222 | - | @Verifier( | |
223 | - | func | |
224 | - | let | |
225 | - | let | |
261 | + | @Verifier(aV) | |
262 | + | func aW () = { | |
263 | + | let aX = { | |
264 | + | let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z)) | |
226 | 265 | then 1 | |
227 | 266 | else 0 | |
228 | - | let | |
267 | + | let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A)) | |
229 | 268 | then 1 | |
230 | 269 | else 0 | |
231 | - | let | |
270 | + | let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B)) | |
232 | 271 | then 1 | |
233 | 272 | else 0 | |
234 | - | ((( | |
273 | + | (((aY + aZ) + ba) >= 2) | |
235 | 274 | } | |
236 | - | let | |
237 | - | | |
275 | + | let w = aV | |
276 | + | aX | |
238 | 277 | } | |
239 | 278 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "active" | |
5 | 5 | ||
6 | 6 | let b = "shutdown_cause" | |
7 | 7 | ||
8 | - | let c = " | |
8 | + | let c = "pool_" | |
9 | 9 | ||
10 | - | let d = " | |
10 | + | let d = "_SWOP_amount" | |
11 | 11 | ||
12 | - | let e = " | |
12 | + | let e = "discounts" | |
13 | 13 | ||
14 | - | let f = " | |
14 | + | let f = "discount_values" | |
15 | 15 | ||
16 | - | let g = " | |
16 | + | let g = "routing_fee" | |
17 | 17 | ||
18 | - | let h = " | |
18 | + | let h = "admin_pub_1" | |
19 | 19 | ||
20 | - | let i = | |
20 | + | let i = "admin_pub_2" | |
21 | 21 | ||
22 | - | let j = | |
22 | + | let j = "admin_pub_3" | |
23 | 23 | ||
24 | - | let k = | |
24 | + | let k = "money_box_address" | |
25 | 25 | ||
26 | - | let l = | |
26 | + | let l = "governance_address" | |
27 | 27 | ||
28 | - | let m = | |
28 | + | let m = "commission" | |
29 | 29 | ||
30 | - | let n = | |
30 | + | let n = 8 | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 100000000 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 10000000000000000 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 50 | |
37 | 37 | ||
38 | - | func r (s) = { | |
39 | - | let t = getString(q, s) | |
40 | - | if ($isInstanceOf(t, "String")) | |
38 | + | let r = 2 | |
39 | + | ||
40 | + | let s = 4600000000000000 | |
41 | + | ||
42 | + | let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | + | ||
44 | + | func u (v) = { | |
45 | + | let w = getString(t, v) | |
46 | + | if ($isInstanceOf(w, "String")) | |
41 | 47 | then { | |
42 | - | let | |
43 | - | fromBase58String( | |
48 | + | let x = w | |
49 | + | fromBase58String(x) | |
44 | 50 | } | |
45 | 51 | else { | |
46 | - | let | |
47 | - | throw(( | |
52 | + | let y = w | |
53 | + | throw((v + "is empty")) | |
48 | 54 | } | |
49 | 55 | } | |
50 | 56 | ||
51 | 57 | ||
52 | - | let | |
58 | + | let z = u(h) | |
53 | 59 | ||
54 | - | let | |
60 | + | let A = u(i) | |
55 | 61 | ||
56 | - | let | |
62 | + | let B = u(j) | |
57 | 63 | ||
58 | - | let | |
64 | + | let C = Address(u(k)) | |
59 | 65 | ||
60 | - | let | |
66 | + | let D = Address(u(l)) | |
61 | 67 | ||
62 | - | let | |
68 | + | let E = valueOrElse(getBoolean(this, a), true) | |
63 | 69 | ||
64 | - | let | |
70 | + | let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty") | |
65 | 71 | ||
66 | - | func D () = if (A) | |
72 | + | let G = 1000000 | |
73 | + | ||
74 | + | func H () = if (E) | |
67 | 75 | then unit | |
68 | 76 | else throw("DApp is inactive at this moment") | |
69 | 77 | ||
70 | 78 | ||
71 | - | func | |
79 | + | func I (J) = if (containsElement([z, A, B], J.callerPublicKey)) | |
72 | 80 | then unit | |
73 | 81 | else throw("Only admin can call this function") | |
74 | 82 | ||
75 | 83 | ||
76 | - | func | |
84 | + | func K () = throw("DApp is already active") | |
77 | 85 | ||
78 | 86 | ||
79 | - | func | |
87 | + | func L (M) = [BooleanEntry(a, false), StringEntry(b, M)] | |
80 | 88 | ||
81 | 89 | ||
82 | - | func | |
90 | + | func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2) | |
83 | 91 | ||
84 | 92 | ||
85 | - | func | |
86 | - | let | |
87 | - | (fraction(( | |
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))) | |
88 | 96 | } | |
89 | 97 | ||
90 | 98 | ||
91 | - | func O (P,Q,R,S,T,U,V) = { | |
92 | - | let W = getIntegerValue(addressFromStringValue(R[0]), T[0]) | |
93 | - | let X = getIntegerValue(addressFromStringValue(R[0]), T[1]) | |
94 | - | let Y = getIntegerValue(addressFromStringValue(R[1]), T[2]) | |
95 | - | let Z = getIntegerValue(addressFromStringValue(R[1]), T[3]) | |
96 | - | let aa = if ((S[0] == "cpmm")) | |
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) | |
105 | + | else false) | |
106 | + | then (G - parseIntValue(W[0])) | |
107 | + | else if (if ((U >= parseIntValue(V[1]))) | |
108 | + | then (parseIntValue(V[2]) > U) | |
109 | + | else false) | |
110 | + | then (G - parseIntValue(W[1])) | |
111 | + | else if (if ((U >= parseIntValue(V[2]))) | |
112 | + | then (parseIntValue(V[3]) > U) | |
113 | + | else false) | |
114 | + | then (G - parseIntValue(W[2])) | |
115 | + | else if (if ((U >= parseIntValue(V[3]))) | |
116 | + | then (parseIntValue(V[4]) > U) | |
117 | + | else false) | |
118 | + | then (G - parseIntValue(W[3])) | |
119 | + | else if ((U >= parseIntValue(V[4]))) | |
120 | + | then (G - parseIntValue(W[4])) | |
121 | + | else G | |
122 | + | } | |
123 | + | ||
124 | + | ||
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")) | |
97 | 132 | then { | |
98 | - | let ab = fraction(X, P, (P + W)) | |
99 | - | fraction(ab, (p - o), p) | |
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) | |
100 | 136 | } | |
101 | - | else if (( | |
137 | + | else if ((ac[0] == "flat")) | |
102 | 138 | then { | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | if (( | |
107 | - | 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 | |
108 | 144 | else throw("Flat contract: invariantNew < invariant") | |
109 | 145 | } | |
110 | 146 | else throw("Incorrect exchange type") | |
111 | - | let | |
147 | + | let ar = if ((ac[1] == "cpmm")) | |
112 | 148 | then { | |
113 | - | let ag = fraction(Z, aa, (aa + Y)) | |
114 | - | fraction(ag, (p - o), p) | |
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) | |
115 | 152 | } | |
116 | - | else if (( | |
153 | + | else if ((ac[1] == "flat")) | |
117 | 154 | then { | |
118 | - | let | |
119 | - | let | |
120 | - | let | |
121 | - | if (( | |
122 | - | 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 | |
123 | 160 | else throw("Flat contract: invariantNew < invariant") | |
124 | 161 | } | |
125 | 162 | else throw("Incorrect exchange type") | |
126 | - | ( | |
163 | + | (ar >= aa) | |
127 | 164 | } | |
128 | 165 | ||
129 | 166 | ||
130 | - | @Callable( | |
131 | - | func routingTrade ( | |
132 | - | let | |
133 | - | let | |
134 | - | let | |
135 | - | if (!( | |
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))) | |
136 | 173 | then throw("Check transaction possibilty: declined") | |
137 | - | else if (if (!(isDefined(getString( | |
174 | + | else if (if (!(isDefined(getString(t, (c + ab[0]))))) | |
138 | 175 | then true | |
139 | - | else !(isDefined(getString( | |
176 | + | else !(isDefined(getString(t, (c + ab[1]))))) | |
140 | 177 | then throw("Pool is not in oracle") | |
141 | 178 | else { | |
142 | - | let | |
143 | - | func | |
144 | - | let | |
145 | - | let | |
146 | - | let | |
147 | - | let | |
148 | - | let | |
149 | - | then $Tuple2( | |
150 | - | else $Tuple2( | |
151 | - | let | |
152 | - | let | |
153 | - | if (((if (( | |
154 | - | then ( | |
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) | |
155 | 192 | else false) == true)) | |
156 | 193 | then { | |
157 | - | let | |
158 | - | let | |
159 | - | then invoke( | |
160 | - | else if (( | |
161 | - | then invoke( | |
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)]) | |
162 | 199 | else throw("Incorrect exchange type") | |
163 | - | if (( | |
200 | + | if ((aI == aI)) | |
164 | 201 | then { | |
165 | - | let t = aw | |
166 | - | if ($isInstanceOf(t, "(Int, ByteVector)")) | |
202 | + | let w = aI | |
203 | + | if (if ($isInstanceOf(w, "(Int, Unit)")) | |
204 | + | then true | |
205 | + | else $isInstanceOf(w, "(Int, ByteVector)")) | |
167 | 206 | then { | |
168 | - | let | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | $Tuple3(( | |
207 | + | let aI = w | |
208 | + | let aJ = aI | |
209 | + | let aK = aJ._1 | |
210 | + | let aL = aJ._2 | |
211 | + | $Tuple3((aB + 1), aK, aL) | |
173 | 212 | } | |
174 | 213 | else throw("Incorrect invoke result: expected amountWithFee and assetsIdSend") | |
175 | 214 | } | |
176 | 215 | else throw("Strict value is not equal to itself.") | |
177 | 216 | } | |
178 | - | else | |
217 | + | else ay | |
179 | 218 | } | |
180 | 219 | ||
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | func | |
186 | - | then | |
187 | - | else | |
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]) | |
188 | 227 | ||
189 | - | func | |
190 | - | then | |
228 | + | func aT (aR,aS) = if ((aS >= aO)) | |
229 | + | then aR | |
191 | 230 | else throw("List size exceeds 3") | |
192 | 231 | ||
193 | - | | |
232 | + | aT(aQ(aQ(aQ(aP, 0), 1), 2), 3) | |
194 | 233 | } | |
195 | - | let | |
196 | - | let | |
197 | - | let | |
198 | - | let | |
199 | - | if (if (( | |
200 | - | then ( | |
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) | |
201 | 240 | else false) | |
202 | - | then [ScriptTransfer( | |
241 | + | then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)] | |
203 | 242 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
204 | 243 | } | |
205 | 244 | }) | |
206 | 245 | ||
207 | 246 | ||
208 | 247 | ||
209 | - | @Callable( | |
210 | - | func shutdown () = valueOrElse( | |
248 | + | @Callable(J) | |
249 | + | func shutdown () = valueOrElse(I(J), if (!(E)) | |
211 | 250 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
212 | - | else | |
251 | + | else L("Paused by admin")) | |
213 | 252 | ||
214 | 253 | ||
215 | 254 | ||
216 | - | @Callable( | |
217 | - | func activate () = valueOrElse( | |
218 | - | then | |
255 | + | @Callable(J) | |
256 | + | func activate () = valueOrElse(I(J), if (E) | |
257 | + | then K() | |
219 | 258 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
220 | 259 | ||
221 | 260 | ||
222 | - | @Verifier( | |
223 | - | func | |
224 | - | let | |
225 | - | let | |
261 | + | @Verifier(aV) | |
262 | + | func aW () = { | |
263 | + | let aX = { | |
264 | + | let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z)) | |
226 | 265 | then 1 | |
227 | 266 | else 0 | |
228 | - | let | |
267 | + | let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A)) | |
229 | 268 | then 1 | |
230 | 269 | else 0 | |
231 | - | let | |
270 | + | let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B)) | |
232 | 271 | then 1 | |
233 | 272 | else 0 | |
234 | - | ((( | |
273 | + | (((aY + aZ) + ba) >= 2) | |
235 | 274 | } | |
236 | - | let | |
237 | - | | |
275 | + | let w = aV | |
276 | + | aX | |
238 | 277 | } | |
239 | 278 |
github/deemru/w8io/169f3d6 96.08 ms ◑