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:AAIFAAAAAAAAABAIAhIICgYYGBERGAESABIAAAAAJQAAAAAHa0FjdGl2ZQIAAAAGYWN0aXZlAAAAAAZrQ2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAA1rUG9vbEluT3JhY2xlAgAAAAVwb29sXwAAAAAOa1VzZXJTd29wSW5Hb3YCAAAADF9TV09QX2Ftb3VudAAAAAAKa0Rpc2NvdW50cwIAAAAJZGlzY291bnRzAAAAAA9rRGlzY291bnRWYWx1ZXMCAAAAD2Rpc2NvdW50X3ZhbHVlcwAAAAALa1JvdXRpbmdGZWUCAAAAC3JvdXRpbmdfZmVlAAAAAA1rQWRtaW5QdWJLZXkxAgAAAAthZG1pbl9wdWJfMQAAAAANa0FkbWluUHViS2V5MgIAAAALYWRtaW5fcHViXzIAAAAADWtBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAAAAABBrTW9uZXlCb3hBZGRyZXNzAgAAABFt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AAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAIEAAAAByRtYXRjaDAFAAAAAnR4BQAAABNtdWx0aVNpZ25lZEJ5QWRtaW5zm9b11w==", "height": 2228723, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8aZNzeXShrL1Rw5LTm67zxmAZmUidW3Ju65FeooUdt64 Next: 9922meKgC3fkWX2itfeaHUKhNTCJ5GfdoasNvt4pE4S6 Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "active" | |
27 | 27 | ||
28 | 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 | - | let r = | |
38 | + | let r = 2 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 4600000000000000 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | 43 | ||
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")) | |
49 | 47 | then { | |
50 | - | let | |
51 | - | fromBase58String( | |
48 | + | let x = w | |
49 | + | fromBase58String(x) | |
52 | 50 | } | |
53 | 51 | else { | |
54 | - | let | |
55 | - | throw(( | |
52 | + | let y = w | |
53 | + | throw((v + "is empty")) | |
56 | 54 | } | |
57 | 55 | } | |
58 | 56 | ||
59 | 57 | ||
60 | - | let | |
58 | + | let z = u(h) | |
61 | 59 | ||
62 | - | let | |
60 | + | let A = u(i) | |
63 | 61 | ||
64 | - | let | |
62 | + | let B = u(j) | |
65 | 63 | ||
66 | - | let | |
64 | + | let C = Address(u(k)) | |
67 | 65 | ||
68 | - | let | |
66 | + | let D = Address(u(l)) | |
69 | 67 | ||
70 | - | let | |
68 | + | let E = valueOrElse(getBoolean(this, a), true) | |
71 | 69 | ||
72 | - | let | |
70 | + | let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty") | |
73 | 71 | ||
74 | - | let | |
72 | + | let G = 1000000 | |
75 | 73 | ||
76 | - | func | |
74 | + | func H () = if (E) | |
77 | 75 | then unit | |
78 | 76 | else throw("DApp is inactive at this moment") | |
79 | 77 | ||
80 | 78 | ||
81 | - | func | |
79 | + | func I (J) = if (containsElement([z, A, B], J.callerPublicKey)) | |
82 | 80 | then unit | |
83 | 81 | else throw("Only admin can call this function") | |
84 | 82 | ||
85 | 83 | ||
86 | - | func | |
84 | + | func K () = throw("DApp is already active") | |
87 | 85 | ||
88 | 86 | ||
89 | - | func | |
87 | + | func L (M) = [BooleanEntry(a, false), StringEntry(b, M)] | |
90 | 88 | ||
91 | 89 | ||
92 | - | func | |
90 | + | func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2) | |
93 | 91 | ||
94 | 92 | ||
95 | - | func | |
96 | - | let | |
97 | - | (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))) | |
98 | 96 | } | |
99 | 97 | ||
100 | 98 | ||
101 | - | func | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | if (if (( | |
106 | - | then (parseIntValue( | |
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) | |
107 | 105 | else false) | |
108 | - | then ( | |
109 | - | else if (if (( | |
110 | - | then (parseIntValue( | |
106 | + | then (G - parseIntValue(W[0])) | |
107 | + | else if (if ((U >= parseIntValue(V[1]))) | |
108 | + | then (parseIntValue(V[2]) > U) | |
111 | 109 | else false) | |
112 | - | then ( | |
113 | - | else if (if (( | |
114 | - | then (parseIntValue( | |
110 | + | then (G - parseIntValue(W[1])) | |
111 | + | else if (if ((U >= parseIntValue(V[2]))) | |
112 | + | then (parseIntValue(V[3]) > U) | |
115 | 113 | else false) | |
116 | - | then ( | |
117 | - | else if (if (( | |
118 | - | then (parseIntValue( | |
114 | + | then (G - parseIntValue(W[2])) | |
115 | + | else if (if ((U >= parseIntValue(V[3]))) | |
116 | + | then (parseIntValue(V[4]) > U) | |
119 | 117 | else false) | |
120 | - | then ( | |
121 | - | else if (( | |
122 | - | then ( | |
123 | - | else | |
118 | + | then (G - parseIntValue(W[3])) | |
119 | + | else if ((U >= parseIntValue(V[4]))) | |
120 | + | then (G - parseIntValue(W[4])) | |
121 | + | else G | |
124 | 122 | } | |
125 | 123 | ||
126 | 124 | ||
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")) | |
130 | 132 | 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") | |
136 | 145 | } | |
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) | |
140 | 152 | } | |
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") | |
168 | 161 | } | |
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) | |
194 | 164 | } | |
195 | 165 | ||
196 | 166 | ||
197 | - | @Callable( | |
198 | - | func routingTrade (ac,ad, | |
199 | - | let | |
200 | - | let | |
201 | - | let | |
202 | - | 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))) | |
203 | 173 | then throw("Check transaction possibilty: declined") | |
204 | - | else if (if (!(isDefined(getString( | |
174 | + | else if (if (!(isDefined(getString(t, (c + ab[0]))))) | |
205 | 175 | then true | |
206 | - | else !(isDefined(getString( | |
176 | + | else !(isDefined(getString(t, (c + ab[1]))))) | |
207 | 177 | then throw("Pool is not in oracle") | |
208 | 178 | else { | |
209 | - | let | |
210 | - | func | |
211 | - | let | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | let | |
216 | - | then $Tuple2( | |
217 | - | else $Tuple2( | |
218 | - | let | |
219 | - | let | |
220 | - | if (((if (( | |
221 | - | 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) | |
222 | 192 | else false) == true)) | |
223 | 193 | 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)) | |
226 | 201 | 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") | |
236 | 214 | } | |
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.") | |
262 | 216 | } | |
263 | - | else | |
217 | + | else ay | |
264 | 218 | } | |
265 | 219 | ||
266 | - | let | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | func | |
271 | - | then | |
272 | - | 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]) | |
273 | 227 | ||
274 | - | func | |
275 | - | then | |
228 | + | func aT (aR,aS) = if ((aS >= aO)) | |
229 | + | then aR | |
276 | 230 | else throw("List size exceeds 3") | |
277 | 231 | ||
278 | - | | |
232 | + | aT(aQ(aQ(aQ(aP, 0), 1), 2), 3) | |
279 | 233 | } | |
280 | - | let | |
281 | - | let | |
282 | - | let | |
283 | - | let | |
284 | - | if (if (( | |
285 | - | 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) | |
286 | 240 | else false) | |
287 | - | then [ScriptTransfer( | |
241 | + | then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)] | |
288 | 242 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
289 | 243 | } | |
290 | 244 | }) | |
291 | 245 | ||
292 | 246 | ||
293 | 247 | ||
294 | - | @Callable( | |
295 | - | func shutdown () = valueOrElse(J | |
248 | + | @Callable(J) | |
249 | + | func shutdown () = valueOrElse(I(J), if (!(E)) | |
296 | 250 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
297 | - | else | |
251 | + | else L("Paused by admin")) | |
298 | 252 | ||
299 | 253 | ||
300 | 254 | ||
301 | - | @Callable( | |
302 | - | func activate () = valueOrElse(J | |
303 | - | then | |
255 | + | @Callable(J) | |
256 | + | func activate () = valueOrElse(I(J), if (E) | |
257 | + | then K() | |
304 | 258 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
305 | 259 | ||
306 | 260 | ||
307 | - | @Verifier( | |
308 | - | func | |
309 | - | let | |
310 | - | let | |
261 | + | @Verifier(aV) | |
262 | + | func aW () = { | |
263 | + | let aX = { | |
264 | + | let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z)) | |
311 | 265 | then 1 | |
312 | 266 | else 0 | |
313 | - | let | |
267 | + | let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A)) | |
314 | 268 | then 1 | |
315 | 269 | else 0 | |
316 | - | let | |
270 | + | let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B)) | |
317 | 271 | then 1 | |
318 | 272 | else 0 | |
319 | - | (((aZ + ba | |
273 | + | (((aY + aZ) + ba) >= 2) | |
320 | 274 | } | |
321 | - | let | |
322 | - | | |
275 | + | let w = aV | |
276 | + | aX | |
323 | 277 | } | |
324 | 278 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
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 | 8 | let c = "pool_" | |
9 | 9 | ||
10 | 10 | let d = "_SWOP_amount" | |
11 | 11 | ||
12 | 12 | let e = "discounts" | |
13 | 13 | ||
14 | 14 | let f = "discount_values" | |
15 | 15 | ||
16 | 16 | let g = "routing_fee" | |
17 | 17 | ||
18 | 18 | let h = "admin_pub_1" | |
19 | 19 | ||
20 | 20 | let i = "admin_pub_2" | |
21 | 21 | ||
22 | 22 | let j = "admin_pub_3" | |
23 | 23 | ||
24 | 24 | let k = "money_box_address" | |
25 | 25 | ||
26 | 26 | let l = "governance_address" | |
27 | 27 | ||
28 | 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 | - | let r = | |
38 | + | let r = 2 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 4600000000000000 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9') | |
43 | 43 | ||
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")) | |
49 | 47 | then { | |
50 | - | let | |
51 | - | fromBase58String( | |
48 | + | let x = w | |
49 | + | fromBase58String(x) | |
52 | 50 | } | |
53 | 51 | else { | |
54 | - | let | |
55 | - | throw(( | |
52 | + | let y = w | |
53 | + | throw((v + "is empty")) | |
56 | 54 | } | |
57 | 55 | } | |
58 | 56 | ||
59 | 57 | ||
60 | - | let | |
58 | + | let z = u(h) | |
61 | 59 | ||
62 | - | let | |
60 | + | let A = u(i) | |
63 | 61 | ||
64 | - | let | |
62 | + | let B = u(j) | |
65 | 63 | ||
66 | - | let | |
64 | + | let C = Address(u(k)) | |
67 | 65 | ||
68 | - | let | |
66 | + | let D = Address(u(l)) | |
69 | 67 | ||
70 | - | let | |
68 | + | let E = valueOrElse(getBoolean(this, a), true) | |
71 | 69 | ||
72 | - | let | |
70 | + | let F = valueOrErrorMessage(getInteger(t, g), "routing_fee is empty") | |
73 | 71 | ||
74 | - | let | |
72 | + | let G = 1000000 | |
75 | 73 | ||
76 | - | func | |
74 | + | func H () = if (E) | |
77 | 75 | then unit | |
78 | 76 | else throw("DApp is inactive at this moment") | |
79 | 77 | ||
80 | 78 | ||
81 | - | func | |
79 | + | func I (J) = if (containsElement([z, A, B], J.callerPublicKey)) | |
82 | 80 | then unit | |
83 | 81 | else throw("Only admin can call this function") | |
84 | 82 | ||
85 | 83 | ||
86 | - | func | |
84 | + | func K () = throw("DApp is already active") | |
87 | 85 | ||
88 | 86 | ||
89 | - | func | |
87 | + | func L (M) = [BooleanEntry(a, false), StringEntry(b, M)] | |
90 | 88 | ||
91 | 89 | ||
92 | - | func | |
90 | + | func N (O,P) = ((fraction(p, O, P) + fraction(p, P, O)) / 2) | |
93 | 91 | ||
94 | 92 | ||
95 | - | func | |
96 | - | let | |
97 | - | (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))) | |
98 | 96 | } | |
99 | 97 | ||
100 | 98 | ||
101 | - | func | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | if (if (( | |
106 | - | then (parseIntValue( | |
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) | |
107 | 105 | else false) | |
108 | - | then ( | |
109 | - | else if (if (( | |
110 | - | then (parseIntValue( | |
106 | + | then (G - parseIntValue(W[0])) | |
107 | + | else if (if ((U >= parseIntValue(V[1]))) | |
108 | + | then (parseIntValue(V[2]) > U) | |
111 | 109 | else false) | |
112 | - | then ( | |
113 | - | else if (if (( | |
114 | - | then (parseIntValue( | |
110 | + | then (G - parseIntValue(W[1])) | |
111 | + | else if (if ((U >= parseIntValue(V[2]))) | |
112 | + | then (parseIntValue(V[3]) > U) | |
115 | 113 | else false) | |
116 | - | then ( | |
117 | - | else if (if (( | |
118 | - | then (parseIntValue( | |
114 | + | then (G - parseIntValue(W[2])) | |
115 | + | else if (if ((U >= parseIntValue(V[3]))) | |
116 | + | then (parseIntValue(V[4]) > U) | |
119 | 117 | else false) | |
120 | - | then ( | |
121 | - | else if (( | |
122 | - | then ( | |
123 | - | else | |
118 | + | then (G - parseIntValue(W[3])) | |
119 | + | else if ((U >= parseIntValue(V[4]))) | |
120 | + | then (G - parseIntValue(W[4])) | |
121 | + | else G | |
124 | 122 | } | |
125 | 123 | ||
126 | 124 | ||
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")) | |
130 | 132 | 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") | |
136 | 145 | } | |
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) | |
140 | 152 | } | |
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") | |
168 | 161 | } | |
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) | |
194 | 164 | } | |
195 | 165 | ||
196 | 166 | ||
197 | - | @Callable( | |
198 | - | func routingTrade (ac,ad, | |
199 | - | let | |
200 | - | let | |
201 | - | let | |
202 | - | 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))) | |
203 | 173 | then throw("Check transaction possibilty: declined") | |
204 | - | else if (if (!(isDefined(getString( | |
174 | + | else if (if (!(isDefined(getString(t, (c + ab[0]))))) | |
205 | 175 | then true | |
206 | - | else !(isDefined(getString( | |
176 | + | else !(isDefined(getString(t, (c + ab[1]))))) | |
207 | 177 | then throw("Pool is not in oracle") | |
208 | 178 | else { | |
209 | - | let | |
210 | - | func | |
211 | - | let | |
212 | - | let | |
213 | - | let | |
214 | - | let | |
215 | - | let | |
216 | - | then $Tuple2( | |
217 | - | else $Tuple2( | |
218 | - | let | |
219 | - | let | |
220 | - | if (((if (( | |
221 | - | 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) | |
222 | 192 | else false) == true)) | |
223 | 193 | 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)) | |
226 | 201 | 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") | |
236 | 214 | } | |
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.") | |
262 | 216 | } | |
263 | - | else | |
217 | + | else ay | |
264 | 218 | } | |
265 | 219 | ||
266 | - | let | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | func | |
271 | - | then | |
272 | - | 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]) | |
273 | 227 | ||
274 | - | func | |
275 | - | then | |
228 | + | func aT (aR,aS) = if ((aS >= aO)) | |
229 | + | then aR | |
276 | 230 | else throw("List size exceeds 3") | |
277 | 231 | ||
278 | - | | |
232 | + | aT(aQ(aQ(aQ(aP, 0), 1), 2), 3) | |
279 | 233 | } | |
280 | - | let | |
281 | - | let | |
282 | - | let | |
283 | - | let | |
284 | - | if (if (( | |
285 | - | 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) | |
286 | 240 | else false) | |
287 | - | then [ScriptTransfer( | |
241 | + | then [ScriptTransfer(J.caller, aK, aL), ScriptTransfer(C, (aU - aK), aL)] | |
288 | 242 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
289 | 243 | } | |
290 | 244 | }) | |
291 | 245 | ||
292 | 246 | ||
293 | 247 | ||
294 | - | @Callable( | |
295 | - | func shutdown () = valueOrElse(J | |
248 | + | @Callable(J) | |
249 | + | func shutdown () = valueOrElse(I(J), if (!(E)) | |
296 | 250 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
297 | - | else | |
251 | + | else L("Paused by admin")) | |
298 | 252 | ||
299 | 253 | ||
300 | 254 | ||
301 | - | @Callable( | |
302 | - | func activate () = valueOrElse(J | |
303 | - | then | |
255 | + | @Callable(J) | |
256 | + | func activate () = valueOrElse(I(J), if (E) | |
257 | + | then K() | |
304 | 258 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
305 | 259 | ||
306 | 260 | ||
307 | - | @Verifier( | |
308 | - | func | |
309 | - | let | |
310 | - | let | |
261 | + | @Verifier(aV) | |
262 | + | func aW () = { | |
263 | + | let aX = { | |
264 | + | let aY = if (sigVerify(aV.bodyBytes, aV.proofs[0], z)) | |
311 | 265 | then 1 | |
312 | 266 | else 0 | |
313 | - | let | |
267 | + | let aZ = if (sigVerify(aV.bodyBytes, aV.proofs[1], A)) | |
314 | 268 | then 1 | |
315 | 269 | else 0 | |
316 | - | let | |
270 | + | let ba = if (sigVerify(aV.bodyBytes, aV.proofs[2], B)) | |
317 | 271 | then 1 | |
318 | 272 | else 0 | |
319 | - | (((aZ + ba | |
273 | + | (((aY + aZ) + ba) >= 2) | |
320 | 274 | } | |
321 | - | let | |
322 | - | | |
275 | + | let w = aV | |
276 | + | aX | |
323 | 277 | } | |
324 | 278 |
github/deemru/w8io/169f3d6 91.75 ms ◑