tx · BKQuFviKjXvX831vGSc8VCHrUhW2Cpy1o1v6xfhJzP4i 3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP: -0.01100000 Waves 2022.08.30 11:54 [2206974] smart account 3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP > SELF 0.00000000 Waves
{ "type": 13, "id": "BKQuFviKjXvX831vGSc8VCHrUhW2Cpy1o1v6xfhJzP4i", "fee": 1100000, "feeAssetId": null, "timestamp": 1661849643812, "version": 2, "chainId": 84, "sender": "3N4nTJ5sSp5X5ChS2bBBmwNMn1eeRzT1FoP", "senderPublicKey": "EsqRXDXnACFAdXz6EPhF1SbKyeV7MVuoyDqmXsMz7ySv", "proofs": [ "49aZBzUjmhzwxrJE1sBgdpctmSQzUna2RyhJq6h6ePdZY16GhQEKk22B4yFRBpktu8RoootrXroJ4naXtKdXose9" ], "script": "base64:AAIFAAAAAAAAACIIAhIDCgEIEgMKAQgSABIDCgEYEggKBgEBAQEIARIDCgEIAAAAHwAAAAADU0VQAgAAAAJfXwAAAAAFRU1QVFkCAAAAAAAAAAAOaWR4UG9vbEFkZHJlc3MAAAAAAAAAAAEAAAAACWlkeExQQXNJZAAAAAAAAAAAAwAAAAAJaWR4QW1Bc0lkAAAAAAAAAAAEAAAAAAlpZHhQckFzSWQAAAAAAAAAAAUAAAAAD2lkeEZhY3RTdGFrQ250cgAAAAAAAAAAAQEAAAALa2V5RmFjdENudHIAAAAAAgAAABMlc19fZmFjdG9yeUNvbnRyYWN0AQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAAAtrZXlQb29sQWRkcgAAAAACAAAADyVzX19wb29sQWRkcmVzcwEAAAALa2V5QW10QXNzZXQAAAAAAgAAAA8lc19fYW1vdW50QXN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wkABEwAAAACCQEAAAAGa2V5QW1wAAAAAAkABEwAAAACBQAAAANhbXAFAAAAA25pbAUAAAADbmlsBAAAAARyZXMyCQAD/AAAAAQFAAAADHBvb2xDb250cmFjdAIAAAAEc2V0UwkABEwAAAACCQEAAAANa2V5QW1wSGlzdG9yeQAAAAEFAAAABmhlaWdodAkABEwAAAACBQAAAANhbXAFAAAAA25pbAUAAAADbmlsCQAFFAAAAAIFAAAAA25pbAkABRQAAAACBQAAAARyZXMxBQAAAARyZXMyCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAD3RhcmdldFB1YmxpY0tleQQAAAAHJG1hdGNoMAkBAAAAFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAJwawUAAAAHJG1hdGNoMAUAAAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXmJkpk6", "height": 2206974, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A7PmE6KHwyMxT8rT8cvjSBGwG6UMyHDVLLWovkD9q9w2 Next: 7uf1i3VGBdpJQMbwpQHqwh3SbW2vCWdhV2k9NZY7yzwC Diff:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = "__" | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = "" | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 1 | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = 3 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 4 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 5 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | let h = toBigInt((b - ((b * 1) / b))) | |
19 | - | ||
20 | - | let i = "100" | |
21 | - | ||
22 | - | let j = "1" | |
23 | - | ||
24 | - | let k = "__" | |
25 | - | ||
26 | - | let l = "" | |
27 | - | ||
28 | - | let m = 1 | |
29 | - | ||
30 | - | let n = 2 | |
31 | - | ||
32 | - | let o = 3 | |
33 | - | ||
34 | - | let p = 4 | |
35 | - | ||
36 | - | let q = 1 | |
37 | - | ||
38 | - | let r = 2 | |
39 | - | ||
40 | - | let s = 3 | |
41 | - | ||
42 | - | let t = 4 | |
43 | - | ||
44 | - | let u = 5 | |
45 | - | ||
46 | - | let v = 6 | |
47 | - | ||
48 | - | let w = 7 | |
49 | - | ||
50 | - | let x = 8 | |
51 | - | ||
52 | - | let y = 9 | |
53 | - | ||
54 | - | let z = 1 | |
55 | - | ||
56 | - | let A = 7 | |
57 | - | ||
58 | - | let B = 10 | |
59 | - | ||
60 | - | let C = 0 | |
61 | - | ||
62 | - | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
18 | + | func h () = "%s__factoryContract" | |
63 | 19 | ||
64 | 20 | ||
65 | - | func | |
21 | + | func i () = "%s__managerPublicKey" | |
66 | 22 | ||
67 | 23 | ||
68 | - | func | |
24 | + | func j () = "%s__pendingManagerPublicKey" | |
69 | 25 | ||
70 | 26 | ||
71 | - | func N (H) = if ((f > H)) | |
72 | - | then -(H) | |
73 | - | else H | |
27 | + | func k () = "%s__poolAddress" | |
74 | 28 | ||
75 | 29 | ||
76 | - | func | |
30 | + | func l () = "%s__amountAsset" | |
77 | 31 | ||
78 | 32 | ||
79 | - | func | |
33 | + | func m () = "%s__priceAsset" | |
80 | 34 | ||
81 | 35 | ||
82 | - | func | |
36 | + | func n () = "%s__adminPubKeys" | |
83 | 37 | ||
84 | 38 | ||
85 | - | func | |
39 | + | func o () = "%s__amp" | |
86 | 40 | ||
87 | 41 | ||
88 | - | func | |
42 | + | func p (q) = ("%s%d__amp__" + toString(q)) | |
89 | 43 | ||
90 | 44 | ||
91 | - | func | |
45 | + | func r () = "%s__factoryConfig" | |
92 | 46 | ||
93 | 47 | ||
94 | - | func | |
48 | + | func s (t,u) = (((("%d%d%s__" + t) + "__") + u) + "__config") | |
95 | 49 | ||
96 | 50 | ||
97 | - | func | |
51 | + | func v (w) = ("%s%s%s__mappings__baseAsset2internalId__" + w) | |
98 | 52 | ||
99 | 53 | ||
100 | - | func | |
54 | + | func x (y,z) = valueOrErrorMessage(getString(y, z), makeString(["mandatory ", toString(y), ".", z, " not defined"], "")) | |
101 | 55 | ||
102 | 56 | ||
103 | - | func | |
57 | + | func A (y,z) = valueOrErrorMessage(getInteger(y, z), makeString(["mandatory ", toString(y), ".", z, " not defined"], "")) | |
104 | 58 | ||
105 | 59 | ||
106 | - | ||
60 | + | let B = addressFromStringValue(x(this, k())) | |
107 | 61 | ||
62 | + | let C = addressFromStringValue(x(B, h())) | |
108 | 63 | ||
109 | - | let ad = "%s__feePermille" | |
110 | - | ||
111 | - | let ae = valueOrElse(getInteger(this, ad), C) | |
112 | - | ||
113 | - | func af () = "%s__factoryConfig" | |
114 | - | ||
115 | - | ||
116 | - | func ag () = "%s%s__matcher__publicKey" | |
117 | - | ||
118 | - | ||
119 | - | func ah (ai,aj) = (((("%d%d%s__" + ai) + "__") + aj) + "__config") | |
120 | - | ||
121 | - | ||
122 | - | func ak (al) = ("%s%s%s__mappings__baseAsset2internalId__" + al) | |
123 | - | ||
124 | - | ||
125 | - | func am () = "%s__shutdown" | |
126 | - | ||
127 | - | ||
128 | - | func an (ao) = throw(makeString(["lp_stable.ride:", ao], " ")) | |
129 | - | ||
130 | - | ||
131 | - | func ap (aq,ar,as) = an(((((("Failed: ordValid=" + toString(aq)) + " sndrValid=") + toString(ar)) + " mtchrValid=") + toString(as))) | |
132 | - | ||
133 | - | ||
134 | - | func at (H) = { | |
135 | - | let au = H | |
136 | - | if ($isInstanceOf(au, "String")) | |
137 | - | then { | |
138 | - | let av = au | |
139 | - | av | |
140 | - | } | |
141 | - | else an("fail cast to String") | |
64 | + | func D () = { | |
65 | + | let E = x(B, l()) | |
66 | + | let F = x(B, m()) | |
67 | + | let G = A(C, v(F)) | |
68 | + | let t = A(C, v(E)) | |
69 | + | split(x(C, s(toString(t), toString(G))), a) | |
142 | 70 | } | |
143 | 71 | ||
144 | 72 | ||
145 | - | func | |
73 | + | func H () = split(x(C, r()), a) | |
146 | 74 | ||
147 | 75 | ||
148 | - | func az (ax,ay) = valueOrErrorMessage(getInteger(ax, ay), makeString(["mandatory ", toString(ax), ".", ay, " not defined"], "")) | |
149 | - | ||
150 | - | ||
151 | - | let aA = addressFromStringValue(aw(this, O())) | |
152 | - | ||
153 | - | let aB = aw(this, ab()) | |
154 | - | ||
155 | - | func aC () = valueOrElse(getBoolean(aA, am()), false) | |
156 | - | ||
157 | - | ||
158 | - | func aD () = fromBase58String(aw(aA, ag())) | |
159 | - | ||
160 | - | ||
161 | - | let aE = addressFromPublicKey(aD()) | |
162 | - | ||
163 | - | func aF () = { | |
164 | - | let aG = aw(this, Z()) | |
165 | - | let aH = aw(this, aa()) | |
166 | - | let aI = az(aA, ak(aH)) | |
167 | - | let ai = az(aA, ak(aG)) | |
168 | - | split(aw(aA, ah(toString(ai), toString(aI))), k) | |
169 | - | } | |
170 | - | ||
171 | - | ||
172 | - | func aJ () = split(aw(aA, af()), k) | |
173 | - | ||
174 | - | ||
175 | - | func aK (aL,aM,aN,aO,aP,aQ,aR,aS,aT,aU) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(aL), toString(aM), toString(aN), toString(aO), toString(aP), toString(aQ), toString(aR), toString(aS), toString(aT), toString(aU)], k) | |
176 | - | ||
177 | - | ||
178 | - | func aV (aW,aX,aY,aO,aR,aS) = makeString(["%d%d%d%d%d%d", toString(aW), toString(aX), toString(aY), toString(aO), toString(aR), toString(aS)], k) | |
179 | - | ||
180 | - | ||
181 | - | func aZ (ba) = if ((ba == "WAVES")) | |
182 | - | then wavesBalance(this).available | |
183 | - | else assetBalance(this, fromBase58String(ba)) | |
184 | - | ||
185 | - | ||
186 | - | func bb (bc,bd) = fraction(bc, d, bd) | |
187 | - | ||
188 | - | ||
189 | - | func be (bf,bg,bh) = { | |
190 | - | let bi = fraction((bf - bg), c, bg) | |
191 | - | let bj = ((bh - N(bi)) > f) | |
192 | - | if (!(bj)) | |
193 | - | then an(("Big slippage: " + toString(bi))) | |
194 | - | else $Tuple2(bj, min([bf, bg])) | |
195 | - | } | |
196 | - | ||
197 | - | ||
198 | - | func bk (bl,bm,bh) = { | |
199 | - | let bi = fraction(bm, c, bl) | |
200 | - | let bn = (bh > bi) | |
201 | - | if (if (bn) | |
202 | - | then true | |
203 | - | else (bm > bl)) | |
204 | - | then an(((((((toString(bm) + " ") + toString(bl)) + " ") + toString(bi)) + " ") + toString(bh))) | |
205 | - | else bn | |
206 | - | } | |
207 | - | ||
208 | - | ||
209 | - | func bo (bp,bq,br,bs) = { | |
210 | - | let bt = D(br, bp) | |
211 | - | let bu = D(bs, bq) | |
212 | - | bb(bu, bt) | |
213 | - | } | |
214 | - | ||
215 | - | ||
216 | - | func bv (br,bs,bw) = { | |
217 | - | let bx = aF() | |
218 | - | let by = parseIntValue(bx[v]) | |
219 | - | let bz = parseIntValue(bx[w]) | |
220 | - | let bA = bo(by, bz, br, bs) | |
221 | - | let bd = D(br, by) | |
222 | - | let bc = D(bs, bz) | |
223 | - | let bB = D(bw, b) | |
224 | - | let bC = bb(bd, bB) | |
225 | - | let bD = bb(bc, bB) | |
226 | - | [bA, bC, bD] | |
227 | - | } | |
228 | - | ||
229 | - | ||
230 | - | func bE (br,bs,bw) = { | |
231 | - | let bF = bv(br, bs, bw) | |
232 | - | [G(bF[0], b), G(bF[1], b), G(bF[2], b)] | |
233 | - | } | |
234 | - | ||
235 | - | ||
236 | - | func bG (bH,bI,bJ,bK) = { | |
237 | - | let bx = aF() | |
238 | - | let bL = bx[s] | |
239 | - | let bM = bx[t] | |
240 | - | let bN = bx[u] | |
241 | - | let bO = parseIntValue(bx[v]) | |
242 | - | let bP = parseIntValue(bx[w]) | |
243 | - | let bQ = bx[r] | |
244 | - | let bR = valueOrErrorMessage(assetInfo(fromBase58String(bL)), "Wrong LP id").quantity | |
245 | - | let bS = if ((bL == bI)) | |
246 | - | then true | |
247 | - | else an("Wrong payment asset") | |
248 | - | if ((bS == bS)) | |
76 | + | func I () = { | |
77 | + | let J = getString(i()) | |
78 | + | if ($isInstanceOf(J, "String")) | |
249 | 79 | then { | |
250 | - | let bT = aZ(bM) | |
251 | - | let bU = aZ(bN) | |
252 | - | let bV = fraction(bT, a, bO) | |
253 | - | let bW = fraction(bU, a, bP) | |
254 | - | let bX = D(bV, a) | |
255 | - | let bY = D(bW, a) | |
256 | - | let bZ = bb(bY, bX) | |
257 | - | let ca = G(bZ, b) | |
258 | - | let cb = D(bJ, b) | |
259 | - | let cc = D(bR, b) | |
260 | - | let cd = fraction(bX, cb, cc) | |
261 | - | let ce = fraction(bY, cb, cc) | |
262 | - | let cf = G(cd, a) | |
263 | - | let cg = G(ce, a) | |
264 | - | let ch = fraction(cf, bO, a) | |
265 | - | let ci = fraction(cg, bP, a) | |
266 | - | let cj = if ((bH == "")) | |
267 | - | then nil | |
268 | - | else [ScriptTransfer(bK, ch, if ((bM == "WAVES")) | |
269 | - | then unit | |
270 | - | else fromBase58String(bM)), ScriptTransfer(bK, ci, if ((bN == "WAVES")) | |
271 | - | then unit | |
272 | - | else fromBase58String(bN)), StringEntry(Y(toString(bK), bH), aV(ch, ci, bJ, ca, height, lastBlock.timestamp)), IntegerEntry(R(), ca), IntegerEntry(S(height, lastBlock.timestamp), ca)] | |
273 | - | $Tuple10(ch, ci, bM, bN, bT, bU, bR, bZ, bQ, cj) | |
80 | + | let K = J | |
81 | + | fromBase58String(K) | |
274 | 82 | } | |
275 | - | else throw("Strict value is not equal to itself.") | |
276 | - | } | |
277 | - | ||
278 | - | ||
279 | - | func ck (bH,cl,cm,cn,co,cp,bK,cq,cr,cs,ct,cu) = { | |
280 | - | let bx = aF() | |
281 | - | let bL = fromBase58String(bx[s]) | |
282 | - | let cv = bx[t] | |
283 | - | let cw = bx[u] | |
284 | - | let cx = bx[x] | |
285 | - | let cy = bx[y] | |
286 | - | let bO = parseIntValue(bx[v]) | |
287 | - | let bP = parseIntValue(bx[w]) | |
288 | - | let bQ = bx[r] | |
289 | - | let bR = valueOrErrorMessage(assetInfo(bL), "Wrong lp asset").quantity | |
290 | - | let bT = if (cq) | |
291 | - | then aZ(cv) | |
292 | - | else if (if (cs) | |
293 | - | then (cu == cv) | |
294 | - | else false) | |
295 | - | then (aZ(cv) - ct) | |
296 | - | else if (cs) | |
297 | - | then aZ(cv) | |
298 | - | else (aZ(cv) - cm) | |
299 | - | let bU = if (cq) | |
300 | - | then aZ(cw) | |
301 | - | else if (if (cs) | |
302 | - | then (cu == cw) | |
303 | - | else false) | |
304 | - | then (aZ(cw) - ct) | |
305 | - | else if (cs) | |
306 | - | then aZ(cw) | |
307 | - | else (aZ(cw) - co) | |
308 | - | let bV = fraction(bT, a, bO) | |
309 | - | let bW = fraction(bU, a, bP) | |
310 | - | let cz = fraction(cm, a, bO) | |
311 | - | let cA = fraction(co, a, bP) | |
312 | - | let cB = D(cz, a) | |
313 | - | let cC = D(cA, a) | |
314 | - | let cD = bb(cC, cB) | |
315 | - | let bX = D(bV, a) | |
316 | - | let bY = D(bW, a) | |
317 | - | let cE = if ((bR == 0)) | |
318 | - | then { | |
319 | - | let bZ = f | |
320 | - | let cF = f | |
321 | - | let cG = pow((cB * cC), 0, toBigInt(5), 1, 0, DOWN) | |
322 | - | $Tuple5(G(cG, b), G(cB, a), G(cC, a), bb((bY + cC), (bX + cB)), cF) | |
323 | - | } | |
324 | - | else { | |
325 | - | let bZ = bb(bY, bX) | |
326 | - | let cH = fraction(N((bZ - cD)), d, bZ) | |
327 | - | let cF = D(cl, b) | |
328 | - | let cI = if (((if ((bZ != f)) | |
329 | - | then (cH > cF) | |
330 | - | else false) == false)) | |
331 | - | then true | |
332 | - | else an(((("Price slippage " + toString(cH)) + " > ") + toString(cF))) | |
333 | - | if ((cI == cI)) | |
334 | - | then { | |
335 | - | let cc = D(bR, b) | |
336 | - | let cJ = fraction(cB, bZ, d) | |
337 | - | let cK = fraction(cC, d, bZ) | |
338 | - | let cL = if ((cJ > cC)) | |
339 | - | then $Tuple2(cK, cB) | |
340 | - | else $Tuple2(cB, cJ) | |
341 | - | let cM = cL._1 | |
342 | - | let cN = cL._2 | |
343 | - | let cG = fraction(cc, cN, bY) | |
344 | - | $Tuple5(G(cG, b), G(cM, a), G(cN, a), bZ, cF) | |
345 | - | } | |
346 | - | else throw("Strict value is not equal to itself.") | |
347 | - | } | |
348 | - | let cO = cE._1 | |
349 | - | let cP = fraction(cE._2, bO, a) | |
350 | - | let cQ = fraction(cE._3, bP, a) | |
351 | - | let cR = G(cE._4, b) | |
352 | - | let cS = G(cE._5, b) | |
353 | - | let cT = if ((cO > 0)) | |
354 | - | then true | |
355 | - | else an("LP <= 0") | |
356 | - | if ((cT == cT)) | |
357 | - | then { | |
358 | - | let cU = if (!(cr)) | |
359 | - | then 0 | |
360 | - | else cO | |
361 | - | let cV = (cm - cP) | |
362 | - | let cW = (co - cQ) | |
363 | - | let cX = if (if (cs) | |
364 | - | then (cu == cv) | |
365 | - | else false) | |
366 | - | then $Tuple2(ct, 0) | |
367 | - | else if (if (cs) | |
368 | - | then (cu == cw) | |
369 | - | else false) | |
370 | - | then $Tuple2(0, ct) | |
371 | - | else $Tuple2(cP, cQ) | |
372 | - | let cY = cX._1 | |
373 | - | let cZ = cX._2 | |
374 | - | let da = [IntegerEntry(R(), cR), IntegerEntry(S(height, lastBlock.timestamp), cR), StringEntry(V(bK, bH), aK(cY, cZ, cU, cR, cl, cS, height, lastBlock.timestamp, cV, cW))] | |
375 | - | $Tuple13(cO, cU, cR, bT, bU, bR, bL, bQ, da, cV, cW, cn, cp) | |
376 | - | } | |
377 | - | else throw("Strict value is not equal to itself.") | |
378 | - | } | |
379 | - | ||
380 | - | ||
381 | - | func db (dc) = { | |
382 | - | let bx = aF() | |
383 | - | let dd = bx[t] | |
384 | - | let de = bx[u] | |
385 | - | let bQ = parseIntValue(bx[r]) | |
386 | - | let by = parseIntValue(bx[v]) | |
387 | - | let bz = parseIntValue(bx[w]) | |
388 | - | let df = aZ(dd) | |
389 | - | let dg = aZ(de) | |
390 | - | let bZ = if ((dc.orderType == Buy)) | |
391 | - | then bo(by, bz, (df + dc.amount), dg) | |
392 | - | else bo(by, bz, (df - dc.amount), dg) | |
393 | - | let ca = G(bZ, b) | |
394 | - | if (if (if (aC()) | |
395 | - | then true | |
396 | - | else (bQ == o)) | |
397 | - | then true | |
398 | - | else (bQ == p)) | |
399 | - | then an("Admin blocked") | |
400 | - | else { | |
401 | - | let dh = dc.assetPair.amountAsset | |
402 | - | let di = if ((dh == unit)) | |
403 | - | then "WAVES" | |
404 | - | else toBase58String(value(dh)) | |
405 | - | let dj = dc.assetPair.priceAsset | |
406 | - | let dk = if ((dj == unit)) | |
407 | - | then "WAVES" | |
408 | - | else toBase58String(value(dj)) | |
409 | - | if (if ((di != dd)) | |
410 | - | then true | |
411 | - | else (dk != de)) | |
412 | - | then an("Wr assets") | |
413 | - | else { | |
414 | - | let dl = dc.price | |
415 | - | let bP = fraction(b, bz, by) | |
416 | - | let dm = J(dl, b, bP) | |
417 | - | let dn = if ((dc.orderType == Buy)) | |
418 | - | then (ca >= dm) | |
419 | - | else (dm >= ca) | |
420 | - | true | |
421 | - | } | |
422 | - | } | |
423 | - | } | |
424 | - | ||
425 | - | ||
426 | - | func do (dp) = { | |
427 | - | let dq = if ((size(dp.payments) == 1)) | |
428 | - | then true | |
429 | - | else an("1 payment expected") | |
430 | - | if ((dq == dq)) | |
431 | - | then { | |
432 | - | let dr = value(dp.payments[0]) | |
433 | - | let bI = value(dr.assetId) | |
434 | - | let ct = dr.amount | |
435 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bI), ct, dp.caller) | |
436 | - | let ch = cE._1 | |
437 | - | let ci = cE._2 | |
438 | - | let bQ = parseIntValue(cE._9) | |
439 | - | let cj = cE._10 | |
440 | - | if (if (aC()) | |
441 | - | then true | |
442 | - | else (bQ == p)) | |
443 | - | then an(("Admin blocked: " + toString(bQ))) | |
444 | - | else $Tuple5(ch, ci, ct, bI, cj) | |
445 | - | } | |
446 | - | else throw("Strict value is not equal to itself.") | |
447 | - | } | |
448 | - | ||
449 | - | ||
450 | - | func ds (dt,X,du,dv,bh,cr,cs,ct,cu) = { | |
451 | - | let cE = ck(X, bh, value(du).amount, value(du).assetId, value(dv).amount, value(dv).assetId, dt, false, cr, cs, ct, cu) | |
452 | - | let bQ = parseIntValue(cE._8) | |
453 | - | if (if (if (aC()) | |
454 | - | then true | |
455 | - | else (bQ == n)) | |
456 | - | then true | |
457 | - | else (bQ == p)) | |
458 | - | then an(("Blocked:" + toString(bQ))) | |
459 | - | else cE | |
460 | - | } | |
461 | - | ||
462 | - | ||
463 | - | func dw (dx) = { | |
464 | - | let dy = fraction(dx, ae, e) | |
465 | - | $Tuple2((dx - dy), dy) | |
466 | - | } | |
467 | - | ||
468 | - | ||
469 | - | func dz () = { | |
470 | - | let au = getString(P()) | |
471 | - | if ($isInstanceOf(au, "String")) | |
472 | - | then { | |
473 | - | let dA = au | |
474 | - | fromBase58String(dA) | |
475 | - | } | |
476 | - | else if ($isInstanceOf(au, "Unit")) | |
83 | + | else if ($isInstanceOf(J, "Unit")) | |
477 | 84 | then unit | |
478 | 85 | else throw("Match error") | |
479 | 86 | } | |
480 | 87 | ||
481 | 88 | ||
482 | - | func | |
483 | - | let | |
484 | - | if ($isInstanceOf( | |
89 | + | func L () = { | |
90 | + | let J = getString(j()) | |
91 | + | if ($isInstanceOf(J, "String")) | |
485 | 92 | then { | |
486 | - | let | |
487 | - | fromBase58String( | |
93 | + | let K = J | |
94 | + | fromBase58String(K) | |
488 | 95 | } | |
489 | - | else if ($isInstanceOf( | |
96 | + | else if ($isInstanceOf(J, "Unit")) | |
490 | 97 | then unit | |
491 | 98 | else throw("Match error") | |
492 | 99 | } | |
493 | 100 | ||
494 | 101 | ||
495 | - | let dC = an("Permission denied") | |
496 | - | ||
497 | - | func dD (dp) = { | |
498 | - | let au = dz() | |
499 | - | if ($isInstanceOf(au, "ByteVector")) | |
102 | + | func M (N) = { | |
103 | + | let O = throw("Permission denied") | |
104 | + | let J = I() | |
105 | + | if ($isInstanceOf(J, "ByteVector")) | |
500 | 106 | then { | |
501 | - | let | |
502 | - | if (( | |
107 | + | let P = J | |
108 | + | if ((N.callerPublicKey == P)) | |
503 | 109 | then true | |
504 | - | else | |
110 | + | else O | |
505 | 111 | } | |
506 | - | else if ($isInstanceOf( | |
507 | - | then if (( | |
112 | + | else if ($isInstanceOf(J, "Unit")) | |
113 | + | then if ((N.caller == this)) | |
508 | 114 | then true | |
509 | - | else | |
115 | + | else O | |
510 | 116 | else throw("Match error") | |
511 | 117 | } | |
512 | 118 | ||
513 | 119 | ||
514 | - | @Callable(dp) | |
515 | - | func constructor (aA) = { | |
516 | - | let dF = dD(dp) | |
517 | - | if ((dF == dF)) | |
518 | - | then [StringEntry(O(), aA)] | |
120 | + | func Q () = { | |
121 | + | let J = getString(n()) | |
122 | + | if ($isInstanceOf(J, "String")) | |
123 | + | then { | |
124 | + | let K = J | |
125 | + | if ((size(K) == 0)) | |
126 | + | then nil | |
127 | + | else split(K, a) | |
128 | + | } | |
129 | + | else nil | |
130 | + | } | |
131 | + | ||
132 | + | ||
133 | + | func R (N) = if (containsElement(Q(), toBase58String(N.callerPublicKey))) | |
134 | + | then true | |
135 | + | else M(N) | |
136 | + | ||
137 | + | ||
138 | + | func S (N) = if ((N.caller == B)) | |
139 | + | then true | |
140 | + | else throw("caller must be the pool") | |
141 | + | ||
142 | + | ||
143 | + | @Callable(N) | |
144 | + | func constructor (T) = { | |
145 | + | let U = M(N) | |
146 | + | if ((U == U)) | |
147 | + | then [StringEntry(k(), T)] | |
519 | 148 | else throw("Strict value is not equal to itself.") | |
520 | 149 | } | |
521 | 150 | ||
522 | 151 | ||
523 | 152 | ||
524 | - | @Callable( | |
525 | - | func setManager ( | |
526 | - | let | |
527 | - | if (( | |
153 | + | @Callable(N) | |
154 | + | func setManager (V) = { | |
155 | + | let U = M(N) | |
156 | + | if ((U == U)) | |
528 | 157 | then { | |
529 | - | let | |
530 | - | if (( | |
531 | - | then [StringEntry( | |
158 | + | let W = fromBase58String(V) | |
159 | + | if ((W == W)) | |
160 | + | then [StringEntry(j(), V)] | |
532 | 161 | else throw("Strict value is not equal to itself.") | |
533 | 162 | } | |
534 | 163 | else throw("Strict value is not equal to itself.") | |
536 | 165 | ||
537 | 166 | ||
538 | 167 | ||
539 | - | @Callable( | |
168 | + | @Callable(N) | |
540 | 169 | func confirmManager () = { | |
541 | - | let | |
542 | - | let | |
170 | + | let X = L() | |
171 | + | let Y = if (isDefined(X)) | |
543 | 172 | then true | |
544 | - | else | |
545 | - | if (( | |
173 | + | else throw("No pending manager") | |
174 | + | if ((Y == Y)) | |
546 | 175 | then { | |
547 | - | let | |
176 | + | let Z = if ((N.callerPublicKey == value(X))) | |
548 | 177 | then true | |
549 | - | else | |
550 | - | if (( | |
551 | - | then [StringEntry( | |
178 | + | else throw("You are not pending manager") | |
179 | + | if ((Z == Z)) | |
180 | + | then [StringEntry(i(), toBase58String(value(X))), DeleteEntry(j())] | |
552 | 181 | else throw("Strict value is not equal to itself.") | |
553 | 182 | } | |
554 | 183 | else throw("Strict value is not equal to itself.") | |
556 | 185 | ||
557 | 186 | ||
558 | 187 | ||
559 | - | @Callable(dp) | |
560 | - | func put (bh,dL) = { | |
561 | - | let dM = aJ() | |
562 | - | let dN = valueOrErrorMessage(addressFromString(dM[z]), "Wrong staking contract") | |
563 | - | let dO = valueOrErrorMessage(addressFromString(dM[A]), "Wrogn slippage contract") | |
564 | - | let dP = if ((bh >= 0)) | |
565 | - | then true | |
566 | - | else an("wrong slippage") | |
567 | - | if ((dP == dP)) | |
188 | + | @Callable(N) | |
189 | + | func setAdmins (aa) = { | |
190 | + | let U = M(N) | |
191 | + | if ((U == U)) | |
192 | + | then [StringEntry(n(), makeString(aa, a))] | |
193 | + | else throw("Strict value is not equal to itself.") | |
194 | + | } | |
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | @Callable(N) | |
199 | + | func unstakeAndGetOneTkn (ab,ac,ad,ae,af,ag) = { | |
200 | + | let ah = if ((size(N.payments) != 0)) | |
201 | + | then throw("No pmnts expd") | |
202 | + | else true | |
203 | + | if ((ah == ah)) | |
568 | 204 | then { | |
569 | - | let dQ = if ((size(dp.payments) == 2)) | |
570 | - | then true | |
571 | - | else an("2 payments expected") | |
572 | - | if ((dQ == dQ)) | |
205 | + | let ai = D() | |
206 | + | let aj = H() | |
207 | + | let ak = fromBase58String(ai[d]) | |
208 | + | let al = valueOrErrorMessage(addressFromString(aj[g]), "Wr st addr") | |
209 | + | let am = invoke(al, "unstake", [toBase58String(ak), ab], nil) | |
210 | + | if ((am == am)) | |
573 | 211 | then { | |
574 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(value(dp.payments[0]).assetId, value(dp.payments[0]).amount), dp.payments[1], bh, true, false, 0, "") | |
575 | - | let cU = dR._2 | |
576 | - | let bL = dR._7 | |
577 | - | let cj = dR._9 | |
578 | - | let cV = dR._10 | |
579 | - | let cW = dR._11 | |
580 | - | let bM = dR._12 | |
581 | - | let bN = dR._13 | |
582 | - | let cE = invoke(aA, "emit", [cU], nil) | |
583 | - | if ((cE == cE)) | |
584 | - | then { | |
585 | - | let dS = { | |
586 | - | let au = cE | |
587 | - | if ($isInstanceOf(au, "Address")) | |
588 | - | then { | |
589 | - | let dT = au | |
590 | - | invoke(dT, "emit", [cU], nil) | |
591 | - | } | |
592 | - | else unit | |
593 | - | } | |
594 | - | if ((dS == dS)) | |
595 | - | then { | |
596 | - | let dU = if ((cV > 0)) | |
597 | - | then invoke(dO, "put", nil, [AttachedPayment(bM, cV)]) | |
598 | - | else nil | |
599 | - | if ((dU == dU)) | |
600 | - | then { | |
601 | - | let dV = if ((cW > 0)) | |
602 | - | then invoke(dO, "put", nil, [AttachedPayment(bN, cW)]) | |
603 | - | else nil | |
604 | - | if ((dV == dV)) | |
605 | - | then { | |
606 | - | let dW = if (dL) | |
607 | - | then { | |
608 | - | let dX = invoke(dN, "stake", nil, [AttachedPayment(bL, cU)]) | |
609 | - | if ((dX == dX)) | |
610 | - | then nil | |
611 | - | else throw("Strict value is not equal to itself.") | |
612 | - | } | |
613 | - | else [ScriptTransfer(dp.caller, cU, bL)] | |
614 | - | (cj ++ dW) | |
615 | - | } | |
616 | - | else throw("Strict value is not equal to itself.") | |
617 | - | } | |
618 | - | else throw("Strict value is not equal to itself.") | |
619 | - | } | |
620 | - | else throw("Strict value is not equal to itself.") | |
621 | - | } | |
212 | + | let an = invoke(B, "getOneTkn", [ac, ad, ae, af, ag], [AttachedPayment(ak, ab)]) | |
213 | + | if ((an == an)) | |
214 | + | then nil | |
622 | 215 | else throw("Strict value is not equal to itself.") | |
623 | 216 | } | |
624 | 217 | else throw("Strict value is not equal to itself.") | |
628 | 221 | ||
629 | 222 | ||
630 | 223 | ||
631 | - | @Callable(dp) | |
632 | - | func putOneTkn (dY,dZ,bg,bh,dL) = { | |
633 | - | let bx = aJ() | |
634 | - | let dN = valueOrErrorMessage(addressFromString(bx[z]), "Wrong staking contract") | |
635 | - | let dO = valueOrErrorMessage(addressFromString(bx[A]), "Wrong slippage contract") | |
636 | - | let ea = valueOrErrorMessage(addressFromString(bx[B]), "Wrong gwx reward contract") | |
637 | - | let eb = aF() | |
638 | - | let bM = eb[t] | |
639 | - | let bN = eb[u] | |
640 | - | let bO = parseIntValue(eb[v]) | |
641 | - | let bP = parseIntValue(eb[w]) | |
642 | - | let ec = valueOrElse(getString(this, ac()), "") | |
643 | - | let bK = if ((ec == toString(dp.caller))) | |
644 | - | then dp.originCaller | |
645 | - | else dp.caller | |
646 | - | if (if (if (if ((0 >= bh)) | |
647 | - | then true | |
648 | - | else (0 >= dY)) | |
649 | - | then true | |
650 | - | else (0 >= dZ)) | |
651 | - | then true | |
652 | - | else (0 >= bg)) | |
653 | - | then an("Wrong params") | |
654 | - | else if ((size(dp.payments) != 1)) | |
655 | - | then an("1 payment expected") | |
656 | - | else { | |
657 | - | let dr = value(dp.payments[0]) | |
658 | - | let bI = toBase58String(value(dr.assetId)) | |
659 | - | let ed = dr.amount | |
660 | - | let ee = dw(ed) | |
661 | - | let ct = ee._1 | |
662 | - | let ef = ee._2 | |
663 | - | if (if (if ((dY > ct)) | |
664 | - | then true | |
665 | - | else (dZ > ct)) | |
666 | - | then true | |
667 | - | else (10000000 > ct)) | |
668 | - | then an("wrong payment amount") | |
669 | - | else { | |
670 | - | let bT = aZ(bM) | |
671 | - | let bU = aZ(bN) | |
672 | - | let eg = if ((bI == bM)) | |
673 | - | then $Tuple6((bT - ct), bU, (ct - dY), dZ, 0, 0) | |
674 | - | else if ((bI == bN)) | |
675 | - | then $Tuple6(bT, (bU - ct), 0, 0, (ct - dZ), dY) | |
676 | - | else an("wrong paymentAssetId") | |
677 | - | let eh = eg._1 | |
678 | - | let ei = eg._2 | |
679 | - | let ej = eg._3 | |
680 | - | let ek = eg._4 | |
681 | - | let el = eg._5 | |
682 | - | let em = eg._6 | |
683 | - | let bm = invoke(ea, "calcD", [toString(eh), toString(ei), aB, i, j], nil) | |
684 | - | let bl = invoke(ea, "calcD", [toString(toBigInt(((eh + ej) - em))), toString(toBigInt(((ei + el) - ek))), aB, i, j], nil) | |
685 | - | let en = bk(parseBigIntValue(at(bl)), parseBigIntValue(at(bm)), h) | |
686 | - | if ((en == en)) | |
687 | - | then { | |
688 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(fromBase58String(bM), dY), AttachedPayment(fromBase58String(bN), dZ), bh, true, true, ct, bI) | |
689 | - | let bf = dR._2 | |
690 | - | let bL = dR._7 | |
691 | - | let cj = dR._9 | |
692 | - | let cV = dR._10 | |
693 | - | let cW = dR._11 | |
694 | - | let eo = be(toBigInt(bf), toBigInt(bg), toBigInt(bh)) | |
695 | - | let cU = toInt(eo._2) | |
696 | - | let ep = invoke(aA, "emit", [cU], nil) | |
697 | - | if ((ep == ep)) | |
698 | - | then { | |
699 | - | let dS = { | |
700 | - | let au = ep | |
701 | - | if ($isInstanceOf(au, "Address")) | |
702 | - | then { | |
703 | - | let dT = au | |
704 | - | invoke(dT, "emit", [cU], nil) | |
705 | - | } | |
706 | - | else unit | |
707 | - | } | |
708 | - | if ((dS == dS)) | |
709 | - | then { | |
710 | - | let dU = if ((cV > 0)) | |
711 | - | then invoke(dO, "put", nil, [AttachedPayment(fromBase58String(bM), cV)]) | |
712 | - | else nil | |
713 | - | if ((dU == dU)) | |
714 | - | then { | |
715 | - | let dV = if ((cW > 0)) | |
716 | - | then invoke(dO, "put", nil, [AttachedPayment(fromBase58String(bN), cW)]) | |
717 | - | else nil | |
718 | - | if ((dV == dV)) | |
719 | - | then { | |
720 | - | let dW = if (dL) | |
721 | - | then { | |
722 | - | let dX = invoke(dN, "stake", nil, [AttachedPayment(bL, cU)]) | |
723 | - | if ((dX == dX)) | |
724 | - | then nil | |
725 | - | else throw("Strict value is not equal to itself.") | |
726 | - | } | |
727 | - | else [ScriptTransfer(dp.caller, cU, bL)] | |
728 | - | let eq = if ((ef > 0)) | |
729 | - | then [ScriptTransfer(aE, ef, fromBase58String(bI))] | |
730 | - | else nil | |
731 | - | ((cj ++ dW) ++ eq) | |
732 | - | } | |
733 | - | else throw("Strict value is not equal to itself.") | |
734 | - | } | |
735 | - | else throw("Strict value is not equal to itself.") | |
736 | - | } | |
737 | - | else throw("Strict value is not equal to itself.") | |
738 | - | } | |
739 | - | else throw("Strict value is not equal to itself.") | |
740 | - | } | |
741 | - | else throw("Strict value is not equal to itself.") | |
742 | - | } | |
743 | - | } | |
744 | - | } | |
745 | - | ||
746 | - | ||
747 | - | ||
748 | - | @Callable(dp) | |
749 | - | func putForFree (er) = if ((0 > er)) | |
750 | - | then an("wrong slippage") | |
751 | - | else if ((size(dp.payments) != 2)) | |
752 | - | then an("2 payments expected") | |
753 | - | else { | |
754 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(value(dp.payments[0]).assetId, value(dp.payments[0]).amount), dp.payments[1], er, false, false, 0, "") | |
755 | - | dR._9 | |
756 | - | } | |
757 | - | ||
758 | - | ||
759 | - | ||
760 | - | @Callable(dp) | |
761 | - | func get () = { | |
762 | - | let cE = do(dp) | |
763 | - | let es = cE._1 | |
764 | - | let ci = cE._2 | |
765 | - | let ct = cE._3 | |
766 | - | let bI = cE._4 | |
767 | - | let cj = cE._5 | |
768 | - | let et = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
769 | - | if ((et == et)) | |
770 | - | then cj | |
771 | - | else throw("Strict value is not equal to itself.") | |
772 | - | } | |
773 | - | ||
774 | - | ||
775 | - | ||
776 | - | @Callable(dp) | |
777 | - | func getOneTkn (eu,ev,ew,ex,bh) = if ((size(dp.payments) != 1)) | |
778 | - | then an("1 payment expected") | |
779 | - | else { | |
780 | - | let bx = aF() | |
781 | - | let bL = bx[s] | |
782 | - | let bM = bx[t] | |
783 | - | let bN = bx[u] | |
784 | - | let bO = parseIntValue(bx[v]) | |
785 | - | let bP = parseIntValue(bx[w]) | |
786 | - | let bQ = bx[r] | |
787 | - | let dM = aJ() | |
788 | - | let ea = valueOrErrorMessage(addressFromString(dM[B]), "Wrong gwxRewardContract address") | |
789 | - | let dr = value(dp.payments[0]) | |
790 | - | let ec = valueOrElse(getString(this, ac()), "") | |
791 | - | let bK = if ((ec == toString(dp.caller))) | |
792 | - | then dp.originCaller | |
793 | - | else dp.caller | |
794 | - | let bH = toBase58String(dp.transactionId) | |
795 | - | let bI = value(dr.assetId) | |
796 | - | let ct = dr.amount | |
797 | - | if ((1000000000 > ct)) | |
798 | - | then an("Min payment 10 LP") | |
799 | - | else if (if (if ((0 > bh)) | |
800 | - | then true | |
801 | - | else (0 > eu)) | |
802 | - | then true | |
803 | - | else (0 > ew)) | |
804 | - | then an("Wrong params") | |
805 | - | else if ((bL != toBase58String(bI))) | |
806 | - | then an("Wrong LP") | |
807 | - | else { | |
808 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bI), ct, dp.caller) | |
809 | - | let ey = cE._1 | |
810 | - | let ez = cE._2 | |
811 | - | let bT = aZ(bM) | |
812 | - | let bU = aZ(bN) | |
813 | - | let eA = if ((ex == bM)) | |
814 | - | then $Tuple7((bT - ey), (bU - ez), eu, ez, 0, 0, (ey + eu)) | |
815 | - | else if ((ex == bN)) | |
816 | - | then $Tuple7((bT - ey), (bU - ez), 0, 0, eu, ey, (ez + eu)) | |
817 | - | else an("wrong outAssetId") | |
818 | - | let eh = eA._1 | |
819 | - | let ei = eA._2 | |
820 | - | let ej = eA._3 | |
821 | - | let ek = eA._4 | |
822 | - | let el = eA._5 | |
823 | - | let em = eA._6 | |
824 | - | let eB = eA._7 | |
825 | - | if (if ((0 > ej)) | |
826 | - | then true | |
827 | - | else (0 > el)) | |
828 | - | then an("Wrong calc") | |
829 | - | else { | |
830 | - | let bm = invoke(ea, "calcD", [toString(eh), toString(ei), aB, i, j], nil) | |
831 | - | let bl = invoke(ea, "calcD", [toString(((eh - ej) + em)), toString(((ei + ek) - el)), aB, i, j], nil) | |
832 | - | let en = bk(parseBigIntValue(at(bl)), parseBigIntValue(at(bm)), h) | |
833 | - | if ((en == en)) | |
834 | - | then { | |
835 | - | let eC = be(toBigInt(eB), toBigInt(ew), toBigInt(bh)) | |
836 | - | if ((eC == eC)) | |
837 | - | then { | |
838 | - | let eD = if ((ex == bM)) | |
839 | - | then $Tuple2(toInt(eC._2), 0) | |
840 | - | else $Tuple2(0, toInt(eC._2)) | |
841 | - | let eE = eD._1 | |
842 | - | let eF = eD._2 | |
843 | - | let eG = (eE + eF) | |
844 | - | let eH = dw(eG) | |
845 | - | let eI = eH._1 | |
846 | - | let ef = eH._2 | |
847 | - | let eJ = if ((ex == "WAVES")) | |
848 | - | then unit | |
849 | - | else fromBase58String(ex) | |
850 | - | let eq = if ((ef > 0)) | |
851 | - | then [ScriptTransfer(aE, ef, eJ)] | |
852 | - | else nil | |
853 | - | let eK = if ((bO >= bP)) | |
854 | - | then bO | |
855 | - | else bP | |
856 | - | if ((eK == eK)) | |
857 | - | then { | |
858 | - | let eL = bb(D(bU, eK), D(bT, eK)) | |
859 | - | let eM = G(eL, b) | |
860 | - | let cj = [ScriptTransfer(bK, eI, eJ), StringEntry(Y(toString(bK), bH), aV(eE, eF, ct, eM, height, lastBlock.timestamp)), IntegerEntry(R(), eM), IntegerEntry(S(height, lastBlock.timestamp), eM)] | |
861 | - | if ((cj == cj)) | |
862 | - | then { | |
863 | - | let eN = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
864 | - | if ((eN == eN)) | |
865 | - | then (cj ++ eq) | |
866 | - | else throw("Strict value is not equal to itself.") | |
867 | - | } | |
868 | - | else throw("Strict value is not equal to itself.") | |
869 | - | } | |
870 | - | else throw("Strict value is not equal to itself.") | |
871 | - | } | |
872 | - | else throw("Strict value is not equal to itself.") | |
873 | - | } | |
874 | - | else throw("Strict value is not equal to itself.") | |
875 | - | } | |
876 | - | } | |
877 | - | } | |
878 | - | ||
879 | - | ||
880 | - | ||
881 | - | @Callable(dp) | |
882 | - | func getNoLess (eO,eP) = { | |
883 | - | let cE = do(dp) | |
884 | - | let ch = cE._1 | |
885 | - | let ci = cE._2 | |
886 | - | let ct = cE._3 | |
887 | - | let bI = cE._4 | |
888 | - | let cj = cE._5 | |
889 | - | let eQ = if ((ch >= eO)) | |
890 | - | then true | |
891 | - | else an(((("Failed: " + toString(ch)) + " < ") + toString(eO))) | |
892 | - | if ((eQ == eQ)) | |
224 | + | @Callable(N) | |
225 | + | func setAmp (ao) = { | |
226 | + | let U = R(N) | |
227 | + | if ((U == U)) | |
893 | 228 | then { | |
894 | - | let eR = if ((ci >= eP)) | |
895 | - | then true | |
896 | - | else an(((("Failed: " + toString(ci)) + " < ") + toString(eP))) | |
897 | - | if ((eR == eR)) | |
898 | - | then { | |
899 | - | let eS = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
900 | - | if ((eS == eS)) | |
901 | - | then cj | |
902 | - | else throw("Strict value is not equal to itself.") | |
903 | - | } | |
904 | - | else throw("Strict value is not equal to itself.") | |
229 | + | let ap = invoke(B, "setS", [o(), ao], nil) | |
230 | + | let aq = invoke(B, "setS", [p(height), ao], nil) | |
231 | + | $Tuple2(nil, $Tuple2(ap, aq)) | |
905 | 232 | } | |
906 | 233 | else throw("Strict value is not equal to itself.") | |
907 | 234 | } | |
908 | 235 | ||
909 | 236 | ||
910 | - | ||
911 | - | @Callable(dp) | |
912 | - | func unstakeAndGet (dx) = { | |
913 | - | let dq = if ((size(dp.payments) != 0)) | |
914 | - | then an("no payments expected") | |
915 | - | else true | |
916 | - | if ((dq == dq)) | |
917 | - | then { | |
918 | - | let bx = aF() | |
919 | - | let eT = aJ() | |
920 | - | let bL = fromBase58String(bx[s]) | |
921 | - | let eU = valueOrErrorMessage(addressFromString(eT[z]), "wrong") | |
922 | - | let eV = invoke(eU, "unstake", [toBase58String(bL), dx], nil) | |
923 | - | if ((eV == eV)) | |
924 | - | then { | |
925 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bL), dx, dp.caller) | |
926 | - | let bQ = parseIntValue(cE._9) | |
927 | - | let cj = cE._10 | |
928 | - | let eW = if (if (aC()) | |
929 | - | then true | |
930 | - | else (bQ == p)) | |
931 | - | then an(("Blocked: " + toString(bQ))) | |
932 | - | else true | |
933 | - | if ((eW == eW)) | |
934 | - | then { | |
935 | - | let eX = invoke(aA, "burn", [dx], [AttachedPayment(bL, dx)]) | |
936 | - | if ((eX == eX)) | |
937 | - | then cj | |
938 | - | else throw("Strict value is not equal to itself.") | |
939 | - | } | |
940 | - | else throw("Strict value is not equal to itself.") | |
941 | - | } | |
942 | - | else throw("Strict value is not equal to itself.") | |
943 | - | } | |
944 | - | else throw("Strict value is not equal to itself.") | |
945 | - | } | |
946 | - | ||
947 | - | ||
948 | - | ||
949 | - | @Callable(dp) | |
950 | - | func activate (eY,eZ) = if ((toString(dp.caller) != toString(aA))) | |
951 | - | then an("denied") | |
952 | - | else $Tuple2([StringEntry(Z(), eY), StringEntry(aa(), eZ)], "success") | |
953 | - | ||
954 | - | ||
955 | - | ||
956 | - | @Callable(dp) | |
957 | - | func setS (fa,eW) = if ((toString(dp.caller) != aw(this, ac()))) | |
958 | - | then dC | |
959 | - | else [StringEntry(fa, eW)] | |
960 | - | ||
961 | - | ||
962 | - | ||
963 | - | @Callable(dp) | |
964 | - | func setI (fa,eW) = if ((toString(dp.caller) != aw(this, ac()))) | |
965 | - | then dC | |
966 | - | else [IntegerEntry(fa, eW)] | |
967 | - | ||
968 | - | ||
969 | - | ||
970 | - | @Callable(dp) | |
971 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aF()) | |
972 | - | ||
973 | - | ||
974 | - | ||
975 | - | @Callable(dp) | |
976 | - | func getAccBalanceWrapperREADONLY (ba) = $Tuple2(nil, aZ(ba)) | |
977 | - | ||
978 | - | ||
979 | - | ||
980 | - | @Callable(dp) | |
981 | - | func calcPricesWrapperREADONLY (br,bs,bw) = { | |
982 | - | let fb = bv(br, bs, bw) | |
983 | - | $Tuple2(nil, [toString(fb[0]), toString(fb[1]), toString(fb[2])]) | |
984 | - | } | |
985 | - | ||
986 | - | ||
987 | - | ||
988 | - | @Callable(dp) | |
989 | - | func fromX18WrapperREADONLY (H,fc) = $Tuple2(nil, G(parseBigIntValue(H), fc)) | |
990 | - | ||
991 | - | ||
992 | - | ||
993 | - | @Callable(dp) | |
994 | - | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
995 | - | ||
996 | - | ||
997 | - | ||
998 | - | @Callable(dp) | |
999 | - | func calcPriceBigIntWrapperREADONLY (bc,bd) = $Tuple2(nil, toString(bb(parseBigIntValue(bc), parseBigIntValue(bd)))) | |
1000 | - | ||
1001 | - | ||
1002 | - | ||
1003 | - | @Callable(dp) | |
1004 | - | func estimatePutOperationWrapperREADONLY (bH,bh,cm,fd,co,fe,ff,cq,cr) = $Tuple2(nil, ck(bH, bh, cm, fd, co, fe, ff, cq, cr, false, 0, "")) | |
1005 | - | ||
1006 | - | ||
1007 | - | ||
1008 | - | @Callable(dp) | |
1009 | - | func estimateGetOperationWrapperREADONLY (bH,fg,bJ,ff) = { | |
1010 | - | let cE = bG(bH, fg, bJ, addressFromStringValue(ff)) | |
1011 | - | $Tuple2(nil, $Tuple10(cE._1, cE._2, cE._3, cE._4, cE._5, cE._6, cE._7, toString(cE._8), cE._9, cE._10)) | |
1012 | - | } | |
1013 | - | ||
1014 | - | ||
1015 | - | @Verifier(fh) | |
1016 | - | func fi () = { | |
1017 | - | let au = fh | |
1018 | - | if ($isInstanceOf(au, "Order")) | |
1019 | - | then { | |
1020 | - | let dc = au | |
1021 | - | let fj = aD() | |
1022 | - | let aq = db(dc) | |
1023 | - | let fk = sigVerify(dc.bodyBytes, dc.proofs[0], dc.senderPublicKey) | |
1024 | - | let fl = sigVerify(dc.bodyBytes, dc.proofs[1], fj) | |
1025 | - | if (if (if (aq) | |
1026 | - | then fk | |
1027 | - | else false) | |
1028 | - | then fl | |
1029 | - | else false) | |
1030 | - | then true | |
1031 | - | else ap(aq, fk, fl) | |
1032 | - | } | |
1033 | - | else { | |
1034 | - | let fm = { | |
1035 | - | let fn = dz() | |
1036 | - | if ($isInstanceOf(fn, "ByteVector")) | |
1037 | - | then { | |
1038 | - | let dE = fn | |
1039 | - | dE | |
1040 | - | } | |
1041 | - | else if ($isInstanceOf(fn, "Unit")) | |
1042 | - | then fh.senderPublicKey | |
1043 | - | else throw("Match error") | |
237 | + | @Verifier(ar) | |
238 | + | func as () = { | |
239 | + | let at = { | |
240 | + | let J = I() | |
241 | + | if ($isInstanceOf(J, "ByteVector")) | |
242 | + | then { | |
243 | + | let P = J | |
244 | + | P | |
1044 | 245 | } | |
1045 | - | sigVerify(fh.bodyBytes, fh.proofs[0], fm) | |
1046 | - | } | |
246 | + | else if ($isInstanceOf(J, "Unit")) | |
247 | + | then ar.senderPublicKey | |
248 | + | else throw("Match error") | |
249 | + | } | |
250 | + | sigVerify(ar.bodyBytes, ar.proofs[0], at) | |
1047 | 251 | } | |
1048 | 252 |
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = | |
4 | + | let a = "__" | |
5 | 5 | ||
6 | - | let b = | |
6 | + | let b = "" | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = 1 | |
9 | 9 | ||
10 | - | let d = | |
10 | + | let d = 3 | |
11 | 11 | ||
12 | - | let e = | |
12 | + | let e = 4 | |
13 | 13 | ||
14 | - | let f = | |
14 | + | let f = 5 | |
15 | 15 | ||
16 | - | let g = | |
16 | + | let g = 1 | |
17 | 17 | ||
18 | - | let h = toBigInt((b - ((b * 1) / b))) | |
19 | - | ||
20 | - | let i = "100" | |
21 | - | ||
22 | - | let j = "1" | |
23 | - | ||
24 | - | let k = "__" | |
25 | - | ||
26 | - | let l = "" | |
27 | - | ||
28 | - | let m = 1 | |
29 | - | ||
30 | - | let n = 2 | |
31 | - | ||
32 | - | let o = 3 | |
33 | - | ||
34 | - | let p = 4 | |
35 | - | ||
36 | - | let q = 1 | |
37 | - | ||
38 | - | let r = 2 | |
39 | - | ||
40 | - | let s = 3 | |
41 | - | ||
42 | - | let t = 4 | |
43 | - | ||
44 | - | let u = 5 | |
45 | - | ||
46 | - | let v = 6 | |
47 | - | ||
48 | - | let w = 7 | |
49 | - | ||
50 | - | let x = 8 | |
51 | - | ||
52 | - | let y = 9 | |
53 | - | ||
54 | - | let z = 1 | |
55 | - | ||
56 | - | let A = 7 | |
57 | - | ||
58 | - | let B = 10 | |
59 | - | ||
60 | - | let C = 0 | |
61 | - | ||
62 | - | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
18 | + | func h () = "%s__factoryContract" | |
63 | 19 | ||
64 | 20 | ||
65 | - | func | |
21 | + | func i () = "%s__managerPublicKey" | |
66 | 22 | ||
67 | 23 | ||
68 | - | func | |
24 | + | func j () = "%s__pendingManagerPublicKey" | |
69 | 25 | ||
70 | 26 | ||
71 | - | func N (H) = if ((f > H)) | |
72 | - | then -(H) | |
73 | - | else H | |
27 | + | func k () = "%s__poolAddress" | |
74 | 28 | ||
75 | 29 | ||
76 | - | func | |
30 | + | func l () = "%s__amountAsset" | |
77 | 31 | ||
78 | 32 | ||
79 | - | func | |
33 | + | func m () = "%s__priceAsset" | |
80 | 34 | ||
81 | 35 | ||
82 | - | func | |
36 | + | func n () = "%s__adminPubKeys" | |
83 | 37 | ||
84 | 38 | ||
85 | - | func | |
39 | + | func o () = "%s__amp" | |
86 | 40 | ||
87 | 41 | ||
88 | - | func | |
42 | + | func p (q) = ("%s%d__amp__" + toString(q)) | |
89 | 43 | ||
90 | 44 | ||
91 | - | func | |
45 | + | func r () = "%s__factoryConfig" | |
92 | 46 | ||
93 | 47 | ||
94 | - | func | |
48 | + | func s (t,u) = (((("%d%d%s__" + t) + "__") + u) + "__config") | |
95 | 49 | ||
96 | 50 | ||
97 | - | func | |
51 | + | func v (w) = ("%s%s%s__mappings__baseAsset2internalId__" + w) | |
98 | 52 | ||
99 | 53 | ||
100 | - | func | |
54 | + | func x (y,z) = valueOrErrorMessage(getString(y, z), makeString(["mandatory ", toString(y), ".", z, " not defined"], "")) | |
101 | 55 | ||
102 | 56 | ||
103 | - | func | |
57 | + | func A (y,z) = valueOrErrorMessage(getInteger(y, z), makeString(["mandatory ", toString(y), ".", z, " not defined"], "")) | |
104 | 58 | ||
105 | 59 | ||
106 | - | ||
60 | + | let B = addressFromStringValue(x(this, k())) | |
107 | 61 | ||
62 | + | let C = addressFromStringValue(x(B, h())) | |
108 | 63 | ||
109 | - | let ad = "%s__feePermille" | |
110 | - | ||
111 | - | let ae = valueOrElse(getInteger(this, ad), C) | |
112 | - | ||
113 | - | func af () = "%s__factoryConfig" | |
114 | - | ||
115 | - | ||
116 | - | func ag () = "%s%s__matcher__publicKey" | |
117 | - | ||
118 | - | ||
119 | - | func ah (ai,aj) = (((("%d%d%s__" + ai) + "__") + aj) + "__config") | |
120 | - | ||
121 | - | ||
122 | - | func ak (al) = ("%s%s%s__mappings__baseAsset2internalId__" + al) | |
123 | - | ||
124 | - | ||
125 | - | func am () = "%s__shutdown" | |
126 | - | ||
127 | - | ||
128 | - | func an (ao) = throw(makeString(["lp_stable.ride:", ao], " ")) | |
129 | - | ||
130 | - | ||
131 | - | func ap (aq,ar,as) = an(((((("Failed: ordValid=" + toString(aq)) + " sndrValid=") + toString(ar)) + " mtchrValid=") + toString(as))) | |
132 | - | ||
133 | - | ||
134 | - | func at (H) = { | |
135 | - | let au = H | |
136 | - | if ($isInstanceOf(au, "String")) | |
137 | - | then { | |
138 | - | let av = au | |
139 | - | av | |
140 | - | } | |
141 | - | else an("fail cast to String") | |
64 | + | func D () = { | |
65 | + | let E = x(B, l()) | |
66 | + | let F = x(B, m()) | |
67 | + | let G = A(C, v(F)) | |
68 | + | let t = A(C, v(E)) | |
69 | + | split(x(C, s(toString(t), toString(G))), a) | |
142 | 70 | } | |
143 | 71 | ||
144 | 72 | ||
145 | - | func | |
73 | + | func H () = split(x(C, r()), a) | |
146 | 74 | ||
147 | 75 | ||
148 | - | func az (ax,ay) = valueOrErrorMessage(getInteger(ax, ay), makeString(["mandatory ", toString(ax), ".", ay, " not defined"], "")) | |
149 | - | ||
150 | - | ||
151 | - | let aA = addressFromStringValue(aw(this, O())) | |
152 | - | ||
153 | - | let aB = aw(this, ab()) | |
154 | - | ||
155 | - | func aC () = valueOrElse(getBoolean(aA, am()), false) | |
156 | - | ||
157 | - | ||
158 | - | func aD () = fromBase58String(aw(aA, ag())) | |
159 | - | ||
160 | - | ||
161 | - | let aE = addressFromPublicKey(aD()) | |
162 | - | ||
163 | - | func aF () = { | |
164 | - | let aG = aw(this, Z()) | |
165 | - | let aH = aw(this, aa()) | |
166 | - | let aI = az(aA, ak(aH)) | |
167 | - | let ai = az(aA, ak(aG)) | |
168 | - | split(aw(aA, ah(toString(ai), toString(aI))), k) | |
169 | - | } | |
170 | - | ||
171 | - | ||
172 | - | func aJ () = split(aw(aA, af()), k) | |
173 | - | ||
174 | - | ||
175 | - | func aK (aL,aM,aN,aO,aP,aQ,aR,aS,aT,aU) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(aL), toString(aM), toString(aN), toString(aO), toString(aP), toString(aQ), toString(aR), toString(aS), toString(aT), toString(aU)], k) | |
176 | - | ||
177 | - | ||
178 | - | func aV (aW,aX,aY,aO,aR,aS) = makeString(["%d%d%d%d%d%d", toString(aW), toString(aX), toString(aY), toString(aO), toString(aR), toString(aS)], k) | |
179 | - | ||
180 | - | ||
181 | - | func aZ (ba) = if ((ba == "WAVES")) | |
182 | - | then wavesBalance(this).available | |
183 | - | else assetBalance(this, fromBase58String(ba)) | |
184 | - | ||
185 | - | ||
186 | - | func bb (bc,bd) = fraction(bc, d, bd) | |
187 | - | ||
188 | - | ||
189 | - | func be (bf,bg,bh) = { | |
190 | - | let bi = fraction((bf - bg), c, bg) | |
191 | - | let bj = ((bh - N(bi)) > f) | |
192 | - | if (!(bj)) | |
193 | - | then an(("Big slippage: " + toString(bi))) | |
194 | - | else $Tuple2(bj, min([bf, bg])) | |
195 | - | } | |
196 | - | ||
197 | - | ||
198 | - | func bk (bl,bm,bh) = { | |
199 | - | let bi = fraction(bm, c, bl) | |
200 | - | let bn = (bh > bi) | |
201 | - | if (if (bn) | |
202 | - | then true | |
203 | - | else (bm > bl)) | |
204 | - | then an(((((((toString(bm) + " ") + toString(bl)) + " ") + toString(bi)) + " ") + toString(bh))) | |
205 | - | else bn | |
206 | - | } | |
207 | - | ||
208 | - | ||
209 | - | func bo (bp,bq,br,bs) = { | |
210 | - | let bt = D(br, bp) | |
211 | - | let bu = D(bs, bq) | |
212 | - | bb(bu, bt) | |
213 | - | } | |
214 | - | ||
215 | - | ||
216 | - | func bv (br,bs,bw) = { | |
217 | - | let bx = aF() | |
218 | - | let by = parseIntValue(bx[v]) | |
219 | - | let bz = parseIntValue(bx[w]) | |
220 | - | let bA = bo(by, bz, br, bs) | |
221 | - | let bd = D(br, by) | |
222 | - | let bc = D(bs, bz) | |
223 | - | let bB = D(bw, b) | |
224 | - | let bC = bb(bd, bB) | |
225 | - | let bD = bb(bc, bB) | |
226 | - | [bA, bC, bD] | |
227 | - | } | |
228 | - | ||
229 | - | ||
230 | - | func bE (br,bs,bw) = { | |
231 | - | let bF = bv(br, bs, bw) | |
232 | - | [G(bF[0], b), G(bF[1], b), G(bF[2], b)] | |
233 | - | } | |
234 | - | ||
235 | - | ||
236 | - | func bG (bH,bI,bJ,bK) = { | |
237 | - | let bx = aF() | |
238 | - | let bL = bx[s] | |
239 | - | let bM = bx[t] | |
240 | - | let bN = bx[u] | |
241 | - | let bO = parseIntValue(bx[v]) | |
242 | - | let bP = parseIntValue(bx[w]) | |
243 | - | let bQ = bx[r] | |
244 | - | let bR = valueOrErrorMessage(assetInfo(fromBase58String(bL)), "Wrong LP id").quantity | |
245 | - | let bS = if ((bL == bI)) | |
246 | - | then true | |
247 | - | else an("Wrong payment asset") | |
248 | - | if ((bS == bS)) | |
76 | + | func I () = { | |
77 | + | let J = getString(i()) | |
78 | + | if ($isInstanceOf(J, "String")) | |
249 | 79 | then { | |
250 | - | let bT = aZ(bM) | |
251 | - | let bU = aZ(bN) | |
252 | - | let bV = fraction(bT, a, bO) | |
253 | - | let bW = fraction(bU, a, bP) | |
254 | - | let bX = D(bV, a) | |
255 | - | let bY = D(bW, a) | |
256 | - | let bZ = bb(bY, bX) | |
257 | - | let ca = G(bZ, b) | |
258 | - | let cb = D(bJ, b) | |
259 | - | let cc = D(bR, b) | |
260 | - | let cd = fraction(bX, cb, cc) | |
261 | - | let ce = fraction(bY, cb, cc) | |
262 | - | let cf = G(cd, a) | |
263 | - | let cg = G(ce, a) | |
264 | - | let ch = fraction(cf, bO, a) | |
265 | - | let ci = fraction(cg, bP, a) | |
266 | - | let cj = if ((bH == "")) | |
267 | - | then nil | |
268 | - | else [ScriptTransfer(bK, ch, if ((bM == "WAVES")) | |
269 | - | then unit | |
270 | - | else fromBase58String(bM)), ScriptTransfer(bK, ci, if ((bN == "WAVES")) | |
271 | - | then unit | |
272 | - | else fromBase58String(bN)), StringEntry(Y(toString(bK), bH), aV(ch, ci, bJ, ca, height, lastBlock.timestamp)), IntegerEntry(R(), ca), IntegerEntry(S(height, lastBlock.timestamp), ca)] | |
273 | - | $Tuple10(ch, ci, bM, bN, bT, bU, bR, bZ, bQ, cj) | |
80 | + | let K = J | |
81 | + | fromBase58String(K) | |
274 | 82 | } | |
275 | - | else throw("Strict value is not equal to itself.") | |
276 | - | } | |
277 | - | ||
278 | - | ||
279 | - | func ck (bH,cl,cm,cn,co,cp,bK,cq,cr,cs,ct,cu) = { | |
280 | - | let bx = aF() | |
281 | - | let bL = fromBase58String(bx[s]) | |
282 | - | let cv = bx[t] | |
283 | - | let cw = bx[u] | |
284 | - | let cx = bx[x] | |
285 | - | let cy = bx[y] | |
286 | - | let bO = parseIntValue(bx[v]) | |
287 | - | let bP = parseIntValue(bx[w]) | |
288 | - | let bQ = bx[r] | |
289 | - | let bR = valueOrErrorMessage(assetInfo(bL), "Wrong lp asset").quantity | |
290 | - | let bT = if (cq) | |
291 | - | then aZ(cv) | |
292 | - | else if (if (cs) | |
293 | - | then (cu == cv) | |
294 | - | else false) | |
295 | - | then (aZ(cv) - ct) | |
296 | - | else if (cs) | |
297 | - | then aZ(cv) | |
298 | - | else (aZ(cv) - cm) | |
299 | - | let bU = if (cq) | |
300 | - | then aZ(cw) | |
301 | - | else if (if (cs) | |
302 | - | then (cu == cw) | |
303 | - | else false) | |
304 | - | then (aZ(cw) - ct) | |
305 | - | else if (cs) | |
306 | - | then aZ(cw) | |
307 | - | else (aZ(cw) - co) | |
308 | - | let bV = fraction(bT, a, bO) | |
309 | - | let bW = fraction(bU, a, bP) | |
310 | - | let cz = fraction(cm, a, bO) | |
311 | - | let cA = fraction(co, a, bP) | |
312 | - | let cB = D(cz, a) | |
313 | - | let cC = D(cA, a) | |
314 | - | let cD = bb(cC, cB) | |
315 | - | let bX = D(bV, a) | |
316 | - | let bY = D(bW, a) | |
317 | - | let cE = if ((bR == 0)) | |
318 | - | then { | |
319 | - | let bZ = f | |
320 | - | let cF = f | |
321 | - | let cG = pow((cB * cC), 0, toBigInt(5), 1, 0, DOWN) | |
322 | - | $Tuple5(G(cG, b), G(cB, a), G(cC, a), bb((bY + cC), (bX + cB)), cF) | |
323 | - | } | |
324 | - | else { | |
325 | - | let bZ = bb(bY, bX) | |
326 | - | let cH = fraction(N((bZ - cD)), d, bZ) | |
327 | - | let cF = D(cl, b) | |
328 | - | let cI = if (((if ((bZ != f)) | |
329 | - | then (cH > cF) | |
330 | - | else false) == false)) | |
331 | - | then true | |
332 | - | else an(((("Price slippage " + toString(cH)) + " > ") + toString(cF))) | |
333 | - | if ((cI == cI)) | |
334 | - | then { | |
335 | - | let cc = D(bR, b) | |
336 | - | let cJ = fraction(cB, bZ, d) | |
337 | - | let cK = fraction(cC, d, bZ) | |
338 | - | let cL = if ((cJ > cC)) | |
339 | - | then $Tuple2(cK, cB) | |
340 | - | else $Tuple2(cB, cJ) | |
341 | - | let cM = cL._1 | |
342 | - | let cN = cL._2 | |
343 | - | let cG = fraction(cc, cN, bY) | |
344 | - | $Tuple5(G(cG, b), G(cM, a), G(cN, a), bZ, cF) | |
345 | - | } | |
346 | - | else throw("Strict value is not equal to itself.") | |
347 | - | } | |
348 | - | let cO = cE._1 | |
349 | - | let cP = fraction(cE._2, bO, a) | |
350 | - | let cQ = fraction(cE._3, bP, a) | |
351 | - | let cR = G(cE._4, b) | |
352 | - | let cS = G(cE._5, b) | |
353 | - | let cT = if ((cO > 0)) | |
354 | - | then true | |
355 | - | else an("LP <= 0") | |
356 | - | if ((cT == cT)) | |
357 | - | then { | |
358 | - | let cU = if (!(cr)) | |
359 | - | then 0 | |
360 | - | else cO | |
361 | - | let cV = (cm - cP) | |
362 | - | let cW = (co - cQ) | |
363 | - | let cX = if (if (cs) | |
364 | - | then (cu == cv) | |
365 | - | else false) | |
366 | - | then $Tuple2(ct, 0) | |
367 | - | else if (if (cs) | |
368 | - | then (cu == cw) | |
369 | - | else false) | |
370 | - | then $Tuple2(0, ct) | |
371 | - | else $Tuple2(cP, cQ) | |
372 | - | let cY = cX._1 | |
373 | - | let cZ = cX._2 | |
374 | - | let da = [IntegerEntry(R(), cR), IntegerEntry(S(height, lastBlock.timestamp), cR), StringEntry(V(bK, bH), aK(cY, cZ, cU, cR, cl, cS, height, lastBlock.timestamp, cV, cW))] | |
375 | - | $Tuple13(cO, cU, cR, bT, bU, bR, bL, bQ, da, cV, cW, cn, cp) | |
376 | - | } | |
377 | - | else throw("Strict value is not equal to itself.") | |
378 | - | } | |
379 | - | ||
380 | - | ||
381 | - | func db (dc) = { | |
382 | - | let bx = aF() | |
383 | - | let dd = bx[t] | |
384 | - | let de = bx[u] | |
385 | - | let bQ = parseIntValue(bx[r]) | |
386 | - | let by = parseIntValue(bx[v]) | |
387 | - | let bz = parseIntValue(bx[w]) | |
388 | - | let df = aZ(dd) | |
389 | - | let dg = aZ(de) | |
390 | - | let bZ = if ((dc.orderType == Buy)) | |
391 | - | then bo(by, bz, (df + dc.amount), dg) | |
392 | - | else bo(by, bz, (df - dc.amount), dg) | |
393 | - | let ca = G(bZ, b) | |
394 | - | if (if (if (aC()) | |
395 | - | then true | |
396 | - | else (bQ == o)) | |
397 | - | then true | |
398 | - | else (bQ == p)) | |
399 | - | then an("Admin blocked") | |
400 | - | else { | |
401 | - | let dh = dc.assetPair.amountAsset | |
402 | - | let di = if ((dh == unit)) | |
403 | - | then "WAVES" | |
404 | - | else toBase58String(value(dh)) | |
405 | - | let dj = dc.assetPair.priceAsset | |
406 | - | let dk = if ((dj == unit)) | |
407 | - | then "WAVES" | |
408 | - | else toBase58String(value(dj)) | |
409 | - | if (if ((di != dd)) | |
410 | - | then true | |
411 | - | else (dk != de)) | |
412 | - | then an("Wr assets") | |
413 | - | else { | |
414 | - | let dl = dc.price | |
415 | - | let bP = fraction(b, bz, by) | |
416 | - | let dm = J(dl, b, bP) | |
417 | - | let dn = if ((dc.orderType == Buy)) | |
418 | - | then (ca >= dm) | |
419 | - | else (dm >= ca) | |
420 | - | true | |
421 | - | } | |
422 | - | } | |
423 | - | } | |
424 | - | ||
425 | - | ||
426 | - | func do (dp) = { | |
427 | - | let dq = if ((size(dp.payments) == 1)) | |
428 | - | then true | |
429 | - | else an("1 payment expected") | |
430 | - | if ((dq == dq)) | |
431 | - | then { | |
432 | - | let dr = value(dp.payments[0]) | |
433 | - | let bI = value(dr.assetId) | |
434 | - | let ct = dr.amount | |
435 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bI), ct, dp.caller) | |
436 | - | let ch = cE._1 | |
437 | - | let ci = cE._2 | |
438 | - | let bQ = parseIntValue(cE._9) | |
439 | - | let cj = cE._10 | |
440 | - | if (if (aC()) | |
441 | - | then true | |
442 | - | else (bQ == p)) | |
443 | - | then an(("Admin blocked: " + toString(bQ))) | |
444 | - | else $Tuple5(ch, ci, ct, bI, cj) | |
445 | - | } | |
446 | - | else throw("Strict value is not equal to itself.") | |
447 | - | } | |
448 | - | ||
449 | - | ||
450 | - | func ds (dt,X,du,dv,bh,cr,cs,ct,cu) = { | |
451 | - | let cE = ck(X, bh, value(du).amount, value(du).assetId, value(dv).amount, value(dv).assetId, dt, false, cr, cs, ct, cu) | |
452 | - | let bQ = parseIntValue(cE._8) | |
453 | - | if (if (if (aC()) | |
454 | - | then true | |
455 | - | else (bQ == n)) | |
456 | - | then true | |
457 | - | else (bQ == p)) | |
458 | - | then an(("Blocked:" + toString(bQ))) | |
459 | - | else cE | |
460 | - | } | |
461 | - | ||
462 | - | ||
463 | - | func dw (dx) = { | |
464 | - | let dy = fraction(dx, ae, e) | |
465 | - | $Tuple2((dx - dy), dy) | |
466 | - | } | |
467 | - | ||
468 | - | ||
469 | - | func dz () = { | |
470 | - | let au = getString(P()) | |
471 | - | if ($isInstanceOf(au, "String")) | |
472 | - | then { | |
473 | - | let dA = au | |
474 | - | fromBase58String(dA) | |
475 | - | } | |
476 | - | else if ($isInstanceOf(au, "Unit")) | |
83 | + | else if ($isInstanceOf(J, "Unit")) | |
477 | 84 | then unit | |
478 | 85 | else throw("Match error") | |
479 | 86 | } | |
480 | 87 | ||
481 | 88 | ||
482 | - | func | |
483 | - | let | |
484 | - | if ($isInstanceOf( | |
89 | + | func L () = { | |
90 | + | let J = getString(j()) | |
91 | + | if ($isInstanceOf(J, "String")) | |
485 | 92 | then { | |
486 | - | let | |
487 | - | fromBase58String( | |
93 | + | let K = J | |
94 | + | fromBase58String(K) | |
488 | 95 | } | |
489 | - | else if ($isInstanceOf( | |
96 | + | else if ($isInstanceOf(J, "Unit")) | |
490 | 97 | then unit | |
491 | 98 | else throw("Match error") | |
492 | 99 | } | |
493 | 100 | ||
494 | 101 | ||
495 | - | let dC = an("Permission denied") | |
496 | - | ||
497 | - | func dD (dp) = { | |
498 | - | let au = dz() | |
499 | - | if ($isInstanceOf(au, "ByteVector")) | |
102 | + | func M (N) = { | |
103 | + | let O = throw("Permission denied") | |
104 | + | let J = I() | |
105 | + | if ($isInstanceOf(J, "ByteVector")) | |
500 | 106 | then { | |
501 | - | let | |
502 | - | if (( | |
107 | + | let P = J | |
108 | + | if ((N.callerPublicKey == P)) | |
503 | 109 | then true | |
504 | - | else | |
110 | + | else O | |
505 | 111 | } | |
506 | - | else if ($isInstanceOf( | |
507 | - | then if (( | |
112 | + | else if ($isInstanceOf(J, "Unit")) | |
113 | + | then if ((N.caller == this)) | |
508 | 114 | then true | |
509 | - | else | |
115 | + | else O | |
510 | 116 | else throw("Match error") | |
511 | 117 | } | |
512 | 118 | ||
513 | 119 | ||
514 | - | @Callable(dp) | |
515 | - | func constructor (aA) = { | |
516 | - | let dF = dD(dp) | |
517 | - | if ((dF == dF)) | |
518 | - | then [StringEntry(O(), aA)] | |
120 | + | func Q () = { | |
121 | + | let J = getString(n()) | |
122 | + | if ($isInstanceOf(J, "String")) | |
123 | + | then { | |
124 | + | let K = J | |
125 | + | if ((size(K) == 0)) | |
126 | + | then nil | |
127 | + | else split(K, a) | |
128 | + | } | |
129 | + | else nil | |
130 | + | } | |
131 | + | ||
132 | + | ||
133 | + | func R (N) = if (containsElement(Q(), toBase58String(N.callerPublicKey))) | |
134 | + | then true | |
135 | + | else M(N) | |
136 | + | ||
137 | + | ||
138 | + | func S (N) = if ((N.caller == B)) | |
139 | + | then true | |
140 | + | else throw("caller must be the pool") | |
141 | + | ||
142 | + | ||
143 | + | @Callable(N) | |
144 | + | func constructor (T) = { | |
145 | + | let U = M(N) | |
146 | + | if ((U == U)) | |
147 | + | then [StringEntry(k(), T)] | |
519 | 148 | else throw("Strict value is not equal to itself.") | |
520 | 149 | } | |
521 | 150 | ||
522 | 151 | ||
523 | 152 | ||
524 | - | @Callable( | |
525 | - | func setManager ( | |
526 | - | let | |
527 | - | if (( | |
153 | + | @Callable(N) | |
154 | + | func setManager (V) = { | |
155 | + | let U = M(N) | |
156 | + | if ((U == U)) | |
528 | 157 | then { | |
529 | - | let | |
530 | - | if (( | |
531 | - | then [StringEntry( | |
158 | + | let W = fromBase58String(V) | |
159 | + | if ((W == W)) | |
160 | + | then [StringEntry(j(), V)] | |
532 | 161 | else throw("Strict value is not equal to itself.") | |
533 | 162 | } | |
534 | 163 | else throw("Strict value is not equal to itself.") | |
535 | 164 | } | |
536 | 165 | ||
537 | 166 | ||
538 | 167 | ||
539 | - | @Callable( | |
168 | + | @Callable(N) | |
540 | 169 | func confirmManager () = { | |
541 | - | let | |
542 | - | let | |
170 | + | let X = L() | |
171 | + | let Y = if (isDefined(X)) | |
543 | 172 | then true | |
544 | - | else | |
545 | - | if (( | |
173 | + | else throw("No pending manager") | |
174 | + | if ((Y == Y)) | |
546 | 175 | then { | |
547 | - | let | |
176 | + | let Z = if ((N.callerPublicKey == value(X))) | |
548 | 177 | then true | |
549 | - | else | |
550 | - | if (( | |
551 | - | then [StringEntry( | |
178 | + | else throw("You are not pending manager") | |
179 | + | if ((Z == Z)) | |
180 | + | then [StringEntry(i(), toBase58String(value(X))), DeleteEntry(j())] | |
552 | 181 | else throw("Strict value is not equal to itself.") | |
553 | 182 | } | |
554 | 183 | else throw("Strict value is not equal to itself.") | |
555 | 184 | } | |
556 | 185 | ||
557 | 186 | ||
558 | 187 | ||
559 | - | @Callable(dp) | |
560 | - | func put (bh,dL) = { | |
561 | - | let dM = aJ() | |
562 | - | let dN = valueOrErrorMessage(addressFromString(dM[z]), "Wrong staking contract") | |
563 | - | let dO = valueOrErrorMessage(addressFromString(dM[A]), "Wrogn slippage contract") | |
564 | - | let dP = if ((bh >= 0)) | |
565 | - | then true | |
566 | - | else an("wrong slippage") | |
567 | - | if ((dP == dP)) | |
188 | + | @Callable(N) | |
189 | + | func setAdmins (aa) = { | |
190 | + | let U = M(N) | |
191 | + | if ((U == U)) | |
192 | + | then [StringEntry(n(), makeString(aa, a))] | |
193 | + | else throw("Strict value is not equal to itself.") | |
194 | + | } | |
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | @Callable(N) | |
199 | + | func unstakeAndGetOneTkn (ab,ac,ad,ae,af,ag) = { | |
200 | + | let ah = if ((size(N.payments) != 0)) | |
201 | + | then throw("No pmnts expd") | |
202 | + | else true | |
203 | + | if ((ah == ah)) | |
568 | 204 | then { | |
569 | - | let dQ = if ((size(dp.payments) == 2)) | |
570 | - | then true | |
571 | - | else an("2 payments expected") | |
572 | - | if ((dQ == dQ)) | |
205 | + | let ai = D() | |
206 | + | let aj = H() | |
207 | + | let ak = fromBase58String(ai[d]) | |
208 | + | let al = valueOrErrorMessage(addressFromString(aj[g]), "Wr st addr") | |
209 | + | let am = invoke(al, "unstake", [toBase58String(ak), ab], nil) | |
210 | + | if ((am == am)) | |
573 | 211 | then { | |
574 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(value(dp.payments[0]).assetId, value(dp.payments[0]).amount), dp.payments[1], bh, true, false, 0, "") | |
575 | - | let cU = dR._2 | |
576 | - | let bL = dR._7 | |
577 | - | let cj = dR._9 | |
578 | - | let cV = dR._10 | |
579 | - | let cW = dR._11 | |
580 | - | let bM = dR._12 | |
581 | - | let bN = dR._13 | |
582 | - | let cE = invoke(aA, "emit", [cU], nil) | |
583 | - | if ((cE == cE)) | |
584 | - | then { | |
585 | - | let dS = { | |
586 | - | let au = cE | |
587 | - | if ($isInstanceOf(au, "Address")) | |
588 | - | then { | |
589 | - | let dT = au | |
590 | - | invoke(dT, "emit", [cU], nil) | |
591 | - | } | |
592 | - | else unit | |
593 | - | } | |
594 | - | if ((dS == dS)) | |
595 | - | then { | |
596 | - | let dU = if ((cV > 0)) | |
597 | - | then invoke(dO, "put", nil, [AttachedPayment(bM, cV)]) | |
598 | - | else nil | |
599 | - | if ((dU == dU)) | |
600 | - | then { | |
601 | - | let dV = if ((cW > 0)) | |
602 | - | then invoke(dO, "put", nil, [AttachedPayment(bN, cW)]) | |
603 | - | else nil | |
604 | - | if ((dV == dV)) | |
605 | - | then { | |
606 | - | let dW = if (dL) | |
607 | - | then { | |
608 | - | let dX = invoke(dN, "stake", nil, [AttachedPayment(bL, cU)]) | |
609 | - | if ((dX == dX)) | |
610 | - | then nil | |
611 | - | else throw("Strict value is not equal to itself.") | |
612 | - | } | |
613 | - | else [ScriptTransfer(dp.caller, cU, bL)] | |
614 | - | (cj ++ dW) | |
615 | - | } | |
616 | - | else throw("Strict value is not equal to itself.") | |
617 | - | } | |
618 | - | else throw("Strict value is not equal to itself.") | |
619 | - | } | |
620 | - | else throw("Strict value is not equal to itself.") | |
621 | - | } | |
212 | + | let an = invoke(B, "getOneTkn", [ac, ad, ae, af, ag], [AttachedPayment(ak, ab)]) | |
213 | + | if ((an == an)) | |
214 | + | then nil | |
622 | 215 | else throw("Strict value is not equal to itself.") | |
623 | 216 | } | |
624 | 217 | else throw("Strict value is not equal to itself.") | |
625 | 218 | } | |
626 | 219 | else throw("Strict value is not equal to itself.") | |
627 | 220 | } | |
628 | 221 | ||
629 | 222 | ||
630 | 223 | ||
631 | - | @Callable(dp) | |
632 | - | func putOneTkn (dY,dZ,bg,bh,dL) = { | |
633 | - | let bx = aJ() | |
634 | - | let dN = valueOrErrorMessage(addressFromString(bx[z]), "Wrong staking contract") | |
635 | - | let dO = valueOrErrorMessage(addressFromString(bx[A]), "Wrong slippage contract") | |
636 | - | let ea = valueOrErrorMessage(addressFromString(bx[B]), "Wrong gwx reward contract") | |
637 | - | let eb = aF() | |
638 | - | let bM = eb[t] | |
639 | - | let bN = eb[u] | |
640 | - | let bO = parseIntValue(eb[v]) | |
641 | - | let bP = parseIntValue(eb[w]) | |
642 | - | let ec = valueOrElse(getString(this, ac()), "") | |
643 | - | let bK = if ((ec == toString(dp.caller))) | |
644 | - | then dp.originCaller | |
645 | - | else dp.caller | |
646 | - | if (if (if (if ((0 >= bh)) | |
647 | - | then true | |
648 | - | else (0 >= dY)) | |
649 | - | then true | |
650 | - | else (0 >= dZ)) | |
651 | - | then true | |
652 | - | else (0 >= bg)) | |
653 | - | then an("Wrong params") | |
654 | - | else if ((size(dp.payments) != 1)) | |
655 | - | then an("1 payment expected") | |
656 | - | else { | |
657 | - | let dr = value(dp.payments[0]) | |
658 | - | let bI = toBase58String(value(dr.assetId)) | |
659 | - | let ed = dr.amount | |
660 | - | let ee = dw(ed) | |
661 | - | let ct = ee._1 | |
662 | - | let ef = ee._2 | |
663 | - | if (if (if ((dY > ct)) | |
664 | - | then true | |
665 | - | else (dZ > ct)) | |
666 | - | then true | |
667 | - | else (10000000 > ct)) | |
668 | - | then an("wrong payment amount") | |
669 | - | else { | |
670 | - | let bT = aZ(bM) | |
671 | - | let bU = aZ(bN) | |
672 | - | let eg = if ((bI == bM)) | |
673 | - | then $Tuple6((bT - ct), bU, (ct - dY), dZ, 0, 0) | |
674 | - | else if ((bI == bN)) | |
675 | - | then $Tuple6(bT, (bU - ct), 0, 0, (ct - dZ), dY) | |
676 | - | else an("wrong paymentAssetId") | |
677 | - | let eh = eg._1 | |
678 | - | let ei = eg._2 | |
679 | - | let ej = eg._3 | |
680 | - | let ek = eg._4 | |
681 | - | let el = eg._5 | |
682 | - | let em = eg._6 | |
683 | - | let bm = invoke(ea, "calcD", [toString(eh), toString(ei), aB, i, j], nil) | |
684 | - | let bl = invoke(ea, "calcD", [toString(toBigInt(((eh + ej) - em))), toString(toBigInt(((ei + el) - ek))), aB, i, j], nil) | |
685 | - | let en = bk(parseBigIntValue(at(bl)), parseBigIntValue(at(bm)), h) | |
686 | - | if ((en == en)) | |
687 | - | then { | |
688 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(fromBase58String(bM), dY), AttachedPayment(fromBase58String(bN), dZ), bh, true, true, ct, bI) | |
689 | - | let bf = dR._2 | |
690 | - | let bL = dR._7 | |
691 | - | let cj = dR._9 | |
692 | - | let cV = dR._10 | |
693 | - | let cW = dR._11 | |
694 | - | let eo = be(toBigInt(bf), toBigInt(bg), toBigInt(bh)) | |
695 | - | let cU = toInt(eo._2) | |
696 | - | let ep = invoke(aA, "emit", [cU], nil) | |
697 | - | if ((ep == ep)) | |
698 | - | then { | |
699 | - | let dS = { | |
700 | - | let au = ep | |
701 | - | if ($isInstanceOf(au, "Address")) | |
702 | - | then { | |
703 | - | let dT = au | |
704 | - | invoke(dT, "emit", [cU], nil) | |
705 | - | } | |
706 | - | else unit | |
707 | - | } | |
708 | - | if ((dS == dS)) | |
709 | - | then { | |
710 | - | let dU = if ((cV > 0)) | |
711 | - | then invoke(dO, "put", nil, [AttachedPayment(fromBase58String(bM), cV)]) | |
712 | - | else nil | |
713 | - | if ((dU == dU)) | |
714 | - | then { | |
715 | - | let dV = if ((cW > 0)) | |
716 | - | then invoke(dO, "put", nil, [AttachedPayment(fromBase58String(bN), cW)]) | |
717 | - | else nil | |
718 | - | if ((dV == dV)) | |
719 | - | then { | |
720 | - | let dW = if (dL) | |
721 | - | then { | |
722 | - | let dX = invoke(dN, "stake", nil, [AttachedPayment(bL, cU)]) | |
723 | - | if ((dX == dX)) | |
724 | - | then nil | |
725 | - | else throw("Strict value is not equal to itself.") | |
726 | - | } | |
727 | - | else [ScriptTransfer(dp.caller, cU, bL)] | |
728 | - | let eq = if ((ef > 0)) | |
729 | - | then [ScriptTransfer(aE, ef, fromBase58String(bI))] | |
730 | - | else nil | |
731 | - | ((cj ++ dW) ++ eq) | |
732 | - | } | |
733 | - | else throw("Strict value is not equal to itself.") | |
734 | - | } | |
735 | - | else throw("Strict value is not equal to itself.") | |
736 | - | } | |
737 | - | else throw("Strict value is not equal to itself.") | |
738 | - | } | |
739 | - | else throw("Strict value is not equal to itself.") | |
740 | - | } | |
741 | - | else throw("Strict value is not equal to itself.") | |
742 | - | } | |
743 | - | } | |
744 | - | } | |
745 | - | ||
746 | - | ||
747 | - | ||
748 | - | @Callable(dp) | |
749 | - | func putForFree (er) = if ((0 > er)) | |
750 | - | then an("wrong slippage") | |
751 | - | else if ((size(dp.payments) != 2)) | |
752 | - | then an("2 payments expected") | |
753 | - | else { | |
754 | - | let dR = ds(toString(dp.caller), toBase58String(dp.transactionId), AttachedPayment(value(dp.payments[0]).assetId, value(dp.payments[0]).amount), dp.payments[1], er, false, false, 0, "") | |
755 | - | dR._9 | |
756 | - | } | |
757 | - | ||
758 | - | ||
759 | - | ||
760 | - | @Callable(dp) | |
761 | - | func get () = { | |
762 | - | let cE = do(dp) | |
763 | - | let es = cE._1 | |
764 | - | let ci = cE._2 | |
765 | - | let ct = cE._3 | |
766 | - | let bI = cE._4 | |
767 | - | let cj = cE._5 | |
768 | - | let et = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
769 | - | if ((et == et)) | |
770 | - | then cj | |
771 | - | else throw("Strict value is not equal to itself.") | |
772 | - | } | |
773 | - | ||
774 | - | ||
775 | - | ||
776 | - | @Callable(dp) | |
777 | - | func getOneTkn (eu,ev,ew,ex,bh) = if ((size(dp.payments) != 1)) | |
778 | - | then an("1 payment expected") | |
779 | - | else { | |
780 | - | let bx = aF() | |
781 | - | let bL = bx[s] | |
782 | - | let bM = bx[t] | |
783 | - | let bN = bx[u] | |
784 | - | let bO = parseIntValue(bx[v]) | |
785 | - | let bP = parseIntValue(bx[w]) | |
786 | - | let bQ = bx[r] | |
787 | - | let dM = aJ() | |
788 | - | let ea = valueOrErrorMessage(addressFromString(dM[B]), "Wrong gwxRewardContract address") | |
789 | - | let dr = value(dp.payments[0]) | |
790 | - | let ec = valueOrElse(getString(this, ac()), "") | |
791 | - | let bK = if ((ec == toString(dp.caller))) | |
792 | - | then dp.originCaller | |
793 | - | else dp.caller | |
794 | - | let bH = toBase58String(dp.transactionId) | |
795 | - | let bI = value(dr.assetId) | |
796 | - | let ct = dr.amount | |
797 | - | if ((1000000000 > ct)) | |
798 | - | then an("Min payment 10 LP") | |
799 | - | else if (if (if ((0 > bh)) | |
800 | - | then true | |
801 | - | else (0 > eu)) | |
802 | - | then true | |
803 | - | else (0 > ew)) | |
804 | - | then an("Wrong params") | |
805 | - | else if ((bL != toBase58String(bI))) | |
806 | - | then an("Wrong LP") | |
807 | - | else { | |
808 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bI), ct, dp.caller) | |
809 | - | let ey = cE._1 | |
810 | - | let ez = cE._2 | |
811 | - | let bT = aZ(bM) | |
812 | - | let bU = aZ(bN) | |
813 | - | let eA = if ((ex == bM)) | |
814 | - | then $Tuple7((bT - ey), (bU - ez), eu, ez, 0, 0, (ey + eu)) | |
815 | - | else if ((ex == bN)) | |
816 | - | then $Tuple7((bT - ey), (bU - ez), 0, 0, eu, ey, (ez + eu)) | |
817 | - | else an("wrong outAssetId") | |
818 | - | let eh = eA._1 | |
819 | - | let ei = eA._2 | |
820 | - | let ej = eA._3 | |
821 | - | let ek = eA._4 | |
822 | - | let el = eA._5 | |
823 | - | let em = eA._6 | |
824 | - | let eB = eA._7 | |
825 | - | if (if ((0 > ej)) | |
826 | - | then true | |
827 | - | else (0 > el)) | |
828 | - | then an("Wrong calc") | |
829 | - | else { | |
830 | - | let bm = invoke(ea, "calcD", [toString(eh), toString(ei), aB, i, j], nil) | |
831 | - | let bl = invoke(ea, "calcD", [toString(((eh - ej) + em)), toString(((ei + ek) - el)), aB, i, j], nil) | |
832 | - | let en = bk(parseBigIntValue(at(bl)), parseBigIntValue(at(bm)), h) | |
833 | - | if ((en == en)) | |
834 | - | then { | |
835 | - | let eC = be(toBigInt(eB), toBigInt(ew), toBigInt(bh)) | |
836 | - | if ((eC == eC)) | |
837 | - | then { | |
838 | - | let eD = if ((ex == bM)) | |
839 | - | then $Tuple2(toInt(eC._2), 0) | |
840 | - | else $Tuple2(0, toInt(eC._2)) | |
841 | - | let eE = eD._1 | |
842 | - | let eF = eD._2 | |
843 | - | let eG = (eE + eF) | |
844 | - | let eH = dw(eG) | |
845 | - | let eI = eH._1 | |
846 | - | let ef = eH._2 | |
847 | - | let eJ = if ((ex == "WAVES")) | |
848 | - | then unit | |
849 | - | else fromBase58String(ex) | |
850 | - | let eq = if ((ef > 0)) | |
851 | - | then [ScriptTransfer(aE, ef, eJ)] | |
852 | - | else nil | |
853 | - | let eK = if ((bO >= bP)) | |
854 | - | then bO | |
855 | - | else bP | |
856 | - | if ((eK == eK)) | |
857 | - | then { | |
858 | - | let eL = bb(D(bU, eK), D(bT, eK)) | |
859 | - | let eM = G(eL, b) | |
860 | - | let cj = [ScriptTransfer(bK, eI, eJ), StringEntry(Y(toString(bK), bH), aV(eE, eF, ct, eM, height, lastBlock.timestamp)), IntegerEntry(R(), eM), IntegerEntry(S(height, lastBlock.timestamp), eM)] | |
861 | - | if ((cj == cj)) | |
862 | - | then { | |
863 | - | let eN = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
864 | - | if ((eN == eN)) | |
865 | - | then (cj ++ eq) | |
866 | - | else throw("Strict value is not equal to itself.") | |
867 | - | } | |
868 | - | else throw("Strict value is not equal to itself.") | |
869 | - | } | |
870 | - | else throw("Strict value is not equal to itself.") | |
871 | - | } | |
872 | - | else throw("Strict value is not equal to itself.") | |
873 | - | } | |
874 | - | else throw("Strict value is not equal to itself.") | |
875 | - | } | |
876 | - | } | |
877 | - | } | |
878 | - | ||
879 | - | ||
880 | - | ||
881 | - | @Callable(dp) | |
882 | - | func getNoLess (eO,eP) = { | |
883 | - | let cE = do(dp) | |
884 | - | let ch = cE._1 | |
885 | - | let ci = cE._2 | |
886 | - | let ct = cE._3 | |
887 | - | let bI = cE._4 | |
888 | - | let cj = cE._5 | |
889 | - | let eQ = if ((ch >= eO)) | |
890 | - | then true | |
891 | - | else an(((("Failed: " + toString(ch)) + " < ") + toString(eO))) | |
892 | - | if ((eQ == eQ)) | |
224 | + | @Callable(N) | |
225 | + | func setAmp (ao) = { | |
226 | + | let U = R(N) | |
227 | + | if ((U == U)) | |
893 | 228 | then { | |
894 | - | let eR = if ((ci >= eP)) | |
895 | - | then true | |
896 | - | else an(((("Failed: " + toString(ci)) + " < ") + toString(eP))) | |
897 | - | if ((eR == eR)) | |
898 | - | then { | |
899 | - | let eS = invoke(aA, "burn", [ct], [AttachedPayment(bI, ct)]) | |
900 | - | if ((eS == eS)) | |
901 | - | then cj | |
902 | - | else throw("Strict value is not equal to itself.") | |
903 | - | } | |
904 | - | else throw("Strict value is not equal to itself.") | |
229 | + | let ap = invoke(B, "setS", [o(), ao], nil) | |
230 | + | let aq = invoke(B, "setS", [p(height), ao], nil) | |
231 | + | $Tuple2(nil, $Tuple2(ap, aq)) | |
905 | 232 | } | |
906 | 233 | else throw("Strict value is not equal to itself.") | |
907 | 234 | } | |
908 | 235 | ||
909 | 236 | ||
910 | - | ||
911 | - | @Callable(dp) | |
912 | - | func unstakeAndGet (dx) = { | |
913 | - | let dq = if ((size(dp.payments) != 0)) | |
914 | - | then an("no payments expected") | |
915 | - | else true | |
916 | - | if ((dq == dq)) | |
917 | - | then { | |
918 | - | let bx = aF() | |
919 | - | let eT = aJ() | |
920 | - | let bL = fromBase58String(bx[s]) | |
921 | - | let eU = valueOrErrorMessage(addressFromString(eT[z]), "wrong") | |
922 | - | let eV = invoke(eU, "unstake", [toBase58String(bL), dx], nil) | |
923 | - | if ((eV == eV)) | |
924 | - | then { | |
925 | - | let cE = bG(toBase58String(dp.transactionId), toBase58String(bL), dx, dp.caller) | |
926 | - | let bQ = parseIntValue(cE._9) | |
927 | - | let cj = cE._10 | |
928 | - | let eW = if (if (aC()) | |
929 | - | then true | |
930 | - | else (bQ == p)) | |
931 | - | then an(("Blocked: " + toString(bQ))) | |
932 | - | else true | |
933 | - | if ((eW == eW)) | |
934 | - | then { | |
935 | - | let eX = invoke(aA, "burn", [dx], [AttachedPayment(bL, dx)]) | |
936 | - | if ((eX == eX)) | |
937 | - | then cj | |
938 | - | else throw("Strict value is not equal to itself.") | |
939 | - | } | |
940 | - | else throw("Strict value is not equal to itself.") | |
941 | - | } | |
942 | - | else throw("Strict value is not equal to itself.") | |
943 | - | } | |
944 | - | else throw("Strict value is not equal to itself.") | |
945 | - | } | |
946 | - | ||
947 | - | ||
948 | - | ||
949 | - | @Callable(dp) | |
950 | - | func activate (eY,eZ) = if ((toString(dp.caller) != toString(aA))) | |
951 | - | then an("denied") | |
952 | - | else $Tuple2([StringEntry(Z(), eY), StringEntry(aa(), eZ)], "success") | |
953 | - | ||
954 | - | ||
955 | - | ||
956 | - | @Callable(dp) | |
957 | - | func setS (fa,eW) = if ((toString(dp.caller) != aw(this, ac()))) | |
958 | - | then dC | |
959 | - | else [StringEntry(fa, eW)] | |
960 | - | ||
961 | - | ||
962 | - | ||
963 | - | @Callable(dp) | |
964 | - | func setI (fa,eW) = if ((toString(dp.caller) != aw(this, ac()))) | |
965 | - | then dC | |
966 | - | else [IntegerEntry(fa, eW)] | |
967 | - | ||
968 | - | ||
969 | - | ||
970 | - | @Callable(dp) | |
971 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aF()) | |
972 | - | ||
973 | - | ||
974 | - | ||
975 | - | @Callable(dp) | |
976 | - | func getAccBalanceWrapperREADONLY (ba) = $Tuple2(nil, aZ(ba)) | |
977 | - | ||
978 | - | ||
979 | - | ||
980 | - | @Callable(dp) | |
981 | - | func calcPricesWrapperREADONLY (br,bs,bw) = { | |
982 | - | let fb = bv(br, bs, bw) | |
983 | - | $Tuple2(nil, [toString(fb[0]), toString(fb[1]), toString(fb[2])]) | |
984 | - | } | |
985 | - | ||
986 | - | ||
987 | - | ||
988 | - | @Callable(dp) | |
989 | - | func fromX18WrapperREADONLY (H,fc) = $Tuple2(nil, G(parseBigIntValue(H), fc)) | |
990 | - | ||
991 | - | ||
992 | - | ||
993 | - | @Callable(dp) | |
994 | - | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
995 | - | ||
996 | - | ||
997 | - | ||
998 | - | @Callable(dp) | |
999 | - | func calcPriceBigIntWrapperREADONLY (bc,bd) = $Tuple2(nil, toString(bb(parseBigIntValue(bc), parseBigIntValue(bd)))) | |
1000 | - | ||
1001 | - | ||
1002 | - | ||
1003 | - | @Callable(dp) | |
1004 | - | func estimatePutOperationWrapperREADONLY (bH,bh,cm,fd,co,fe,ff,cq,cr) = $Tuple2(nil, ck(bH, bh, cm, fd, co, fe, ff, cq, cr, false, 0, "")) | |
1005 | - | ||
1006 | - | ||
1007 | - | ||
1008 | - | @Callable(dp) | |
1009 | - | func estimateGetOperationWrapperREADONLY (bH,fg,bJ,ff) = { | |
1010 | - | let cE = bG(bH, fg, bJ, addressFromStringValue(ff)) | |
1011 | - | $Tuple2(nil, $Tuple10(cE._1, cE._2, cE._3, cE._4, cE._5, cE._6, cE._7, toString(cE._8), cE._9, cE._10)) | |
1012 | - | } | |
1013 | - | ||
1014 | - | ||
1015 | - | @Verifier(fh) | |
1016 | - | func fi () = { | |
1017 | - | let au = fh | |
1018 | - | if ($isInstanceOf(au, "Order")) | |
1019 | - | then { | |
1020 | - | let dc = au | |
1021 | - | let fj = aD() | |
1022 | - | let aq = db(dc) | |
1023 | - | let fk = sigVerify(dc.bodyBytes, dc.proofs[0], dc.senderPublicKey) | |
1024 | - | let fl = sigVerify(dc.bodyBytes, dc.proofs[1], fj) | |
1025 | - | if (if (if (aq) | |
1026 | - | then fk | |
1027 | - | else false) | |
1028 | - | then fl | |
1029 | - | else false) | |
1030 | - | then true | |
1031 | - | else ap(aq, fk, fl) | |
1032 | - | } | |
1033 | - | else { | |
1034 | - | let fm = { | |
1035 | - | let fn = dz() | |
1036 | - | if ($isInstanceOf(fn, "ByteVector")) | |
1037 | - | then { | |
1038 | - | let dE = fn | |
1039 | - | dE | |
1040 | - | } | |
1041 | - | else if ($isInstanceOf(fn, "Unit")) | |
1042 | - | then fh.senderPublicKey | |
1043 | - | else throw("Match error") | |
237 | + | @Verifier(ar) | |
238 | + | func as () = { | |
239 | + | let at = { | |
240 | + | let J = I() | |
241 | + | if ($isInstanceOf(J, "ByteVector")) | |
242 | + | then { | |
243 | + | let P = J | |
244 | + | P | |
1044 | 245 | } | |
1045 | - | sigVerify(fh.bodyBytes, fh.proofs[0], fm) | |
1046 | - | } | |
246 | + | else if ($isInstanceOf(J, "Unit")) | |
247 | + | then ar.senderPublicKey | |
248 | + | else throw("Match error") | |
249 | + | } | |
250 | + | sigVerify(ar.bodyBytes, ar.proofs[0], at) | |
1047 | 251 | } | |
1048 | 252 |
github/deemru/w8io/026f985 88.71 ms ◑