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:BgIQCAISCAoGGBgRERgBEgASACYAB2tBY3RpdmUCBmFjdGl2ZQAGa0NhdXNlAg5zaHV0ZG93bl9jYXVzZQANa1Bvb2xJbk9yYWNsZQIFcG9vbF8ADmtVc2VyU3dvcEluR292AgxfU1dPUF9hbW91bnQACmtEaXNjb3VudHMCCWRpc2NvdW50cwAPa0Rpc2NvdW50VmFsdWVzAg9kaXNjb3VudF92YWx1ZXMAC2tSb3V0aW5nRmVlAgtyb3V0aW5nX2ZlZQANa0FkbWluUHViS2V5MQILYWRtaW5fcHViXzEADWtBZG1pblB1YktleTICC2FkbWluX3B1Yl8yAA1rQWRtaW5QdWJLZXkzAgthZG1pbl9wdWJfMwAQa01vbmV5Qm94QWRkcmVzcwIRbW9uZXlfYm94X2FkZHJlc3MAC2tHb3ZBZGRyZXNzAhJnb3Zlcm5hbmNlX2FkZHJlc3MABGtGZWUCCmNvbW1pc3Npb24AEmtNdWx0eUFzc2V0Q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l0ZXMJAJEDAggFAnR4BnByb29mcwACBQxhZG1pblB1YktleTMAAQAACQBnAgkAZAIJAGQCBRJhZG1pblB1YktleTFTaWduZWQFEmFkbWluUHViS2V5MlNpZ25lZAUSYWRtaW5QdWJLZXkzU2lnbmVkAAIEByRtYXRjaDAFAnR4BRNtdWx0aVNpZ25lZEJ5QWRtaW5zgk6e/A==", "height": 2228759, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H4VGBBU9ZmrA8XG9vmczGMcjAAV8SKNLbViTLz48Mfym Next: 71JE7V6wKjCbGbgtWhk4gSeV2duKEy4aX6qT6RKthMpk Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 = "_balance" | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 8 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 100000000 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 10000000000000000 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 50 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 4600000000000000 | |
43 | 43 | ||
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")) | |
47 | 49 | then { | |
48 | - | let | |
49 | - | fromBase58String( | |
50 | + | let y = x | |
51 | + | fromBase58String(y) | |
50 | 52 | } | |
51 | 53 | else { | |
52 | - | let | |
53 | - | throw(( | |
54 | + | let z = x | |
55 | + | throw((w + "is empty")) | |
54 | 56 | } | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | - | let | |
60 | + | let A = v(h) | |
59 | 61 | ||
60 | - | let | |
62 | + | let B = v(i) | |
61 | 63 | ||
62 | - | let | |
64 | + | let C = v(j) | |
63 | 65 | ||
64 | - | let | |
66 | + | let D = Address(v(k)) | |
65 | 67 | ||
66 | - | let | |
68 | + | let E = Address(v(l)) | |
67 | 69 | ||
68 | - | let | |
70 | + | let F = valueOrElse(getBoolean(this, a), true) | |
69 | 71 | ||
70 | - | let | |
72 | + | let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty") | |
71 | 73 | ||
72 | - | let | |
74 | + | let H = 1000000 | |
73 | 75 | ||
74 | - | func | |
76 | + | func I () = if (F) | |
75 | 77 | then unit | |
76 | 78 | else throw("DApp is inactive at this moment") | |
77 | 79 | ||
78 | 80 | ||
79 | - | func | |
81 | + | func J (K) = if (containsElement([A, B, C], K.callerPublicKey)) | |
80 | 82 | then unit | |
81 | 83 | else throw("Only admin can call this function") | |
82 | 84 | ||
83 | 85 | ||
84 | - | func | |
86 | + | func L () = throw("DApp is already active") | |
85 | 87 | ||
86 | 88 | ||
87 | - | func | |
89 | + | func M (N) = [BooleanEntry(a, false), StringEntry(b, N)] | |
88 | 90 | ||
89 | 91 | ||
90 | - | func | |
92 | + | func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2) | |
91 | 93 | ||
92 | 94 | ||
93 | - | func | |
94 | - | let | |
95 | - | (fraction(( | |
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))) | |
96 | 98 | } | |
97 | 99 | ||
98 | 100 | ||
99 | - | func | |
100 | - | let | |
101 | - | let | |
102 | - | let | |
103 | - | if (if (( | |
104 | - | then (parseIntValue( | |
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) | |
105 | 107 | else false) | |
106 | - | then ( | |
107 | - | else if (if (( | |
108 | - | then (parseIntValue( | |
108 | + | then (H - parseIntValue(X[0])) | |
109 | + | else if (if ((V >= parseIntValue(W[1]))) | |
110 | + | then (parseIntValue(W[2]) > V) | |
109 | 111 | else false) | |
110 | - | then ( | |
111 | - | else if (if (( | |
112 | - | then (parseIntValue( | |
112 | + | then (H - parseIntValue(X[1])) | |
113 | + | else if (if ((V >= parseIntValue(W[2]))) | |
114 | + | then (parseIntValue(W[3]) > V) | |
113 | 115 | else false) | |
114 | - | then ( | |
115 | - | else if (if (( | |
116 | - | then (parseIntValue( | |
116 | + | then (H - parseIntValue(X[2])) | |
117 | + | else if (if ((V >= parseIntValue(W[3]))) | |
118 | + | then (parseIntValue(W[4]) > V) | |
117 | 119 | else false) | |
118 | - | then ( | |
119 | - | else if (( | |
120 | - | then ( | |
121 | - | else | |
120 | + | then (H - parseIntValue(X[3])) | |
121 | + | else if ((V >= parseIntValue(W[4]))) | |
122 | + | then (H - parseIntValue(X[4])) | |
123 | + | else H | |
122 | 124 | } | |
123 | 125 | ||
124 | 126 | ||
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")) | |
132 | 130 | 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.") | |
136 | 140 | } | |
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)")) | |
145 | 168 | } | |
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.") | |
152 | 172 | } | |
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) | |
164 | 194 | } | |
165 | 195 | ||
166 | 196 | ||
167 | - | @Callable( | |
168 | - | func routingTrade ( | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | if (!( | |
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))) | |
173 | 203 | then throw("Check transaction possibilty: declined") | |
174 | - | else if (if (!(isDefined(getString( | |
204 | + | else if (if (!(isDefined(getString(u, (c + ac[0]))))) | |
175 | 205 | then true | |
176 | - | else !(isDefined(getString( | |
206 | + | else !(isDefined(getString(u, (c + ac[1]))))) | |
177 | 207 | then throw("Pool is not in oracle") | |
178 | 208 | else { | |
179 | - | let | |
180 | - | func | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | let | |
186 | - | then $Tuple2( | |
187 | - | else $Tuple2( | |
188 | - | let | |
189 | - | let | |
190 | - | if (((if (( | |
191 | - | then ( | |
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) | |
192 | 222 | else false) == true)) | |
193 | 223 | 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")) | |
201 | 226 | 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)) | |
206 | 234 | 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) | |
212 | 238 | } | |
213 | - | else throw(" | |
239 | + | else throw("Strict value is not equal to itself.") | |
214 | 240 | } | |
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") | |
216 | 266 | } | |
217 | - | else | |
267 | + | else aB | |
218 | 268 | } | |
219 | 269 | ||
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | func | |
225 | - | then | |
226 | - | else | |
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]) | |
227 | 277 | ||
228 | - | func | |
229 | - | then | |
278 | + | func aV (aT,aU) = if ((aU >= aQ)) | |
279 | + | then aT | |
230 | 280 | else throw("List size exceeds 3") | |
231 | 281 | ||
232 | - | | |
282 | + | aV(aS(aS(aS(aR, 0), 1), 2), 3) | |
233 | 283 | } | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | if (if (( | |
239 | - | then ( | |
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) | |
240 | 290 | else false) | |
241 | - | then [ScriptTransfer( | |
291 | + | then [ScriptTransfer(K.caller, aY, aX), ScriptTransfer(D, (aW - aY), aX)] | |
242 | 292 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
243 | 293 | } | |
244 | 294 | }) | |
245 | 295 | ||
246 | 296 | ||
247 | 297 | ||
248 | - | @Callable( | |
249 | - | func shutdown () = valueOrElse( | |
298 | + | @Callable(K) | |
299 | + | func shutdown () = valueOrElse(J(K), if (!(F)) | |
250 | 300 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
251 | - | else | |
301 | + | else M("Paused by admin")) | |
252 | 302 | ||
253 | 303 | ||
254 | 304 | ||
255 | - | @Callable( | |
256 | - | func activate () = valueOrElse( | |
257 | - | then | |
305 | + | @Callable(K) | |
306 | + | func activate () = valueOrElse(J(K), if (F) | |
307 | + | then L() | |
258 | 308 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
259 | 309 | ||
260 | 310 | ||
261 | - | @Verifier( | |
262 | - | func | |
263 | - | let | |
264 | - | let | |
311 | + | @Verifier(aZ) | |
312 | + | func ba () = { | |
313 | + | let bb = { | |
314 | + | let bc = if (sigVerify(aZ.bodyBytes, aZ.proofs[0], A)) | |
265 | 315 | then 1 | |
266 | 316 | else 0 | |
267 | - | let | |
317 | + | let bd = if (sigVerify(aZ.bodyBytes, aZ.proofs[1], B)) | |
268 | 318 | then 1 | |
269 | 319 | else 0 | |
270 | - | let | |
320 | + | let be = if (sigVerify(aZ.bodyBytes, aZ.proofs[2], C)) | |
271 | 321 | then 1 | |
272 | 322 | else 0 | |
273 | - | ((( | |
323 | + | (((bc + bd) + be) >= 2) | |
274 | 324 | } | |
275 | - | let | |
276 | - | | |
325 | + | let x = aZ | |
326 | + | bb | |
277 | 327 | } | |
278 | 328 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 = "_balance" | |
31 | 31 | ||
32 | - | let o = | |
32 | + | let o = 8 | |
33 | 33 | ||
34 | - | let p = | |
34 | + | let p = 100000000 | |
35 | 35 | ||
36 | - | let q = | |
36 | + | let q = 10000000000000000 | |
37 | 37 | ||
38 | - | let r = | |
38 | + | let r = 50 | |
39 | 39 | ||
40 | - | let s = | |
40 | + | let s = 2 | |
41 | 41 | ||
42 | - | let t = | |
42 | + | let t = 4600000000000000 | |
43 | 43 | ||
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")) | |
47 | 49 | then { | |
48 | - | let | |
49 | - | fromBase58String( | |
50 | + | let y = x | |
51 | + | fromBase58String(y) | |
50 | 52 | } | |
51 | 53 | else { | |
52 | - | let | |
53 | - | throw(( | |
54 | + | let z = x | |
55 | + | throw((w + "is empty")) | |
54 | 56 | } | |
55 | 57 | } | |
56 | 58 | ||
57 | 59 | ||
58 | - | let | |
60 | + | let A = v(h) | |
59 | 61 | ||
60 | - | let | |
62 | + | let B = v(i) | |
61 | 63 | ||
62 | - | let | |
64 | + | let C = v(j) | |
63 | 65 | ||
64 | - | let | |
66 | + | let D = Address(v(k)) | |
65 | 67 | ||
66 | - | let | |
68 | + | let E = Address(v(l)) | |
67 | 69 | ||
68 | - | let | |
70 | + | let F = valueOrElse(getBoolean(this, a), true) | |
69 | 71 | ||
70 | - | let | |
72 | + | let G = valueOrErrorMessage(getInteger(u, g), "routing_fee is empty") | |
71 | 73 | ||
72 | - | let | |
74 | + | let H = 1000000 | |
73 | 75 | ||
74 | - | func | |
76 | + | func I () = if (F) | |
75 | 77 | then unit | |
76 | 78 | else throw("DApp is inactive at this moment") | |
77 | 79 | ||
78 | 80 | ||
79 | - | func | |
81 | + | func J (K) = if (containsElement([A, B, C], K.callerPublicKey)) | |
80 | 82 | then unit | |
81 | 83 | else throw("Only admin can call this function") | |
82 | 84 | ||
83 | 85 | ||
84 | - | func | |
86 | + | func L () = throw("DApp is already active") | |
85 | 87 | ||
86 | 88 | ||
87 | - | func | |
89 | + | func M (N) = [BooleanEntry(a, false), StringEntry(b, N)] | |
88 | 90 | ||
89 | 91 | ||
90 | - | func | |
92 | + | func O (P,Q) = ((fraction(q, P, Q) + fraction(q, Q, P)) / 2) | |
91 | 93 | ||
92 | 94 | ||
93 | - | func | |
94 | - | let | |
95 | - | (fraction(( | |
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))) | |
96 | 98 | } | |
97 | 99 | ||
98 | 100 | ||
99 | - | func | |
100 | - | let | |
101 | - | let | |
102 | - | let | |
103 | - | if (if (( | |
104 | - | then (parseIntValue( | |
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) | |
105 | 107 | else false) | |
106 | - | then ( | |
107 | - | else if (if (( | |
108 | - | then (parseIntValue( | |
108 | + | then (H - parseIntValue(X[0])) | |
109 | + | else if (if ((V >= parseIntValue(W[1]))) | |
110 | + | then (parseIntValue(W[2]) > V) | |
109 | 111 | else false) | |
110 | - | then ( | |
111 | - | else if (if (( | |
112 | - | then (parseIntValue( | |
112 | + | then (H - parseIntValue(X[1])) | |
113 | + | else if (if ((V >= parseIntValue(W[2]))) | |
114 | + | then (parseIntValue(W[3]) > V) | |
113 | 115 | else false) | |
114 | - | then ( | |
115 | - | else if (if (( | |
116 | - | then (parseIntValue( | |
116 | + | then (H - parseIntValue(X[2])) | |
117 | + | else if (if ((V >= parseIntValue(W[3]))) | |
118 | + | then (parseIntValue(W[4]) > V) | |
117 | 119 | else false) | |
118 | - | then ( | |
119 | - | else if (( | |
120 | - | then ( | |
121 | - | else | |
120 | + | then (H - parseIntValue(X[3])) | |
121 | + | else if ((V >= parseIntValue(W[4]))) | |
122 | + | then (H - parseIntValue(X[4])) | |
123 | + | else H | |
122 | 124 | } | |
123 | 125 | ||
124 | 126 | ||
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")) | |
132 | 130 | 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.") | |
136 | 140 | } | |
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)")) | |
145 | 168 | } | |
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.") | |
152 | 172 | } | |
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) | |
164 | 194 | } | |
165 | 195 | ||
166 | 196 | ||
167 | - | @Callable( | |
168 | - | func routingTrade ( | |
169 | - | let | |
170 | - | let | |
171 | - | let | |
172 | - | if (!( | |
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))) | |
173 | 203 | then throw("Check transaction possibilty: declined") | |
174 | - | else if (if (!(isDefined(getString( | |
204 | + | else if (if (!(isDefined(getString(u, (c + ac[0]))))) | |
175 | 205 | then true | |
176 | - | else !(isDefined(getString( | |
206 | + | else !(isDefined(getString(u, (c + ac[1]))))) | |
177 | 207 | then throw("Pool is not in oracle") | |
178 | 208 | else { | |
179 | - | let | |
180 | - | func | |
181 | - | let | |
182 | - | let | |
183 | - | let | |
184 | - | let | |
185 | - | let | |
186 | - | then $Tuple2( | |
187 | - | else $Tuple2( | |
188 | - | let | |
189 | - | let | |
190 | - | if (((if (( | |
191 | - | then ( | |
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) | |
192 | 222 | else false) == true)) | |
193 | 223 | 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")) | |
201 | 226 | 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)) | |
206 | 234 | 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) | |
212 | 238 | } | |
213 | - | else throw(" | |
239 | + | else throw("Strict value is not equal to itself.") | |
214 | 240 | } | |
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") | |
216 | 266 | } | |
217 | - | else | |
267 | + | else aB | |
218 | 268 | } | |
219 | 269 | ||
220 | - | let | |
221 | - | let | |
222 | - | let | |
223 | - | let | |
224 | - | func | |
225 | - | then | |
226 | - | else | |
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]) | |
227 | 277 | ||
228 | - | func | |
229 | - | then | |
278 | + | func aV (aT,aU) = if ((aU >= aQ)) | |
279 | + | then aT | |
230 | 280 | else throw("List size exceeds 3") | |
231 | 281 | ||
232 | - | | |
282 | + | aV(aS(aS(aS(aR, 0), 1), 2), 3) | |
233 | 283 | } | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | if (if (( | |
239 | - | then ( | |
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) | |
240 | 290 | else false) | |
241 | - | then [ScriptTransfer( | |
291 | + | then [ScriptTransfer(K.caller, aY, aX), ScriptTransfer(D, (aW - aY), aX)] | |
242 | 292 | else throw("routing != routingSize or amountToRecieve < minAmountToReceive") | |
243 | 293 | } | |
244 | 294 | }) | |
245 | 295 | ||
246 | 296 | ||
247 | 297 | ||
248 | - | @Callable( | |
249 | - | func shutdown () = valueOrElse( | |
298 | + | @Callable(K) | |
299 | + | func shutdown () = valueOrElse(J(K), if (!(F)) | |
250 | 300 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, b), "the cause wasn't specified"))) | |
251 | - | else | |
301 | + | else M("Paused by admin")) | |
252 | 302 | ||
253 | 303 | ||
254 | 304 | ||
255 | - | @Callable( | |
256 | - | func activate () = valueOrElse( | |
257 | - | then | |
305 | + | @Callable(K) | |
306 | + | func activate () = valueOrElse(J(K), if (F) | |
307 | + | then L() | |
258 | 308 | else [BooleanEntry(a, true), DeleteEntry(b)]) | |
259 | 309 | ||
260 | 310 | ||
261 | - | @Verifier( | |
262 | - | func | |
263 | - | let | |
264 | - | let | |
311 | + | @Verifier(aZ) | |
312 | + | func ba () = { | |
313 | + | let bb = { | |
314 | + | let bc = if (sigVerify(aZ.bodyBytes, aZ.proofs[0], A)) | |
265 | 315 | then 1 | |
266 | 316 | else 0 | |
267 | - | let | |
317 | + | let bd = if (sigVerify(aZ.bodyBytes, aZ.proofs[1], B)) | |
268 | 318 | then 1 | |
269 | 319 | else 0 | |
270 | - | let | |
320 | + | let be = if (sigVerify(aZ.bodyBytes, aZ.proofs[2], C)) | |
271 | 321 | then 1 | |
272 | 322 | else 0 | |
273 | - | ((( | |
323 | + | (((bc + bd) + be) >= 2) | |
274 | 324 | } | |
275 | - | let | |
276 | - | | |
325 | + | let x = aZ | |
326 | + | bb | |
277 | 327 | } | |
278 | 328 |
github/deemru/w8io/026f985 89.76 ms ◑