tx · B47DSa4A5zehKcRNKRpkFNmSkf27ax6YwDwGWT4Va9oK 3MsdLkCCcsf1niGwjyQCMi8aC4CkNbm2Wy9: -0.03100000 Waves 2022.12.27 13:01 [2378533] smart account 3MsdLkCCcsf1niGwjyQCMi8aC4CkNbm2Wy9 > SELF 0.00000000 Waves
{ "type": 13, "id": "B47DSa4A5zehKcRNKRpkFNmSkf27ax6YwDwGWT4Va9oK", "fee": 3100000, "feeAssetId": null, "timestamp": 1672135301171, "version": 1, "sender": "3MsdLkCCcsf1niGwjyQCMi8aC4CkNbm2Wy9", "senderPublicKey": "B4L9D9LnFwCPW8fFVc65SHyFNYjb1KJv6MUQXPGMPSTy", "proofs": [ "26ydxPbmPTBHrYrfV3xdXAZhRPdAYEacWWUxTBE32tkHCvMxsNbRZ2rUHhRFPnyEYusdr9jn6parFzNVkB1kPbAQ" ], "script": "base64:BgK3JwgCEgMKAQgSABIECgIBBBIDCgEBEgQKAgEEEgQKAggBEgQKAggBEgQKAggBEgUKAwEIARIAEgQKAgEBEgMKAQESBQoDAQEBEgQKAggIEgASAwoBCBIFCgMBAQESBAoCAQESBAoCCAESBAoCCAgSCwoJCAEBAgECCAQEEgYKBAgIAQgSABIDCgEBEgMKAQESBAoCCAEiCmxQZGVjaW1hbHMiBnNjYWxlOCIMc2NhbGU4QmlnSW50IgdzY2FsZTE4Igp6ZXJvQmlnSW50IgRiaWcwIgRiaWcxIgRiaWcyIgt3YXZlc1N0cmluZyIDU0VQIgpQb29sQWN0aXZlIg9Qb29sUHV0RGlzYWJsZWQiE1Bvb2xNYXRjaGVyRGlzYWJsZWQiDFBvb2xTaHV0ZG93biIOaWR4UG9vbEFkZHJlc3MiDWlkeFBvb2xTdGF0dXMiEGlkeFBvb2xMUEFzc2V0SWQiDWlkeEFtdEFzc2V0SWQiD2lkeFByaWNlQXNzZXRJZCIOaWR4QW10QXNzZXREY20iEGlkeFByaWNlQXNzZXREY20iDmlkeElBbXRBc3NldElkIhBpZHhJUHJpY2VB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Ym9keUJ5dGVzCQCRAwIIBQJjUgZwcm9vZnMAAAgFAmNSD3NlbmRlclB1YmxpY0tleQQCYXQJAPQDAwgFAmNSCWJvZHlCeXRlcwkAkQMCCAUCY1IGcHJvb2ZzAAEFAmZMAwMDBQJhcgUCYXMHBQJhdAcGCQECYXEDBQJhcgUCYXMFAmF0AwkAAQIFAmRxAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQCZXcFAmRxBAJmTQkA9gMBCQEFdmFsdWUBCAUCZXcGc2NyaXB0BAJmTgkA2wQBCQEFdmFsdWUBCQCdCAIFAmFBCQECYW8ABAJmTwkA8QcBBQR0aGlzAwMJAAACBQJmTgUCZk0JAQIhPQIFAmZPBQJmTQcGCQD0AwMIBQJmSQlib2R5Qnl0ZXMJAJEDAggFAmZJBnByb29mcwAABQJmSwkA9AMDCAUCZkkJYm9keUJ5dGVzCQCRAwIIBQJmSQZwcm9vZnMAAAUCZkvBwFdz", "chainId": 84, "height": 2378533, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7G5bdQPXfoZih6Pg9R2JSfLEQLNWqgSEhhRMYGDmdimm Next: 8kctPtkVzt3HvMFmvPphwNZdjwojkghJVBwpqmEBuXVD Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | func G (H,I) = toInt(fraction(H, toBigInt(I), d)) | |
66 | 66 | ||
67 | 67 | ||
68 | - | func J ( | |
68 | + | func J (K,L,M) = fraction(K, L, M) | |
69 | 69 | ||
70 | 70 | ||
71 | - | func L (M,N,O) = fraction(M, N, O) | |
72 | - | ||
73 | - | ||
74 | - | func P (H) = if ((0 > H)) | |
71 | + | func N (H) = if ((0 > H)) | |
75 | 72 | then -(H) | |
76 | 73 | else H | |
77 | 74 | ||
78 | 75 | ||
79 | - | func | |
76 | + | func O (H) = if ((e > H)) | |
80 | 77 | then -(H) | |
81 | 78 | else H | |
82 | 79 | ||
83 | 80 | ||
84 | - | func | |
81 | + | func P () = "%s__factoryContract" | |
85 | 82 | ||
86 | 83 | ||
87 | - | func | |
84 | + | func Q () = "%s__managerPublicKey" | |
88 | 85 | ||
89 | 86 | ||
90 | - | func | |
87 | + | func R () = "%s__pendingManagerPublicKey" | |
91 | 88 | ||
92 | 89 | ||
93 | - | func | |
90 | + | func S () = "%s%s__price__last" | |
94 | 91 | ||
95 | 92 | ||
96 | - | func | |
93 | + | func T (U,V) = makeString(["%s%s%d%d__price__history", toString(U), toString(V)], j) | |
97 | 94 | ||
98 | 95 | ||
99 | - | func | |
96 | + | func W (X,Y) = ((("%s%s%s__P__" + X) + "__") + Y) | |
100 | 97 | ||
101 | 98 | ||
102 | - | func | |
99 | + | func Z (X,Y) = ((("%s%s%s__G__" + X) + "__") + Y) | |
103 | 100 | ||
104 | 101 | ||
105 | - | func | |
102 | + | func aa () = "%s__amountAsset" | |
106 | 103 | ||
107 | 104 | ||
108 | - | func | |
105 | + | func ab () = "%s__priceAsset" | |
109 | 106 | ||
110 | 107 | ||
111 | - | let ae = "%s__fee" | |
112 | - | ||
113 | - | let af = fraction(10, b, 10000) | |
114 | - | ||
115 | - | let ag = valueOrElse(getInteger(this, ae), af) | |
116 | - | ||
117 | - | let ah = makeString(["%s", "kLp"], j) | |
118 | - | ||
119 | - | let ai = makeString(["%s", "kLpRefreshedHeight"], j) | |
120 | - | ||
121 | - | let aj = makeString(["%s", "refreshKLpDelay"], j) | |
122 | - | ||
123 | - | let ak = 30 | |
124 | - | ||
125 | - | let al = valueOrElse(getInteger(this, aj), ak) | |
126 | - | ||
127 | - | func am () = "%s__factoryConfig" | |
108 | + | func ac () = "%s__factoryConfig" | |
128 | 109 | ||
129 | 110 | ||
130 | - | func | |
111 | + | func ad () = "%s%s__matcher__publicKey" | |
131 | 112 | ||
132 | 113 | ||
133 | - | func | |
114 | + | func ae (af) = (("%s%s%s__" + af) + "__mappings__poolContract2LpAsset") | |
134 | 115 | ||
135 | 116 | ||
136 | - | func | |
117 | + | func ag (ah,ai) = (((("%d%d%s__" + ah) + "__") + ai) + "__config") | |
137 | 118 | ||
138 | 119 | ||
139 | - | func | |
120 | + | func aj (ak) = ("%s%s%s__mappings__baseAsset2internalId__" + ak) | |
140 | 121 | ||
141 | 122 | ||
142 | - | func | |
123 | + | func al () = "%s__shutdown" | |
143 | 124 | ||
144 | 125 | ||
145 | - | func | |
126 | + | func am (an) = ("%s%s__poolWeight__" + an) | |
146 | 127 | ||
147 | 128 | ||
148 | - | func | |
129 | + | func ao () = "%s__allowedLpScriptHash" | |
149 | 130 | ||
150 | 131 | ||
151 | - | let | |
132 | + | let ap = "%s__feeCollectorAddress" | |
152 | 133 | ||
153 | - | func | |
134 | + | func aq (ar,as,at) = throw(((((("order validation failed: orderValid=" + toString(ar)) + " senderValid=") + toString(as)) + " matcherValid=") + toString(at))) | |
154 | 135 | ||
155 | 136 | ||
156 | - | func | |
137 | + | func au (av,aw) = valueOrErrorMessage(getString(av, aw), makeString(["mandatory ", toString(av), ".", aw, " is not defined"], "")) | |
157 | 138 | ||
158 | 139 | ||
159 | - | func | |
140 | + | func ax (av,aw) = valueOrErrorMessage(getInteger(av, aw), makeString(["mandatory ", toString(av), ".", aw, " is not defined"], "")) | |
160 | 141 | ||
161 | 142 | ||
162 | - | func | |
143 | + | func ay (az) = throw(makeString(["lp.ride:", az], " ")) | |
163 | 144 | ||
164 | 145 | ||
165 | - | func aK (aJ) = makeString(["lp.ride:", aJ], " ") | |
146 | + | let aA = addressFromStringValue(au(this, P())) | |
147 | + | ||
148 | + | let aB = addressFromStringValue(au(aA, ap)) | |
149 | + | ||
150 | + | let aC = { | |
151 | + | let aD = invoke(aA, "getInFeeREADONLY", [toString(this)], nil) | |
152 | + | if ($isInstanceOf(aD, "Int")) | |
153 | + | then aD | |
154 | + | else throw(($getType(aD) + " couldn't be cast to Int")) | |
155 | + | } | |
156 | + | ||
157 | + | let aE = { | |
158 | + | let aD = invoke(aA, "getOutFeeREADONLY", [toString(this)], nil) | |
159 | + | if ($isInstanceOf(aD, "Int")) | |
160 | + | then aD | |
161 | + | else throw(($getType(aD) + " couldn't be cast to Int")) | |
162 | + | } | |
163 | + | ||
164 | + | func aF () = valueOrElse(getBoolean(aA, al()), false) | |
166 | 165 | ||
167 | 166 | ||
168 | - | let aL = addressFromStringValue(aE(this, R())) | |
169 | - | ||
170 | - | let aM = addressFromStringValue(aE(aL, az)) | |
171 | - | ||
172 | - | func aN () = valueOrElse(getBoolean(aL, av()), false) | |
167 | + | func aG () = fromBase58String(au(aA, ad())) | |
173 | 168 | ||
174 | 169 | ||
175 | - | func aO () = fromBase58String(aE(aL, an())) | |
176 | - | ||
177 | - | ||
178 | - | func aP () = { | |
179 | - | let aQ = aE(this, ac()) | |
180 | - | let aR = aE(this, ad()) | |
181 | - | let as = aH(aL, at(aR)) | |
182 | - | let ar = aH(aL, at(aQ)) | |
183 | - | split(aE(aL, aq(toString(ar), toString(as))), j) | |
170 | + | func aH () = { | |
171 | + | let aI = au(this, aa()) | |
172 | + | let aJ = au(this, ab()) | |
173 | + | let ai = ax(aA, aj(aJ)) | |
174 | + | let ah = ax(aA, aj(aI)) | |
175 | + | split(au(aA, ag(toString(ah), toString(ai))), j) | |
184 | 176 | } | |
185 | 177 | ||
186 | 178 | ||
187 | - | func | |
179 | + | func aK (aL) = if ((aL == i)) | |
188 | 180 | then unit | |
189 | - | else fromBase58String( | |
181 | + | else fromBase58String(aL) | |
190 | 182 | ||
191 | 183 | ||
192 | - | func | |
184 | + | func aM (aL) = if ((aL == unit)) | |
193 | 185 | then i | |
194 | - | else toBase58String(value( | |
186 | + | else toBase58String(value(aL)) | |
195 | 187 | ||
196 | 188 | ||
197 | - | func | |
189 | + | func aN (aO) = $Tuple7(addressFromStringValue(aO[o]), parseIntValue(aO[p]), fromBase58String(aO[q]), aK(aO[r]), aK(aO[s]), parseIntValue(aO[t]), parseIntValue(aO[u])) | |
198 | 190 | ||
199 | 191 | ||
200 | - | let | |
192 | + | let aP = aN(aH()) | |
201 | 193 | ||
202 | - | let | |
194 | + | let aQ = aP | |
203 | 195 | ||
204 | - | let | |
196 | + | let aR = aQ._1 | |
205 | 197 | ||
206 | - | let | |
198 | + | let aS = aQ._2 | |
207 | 199 | ||
208 | - | let | |
200 | + | let aT = aQ._3 | |
209 | 201 | ||
210 | - | let | |
202 | + | let aU = aQ._4 | |
211 | 203 | ||
212 | - | let | |
204 | + | let aV = aQ._5 | |
213 | 205 | ||
214 | - | let | |
206 | + | let aW = aQ._6 | |
215 | 207 | ||
216 | - | let | |
208 | + | let aX = aQ._7 | |
217 | 209 | ||
218 | - | func | |
210 | + | func aY () = split(au(aA, ac()), j) | |
219 | 211 | ||
220 | 212 | ||
221 | - | let | |
213 | + | let aZ = valueOrErrorMessage(addressFromString(aY()[B]), "incorrect staking address") | |
222 | 214 | ||
223 | - | let | |
215 | + | let ba = valueOrErrorMessage(addressFromString(aY()[C]), "incorrect staking address") | |
224 | 216 | ||
225 | - | func | |
217 | + | func bb (bc,bd,be,bf,bg,bh,bi,bj,bk,bl) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bc), toString(bd), toString(be), toString(bf), toString(bg), toString(bh), toString(bi), toString(bj), toString(bk), toString(bl)], j) | |
226 | 218 | ||
227 | 219 | ||
228 | - | func | |
220 | + | func bm (bn,bo,bp,bf,bi,bj) = makeString(["%d%d%d%d%d%d", toString(bn), toString(bo), toString(bp), toString(bf), toString(bi), toString(bj)], j) | |
229 | 221 | ||
230 | 222 | ||
231 | - | func | |
223 | + | func bq (br) = if ((br == "WAVES")) | |
232 | 224 | then wavesBalance(this).available | |
233 | - | else assetBalance(this, fromBase58String( | |
225 | + | else assetBalance(this, fromBase58String(br)) | |
234 | 226 | ||
235 | 227 | ||
236 | - | func | |
228 | + | func bs (bt,bu) = fraction(bt, d, bu) | |
237 | 229 | ||
238 | 230 | ||
239 | - | func bD (bB,bC,K) = fraction(bB, d, bC, K) | |
240 | - | ||
241 | - | ||
242 | - | func bE (bF,bG,bH,bI) = { | |
243 | - | let bJ = D(bH, bF) | |
244 | - | let bK = D(bI, bG) | |
245 | - | bA(bK, bJ) | |
231 | + | func bv (bw,bx,by,bz) = { | |
232 | + | let bA = D(by, bw) | |
233 | + | let bB = D(bz, bx) | |
234 | + | bs(bB, bA) | |
246 | 235 | } | |
247 | 236 | ||
248 | 237 | ||
249 | - | func | |
250 | - | let | |
251 | - | let | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | [ | |
238 | + | func bC (by,bz,bD) = { | |
239 | + | let bE = aH() | |
240 | + | let bF = parseIntValue(bE[t]) | |
241 | + | let bG = parseIntValue(bE[u]) | |
242 | + | let bH = bv(bF, bG, by, bz) | |
243 | + | let bu = D(by, bF) | |
244 | + | let bt = D(bz, bG) | |
245 | + | let bI = D(bD, b) | |
246 | + | let bJ = bs(bu, bI) | |
247 | + | let bK = bs(bt, bI) | |
248 | + | [bH, bJ, bK] | |
260 | 249 | } | |
261 | 250 | ||
262 | 251 | ||
263 | - | func | |
264 | - | let | |
265 | - | [G( | |
252 | + | func bL (by,bz,bD) = { | |
253 | + | let bM = bC(by, bz, bD) | |
254 | + | [G(bM[0], b), G(bM[1], b), G(bM[2], b)] | |
266 | 255 | } | |
267 | 256 | ||
268 | 257 | ||
269 | - | func | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | let | |
277 | - | let | |
278 | - | if (( | |
258 | + | func bN (bO,bP,bQ,X) = { | |
259 | + | let bE = aH() | |
260 | + | let bR = bE[q] | |
261 | + | let bS = bE[r] | |
262 | + | let bT = bE[s] | |
263 | + | let bw = parseIntValue(bE[t]) | |
264 | + | let bx = parseIntValue(bE[u]) | |
265 | + | let bU = bE[p] | |
266 | + | let bV = valueOrErrorMessage(assetInfo(fromBase58String(bR)), (("Asset " + bR) + " doesn't exist")).quantity | |
267 | + | if ((bR != bP)) | |
279 | 268 | then throw("Invalid asset passed.") | |
280 | 269 | else { | |
281 | - | let | |
282 | - | let | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
270 | + | let bW = bq(bS) | |
271 | + | let bX = D(bW, bw) | |
272 | + | let bY = bq(bT) | |
273 | + | let bZ = D(bY, bx) | |
274 | + | let ca = bs(bZ, bX) | |
275 | + | let cb = G(ca, b) | |
276 | + | let cc = D(bQ, b) | |
277 | + | let cd = D(bV, b) | |
278 | + | let ce = fraction(bX, cc, cd) | |
279 | + | let cf = fraction(bZ, cc, cd) | |
280 | + | let cg = G(ce, bw) | |
281 | + | let ch = G(cf, bx) | |
282 | + | let ci = if ((bO == "")) | |
294 | 283 | then nil | |
295 | - | else [ScriptTransfer( | |
284 | + | else [ScriptTransfer(X, cg, if ((bS == "WAVES")) | |
296 | 285 | then unit | |
297 | - | else fromBase58String( | |
286 | + | else fromBase58String(bS)), ScriptTransfer(X, ch, if ((bT == "WAVES")) | |
298 | 287 | then unit | |
299 | - | else fromBase58String( | |
300 | - | $Tuple10( | |
288 | + | else fromBase58String(bT)), StringEntry(Z(toString(X), bO), bm(cg, ch, bQ, cb, height, lastBlock.timestamp)), IntegerEntry(S(), cb), IntegerEntry(T(height, lastBlock.timestamp), cb)] | |
289 | + | $Tuple10(cg, ch, bS, bT, bW, bY, bV, ca, bU, ci) | |
301 | 290 | } | |
302 | 291 | } | |
303 | 292 | ||
304 | 293 | ||
305 | - | func | |
306 | - | let | |
307 | - | let | |
308 | - | let | |
309 | - | let | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
316 | - | let | |
317 | - | let | |
318 | - | if (if (( | |
294 | + | func cj (bO,ck,cl,cm,cn,co,X,cp,cq) = { | |
295 | + | let bE = aH() | |
296 | + | let bR = fromBase58String(bE[q]) | |
297 | + | let cr = bE[r] | |
298 | + | let cs = bE[s] | |
299 | + | let ct = bE[v] | |
300 | + | let cu = bE[w] | |
301 | + | let bF = parseIntValue(bE[t]) | |
302 | + | let bG = parseIntValue(bE[u]) | |
303 | + | let bU = bE[p] | |
304 | + | let bV = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
305 | + | let cv = toBase58String(valueOrElse(cm, fromBase58String("WAVES"))) | |
306 | + | let cw = toBase58String(valueOrElse(co, fromBase58String("WAVES"))) | |
307 | + | if (if ((cr != cv)) | |
319 | 308 | then true | |
320 | - | else ( | |
309 | + | else (cs != cw)) | |
321 | 310 | then throw("Invalid amt or price asset passed.") | |
322 | 311 | else { | |
323 | - | let | |
324 | - | then | |
325 | - | else ( | |
326 | - | let | |
327 | - | then | |
328 | - | else ( | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
312 | + | let bW = if (cp) | |
313 | + | then bq(cr) | |
314 | + | else (bq(cr) - cl) | |
315 | + | let bY = if (cp) | |
316 | + | then bq(cs) | |
317 | + | else (bq(cs) - cn) | |
318 | + | let cx = D(cl, bF) | |
319 | + | let cy = D(cn, bG) | |
320 | + | let cz = bs(cy, cx) | |
321 | + | let bX = D(bW, bF) | |
322 | + | let bZ = D(bY, bG) | |
323 | + | let cA = if ((bV == 0)) | |
335 | 324 | then { | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | $Tuple5(G( | |
325 | + | let ca = e | |
326 | + | let cB = e | |
327 | + | let bI = pow((cx * cy), 0, toBigInt(5), 1, 0, DOWN) | |
328 | + | $Tuple5(G(bI, b), G(cx, bF), G(cy, bG), bs((bZ + cy), (bX + cx)), cB) | |
340 | 329 | } | |
341 | 330 | else { | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | if (if (( | |
346 | - | then ( | |
331 | + | let ca = bs(bZ, bX) | |
332 | + | let cB = fraction(O((ca - cz)), d, ca) | |
333 | + | let cC = D(ck, b) | |
334 | + | if (if ((ca != e)) | |
335 | + | then (cB > cC) | |
347 | 336 | else false) | |
348 | - | then throw(((("Price slippage " + toString( | |
337 | + | then throw(((("Price slippage " + toString(cB)) + " exceeded the passed limit of ") + toString(cC))) | |
349 | 338 | else { | |
350 | - | let | |
351 | - | let | |
352 | - | let | |
353 | - | let | |
354 | - | then $Tuple2( | |
355 | - | else $Tuple2( | |
356 | - | let | |
357 | - | let | |
358 | - | let | |
359 | - | $Tuple5( | |
339 | + | let cd = D(bV, b) | |
340 | + | let cD = fraction(cx, ca, d) | |
341 | + | let cE = fraction(cy, d, ca) | |
342 | + | let cF = if ((cD > cy)) | |
343 | + | then $Tuple2(cE, cy) | |
344 | + | else $Tuple2(cx, cD) | |
345 | + | let cG = cF._1 | |
346 | + | let cH = cF._2 | |
347 | + | let bI = fraction(cd, cH, bZ) | |
348 | + | $Tuple5(G(bI, b), G(cG, bF), G(cH, bG), ca, cB) | |
360 | 349 | } | |
361 | 350 | } | |
362 | - | let | |
363 | - | let | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | if ((0 >= | |
351 | + | let cI = cA._1 | |
352 | + | let cJ = cA._2 | |
353 | + | let cK = cA._3 | |
354 | + | let cb = G(cA._4, b) | |
355 | + | let cL = G(cA._5, b) | |
356 | + | if ((0 >= cI)) | |
368 | 357 | then throw("Invalid calculations. LP calculated is less than zero.") | |
369 | 358 | else { | |
370 | - | let | |
359 | + | let cM = if (!(cq)) | |
371 | 360 | then 0 | |
372 | - | else | |
373 | - | let | |
374 | - | let | |
375 | - | let | |
376 | - | $Tuple13( | |
361 | + | else cI | |
362 | + | let cN = (cl - cJ) | |
363 | + | let cO = (cn - cK) | |
364 | + | let cP = [IntegerEntry(S(), cb), IntegerEntry(T(height, lastBlock.timestamp), cb), StringEntry(W(X, bO), bb(cJ, cK, cM, cb, ck, cL, height, lastBlock.timestamp, cN, cO))] | |
365 | + | $Tuple13(cI, cM, cb, bW, bY, bV, bR, bU, cP, cN, cO, cm, co) | |
377 | 366 | } | |
378 | 367 | } | |
379 | 368 | } | |
380 | 369 | ||
381 | 370 | ||
382 | - | func cZ (da,db,ce) = { | |
383 | - | let dc = fraction(pow((da * db), 0, toBigInt(5), 1, 18, DOWN), g, ce) | |
384 | - | if ((ce == f)) | |
385 | - | then f | |
386 | - | else dc | |
371 | + | func cQ (cR) = { | |
372 | + | let bE = aH() | |
373 | + | let cS = bE[r] | |
374 | + | let cT = bE[s] | |
375 | + | let bU = parseIntValue(bE[p]) | |
376 | + | let bF = parseIntValue(bE[t]) | |
377 | + | let bG = parseIntValue(bE[u]) | |
378 | + | let cU = bq(cS) | |
379 | + | let cV = bq(cT) | |
380 | + | let ca = if ((cR.orderType == Buy)) | |
381 | + | then bv(bF, bG, (cU + cR.amount), cV) | |
382 | + | else bv(bF, bG, (cU - cR.amount), cV) | |
383 | + | let cb = G(ca, b) | |
384 | + | if (if (if (aF()) | |
385 | + | then true | |
386 | + | else (bU == m)) | |
387 | + | then true | |
388 | + | else (bU == n)) | |
389 | + | then throw("Exchange operations disabled") | |
390 | + | else { | |
391 | + | let cW = cR.assetPair.amountAsset | |
392 | + | let cX = if ((cW == unit)) | |
393 | + | then "WAVES" | |
394 | + | else toBase58String(value(cW)) | |
395 | + | let cY = cR.assetPair.priceAsset | |
396 | + | let cZ = if ((cY == unit)) | |
397 | + | then "WAVES" | |
398 | + | else toBase58String(value(cY)) | |
399 | + | if (if ((cX != cS)) | |
400 | + | then true | |
401 | + | else (cZ != cT)) | |
402 | + | then throw("Wrong order assets.") | |
403 | + | else { | |
404 | + | let da = cR.price | |
405 | + | let db = fraction(b, bG, bF) | |
406 | + | let dc = J(da, b, db) | |
407 | + | let dd = if ((cR.orderType == Buy)) | |
408 | + | then (cb >= dc) | |
409 | + | else (dc >= cb) | |
410 | + | true | |
411 | + | } | |
412 | + | } | |
387 | 413 | } | |
388 | 414 | ||
389 | 415 | ||
390 | - | func dd (de,df,dg) = { | |
391 | - | let dh = (toBigInt(by(aU(bc))) - de) | |
392 | - | let di = (toBigInt(by(aU(bd))) - df) | |
393 | - | let dj = (toBigInt(value(assetInfo(bb)).quantity) - dg) | |
394 | - | let dk = cZ(dh, di, dj) | |
395 | - | dk | |
396 | - | } | |
397 | - | ||
398 | - | ||
399 | - | func dl (dm,dn,dg) = { | |
400 | - | let dh = (by(aU(bc)) + dm) | |
401 | - | let di = (by(aU(bd)) + dn) | |
402 | - | let dj = (value(assetInfo(bb)).quantity + dg) | |
403 | - | let dc = cZ(toBigInt(dh), toBigInt(di), toBigInt(dj)) | |
404 | - | let do = [IntegerEntry(ai, height), StringEntry(ah, toString(dc))] | |
405 | - | $Tuple2(do, dc) | |
406 | - | } | |
407 | - | ||
408 | - | ||
409 | - | func dp (dq,dc) = if ((dc >= dq)) | |
410 | - | then true | |
411 | - | else aI(makeString(["updated KLp lower than current KLp", toString(dq), toString(dc)], " ")) | |
412 | - | ||
413 | - | ||
414 | - | func dr (ds) = { | |
415 | - | let dt = ds.amount | |
416 | - | let du = fraction(ds.amount, ds.price, b, FLOOR) | |
417 | - | let dv = if ((ds.orderType == Buy)) | |
418 | - | then $Tuple2(dt, -(du)) | |
419 | - | else $Tuple2(-(dt), du) | |
420 | - | let dm = dv._1 | |
421 | - | let dn = dv._2 | |
422 | - | if (if (if (aN()) | |
423 | - | then true | |
424 | - | else (ba == m)) | |
425 | - | then true | |
426 | - | else (ba == n)) | |
427 | - | then throw("Exchange operations disabled") | |
428 | - | else if (if ((ds.assetPair.amountAsset != bc)) | |
429 | - | then true | |
430 | - | else (ds.assetPair.priceAsset != bd)) | |
431 | - | then throw("Wrong order assets.") | |
432 | - | else { | |
433 | - | let dw = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, ah), aK("kLp is required"))), aK("invalid kLp")) | |
434 | - | let dx = dl(dm, dn, 0) | |
435 | - | let dy = dx._1 | |
436 | - | let dz = dx._2 | |
437 | - | let dA = (dz >= dw) | |
438 | - | dA | |
439 | - | } | |
440 | - | } | |
441 | - | ||
442 | - | ||
443 | - | func dB (dC) = if ((size(dC.payments) != 1)) | |
416 | + | func de (df) = if ((size(df.payments) != 1)) | |
444 | 417 | then throw("exactly 1 payment is expected") | |
445 | 418 | else { | |
446 | - | let | |
447 | - | let | |
448 | - | let | |
449 | - | let | |
450 | - | let | |
451 | - | let | |
452 | - | let | |
453 | - | let | |
454 | - | if (if ( | |
419 | + | let dg = value(df.payments[0]) | |
420 | + | let bP = value(dg.assetId) | |
421 | + | let dh = dg.amount | |
422 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(bP), dh, df.caller) | |
423 | + | let cg = cA._1 | |
424 | + | let ch = cA._2 | |
425 | + | let bU = parseIntValue(cA._9) | |
426 | + | let ci = cA._10 | |
427 | + | if (if (aF()) | |
455 | 428 | then true | |
456 | - | else ( | |
457 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
458 | - | else $Tuple5( | |
429 | + | else (bU == n)) | |
430 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bU))) | |
431 | + | else $Tuple5(cg, ch, dh, bP, ci) | |
459 | 432 | } | |
460 | 433 | ||
461 | 434 | ||
462 | - | func | |
435 | + | func di (df,ck,cq) = if ((size(df.payments) != 2)) | |
463 | 436 | then throw("exactly 2 payments are expected") | |
464 | 437 | else { | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | if (if (if ( | |
438 | + | let dj = value(df.payments[0]) | |
439 | + | let dk = value(df.payments[1]) | |
440 | + | let dl = cj(toBase58String(df.transactionId), ck, dj.amount, dj.assetId, dk.amount, dk.assetId, toString(df.caller), false, cq) | |
441 | + | let bU = parseIntValue(dl._8) | |
442 | + | if (if (if (aF()) | |
470 | 443 | then true | |
471 | - | else ( | |
444 | + | else (bU == l)) | |
472 | 445 | then true | |
473 | - | else ( | |
474 | - | then throw(("Put operation is blocked by admin. Status = " + toString( | |
475 | - | else | |
446 | + | else (bU == n)) | |
447 | + | then throw(("Put operation is blocked by admin. Status = " + toString(bU))) | |
448 | + | else dl | |
476 | 449 | } | |
477 | 450 | ||
478 | 451 | ||
479 | - | func | |
480 | - | let | |
481 | - | if (( | |
452 | + | func dm (dn) = { | |
453 | + | let do = invoke(aA, "emit", [dn], nil) | |
454 | + | if ((do == do)) | |
482 | 455 | then { | |
483 | - | let | |
484 | - | let | |
485 | - | if ($isInstanceOf( | |
456 | + | let dp = { | |
457 | + | let dq = do | |
458 | + | if ($isInstanceOf(dq, "Address")) | |
486 | 459 | then { | |
487 | - | let | |
488 | - | invoke( | |
460 | + | let dr = dq | |
461 | + | invoke(dr, "emit", [dn], nil) | |
489 | 462 | } | |
490 | 463 | else unit | |
491 | 464 | } | |
492 | - | if (( | |
493 | - | then | |
465 | + | if ((dp == dp)) | |
466 | + | then dn | |
494 | 467 | else throw("Strict value is not equal to itself.") | |
495 | 468 | } | |
496 | 469 | else throw("Strict value is not equal to itself.") | |
497 | 470 | } | |
498 | 471 | ||
499 | 472 | ||
500 | - | func dP (dK) = { | |
501 | - | let dQ = fraction(dK, ag, b) | |
502 | - | $Tuple2((dK - dQ), dQ) | |
473 | + | func ds (dn,dt) = { | |
474 | + | let du = if ((dt == 0)) | |
475 | + | then 0 | |
476 | + | else fraction(dn, dt, b) | |
477 | + | $Tuple2((dn - du), du) | |
503 | 478 | } | |
504 | 479 | ||
505 | 480 | ||
506 | - | func | |
507 | - | let | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
481 | + | func dv (dw,dx,X,Y) = { | |
482 | + | let dy = (Y == unit) | |
483 | + | let dz = bq(aM(aU)) | |
484 | + | let dA = bq(aM(aV)) | |
485 | + | let dB = if ((dx == aU)) | |
511 | 486 | then true | |
512 | - | else if (( | |
487 | + | else if ((dx == aV)) | |
513 | 488 | then false | |
514 | - | else | |
515 | - | let | |
516 | - | then $Tuple2( | |
517 | - | else if ( | |
518 | - | then $Tuple2(( | |
519 | - | else $Tuple2( | |
520 | - | let | |
521 | - | let | |
522 | - | let | |
523 | - | then $Tuple2( | |
524 | - | else $Tuple2(0, | |
525 | - | let | |
526 | - | let | |
527 | - | let | |
528 | - | let | |
529 | - | let | |
530 | - | let | |
531 | - | let | |
532 | - | let | |
533 | - | let | |
534 | - | let | |
535 | - | let | |
536 | - | let | |
537 | - | then | |
538 | - | else | |
539 | - | let | |
540 | - | let | |
541 | - | let | |
489 | + | else ay("invalid asset") | |
490 | + | let dC = if (dy) | |
491 | + | then $Tuple2(dz, dA) | |
492 | + | else if (dB) | |
493 | + | then $Tuple2((dz - dw), dA) | |
494 | + | else $Tuple2(dz, (dA - dw)) | |
495 | + | let dD = dC._1 | |
496 | + | let dE = dC._2 | |
497 | + | let dF = if (dB) | |
498 | + | then $Tuple2(dw, 0) | |
499 | + | else $Tuple2(0, dw) | |
500 | + | let dG = dF._1 | |
501 | + | let dH = dF._2 | |
502 | + | let dI = ds(dG, aC)._1 | |
503 | + | let dJ = ds(dH, aC)._1 | |
504 | + | let dK = ds(dw, aC) | |
505 | + | let dL = dK._1 | |
506 | + | let du = dK._2 | |
507 | + | let dM = (dD + dI) | |
508 | + | let dN = (dE + dJ) | |
509 | + | let dO = bs(D(dN, aX), D(dM, aW)) | |
510 | + | let dP = G(dO, b) | |
511 | + | let dQ = if (dB) | |
512 | + | then dD | |
513 | + | else dE | |
514 | + | let dR = toBigInt(dQ) | |
515 | + | let dS = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
516 | + | let dT = if ((dS > f)) | |
542 | 517 | then true | |
543 | - | else | |
544 | - | if (( | |
518 | + | else ay("initial deposit requires all coins") | |
519 | + | if ((dT == dT)) | |
545 | 520 | then { | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
521 | + | let dU = toBigInt(dL) | |
522 | + | let dV = max([0, toInt(((dS * (sqrtBigInt((d + ((dU * d) / dR)), 18, 18, DOWN) - d)) / d))]) | |
523 | + | let cP = if (dy) | |
549 | 524 | then nil | |
550 | - | else [IntegerEntry( | |
551 | - | let | |
552 | - | let | |
553 | - | let | |
554 | - | let | |
555 | - | then $Tuple2( | |
556 | - | else $Tuple2( | |
557 | - | let | |
558 | - | let | |
559 | - | let | |
560 | - | fraction(( | |
525 | + | else [IntegerEntry(S(), dP), IntegerEntry(T(height, lastBlock.timestamp), dP), StringEntry(W(toString(value(X)), toBase58String(value(Y))), bb(dG, dH, dV, dP, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
526 | + | let dW = bs(D(dE, aX), D(dD, aW)) | |
527 | + | let dX = G(dW, b) | |
528 | + | let dY = { | |
529 | + | let dZ = if (dB) | |
530 | + | then $Tuple2(dG, dD) | |
531 | + | else $Tuple2(dH, dE) | |
532 | + | let dn = dZ._1 | |
533 | + | let ea = dZ._2 | |
534 | + | let eb = toInt(fraction(dS, toBigInt((dn / 2)), toBigInt(ea))) | |
535 | + | fraction((dV - eb), b, eb) | |
561 | 536 | } | |
562 | - | $ | |
537 | + | $Tuple4(dV, cP, du, dY) | |
563 | 538 | } | |
564 | 539 | else throw("Strict value is not equal to itself.") | |
565 | 540 | } | |
566 | 541 | ||
567 | 542 | ||
568 | - | func ew (ex,ef,dT,Z,aa) = { | |
569 | - | let dU = (aa == unit) | |
570 | - | let bN = aP() | |
571 | - | let bO = parseIntValue(bN[t]) | |
572 | - | let bP = parseIntValue(bN[u]) | |
573 | - | let ey = [if ((dT == bb)) | |
543 | + | func ec (ed,dL,dx,X,Y) = { | |
544 | + | let dy = (Y == unit) | |
545 | + | let ee = [if ((dx == aT)) | |
574 | 546 | then true | |
575 | - | else | |
576 | - | if (( | |
547 | + | else ay("invalid lp asset")] | |
548 | + | if ((ee == ee)) | |
577 | 549 | then { | |
578 | - | let | |
550 | + | let ef = if ((ed == aU)) | |
579 | 551 | then true | |
580 | - | else if (( | |
552 | + | else if ((ed == aV)) | |
581 | 553 | then false | |
582 | - | else aI("invalid asset") | |
583 | - | let eA = if (ez) | |
584 | - | then toBigInt(by(aU(bc))) | |
585 | - | else toBigInt(by(aU(bd))) | |
586 | - | let eB = if (ez) | |
587 | - | then bO | |
588 | - | else bP | |
589 | - | let eC = by(aU(bc)) | |
590 | - | let eD = by(aU(bd)) | |
591 | - | let eE = if (ez) | |
592 | - | then eC | |
593 | - | else eD | |
594 | - | let eF = toBigInt(eE) | |
595 | - | let em = toBigInt(valueOrErrorMessage(assetInfo(bb), (("asset " + toBase58String(bb)) + " doesn't exist")).quantity) | |
596 | - | let eG = toBigInt(ef) | |
597 | - | let eH = max([0, toInt(((eA * (d - pow((d - ((eG * d) / em)), 18, h, 0, 18, DOWN))) / d))]) | |
598 | - | let eI = dP(eH) | |
599 | - | let eJ = eI._1 | |
600 | - | let dQ = eI._2 | |
601 | - | let eK = if (ez) | |
602 | - | then $Tuple4(eJ, 0, (eC - eH), eD) | |
603 | - | else $Tuple4(0, eJ, eC, (eD - eH)) | |
604 | - | let eL = eK._1 | |
605 | - | let eM = eK._2 | |
606 | - | let eN = eK._3 | |
607 | - | let eO = eK._4 | |
608 | - | let ei = bA(D(eO, bf), D(eN, be)) | |
609 | - | let ej = G(ei, b) | |
610 | - | let cY = if (dU) | |
554 | + | else ay("invalid asset") | |
555 | + | let eg = if (ef) | |
556 | + | then toBigInt(bq(aM(aU))) | |
557 | + | else toBigInt(bq(aM(aV))) | |
558 | + | let eh = bq(aM(aU)) | |
559 | + | let ei = bq(aM(aV)) | |
560 | + | let ej = if (ef) | |
561 | + | then eh | |
562 | + | else ei | |
563 | + | let ek = toBigInt(ej) | |
564 | + | let dS = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
565 | + | let el = toBigInt(dL) | |
566 | + | let em = max([0, toInt(((eg * (d - pow((d - ((el * d) / dS)), 18, h, 0, 18, DOWN))) / d))]) | |
567 | + | let en = ds(em, aE) | |
568 | + | let eo = en._1 | |
569 | + | let du = en._2 | |
570 | + | let ep = if (ef) | |
571 | + | then $Tuple4(eo, 0, (eh - em), ei) | |
572 | + | else $Tuple4(0, eo, eh, (ei - em)) | |
573 | + | let eq = ep._1 | |
574 | + | let er = ep._2 | |
575 | + | let es = ep._3 | |
576 | + | let et = ep._4 | |
577 | + | let dO = bs(D(et, aX), D(es, aW)) | |
578 | + | let dP = G(dO, b) | |
579 | + | let cP = if (dy) | |
611 | 580 | then nil | |
612 | - | else [StringEntry( | |
613 | - | let | |
614 | - | let | |
615 | - | let | |
616 | - | let | |
617 | - | fraction(( | |
581 | + | else [StringEntry(Z(toString(value(X)), toBase58String(value(Y))), bm(eq, er, dL, dP, height, lastBlock.timestamp)), IntegerEntry(S(), dP), IntegerEntry(T(height, lastBlock.timestamp), dP)] | |
582 | + | let dW = bs(D(ei, aX), D(eh, aW)) | |
583 | + | let dX = G(dW, b) | |
584 | + | let dY = { | |
585 | + | let eu = (toInt(fraction(eg, el, dS)) * 2) | |
586 | + | fraction((eo - eu), b, eu) | |
618 | 587 | } | |
619 | - | $ | |
588 | + | $Tuple4(eo, cP, du, dY) | |
620 | 589 | } | |
621 | 590 | else throw("Strict value is not equal to itself.") | |
622 | 591 | } | |
623 | 592 | ||
624 | 593 | ||
625 | - | func | |
626 | - | let | |
627 | - | if ($isInstanceOf( | |
594 | + | func ev () = { | |
595 | + | let dq = getString(Q()) | |
596 | + | if ($isInstanceOf(dq, "String")) | |
628 | 597 | then { | |
629 | - | let | |
630 | - | fromBase58String( | |
598 | + | let ew = dq | |
599 | + | fromBase58String(ew) | |
631 | 600 | } | |
632 | - | else if ($isInstanceOf( | |
601 | + | else if ($isInstanceOf(dq, "Unit")) | |
633 | 602 | then unit | |
634 | 603 | else throw("Match error") | |
635 | 604 | } | |
636 | 605 | ||
637 | 606 | ||
638 | - | func | |
639 | - | let | |
640 | - | if ($isInstanceOf( | |
607 | + | func ex () = { | |
608 | + | let dq = getString(R()) | |
609 | + | if ($isInstanceOf(dq, "String")) | |
641 | 610 | then { | |
642 | - | let | |
643 | - | fromBase58String( | |
611 | + | let ew = dq | |
612 | + | fromBase58String(ew) | |
644 | 613 | } | |
645 | - | else if ($isInstanceOf( | |
614 | + | else if ($isInstanceOf(dq, "Unit")) | |
646 | 615 | then unit | |
647 | 616 | else throw("Match error") | |
648 | 617 | } | |
649 | 618 | ||
650 | 619 | ||
651 | - | func | |
652 | - | let | |
653 | - | if ($isInstanceOf( | |
620 | + | func ey (df) = { | |
621 | + | let dq = ev() | |
622 | + | if ($isInstanceOf(dq, "ByteVector")) | |
654 | 623 | then { | |
655 | - | let | |
656 | - | ( | |
624 | + | let ez = dq | |
625 | + | (df.callerPublicKey == ez) | |
657 | 626 | } | |
658 | - | else if ($isInstanceOf( | |
659 | - | then ( | |
627 | + | else if ($isInstanceOf(dq, "Unit")) | |
628 | + | then (df.caller == this) | |
660 | 629 | else throw("Match error") | |
661 | 630 | } | |
662 | 631 | ||
663 | 632 | ||
664 | - | func | |
665 | - | let | |
666 | - | let | |
667 | - | if ($isInstanceOf( | |
633 | + | func eA (df) = { | |
634 | + | let eB = throw("Permission denied") | |
635 | + | let dq = ev() | |
636 | + | if ($isInstanceOf(dq, "ByteVector")) | |
668 | 637 | then { | |
669 | - | let | |
670 | - | if (( | |
638 | + | let ez = dq | |
639 | + | if ((df.callerPublicKey == ez)) | |
671 | 640 | then true | |
672 | - | else | |
641 | + | else eB | |
673 | 642 | } | |
674 | - | else if ($isInstanceOf( | |
675 | - | then if (( | |
643 | + | else if ($isInstanceOf(dq, "Unit")) | |
644 | + | then if ((df.caller == this)) | |
676 | 645 | then true | |
677 | - | else | |
646 | + | else eB | |
678 | 647 | else throw("Match error") | |
679 | 648 | } | |
680 | 649 | ||
681 | 650 | ||
682 | - | @Callable( | |
683 | - | func setManager ( | |
684 | - | let | |
685 | - | if (( | |
651 | + | @Callable(df) | |
652 | + | func setManager (eC) = { | |
653 | + | let eD = eA(df) | |
654 | + | if ((eD == eD)) | |
686 | 655 | then { | |
687 | - | let | |
688 | - | if (( | |
689 | - | then [StringEntry( | |
656 | + | let eE = fromBase58String(eC) | |
657 | + | if ((eE == eE)) | |
658 | + | then [StringEntry(R(), eC)] | |
690 | 659 | else throw("Strict value is not equal to itself.") | |
691 | 660 | } | |
692 | 661 | else throw("Strict value is not equal to itself.") | |
694 | 663 | ||
695 | 664 | ||
696 | 665 | ||
697 | - | @Callable( | |
666 | + | @Callable(df) | |
698 | 667 | func confirmManager () = { | |
699 | - | let | |
700 | - | let | |
668 | + | let eF = ex() | |
669 | + | let eG = if (isDefined(eF)) | |
701 | 670 | then true | |
702 | 671 | else throw("No pending manager") | |
703 | - | if (( | |
672 | + | if ((eG == eG)) | |
704 | 673 | then { | |
705 | - | let | |
674 | + | let eH = if ((df.callerPublicKey == value(eF))) | |
706 | 675 | then true | |
707 | 676 | else throw("You are not pending manager") | |
708 | - | if (( | |
709 | - | then [StringEntry( | |
677 | + | if ((eH == eH)) | |
678 | + | then [StringEntry(Q(), toBase58String(value(eF))), DeleteEntry(R())] | |
710 | 679 | else throw("Strict value is not equal to itself.") | |
711 | 680 | } | |
712 | 681 | else throw("Strict value is not equal to itself.") | |
714 | 683 | ||
715 | 684 | ||
716 | 685 | ||
717 | - | @Callable( | |
718 | - | func put ( | |
686 | + | @Callable(df) | |
687 | + | func put (ck,eI) = if ((0 > ck)) | |
719 | 688 | then throw("Invalid slippageTolerance passed") | |
720 | 689 | else { | |
721 | - | let dI = dF(dC, ct, true) | |
722 | - | let cV = dI._2 | |
723 | - | let ca = dI._7 | |
724 | - | let cr = dI._9 | |
725 | - | let cW = dI._10 | |
726 | - | let cX = dI._11 | |
727 | - | let fe = dI._12 | |
728 | - | let ff = dI._13 | |
729 | - | let dG = toBigInt(value(dC.payments[0]).amount) | |
730 | - | let dH = toBigInt(value(dC.payments[1]).amount) | |
731 | - | let dk = dd(dG, dH, toBigInt(0)) | |
732 | - | if ((dk == dk)) | |
690 | + | let dl = di(df, ck, true) | |
691 | + | let cM = dl._2 | |
692 | + | let bR = dl._7 | |
693 | + | let ci = dl._9 | |
694 | + | let cN = dl._10 | |
695 | + | let cO = dl._11 | |
696 | + | let eJ = dl._12 | |
697 | + | let eK = dl._13 | |
698 | + | let do = invoke(aA, "emit", [cM], nil) | |
699 | + | if ((do == do)) | |
733 | 700 | then { | |
734 | - | let dL = invoke(aL, "emit", [cV], nil) | |
735 | - | if ((dL == dL)) | |
701 | + | let dp = { | |
702 | + | let dq = do | |
703 | + | if ($isInstanceOf(dq, "Address")) | |
704 | + | then { | |
705 | + | let dr = dq | |
706 | + | invoke(dr, "emit", [cM], nil) | |
707 | + | } | |
708 | + | else unit | |
709 | + | } | |
710 | + | if ((dp == dp)) | |
736 | 711 | then { | |
737 | - | let dM = { | |
738 | - | let dN = dL | |
739 | - | if ($isInstanceOf(dN, "Address")) | |
740 | - | then { | |
741 | - | let dO = dN | |
742 | - | invoke(dO, "emit", [cV], nil) | |
743 | - | } | |
744 | - | else unit | |
745 | - | } | |
746 | - | if ((dM == dM)) | |
712 | + | let eL = if ((cN > 0)) | |
713 | + | then invoke(ba, "put", nil, [AttachedPayment(eJ, cN)]) | |
714 | + | else nil | |
715 | + | if ((eL == eL)) | |
747 | 716 | then { | |
748 | - | let | |
749 | - | then invoke( | |
717 | + | let eM = if ((cO > 0)) | |
718 | + | then invoke(ba, "put", nil, [AttachedPayment(eK, cO)]) | |
750 | 719 | else nil | |
751 | - | if (( | |
720 | + | if ((eM == eM)) | |
752 | 721 | then { | |
753 | - | let fh = if ((cX > 0)) | |
754 | - | then invoke(bi, "put", nil, [AttachedPayment(ff, cX)]) | |
755 | - | else nil | |
756 | - | if ((fh == fh)) | |
722 | + | let eN = if (eI) | |
757 | 723 | then { | |
758 | - | let fi = if (fd) | |
759 | - | then { | |
760 | - | let fj = invoke(bh, "stake", nil, [AttachedPayment(ca, cV)]) | |
761 | - | if ((fj == fj)) | |
762 | - | then nil | |
763 | - | else throw("Strict value is not equal to itself.") | |
764 | - | } | |
765 | - | else [ScriptTransfer(dC.caller, cV, ca)] | |
766 | - | let fk = dl(0, 0, 0) | |
767 | - | if ((fk == fk)) | |
768 | - | then { | |
769 | - | let dc = fk._2 | |
770 | - | let fl = fk._1 | |
771 | - | let fm = dp(dk, dc) | |
772 | - | if ((fm == fm)) | |
773 | - | then ((cr ++ fi) ++ fl) | |
774 | - | else throw("Strict value is not equal to itself.") | |
775 | - | } | |
724 | + | let eO = invoke(aZ, "stake", nil, [AttachedPayment(bR, cM)]) | |
725 | + | if ((eO == eO)) | |
726 | + | then nil | |
776 | 727 | else throw("Strict value is not equal to itself.") | |
777 | 728 | } | |
778 | - | else throw("Strict value is not equal to itself.") | |
729 | + | else [ScriptTransfer(df.caller, cM, bR)] | |
730 | + | (ci ++ eN) | |
779 | 731 | } | |
780 | 732 | else throw("Strict value is not equal to itself.") | |
781 | 733 | } | |
788 | 740 | ||
789 | 741 | ||
790 | 742 | ||
791 | - | @Callable( | |
792 | - | func putForFree ( | |
743 | + | @Callable(df) | |
744 | + | func putForFree (eP) = if ((0 > eP)) | |
793 | 745 | then throw("Invalid value passed") | |
794 | 746 | else { | |
795 | - | let dI = dF(dC, fn, false) | |
796 | - | let cr = dI._9 | |
797 | - | let dG = toBigInt(value(dC.payments[0]).amount) | |
798 | - | let dH = toBigInt(value(dC.payments[1]).amount) | |
799 | - | let dk = dd(dG, dH, toBigInt(0)) | |
800 | - | if ((dk == dk)) | |
801 | - | then { | |
802 | - | let fo = dl(0, 0, 0) | |
803 | - | let fl = fo._1 | |
804 | - | let dc = fo._2 | |
805 | - | let fm = dp(dk, dc) | |
806 | - | if ((fm == fm)) | |
807 | - | then (cr ++ fl) | |
808 | - | else throw("Strict value is not equal to itself.") | |
809 | - | } | |
810 | - | else throw("Strict value is not equal to itself.") | |
747 | + | let dl = di(df, eP, false) | |
748 | + | dl._9 | |
811 | 749 | } | |
812 | 750 | ||
813 | 751 | ||
814 | 752 | ||
815 | - | @Callable( | |
816 | - | func putOneTkn ( | |
817 | - | let | |
818 | - | let | |
819 | - | if ($isInstanceOf( | |
820 | - | then | |
821 | - | else throw(($getType( | |
753 | + | @Callable(df) | |
754 | + | func putOneTkn (eQ,eR) = { | |
755 | + | let eS = { | |
756 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
757 | + | if ($isInstanceOf(aD, "Boolean")) | |
758 | + | then aD | |
759 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
822 | 760 | } | |
823 | - | let | |
761 | + | let eT = if (if (if (aF()) | |
824 | 762 | then true | |
825 | - | else ( | |
763 | + | else (aS == l)) | |
826 | 764 | then true | |
827 | - | else ( | |
765 | + | else (aS == n)) | |
828 | 766 | then true | |
829 | - | else | |
830 | - | let | |
767 | + | else eS | |
768 | + | let ee = [if (if (!(eT)) | |
831 | 769 | then true | |
832 | - | else | |
770 | + | else ey(df)) | |
833 | 771 | then true | |
834 | - | else | |
772 | + | else ay("put operation is blocked by admin"), if ((size(df.payments) == 1)) | |
835 | 773 | then true | |
836 | - | else | |
837 | - | if (( | |
774 | + | else ay("exactly 1 payment are expected")] | |
775 | + | if ((ee == ee)) | |
838 | 776 | then { | |
839 | - | let fu = dC.payments[0] | |
840 | - | let dT = fu.assetId | |
841 | - | let dS = fu.amount | |
842 | - | let dk = if ((dT == bc)) | |
843 | - | then dd(toBigInt(dS), toBigInt(0), toBigInt(0)) | |
844 | - | else if ((dT == bd)) | |
845 | - | then dd(toBigInt(0), toBigInt(dS), toBigInt(0)) | |
846 | - | else aI("payment asset is not supported") | |
847 | - | if ((dk == dk)) | |
777 | + | let eU = df.payments[0] | |
778 | + | let dx = eU.assetId | |
779 | + | let dw = eU.amount | |
780 | + | let X = df.caller | |
781 | + | let Y = df.transactionId | |
782 | + | let eV = dv(dw, dx, X, Y) | |
783 | + | if ((eV == eV)) | |
848 | 784 | then { | |
849 | - | let Z = dC.caller | |
850 | - | let aa = dC.transactionId | |
851 | - | let fv = dR(dS, dT, Z, aa) | |
852 | - | if ((fv == fv)) | |
785 | + | let eW = eV._4 | |
786 | + | let du = eV._3 | |
787 | + | let cP = eV._2 | |
788 | + | let eX = eV._1 | |
789 | + | let eY = if (if ((eQ > 0)) | |
790 | + | then (eQ > eX) | |
791 | + | else false) | |
792 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
793 | + | else eX | |
794 | + | let do = dm(eY) | |
795 | + | if ((do == do)) | |
853 | 796 | then { | |
854 | - | let dX = fv._5 | |
855 | - | let fw = fv._4 | |
856 | - | let dQ = fv._3 | |
857 | - | let cY = fv._2 | |
858 | - | let fx = fv._1 | |
859 | - | let fy = if (if ((fp > 0)) | |
860 | - | then (fp > fx) | |
797 | + | let eN = if (eR) | |
798 | + | then { | |
799 | + | let eZ = invoke(aZ, "stake", nil, [AttachedPayment(aT, eY)]) | |
800 | + | if ((eZ == eZ)) | |
801 | + | then nil | |
802 | + | else throw("Strict value is not equal to itself.") | |
803 | + | } | |
804 | + | else [ScriptTransfer(df.caller, eY, aT)] | |
805 | + | let fa = if ((du > 0)) | |
806 | + | then [ScriptTransfer(aB, du, dx)] | |
807 | + | else nil | |
808 | + | $Tuple2(((cP ++ eN) ++ fa), eY) | |
809 | + | } | |
810 | + | else throw("Strict value is not equal to itself.") | |
811 | + | } | |
812 | + | else throw("Strict value is not equal to itself.") | |
813 | + | } | |
814 | + | else throw("Strict value is not equal to itself.") | |
815 | + | } | |
816 | + | ||
817 | + | ||
818 | + | ||
819 | + | @Callable(df) | |
820 | + | func putOneTknREADONLY (dx,dw) = { | |
821 | + | let fb = dv(dw, aK(dx), unit, unit) | |
822 | + | let eX = fb._1 | |
823 | + | let cP = fb._2 | |
824 | + | let du = fb._3 | |
825 | + | let eW = fb._4 | |
826 | + | $Tuple2(nil, $Tuple3(eX, du, eW)) | |
827 | + | } | |
828 | + | ||
829 | + | ||
830 | + | ||
831 | + | @Callable(df) | |
832 | + | func getOneTkn (fc,eQ) = { | |
833 | + | let eS = { | |
834 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
835 | + | if ($isInstanceOf(aD, "Boolean")) | |
836 | + | then aD | |
837 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
838 | + | } | |
839 | + | let fd = if (if (aF()) | |
840 | + | then true | |
841 | + | else (aS == n)) | |
842 | + | then true | |
843 | + | else eS | |
844 | + | let ee = [if (if (!(fd)) | |
845 | + | then true | |
846 | + | else ey(df)) | |
847 | + | then true | |
848 | + | else ay("get operation is blocked by admin"), if ((size(df.payments) == 1)) | |
849 | + | then true | |
850 | + | else ay("exactly 1 payment are expected")] | |
851 | + | if ((ee == ee)) | |
852 | + | then { | |
853 | + | let ed = aK(fc) | |
854 | + | let eU = df.payments[0] | |
855 | + | let dx = eU.assetId | |
856 | + | let dL = eU.amount | |
857 | + | let X = df.caller | |
858 | + | let Y = df.transactionId | |
859 | + | let fe = ec(ed, dL, dx, X, Y) | |
860 | + | if ((fe == fe)) | |
861 | + | then { | |
862 | + | let eW = fe._4 | |
863 | + | let du = fe._3 | |
864 | + | let cP = fe._2 | |
865 | + | let ff = fe._1 | |
866 | + | let dn = if (if ((eQ > 0)) | |
867 | + | then (eQ > ff) | |
868 | + | else false) | |
869 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
870 | + | else ff | |
871 | + | let fg = invoke(aA, "burn", [dL], [AttachedPayment(dx, dL)]) | |
872 | + | if ((fg == fg)) | |
873 | + | then { | |
874 | + | let fh = [ScriptTransfer(X, dn, ed)] | |
875 | + | let fa = if ((du > 0)) | |
876 | + | then [ScriptTransfer(aB, du, ed)] | |
877 | + | else nil | |
878 | + | $Tuple2(((cP ++ fh) ++ fa), dn) | |
879 | + | } | |
880 | + | else throw("Strict value is not equal to itself.") | |
881 | + | } | |
882 | + | else throw("Strict value is not equal to itself.") | |
883 | + | } | |
884 | + | else throw("Strict value is not equal to itself.") | |
885 | + | } | |
886 | + | ||
887 | + | ||
888 | + | ||
889 | + | @Callable(df) | |
890 | + | func getOneTknREADONLY (ed,dL) = { | |
891 | + | let fi = ec(aK(ed), dL, aT, unit, unit) | |
892 | + | let ff = fi._1 | |
893 | + | let cP = fi._2 | |
894 | + | let du = fi._3 | |
895 | + | let eW = fi._4 | |
896 | + | $Tuple2(nil, $Tuple3(ff, du, eW)) | |
897 | + | } | |
898 | + | ||
899 | + | ||
900 | + | ||
901 | + | @Callable(df) | |
902 | + | func unstakeAndGetOneTkn (fj,fc,eQ) = { | |
903 | + | let eS = { | |
904 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
905 | + | if ($isInstanceOf(aD, "Boolean")) | |
906 | + | then aD | |
907 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
908 | + | } | |
909 | + | let fd = if (if (aF()) | |
910 | + | then true | |
911 | + | else (aS == n)) | |
912 | + | then true | |
913 | + | else eS | |
914 | + | let ee = [if (if (!(fd)) | |
915 | + | then true | |
916 | + | else ey(df)) | |
917 | + | then true | |
918 | + | else ay("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
919 | + | then true | |
920 | + | else ay("no payments are expected")] | |
921 | + | if ((ee == ee)) | |
922 | + | then { | |
923 | + | let ed = aK(fc) | |
924 | + | let X = df.caller | |
925 | + | let Y = df.transactionId | |
926 | + | let fk = invoke(aZ, "unstake", [toBase58String(aT), fj], nil) | |
927 | + | if ((fk == fk)) | |
928 | + | then { | |
929 | + | let fl = ec(ed, fj, aT, X, Y) | |
930 | + | if ((fl == fl)) | |
931 | + | then { | |
932 | + | let eW = fl._4 | |
933 | + | let du = fl._3 | |
934 | + | let cP = fl._2 | |
935 | + | let ff = fl._1 | |
936 | + | let dn = if (if ((eQ > 0)) | |
937 | + | then (eQ > ff) | |
861 | 938 | else false) | |
862 | - | then | |
863 | - | else | |
864 | - | let | |
865 | - | if (( | |
939 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
940 | + | else ff | |
941 | + | let fg = invoke(aA, "burn", [fj], [AttachedPayment(aT, fj)]) | |
942 | + | if ((fg == fg)) | |
866 | 943 | then { | |
867 | - | let fi = if (fq) | |
868 | - | then { | |
869 | - | let fz = invoke(bh, "stake", nil, [AttachedPayment(bb, fy)]) | |
870 | - | if ((fz == fz)) | |
871 | - | then nil | |
872 | - | else throw("Strict value is not equal to itself.") | |
873 | - | } | |
874 | - | else [ScriptTransfer(dC.caller, fy, bb)] | |
875 | - | let fA = if ((dQ > 0)) | |
876 | - | then [ScriptTransfer(aM, dQ, dT)] | |
944 | + | let fh = [ScriptTransfer(df.caller, dn, ed)] | |
945 | + | let fa = if ((du > 0)) | |
946 | + | then [ScriptTransfer(aB, du, ed)] | |
877 | 947 | else nil | |
878 | - | let fB = if ((this == aM)) | |
879 | - | then $Tuple2(0, 0) | |
880 | - | else if (dX) | |
881 | - | then $Tuple2(-(dQ), 0) | |
882 | - | else $Tuple2(0, -(dQ)) | |
883 | - | let dm = fB._1 | |
884 | - | let dn = fB._2 | |
885 | - | let fC = dl(dm, dn, 0) | |
886 | - | let fl = fC._1 | |
887 | - | let dc = fC._2 | |
888 | - | let dw = value(getString(ah)) | |
889 | - | let fm = dp(dk, dc) | |
890 | - | if ((fm == fm)) | |
891 | - | then $Tuple2((((cY ++ fi) ++ fA) ++ fl), fy) | |
892 | - | else throw("Strict value is not equal to itself.") | |
948 | + | $Tuple2(((cP ++ fh) ++ fa), dn) | |
893 | 949 | } | |
894 | 950 | else throw("Strict value is not equal to itself.") | |
895 | 951 | } | |
902 | 958 | ||
903 | 959 | ||
904 | 960 | ||
905 | - | @Callable(dC) | |
906 | - | func putOneTknREADONLY (dT,dS) = { | |
907 | - | let fD = dR(dS, aS(dT), unit, unit) | |
908 | - | let fx = fD._1 | |
909 | - | let cY = fD._2 | |
910 | - | let dQ = fD._3 | |
911 | - | let fw = fD._4 | |
912 | - | let dX = fD._5 | |
913 | - | $Tuple2(nil, $Tuple3(fx, dQ, fw)) | |
961 | + | @Callable(df) | |
962 | + | func get () = { | |
963 | + | let cA = de(df) | |
964 | + | let fm = cA._1 | |
965 | + | let ch = cA._2 | |
966 | + | let dh = cA._3 | |
967 | + | let bP = cA._4 | |
968 | + | let ci = cA._5 | |
969 | + | let fn = invoke(aA, "burn", [dh], [AttachedPayment(bP, dh)]) | |
970 | + | if ((fn == fn)) | |
971 | + | then ci | |
972 | + | else throw("Strict value is not equal to itself.") | |
914 | 973 | } | |
915 | 974 | ||
916 | 975 | ||
917 | 976 | ||
918 | - | @Callable(dC) | |
919 | - | func getOneTkn (fE,fp) = { | |
920 | - | let fr = { | |
921 | - | let fs = invoke(aL, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
922 | - | if ($isInstanceOf(fs, "Boolean")) | |
923 | - | then fs | |
924 | - | else throw(($getType(fs) + " couldn't be cast to Boolean")) | |
925 | - | } | |
926 | - | let fF = if (if (aN()) | |
927 | - | then true | |
928 | - | else (ba == n)) | |
929 | - | then true | |
930 | - | else fr | |
931 | - | let ey = [if (if (!(fF)) | |
932 | - | then true | |
933 | - | else eT(dC)) | |
934 | - | then true | |
935 | - | else aI("get operation is blocked by admin"), if ((size(dC.payments) == 1)) | |
936 | - | then true | |
937 | - | else aI("exactly 1 payment are expected")] | |
938 | - | if ((ey == ey)) | |
977 | + | @Callable(df) | |
978 | + | func getNoLess (fo,fp) = { | |
979 | + | let cA = de(df) | |
980 | + | let cg = cA._1 | |
981 | + | let ch = cA._2 | |
982 | + | let dh = cA._3 | |
983 | + | let bP = cA._4 | |
984 | + | let ci = cA._5 | |
985 | + | if ((fo > cg)) | |
986 | + | then throw(((("noLessThenAmtAsset failed: " + toString(cg)) + " < ") + toString(fo))) | |
987 | + | else if ((fp > ch)) | |
988 | + | then throw(((("noLessThenPriceAsset failed: " + toString(ch)) + " < ") + toString(fp))) | |
989 | + | else { | |
990 | + | let fn = invoke(aA, "burn", [dh], [AttachedPayment(bP, dh)]) | |
991 | + | if ((fn == fn)) | |
992 | + | then ci | |
993 | + | else throw("Strict value is not equal to itself.") | |
994 | + | } | |
995 | + | } | |
996 | + | ||
997 | + | ||
998 | + | ||
999 | + | @Callable(df) | |
1000 | + | func unstakeAndGet (dn) = { | |
1001 | + | let fq = if ((size(df.payments) != 0)) | |
1002 | + | then throw("No payments are expected") | |
1003 | + | else true | |
1004 | + | if ((fq == fq)) | |
939 | 1005 | then { | |
940 | - | let ex = aS(fE) | |
941 | - | let fu = dC.payments[0] | |
942 | - | let dT = fu.assetId | |
943 | - | let ef = fu.amount | |
944 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
945 | - | if ((dk == dk)) | |
1006 | + | let bE = aH() | |
1007 | + | let bR = fromBase58String(bE[q]) | |
1008 | + | let fk = invoke(aZ, "unstake", [toBase58String(bR), dn], nil) | |
1009 | + | if ((fk == fk)) | |
946 | 1010 | then { | |
947 | - | let Z = dC.caller | |
948 | - | let aa = dC.transactionId | |
949 | - | let fG = ew(ex, ef, dT, Z, aa) | |
950 | - | if ((fG == fG)) | |
1011 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(bR), dn, df.caller) | |
1012 | + | let bU = parseIntValue(cA._9) | |
1013 | + | let ci = cA._10 | |
1014 | + | let fr = if (if (aF()) | |
1015 | + | then true | |
1016 | + | else (bU == n)) | |
1017 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bU))) | |
1018 | + | else true | |
1019 | + | if ((fr == fr)) | |
951 | 1020 | then { | |
952 | - | let ez = fG._5 | |
953 | - | let fw = fG._4 | |
954 | - | let dQ = fG._3 | |
955 | - | let cY = fG._2 | |
956 | - | let fH = fG._1 | |
957 | - | let dK = if (if ((fp > 0)) | |
958 | - | then (fp > fH) | |
959 | - | else false) | |
960 | - | then aI(makeString(["amount to receive is less than ", toString(fp)], "")) | |
961 | - | else fH | |
962 | - | let fI = invoke(aL, "burn", [ef], [AttachedPayment(dT, ef)]) | |
963 | - | if ((fI == fI)) | |
964 | - | then { | |
965 | - | let fJ = [ScriptTransfer(Z, dK, ex)] | |
966 | - | let fA = if ((dQ > 0)) | |
967 | - | then [ScriptTransfer(aM, dQ, ex)] | |
968 | - | else nil | |
969 | - | let fK = { | |
970 | - | let fL = if ((this == aM)) | |
971 | - | then 0 | |
972 | - | else dQ | |
973 | - | if (ez) | |
974 | - | then $Tuple2(-((dK + fL)), 0) | |
975 | - | else $Tuple2(0, -((dK + fL))) | |
976 | - | } | |
977 | - | let dm = fK._1 | |
978 | - | let dn = fK._2 | |
979 | - | let fM = dl(dm, dn, 0) | |
980 | - | let fl = fM._1 | |
981 | - | let dc = fM._2 | |
982 | - | let fm = dp(dk, dc) | |
983 | - | if ((fm == fm)) | |
984 | - | then $Tuple2((((cY ++ fJ) ++ fA) ++ fl), dK) | |
985 | - | else throw("Strict value is not equal to itself.") | |
986 | - | } | |
1021 | + | let fn = invoke(aA, "burn", [dn], [AttachedPayment(bR, dn)]) | |
1022 | + | if ((fn == fn)) | |
1023 | + | then ci | |
987 | 1024 | else throw("Strict value is not equal to itself.") | |
988 | 1025 | } | |
989 | 1026 | else throw("Strict value is not equal to itself.") | |
995 | 1032 | ||
996 | 1033 | ||
997 | 1034 | ||
998 | - | @Callable(dC) | |
999 | - | func getOneTknREADONLY (ex,ef) = { | |
1000 | - | let fN = ew(aS(ex), ef, bb, unit, unit) | |
1001 | - | let fH = fN._1 | |
1002 | - | let cY = fN._2 | |
1003 | - | let dQ = fN._3 | |
1004 | - | let fw = fN._4 | |
1005 | - | let ez = fN._5 | |
1006 | - | $Tuple2(nil, $Tuple3(fH, dQ, fw)) | |
1007 | - | } | |
1008 | - | ||
1009 | - | ||
1010 | - | ||
1011 | - | @Callable(dC) | |
1012 | - | func unstakeAndGetOneTkn (fO,fE,fp) = { | |
1013 | - | let fr = { | |
1014 | - | let fs = invoke(aL, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1015 | - | if ($isInstanceOf(fs, "Boolean")) | |
1016 | - | then fs | |
1017 | - | else throw(($getType(fs) + " couldn't be cast to Boolean")) | |
1018 | - | } | |
1019 | - | let fF = if (if (aN()) | |
1035 | + | @Callable(df) | |
1036 | + | func unstakeAndGetNoLess (fj,fs,fp) = { | |
1037 | + | let fd = if (aF()) | |
1020 | 1038 | then true | |
1021 | - | else (ba == n)) | |
1039 | + | else (aS == n) | |
1040 | + | let ee = [if (!(fd)) | |
1022 | 1041 | then true | |
1023 | - | else fr | |
1024 | - | let ey = [if (if (!(fF)) | |
1042 | + | else throw("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
1025 | 1043 | then true | |
1026 | - | else eT(dC)) | |
1027 | - | then true | |
1028 | - | else aI("get operation is blocked by admin"), if ((size(dC.payments) == 0)) | |
1029 | - | then true | |
1030 | - | else aI("no payments are expected")] | |
1031 | - | if ((ey == ey)) | |
1044 | + | else throw("no payments are expected")] | |
1045 | + | if ((ee == ee)) | |
1032 | 1046 | then { | |
1033 | - | let ex = aS(fE) | |
1034 | - | let Z = dC.caller | |
1035 | - | let aa = dC.transactionId | |
1036 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1037 | - | if ((dk == dk)) | |
1047 | + | let fk = invoke(aZ, "unstake", [toBase58String(aT), fj], nil) | |
1048 | + | if ((fk == fk)) | |
1038 | 1049 | then { | |
1039 | - | let fP = invoke(bh, "unstake", [toBase58String(bb), fO], nil) | |
1040 | - | if ((fP == fP)) | |
1050 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(aT), fj, df.caller) | |
1051 | + | let cg = cA._1 | |
1052 | + | let ch = cA._2 | |
1053 | + | let ci = cA._10 | |
1054 | + | let ft = [if ((cg >= fs)) | |
1055 | + | then true | |
1056 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(fs)], "")), if ((ch >= fp)) | |
1057 | + | then true | |
1058 | + | else throw(makeString(["price asset amount to receive is less than ", toString(fp)], ""))] | |
1059 | + | if ((ft == ft)) | |
1041 | 1060 | then { | |
1042 | - | let fQ = ew(ex, fO, bb, Z, aa) | |
1043 | - | if ((fQ == fQ)) | |
1044 | - | then { | |
1045 | - | let ez = fQ._5 | |
1046 | - | let fw = fQ._4 | |
1047 | - | let dQ = fQ._3 | |
1048 | - | let cY = fQ._2 | |
1049 | - | let fH = fQ._1 | |
1050 | - | let dK = if (if ((fp > 0)) | |
1051 | - | then (fp > fH) | |
1052 | - | else false) | |
1053 | - | then aI(makeString(["amount to receive is less than ", toString(fp)], "")) | |
1054 | - | else fH | |
1055 | - | let fI = invoke(aL, "burn", [fO], [AttachedPayment(bb, fO)]) | |
1056 | - | if ((fI == fI)) | |
1057 | - | then { | |
1058 | - | let fJ = [ScriptTransfer(dC.caller, dK, ex)] | |
1059 | - | let fA = if ((dQ > 0)) | |
1060 | - | then [ScriptTransfer(aM, dQ, ex)] | |
1061 | - | else nil | |
1062 | - | let fR = { | |
1063 | - | let fL = if ((this == aM)) | |
1064 | - | then 0 | |
1065 | - | else dQ | |
1066 | - | if (ez) | |
1067 | - | then $Tuple2(-((dK + fL)), 0) | |
1068 | - | else $Tuple2(0, -((dK + fL))) | |
1069 | - | } | |
1070 | - | let dm = fR._1 | |
1071 | - | let dn = fR._2 | |
1072 | - | let fS = dl(dm, dn, 0) | |
1073 | - | let fl = fS._1 | |
1074 | - | let dc = fS._2 | |
1075 | - | let fm = dp(dk, dc) | |
1076 | - | if ((fm == fm)) | |
1077 | - | then $Tuple2((((cY ++ fJ) ++ fA) ++ fl), dK) | |
1078 | - | else throw("Strict value is not equal to itself.") | |
1079 | - | } | |
1080 | - | else throw("Strict value is not equal to itself.") | |
1081 | - | } | |
1061 | + | let fn = invoke(aA, "burn", [fj], [AttachedPayment(aT, fj)]) | |
1062 | + | if ((fn == fn)) | |
1063 | + | then ci | |
1082 | 1064 | else throw("Strict value is not equal to itself.") | |
1083 | 1065 | } | |
1084 | 1066 | else throw("Strict value is not equal to itself.") | |
1090 | 1072 | ||
1091 | 1073 | ||
1092 | 1074 | ||
1093 | - | @Callable(dC) | |
1094 | - | func get () = { | |
1095 | - | let cJ = dB(dC) | |
1096 | - | let fT = cJ._1 | |
1097 | - | let cq = cJ._2 | |
1098 | - | let dE = cJ._3 | |
1099 | - | let bY = cJ._4 | |
1100 | - | let cr = cJ._5 | |
1101 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1102 | - | if ((dk == dk)) | |
1103 | - | then { | |
1104 | - | let fU = invoke(aL, "burn", [dE], [AttachedPayment(bY, dE)]) | |
1105 | - | if ((fU == fU)) | |
1106 | - | then { | |
1107 | - | let fV = dl(-(fT), -(cq), 0) | |
1108 | - | let fl = fV._1 | |
1109 | - | let dc = fV._2 | |
1110 | - | let fm = dp(dk, dc) | |
1111 | - | if ((fm == fm)) | |
1112 | - | then (cr ++ fl) | |
1113 | - | else throw("Strict value is not equal to itself.") | |
1114 | - | } | |
1115 | - | else throw("Strict value is not equal to itself.") | |
1116 | - | } | |
1117 | - | else throw("Strict value is not equal to itself.") | |
1075 | + | @Callable(df) | |
1076 | + | func activate (fu,fv) = if ((toString(df.caller) != toString(aA))) | |
1077 | + | then throw("permissions denied") | |
1078 | + | else $Tuple2([StringEntry(aa(), fu), StringEntry(ab(), fv)], "success") | |
1079 | + | ||
1080 | + | ||
1081 | + | ||
1082 | + | @Callable(df) | |
1083 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aH()) | |
1084 | + | ||
1085 | + | ||
1086 | + | ||
1087 | + | @Callable(df) | |
1088 | + | func getAccBalanceWrapperREADONLY (br) = $Tuple2(nil, bq(br)) | |
1089 | + | ||
1090 | + | ||
1091 | + | ||
1092 | + | @Callable(df) | |
1093 | + | func calcPricesWrapperREADONLY (by,bz,bD) = { | |
1094 | + | let bM = bC(by, bz, bD) | |
1095 | + | $Tuple2(nil, [toString(bM[0]), toString(bM[1]), toString(bM[2])]) | |
1118 | 1096 | } | |
1119 | 1097 | ||
1120 | 1098 | ||
1121 | 1099 | ||
1122 | - | @Callable(dC) | |
1123 | - | func getNoLess (fW,fX) = { | |
1124 | - | let cJ = dB(dC) | |
1125 | - | let cp = cJ._1 | |
1126 | - | let cq = cJ._2 | |
1127 | - | let dE = cJ._3 | |
1128 | - | let bY = cJ._4 | |
1129 | - | let cr = cJ._5 | |
1130 | - | if ((fW > cp)) | |
1131 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cp)) + " < ") + toString(fW))) | |
1132 | - | else if ((fX > cq)) | |
1133 | - | then throw(((("noLessThenPriceAsset failed: " + toString(cq)) + " < ") + toString(fX))) | |
1134 | - | else { | |
1135 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1136 | - | if ((dk == dk)) | |
1137 | - | then { | |
1138 | - | let fU = invoke(aL, "burn", [dE], [AttachedPayment(bY, dE)]) | |
1139 | - | if ((fU == fU)) | |
1140 | - | then { | |
1141 | - | let fY = dl(-(cp), -(cq), 0) | |
1142 | - | let fl = fY._1 | |
1143 | - | let dc = fY._2 | |
1144 | - | let fm = dp(dk, dc) | |
1145 | - | if ((fm == fm)) | |
1146 | - | then (cr ++ fl) | |
1147 | - | else throw("Strict value is not equal to itself.") | |
1148 | - | } | |
1149 | - | else throw("Strict value is not equal to itself.") | |
1150 | - | } | |
1151 | - | else throw("Strict value is not equal to itself.") | |
1152 | - | } | |
1100 | + | @Callable(df) | |
1101 | + | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1102 | + | ||
1103 | + | ||
1104 | + | ||
1105 | + | @Callable(df) | |
1106 | + | func fromX18WrapperREADONLY (H,I) = $Tuple2(nil, G(parseBigIntValue(H), I)) | |
1107 | + | ||
1108 | + | ||
1109 | + | ||
1110 | + | @Callable(df) | |
1111 | + | func calcPriceBigIntWrapperREADONLY (bt,bu) = $Tuple2(nil, toString(bs(parseBigIntValue(bt), parseBigIntValue(bu)))) | |
1112 | + | ||
1113 | + | ||
1114 | + | ||
1115 | + | @Callable(df) | |
1116 | + | func estimatePutOperationWrapperREADONLY (bO,ck,cl,cm,cn,co,X,cp,cq) = $Tuple2(nil, cj(bO, ck, cl, cm, cn, co, X, cp, cq)) | |
1117 | + | ||
1118 | + | ||
1119 | + | ||
1120 | + | @Callable(df) | |
1121 | + | func estimateGetOperationWrapperREADONLY (bO,bP,bQ,X) = { | |
1122 | + | let cA = bN(bO, bP, bQ, addressFromStringValue(X)) | |
1123 | + | $Tuple2(nil, $Tuple10(cA._1, cA._2, cA._3, cA._4, cA._5, cA._6, cA._7, toString(cA._8), cA._9, cA._10)) | |
1153 | 1124 | } | |
1154 | 1125 | ||
1155 | 1126 | ||
1156 | 1127 | ||
1157 | - | @Callable(dC) | |
1158 | - | func unstakeAndGet (dK) = { | |
1159 | - | let fZ = if ((size(dC.payments) != 0)) | |
1160 | - | then throw("No payments are expected") | |
1161 | - | else true | |
1162 | - | if ((fZ == fZ)) | |
1163 | - | then { | |
1164 | - | let bN = aP() | |
1165 | - | let ca = fromBase58String(bN[q]) | |
1166 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1167 | - | if ((dk == dk)) | |
1168 | - | then { | |
1169 | - | let fP = invoke(bh, "unstake", [toBase58String(ca), dK], nil) | |
1170 | - | if ((fP == fP)) | |
1171 | - | then { | |
1172 | - | let cJ = bW(toBase58String(dC.transactionId), toBase58String(ca), dK, dC.caller) | |
1173 | - | let cp = cJ._1 | |
1174 | - | let cq = cJ._2 | |
1175 | - | let cd = parseIntValue(cJ._9) | |
1176 | - | let cr = cJ._10 | |
1177 | - | let ga = if (if (aN()) | |
1178 | - | then true | |
1179 | - | else (cd == n)) | |
1180 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cd))) | |
1181 | - | else true | |
1182 | - | if ((ga == ga)) | |
1183 | - | then { | |
1184 | - | let fU = invoke(aL, "burn", [dK], [AttachedPayment(ca, dK)]) | |
1185 | - | if ((fU == fU)) | |
1186 | - | then { | |
1187 | - | let gb = dl(-(cp), -(cq), 0) | |
1188 | - | let fl = gb._1 | |
1189 | - | let dc = gb._2 | |
1190 | - | let fm = dp(dk, dc) | |
1191 | - | if ((fm == fm)) | |
1192 | - | then (cr ++ fl) | |
1193 | - | else throw("Strict value is not equal to itself.") | |
1194 | - | } | |
1195 | - | else throw("Strict value is not equal to itself.") | |
1196 | - | } | |
1197 | - | else throw("Strict value is not equal to itself.") | |
1198 | - | } | |
1199 | - | else throw("Strict value is not equal to itself.") | |
1200 | - | } | |
1201 | - | else throw("Strict value is not equal to itself.") | |
1202 | - | } | |
1203 | - | else throw("Strict value is not equal to itself.") | |
1128 | + | @Callable(df) | |
1129 | + | func statsREADONLY () = { | |
1130 | + | let bE = aH() | |
1131 | + | let bR = fromBase58String(bE[q]) | |
1132 | + | let cS = bE[r] | |
1133 | + | let cT = bE[s] | |
1134 | + | let ct = bE[v] | |
1135 | + | let cu = bE[w] | |
1136 | + | let bF = parseIntValue(bE[t]) | |
1137 | + | let bG = parseIntValue(bE[u]) | |
1138 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1139 | + | let cU = bq(cS) | |
1140 | + | let cV = bq(cT) | |
1141 | + | let fx = if ((fw == 0)) | |
1142 | + | then [e, e, e] | |
1143 | + | else bC(cU, cV, fw) | |
1144 | + | let cb = 0 | |
1145 | + | let fy = G(fx[1], b) | |
1146 | + | let fz = G(fx[2], b) | |
1147 | + | let fA = value(getInteger(aA, am(toString(this)))) | |
1148 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cU), toString(cV), toString(fw), toString(cb), toString(fy), toString(fz), toString(fA)], j)) | |
1204 | 1149 | } | |
1205 | 1150 | ||
1206 | 1151 | ||
1207 | 1152 | ||
1208 | - | @Callable(dC) | |
1209 | - | func unstakeAndGetNoLess (fO,gc,fX) = { | |
1210 | - | let fF = if (aN()) | |
1211 | - | then true | |
1212 | - | else (ba == n) | |
1213 | - | let ey = [if (!(fF)) | |
1214 | - | then true | |
1215 | - | else throw("get operation is blocked by admin"), if ((size(dC.payments) == 0)) | |
1216 | - | then true | |
1217 | - | else throw("no payments are expected")] | |
1218 | - | if ((ey == ey)) | |
1219 | - | then { | |
1220 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1221 | - | if ((dk == dk)) | |
1222 | - | then { | |
1223 | - | let fP = invoke(bh, "unstake", [toBase58String(bb), fO], nil) | |
1224 | - | if ((fP == fP)) | |
1225 | - | then { | |
1226 | - | let cJ = bW(toBase58String(dC.transactionId), toBase58String(bb), fO, dC.caller) | |
1227 | - | let cp = cJ._1 | |
1228 | - | let cq = cJ._2 | |
1229 | - | let cr = cJ._10 | |
1230 | - | let gd = [if ((cp >= gc)) | |
1231 | - | then true | |
1232 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(gc)], "")), if ((cq >= fX)) | |
1233 | - | then true | |
1234 | - | else throw(makeString(["price asset amount to receive is less than ", toString(fX)], ""))] | |
1235 | - | if ((gd == gd)) | |
1236 | - | then { | |
1237 | - | let fU = invoke(aL, "burn", [fO], [AttachedPayment(bb, fO)]) | |
1238 | - | if ((fU == fU)) | |
1239 | - | then { | |
1240 | - | let ge = dl(-(cp), -(cq), 0) | |
1241 | - | let fl = ge._1 | |
1242 | - | let dc = ge._2 | |
1243 | - | let fm = dp(dk, dc) | |
1244 | - | if ((fm == fm)) | |
1245 | - | then (cr ++ fl) | |
1246 | - | else throw("Strict value is not equal to itself.") | |
1247 | - | } | |
1248 | - | else throw("Strict value is not equal to itself.") | |
1249 | - | } | |
1250 | - | else throw("Strict value is not equal to itself.") | |
1251 | - | } | |
1252 | - | else throw("Strict value is not equal to itself.") | |
1253 | - | } | |
1254 | - | else throw("Strict value is not equal to itself.") | |
1255 | - | } | |
1256 | - | else throw("Strict value is not equal to itself.") | |
1153 | + | @Callable(df) | |
1154 | + | func evaluatePutByAmountAssetREADONLY (cl) = { | |
1155 | + | let bE = aH() | |
1156 | + | let bR = fromBase58String(bE[q]) | |
1157 | + | let cr = bE[r] | |
1158 | + | let bS = fromBase58String(cr) | |
1159 | + | let cs = bE[s] | |
1160 | + | let bT = fromBase58String(cs) | |
1161 | + | let bF = parseIntValue(bE[t]) | |
1162 | + | let bG = parseIntValue(bE[u]) | |
1163 | + | let bU = bE[p] | |
1164 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1165 | + | let cU = bq(cr) | |
1166 | + | let cV = bq(cs) | |
1167 | + | let bA = D(cU, bF) | |
1168 | + | let bB = D(cV, bG) | |
1169 | + | let ca = if ((fw == 0)) | |
1170 | + | then e | |
1171 | + | else bs(bB, bA) | |
1172 | + | let cx = D(cl, bF) | |
1173 | + | let cy = fraction(cx, ca, d) | |
1174 | + | let cn = G(cy, bG) | |
1175 | + | let dl = cj("", 500000, cl, bS, cn, bT, "", true, false) | |
1176 | + | let cI = dl._1 | |
1177 | + | let fB = dl._3 | |
1178 | + | let bW = dl._4 | |
1179 | + | let bY = dl._5 | |
1180 | + | let bV = dl._6 | |
1181 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cI), toString(G(ca, b)), toString(bW), toString(bY), toString(bV), bU, toString(cl), toString(cn)], j)) | |
1257 | 1182 | } | |
1258 | 1183 | ||
1259 | 1184 | ||
1260 | 1185 | ||
1261 | - | @Callable(dC) | |
1262 | - | func activate (gf,gg) = if ((toString(dC.caller) != toString(aL))) | |
1263 | - | then throw("permissions denied") | |
1264 | - | else $Tuple2([StringEntry(ac(), gf), StringEntry(ad(), gg)], "success") | |
1265 | - | ||
1266 | - | ||
1267 | - | ||
1268 | - | @Callable(dC) | |
1269 | - | func refreshKLp () = { | |
1270 | - | let gh = valueOrElse(getInteger(ai), 0) | |
1271 | - | let gi = if (((height - gh) >= al)) | |
1272 | - | then unit | |
1273 | - | else aI(makeString([toString(al), " blocks have not passed since the previous call"], "")) | |
1274 | - | if ((gi == gi)) | |
1275 | - | then { | |
1276 | - | let dw = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ah), "0")), aK("invalid kLp")) | |
1277 | - | let gj = dl(0, 0, 0) | |
1278 | - | let gk = gj._1 | |
1279 | - | let dc = gj._2 | |
1280 | - | let do = if ((dw != dc)) | |
1281 | - | then gk | |
1282 | - | else aI("nothing to refresh") | |
1283 | - | $Tuple2(do, toString(dc)) | |
1284 | - | } | |
1285 | - | else throw("Strict value is not equal to itself.") | |
1186 | + | @Callable(df) | |
1187 | + | func evaluatePutByPriceAssetREADONLY (cn) = { | |
1188 | + | let bE = aH() | |
1189 | + | let bR = fromBase58String(bE[q]) | |
1190 | + | let cr = bE[r] | |
1191 | + | let bS = fromBase58String(cr) | |
1192 | + | let cs = bE[s] | |
1193 | + | let bT = fromBase58String(cs) | |
1194 | + | let bF = parseIntValue(bE[t]) | |
1195 | + | let bG = parseIntValue(bE[u]) | |
1196 | + | let bU = bE[p] | |
1197 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1198 | + | let fC = bq(cr) | |
1199 | + | let fD = bq(cs) | |
1200 | + | let fE = D(fC, bF) | |
1201 | + | let fF = D(fD, bG) | |
1202 | + | let ca = if ((fw == 0)) | |
1203 | + | then e | |
1204 | + | else bs(fF, fE) | |
1205 | + | let cy = D(cn, bG) | |
1206 | + | let cx = fraction(cy, d, ca) | |
1207 | + | let cl = G(cx, bF) | |
1208 | + | let dl = cj("", 500000, cl, bS, cn, bT, "", true, false) | |
1209 | + | let cI = dl._1 | |
1210 | + | let fB = dl._3 | |
1211 | + | let bW = dl._4 | |
1212 | + | let bY = dl._5 | |
1213 | + | let bV = dl._6 | |
1214 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cI), toString(G(ca, b)), toString(bW), toString(bY), toString(bV), bU, toString(cl), toString(cn)], j)) | |
1286 | 1215 | } | |
1287 | 1216 | ||
1288 | 1217 | ||
1289 | 1218 | ||
1290 | - | @Callable(dC) | |
1291 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aP()) | |
1292 | - | ||
1293 | - | ||
1294 | - | ||
1295 | - | @Callable(dC) | |
1296 | - | func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz)) | |
1297 | - | ||
1298 | - | ||
1299 | - | ||
1300 | - | @Callable(dC) | |
1301 | - | func calcPricesWrapperREADONLY (bH,bI,bM) = { | |
1302 | - | let bV = bL(bH, bI, bM) | |
1303 | - | $Tuple2(nil, [toString(bV[0]), toString(bV[1]), toString(bV[2])]) | |
1219 | + | @Callable(df) | |
1220 | + | func evaluateGetREADONLY (fG,fH) = { | |
1221 | + | let cA = bN("", fG, fH, this) | |
1222 | + | let cg = cA._1 | |
1223 | + | let ch = cA._2 | |
1224 | + | let bW = cA._5 | |
1225 | + | let bY = cA._6 | |
1226 | + | let bV = cA._7 | |
1227 | + | let cb = cA._8 | |
1228 | + | let bU = parseIntValue(cA._9) | |
1229 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cg), toString(ch), toString(bW), toString(bY), toString(bV), toString(cb), toString(bU)], j)) | |
1304 | 1230 | } | |
1305 | 1231 | ||
1306 | 1232 | ||
1307 | - | ||
1308 | - | @Callable(dC) | |
1309 | - | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1310 | - | ||
1311 | - | ||
1312 | - | ||
1313 | - | @Callable(dC) | |
1314 | - | func fromX18WrapperREADONLY (H,I) = $Tuple2(nil, G(parseBigIntValue(H), I)) | |
1315 | - | ||
1316 | - | ||
1317 | - | ||
1318 | - | @Callable(dC) | |
1319 | - | func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC)))) | |
1320 | - | ||
1321 | - | ||
1322 | - | ||
1323 | - | @Callable(dC) | |
1324 | - | func estimatePutOperationWrapperREADONLY (bX,ct,cu,cv,cw,cx,Z,cy,cz) = $Tuple2(nil, cs(bX, ct, cu, cv, cw, cx, Z, cy, cz)) | |
1325 | - | ||
1326 | - | ||
1327 | - | ||
1328 | - | @Callable(dC) | |
1329 | - | func estimateGetOperationWrapperREADONLY (bX,bY,bZ,Z) = { | |
1330 | - | let cJ = bW(bX, bY, bZ, addressFromStringValue(Z)) | |
1331 | - | $Tuple2(nil, $Tuple10(cJ._1, cJ._2, cJ._3, cJ._4, cJ._5, cJ._6, cJ._7, toString(cJ._8), cJ._9, cJ._10)) | |
1332 | - | } | |
1333 | - | ||
1334 | - | ||
1335 | - | ||
1336 | - | @Callable(dC) | |
1337 | - | func statsREADONLY () = { | |
1338 | - | let bN = aP() | |
1339 | - | let ca = fromBase58String(bN[q]) | |
1340 | - | let gl = bN[r] | |
1341 | - | let gm = bN[s] | |
1342 | - | let cC = bN[v] | |
1343 | - | let cD = bN[w] | |
1344 | - | let bO = parseIntValue(bN[t]) | |
1345 | - | let bP = parseIntValue(bN[u]) | |
1346 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1347 | - | let go = by(gl) | |
1348 | - | let gp = by(gm) | |
1349 | - | let gq = if ((gn == 0)) | |
1350 | - | then [e, e, e] | |
1351 | - | else bL(go, gp, gn) | |
1352 | - | let ck = 0 | |
1353 | - | let gr = G(gq[1], b) | |
1354 | - | let gs = G(gq[2], b) | |
1355 | - | let gt = value(getInteger(aL, aw(toString(this)))) | |
1356 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(go), toString(gp), toString(gn), toString(ck), toString(gr), toString(gs), toString(gt)], j)) | |
1357 | - | } | |
1358 | - | ||
1359 | - | ||
1360 | - | ||
1361 | - | @Callable(dC) | |
1362 | - | func evaluatePutByAmountAssetREADONLY (cu) = { | |
1363 | - | let bN = aP() | |
1364 | - | let ca = fromBase58String(bN[q]) | |
1365 | - | let cA = bN[r] | |
1366 | - | let cb = fromBase58String(cA) | |
1367 | - | let cB = bN[s] | |
1368 | - | let cc = fromBase58String(cB) | |
1369 | - | let bO = parseIntValue(bN[t]) | |
1370 | - | let bP = parseIntValue(bN[u]) | |
1371 | - | let cd = bN[p] | |
1372 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1373 | - | let go = by(cA) | |
1374 | - | let gp = by(cB) | |
1375 | - | let bJ = D(go, bO) | |
1376 | - | let bK = D(gp, bP) | |
1377 | - | let cj = if ((gn == 0)) | |
1378 | - | then e | |
1379 | - | else bA(bK, bJ) | |
1380 | - | let cG = D(cu, bO) | |
1381 | - | let cH = fraction(cG, cj, d) | |
1382 | - | let cw = G(cH, bP) | |
1383 | - | let dI = cs("", 500000, cu, cb, cw, cc, "", true, false) | |
1384 | - | let cR = dI._1 | |
1385 | - | let gu = dI._3 | |
1386 | - | let cf = dI._4 | |
1387 | - | let ch = dI._5 | |
1388 | - | let ce = dI._6 | |
1389 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cR), toString(G(cj, b)), toString(cf), toString(ch), toString(ce), cd, toString(cu), toString(cw)], j)) | |
1390 | - | } | |
1391 | - | ||
1392 | - | ||
1393 | - | ||
1394 | - | @Callable(dC) | |
1395 | - | func evaluatePutByPriceAssetREADONLY (cw) = { | |
1396 | - | let bN = aP() | |
1397 | - | let ca = fromBase58String(bN[q]) | |
1398 | - | let cA = bN[r] | |
1399 | - | let cb = fromBase58String(cA) | |
1400 | - | let cB = bN[s] | |
1401 | - | let cc = fromBase58String(cB) | |
1402 | - | let bO = parseIntValue(bN[t]) | |
1403 | - | let bP = parseIntValue(bN[u]) | |
1404 | - | let cd = bN[p] | |
1405 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1406 | - | let gv = by(cA) | |
1407 | - | let gw = by(cB) | |
1408 | - | let gx = D(gv, bO) | |
1409 | - | let gy = D(gw, bP) | |
1410 | - | let cj = if ((gn == 0)) | |
1411 | - | then e | |
1412 | - | else bA(gy, gx) | |
1413 | - | let cH = D(cw, bP) | |
1414 | - | let cG = fraction(cH, d, cj) | |
1415 | - | let cu = G(cG, bO) | |
1416 | - | let dI = cs("", 500000, cu, cb, cw, cc, "", true, false) | |
1417 | - | let cR = dI._1 | |
1418 | - | let gu = dI._3 | |
1419 | - | let cf = dI._4 | |
1420 | - | let ch = dI._5 | |
1421 | - | let ce = dI._6 | |
1422 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cR), toString(G(cj, b)), toString(cf), toString(ch), toString(ce), cd, toString(cu), toString(cw)], j)) | |
1423 | - | } | |
1424 | - | ||
1425 | - | ||
1426 | - | ||
1427 | - | @Callable(dC) | |
1428 | - | func evaluateGetREADONLY (gz,gA) = { | |
1429 | - | let cJ = bW("", gz, gA, this) | |
1430 | - | let cp = cJ._1 | |
1431 | - | let cq = cJ._2 | |
1432 | - | let cf = cJ._5 | |
1433 | - | let ch = cJ._6 | |
1434 | - | let ce = cJ._7 | |
1435 | - | let ck = cJ._8 | |
1436 | - | let cd = parseIntValue(cJ._9) | |
1437 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cp), toString(cq), toString(cf), toString(ch), toString(ce), toString(ck), toString(cd)], j)) | |
1438 | - | } | |
1439 | - | ||
1440 | - | ||
1441 | - | @Verifier(gB) | |
1442 | - | func gC () = { | |
1443 | - | let gD = { | |
1444 | - | let dN = eQ() | |
1445 | - | if ($isInstanceOf(dN, "ByteVector")) | |
1233 | + | @Verifier(fI) | |
1234 | + | func fJ () = { | |
1235 | + | let fK = { | |
1236 | + | let dq = ev() | |
1237 | + | if ($isInstanceOf(dq, "ByteVector")) | |
1446 | 1238 | then { | |
1447 | - | let | |
1448 | - | | |
1239 | + | let ez = dq | |
1240 | + | ez | |
1449 | 1241 | } | |
1450 | - | else if ($isInstanceOf( | |
1451 | - | then | |
1242 | + | else if ($isInstanceOf(dq, "Unit")) | |
1243 | + | then fI.senderPublicKey | |
1452 | 1244 | else throw("Match error") | |
1453 | 1245 | } | |
1454 | - | let | |
1455 | - | if ($isInstanceOf( | |
1246 | + | let dq = fI | |
1247 | + | if ($isInstanceOf(dq, "Order")) | |
1456 | 1248 | then { | |
1457 | - | let | |
1458 | - | let | |
1459 | - | let | |
1460 | - | let | |
1461 | - | let | |
1462 | - | if (if (if ( | |
1463 | - | then | |
1249 | + | let cR = dq | |
1250 | + | let fL = aG() | |
1251 | + | let ar = cQ(cR) | |
1252 | + | let as = sigVerify(cR.bodyBytes, cR.proofs[0], cR.senderPublicKey) | |
1253 | + | let at = sigVerify(cR.bodyBytes, cR.proofs[1], fL) | |
1254 | + | if (if (if (ar) | |
1255 | + | then as | |
1464 | 1256 | else false) | |
1465 | - | then | |
1257 | + | then at | |
1466 | 1258 | else false) | |
1467 | 1259 | then true | |
1468 | - | else | |
1260 | + | else aq(ar, as, at) | |
1469 | 1261 | } | |
1470 | - | else if ($isInstanceOf( | |
1262 | + | else if ($isInstanceOf(dq, "SetScriptTransaction")) | |
1471 | 1263 | then { | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | if (if (( | |
1477 | - | then ( | |
1264 | + | let ew = dq | |
1265 | + | let fM = blake2b256(value(ew.script)) | |
1266 | + | let fN = fromBase64String(value(getString(aA, ao()))) | |
1267 | + | let fO = scriptHash(this) | |
1268 | + | if (if ((fN == fM)) | |
1269 | + | then (fO != fM) | |
1478 | 1270 | else false) | |
1479 | 1271 | then true | |
1480 | - | else sigVerify( | |
1272 | + | else sigVerify(fI.bodyBytes, fI.proofs[0], fK) | |
1481 | 1273 | } | |
1482 | - | else sigVerify( | |
1274 | + | else sigVerify(fI.bodyBytes, fI.proofs[0], fK) | |
1483 | 1275 | } | |
1484 | 1276 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 8 | |
5 | 5 | ||
6 | 6 | let b = 100000000 | |
7 | 7 | ||
8 | 8 | let c = toBigInt(100000000) | |
9 | 9 | ||
10 | 10 | let d = toBigInt(1000000000000000000) | |
11 | 11 | ||
12 | 12 | let e = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let f = toBigInt(0) | |
15 | 15 | ||
16 | 16 | let g = toBigInt(1) | |
17 | 17 | ||
18 | 18 | let h = toBigInt(2) | |
19 | 19 | ||
20 | 20 | let i = "WAVES" | |
21 | 21 | ||
22 | 22 | let j = "__" | |
23 | 23 | ||
24 | 24 | let k = 1 | |
25 | 25 | ||
26 | 26 | let l = 2 | |
27 | 27 | ||
28 | 28 | let m = 3 | |
29 | 29 | ||
30 | 30 | let n = 4 | |
31 | 31 | ||
32 | 32 | let o = 1 | |
33 | 33 | ||
34 | 34 | let p = 2 | |
35 | 35 | ||
36 | 36 | let q = 3 | |
37 | 37 | ||
38 | 38 | let r = 4 | |
39 | 39 | ||
40 | 40 | let s = 5 | |
41 | 41 | ||
42 | 42 | let t = 6 | |
43 | 43 | ||
44 | 44 | let u = 7 | |
45 | 45 | ||
46 | 46 | let v = 8 | |
47 | 47 | ||
48 | 48 | let w = 9 | |
49 | 49 | ||
50 | 50 | let x = 10 | |
51 | 51 | ||
52 | 52 | let y = 1 | |
53 | 53 | ||
54 | 54 | let z = 2 | |
55 | 55 | ||
56 | 56 | let A = 3 | |
57 | 57 | ||
58 | 58 | let B = 1 | |
59 | 59 | ||
60 | 60 | let C = 7 | |
61 | 61 | ||
62 | 62 | func D (E,F) = fraction(toBigInt(E), d, toBigInt(F)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func G (H,I) = toInt(fraction(H, toBigInt(I), d)) | |
66 | 66 | ||
67 | 67 | ||
68 | - | func J ( | |
68 | + | func J (K,L,M) = fraction(K, L, M) | |
69 | 69 | ||
70 | 70 | ||
71 | - | func L (M,N,O) = fraction(M, N, O) | |
72 | - | ||
73 | - | ||
74 | - | func P (H) = if ((0 > H)) | |
71 | + | func N (H) = if ((0 > H)) | |
75 | 72 | then -(H) | |
76 | 73 | else H | |
77 | 74 | ||
78 | 75 | ||
79 | - | func | |
76 | + | func O (H) = if ((e > H)) | |
80 | 77 | then -(H) | |
81 | 78 | else H | |
82 | 79 | ||
83 | 80 | ||
84 | - | func | |
81 | + | func P () = "%s__factoryContract" | |
85 | 82 | ||
86 | 83 | ||
87 | - | func | |
84 | + | func Q () = "%s__managerPublicKey" | |
88 | 85 | ||
89 | 86 | ||
90 | - | func | |
87 | + | func R () = "%s__pendingManagerPublicKey" | |
91 | 88 | ||
92 | 89 | ||
93 | - | func | |
90 | + | func S () = "%s%s__price__last" | |
94 | 91 | ||
95 | 92 | ||
96 | - | func | |
93 | + | func T (U,V) = makeString(["%s%s%d%d__price__history", toString(U), toString(V)], j) | |
97 | 94 | ||
98 | 95 | ||
99 | - | func | |
96 | + | func W (X,Y) = ((("%s%s%s__P__" + X) + "__") + Y) | |
100 | 97 | ||
101 | 98 | ||
102 | - | func | |
99 | + | func Z (X,Y) = ((("%s%s%s__G__" + X) + "__") + Y) | |
103 | 100 | ||
104 | 101 | ||
105 | - | func | |
102 | + | func aa () = "%s__amountAsset" | |
106 | 103 | ||
107 | 104 | ||
108 | - | func | |
105 | + | func ab () = "%s__priceAsset" | |
109 | 106 | ||
110 | 107 | ||
111 | - | let ae = "%s__fee" | |
112 | - | ||
113 | - | let af = fraction(10, b, 10000) | |
114 | - | ||
115 | - | let ag = valueOrElse(getInteger(this, ae), af) | |
116 | - | ||
117 | - | let ah = makeString(["%s", "kLp"], j) | |
118 | - | ||
119 | - | let ai = makeString(["%s", "kLpRefreshedHeight"], j) | |
120 | - | ||
121 | - | let aj = makeString(["%s", "refreshKLpDelay"], j) | |
122 | - | ||
123 | - | let ak = 30 | |
124 | - | ||
125 | - | let al = valueOrElse(getInteger(this, aj), ak) | |
126 | - | ||
127 | - | func am () = "%s__factoryConfig" | |
108 | + | func ac () = "%s__factoryConfig" | |
128 | 109 | ||
129 | 110 | ||
130 | - | func | |
111 | + | func ad () = "%s%s__matcher__publicKey" | |
131 | 112 | ||
132 | 113 | ||
133 | - | func | |
114 | + | func ae (af) = (("%s%s%s__" + af) + "__mappings__poolContract2LpAsset") | |
134 | 115 | ||
135 | 116 | ||
136 | - | func | |
117 | + | func ag (ah,ai) = (((("%d%d%s__" + ah) + "__") + ai) + "__config") | |
137 | 118 | ||
138 | 119 | ||
139 | - | func | |
120 | + | func aj (ak) = ("%s%s%s__mappings__baseAsset2internalId__" + ak) | |
140 | 121 | ||
141 | 122 | ||
142 | - | func | |
123 | + | func al () = "%s__shutdown" | |
143 | 124 | ||
144 | 125 | ||
145 | - | func | |
126 | + | func am (an) = ("%s%s__poolWeight__" + an) | |
146 | 127 | ||
147 | 128 | ||
148 | - | func | |
129 | + | func ao () = "%s__allowedLpScriptHash" | |
149 | 130 | ||
150 | 131 | ||
151 | - | let | |
132 | + | let ap = "%s__feeCollectorAddress" | |
152 | 133 | ||
153 | - | func | |
134 | + | func aq (ar,as,at) = throw(((((("order validation failed: orderValid=" + toString(ar)) + " senderValid=") + toString(as)) + " matcherValid=") + toString(at))) | |
154 | 135 | ||
155 | 136 | ||
156 | - | func | |
137 | + | func au (av,aw) = valueOrErrorMessage(getString(av, aw), makeString(["mandatory ", toString(av), ".", aw, " is not defined"], "")) | |
157 | 138 | ||
158 | 139 | ||
159 | - | func | |
140 | + | func ax (av,aw) = valueOrErrorMessage(getInteger(av, aw), makeString(["mandatory ", toString(av), ".", aw, " is not defined"], "")) | |
160 | 141 | ||
161 | 142 | ||
162 | - | func | |
143 | + | func ay (az) = throw(makeString(["lp.ride:", az], " ")) | |
163 | 144 | ||
164 | 145 | ||
165 | - | func aK (aJ) = makeString(["lp.ride:", aJ], " ") | |
146 | + | let aA = addressFromStringValue(au(this, P())) | |
147 | + | ||
148 | + | let aB = addressFromStringValue(au(aA, ap)) | |
149 | + | ||
150 | + | let aC = { | |
151 | + | let aD = invoke(aA, "getInFeeREADONLY", [toString(this)], nil) | |
152 | + | if ($isInstanceOf(aD, "Int")) | |
153 | + | then aD | |
154 | + | else throw(($getType(aD) + " couldn't be cast to Int")) | |
155 | + | } | |
156 | + | ||
157 | + | let aE = { | |
158 | + | let aD = invoke(aA, "getOutFeeREADONLY", [toString(this)], nil) | |
159 | + | if ($isInstanceOf(aD, "Int")) | |
160 | + | then aD | |
161 | + | else throw(($getType(aD) + " couldn't be cast to Int")) | |
162 | + | } | |
163 | + | ||
164 | + | func aF () = valueOrElse(getBoolean(aA, al()), false) | |
166 | 165 | ||
167 | 166 | ||
168 | - | let aL = addressFromStringValue(aE(this, R())) | |
169 | - | ||
170 | - | let aM = addressFromStringValue(aE(aL, az)) | |
171 | - | ||
172 | - | func aN () = valueOrElse(getBoolean(aL, av()), false) | |
167 | + | func aG () = fromBase58String(au(aA, ad())) | |
173 | 168 | ||
174 | 169 | ||
175 | - | func aO () = fromBase58String(aE(aL, an())) | |
176 | - | ||
177 | - | ||
178 | - | func aP () = { | |
179 | - | let aQ = aE(this, ac()) | |
180 | - | let aR = aE(this, ad()) | |
181 | - | let as = aH(aL, at(aR)) | |
182 | - | let ar = aH(aL, at(aQ)) | |
183 | - | split(aE(aL, aq(toString(ar), toString(as))), j) | |
170 | + | func aH () = { | |
171 | + | let aI = au(this, aa()) | |
172 | + | let aJ = au(this, ab()) | |
173 | + | let ai = ax(aA, aj(aJ)) | |
174 | + | let ah = ax(aA, aj(aI)) | |
175 | + | split(au(aA, ag(toString(ah), toString(ai))), j) | |
184 | 176 | } | |
185 | 177 | ||
186 | 178 | ||
187 | - | func | |
179 | + | func aK (aL) = if ((aL == i)) | |
188 | 180 | then unit | |
189 | - | else fromBase58String( | |
181 | + | else fromBase58String(aL) | |
190 | 182 | ||
191 | 183 | ||
192 | - | func | |
184 | + | func aM (aL) = if ((aL == unit)) | |
193 | 185 | then i | |
194 | - | else toBase58String(value( | |
186 | + | else toBase58String(value(aL)) | |
195 | 187 | ||
196 | 188 | ||
197 | - | func | |
189 | + | func aN (aO) = $Tuple7(addressFromStringValue(aO[o]), parseIntValue(aO[p]), fromBase58String(aO[q]), aK(aO[r]), aK(aO[s]), parseIntValue(aO[t]), parseIntValue(aO[u])) | |
198 | 190 | ||
199 | 191 | ||
200 | - | let | |
192 | + | let aP = aN(aH()) | |
201 | 193 | ||
202 | - | let | |
194 | + | let aQ = aP | |
203 | 195 | ||
204 | - | let | |
196 | + | let aR = aQ._1 | |
205 | 197 | ||
206 | - | let | |
198 | + | let aS = aQ._2 | |
207 | 199 | ||
208 | - | let | |
200 | + | let aT = aQ._3 | |
209 | 201 | ||
210 | - | let | |
202 | + | let aU = aQ._4 | |
211 | 203 | ||
212 | - | let | |
204 | + | let aV = aQ._5 | |
213 | 205 | ||
214 | - | let | |
206 | + | let aW = aQ._6 | |
215 | 207 | ||
216 | - | let | |
208 | + | let aX = aQ._7 | |
217 | 209 | ||
218 | - | func | |
210 | + | func aY () = split(au(aA, ac()), j) | |
219 | 211 | ||
220 | 212 | ||
221 | - | let | |
213 | + | let aZ = valueOrErrorMessage(addressFromString(aY()[B]), "incorrect staking address") | |
222 | 214 | ||
223 | - | let | |
215 | + | let ba = valueOrErrorMessage(addressFromString(aY()[C]), "incorrect staking address") | |
224 | 216 | ||
225 | - | func | |
217 | + | func bb (bc,bd,be,bf,bg,bh,bi,bj,bk,bl) = makeString(["%d%d%d%d%d%d%d%d%d%d", toString(bc), toString(bd), toString(be), toString(bf), toString(bg), toString(bh), toString(bi), toString(bj), toString(bk), toString(bl)], j) | |
226 | 218 | ||
227 | 219 | ||
228 | - | func | |
220 | + | func bm (bn,bo,bp,bf,bi,bj) = makeString(["%d%d%d%d%d%d", toString(bn), toString(bo), toString(bp), toString(bf), toString(bi), toString(bj)], j) | |
229 | 221 | ||
230 | 222 | ||
231 | - | func | |
223 | + | func bq (br) = if ((br == "WAVES")) | |
232 | 224 | then wavesBalance(this).available | |
233 | - | else assetBalance(this, fromBase58String( | |
225 | + | else assetBalance(this, fromBase58String(br)) | |
234 | 226 | ||
235 | 227 | ||
236 | - | func | |
228 | + | func bs (bt,bu) = fraction(bt, d, bu) | |
237 | 229 | ||
238 | 230 | ||
239 | - | func bD (bB,bC,K) = fraction(bB, d, bC, K) | |
240 | - | ||
241 | - | ||
242 | - | func bE (bF,bG,bH,bI) = { | |
243 | - | let bJ = D(bH, bF) | |
244 | - | let bK = D(bI, bG) | |
245 | - | bA(bK, bJ) | |
231 | + | func bv (bw,bx,by,bz) = { | |
232 | + | let bA = D(by, bw) | |
233 | + | let bB = D(bz, bx) | |
234 | + | bs(bB, bA) | |
246 | 235 | } | |
247 | 236 | ||
248 | 237 | ||
249 | - | func | |
250 | - | let | |
251 | - | let | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | let | |
258 | - | let | |
259 | - | [ | |
238 | + | func bC (by,bz,bD) = { | |
239 | + | let bE = aH() | |
240 | + | let bF = parseIntValue(bE[t]) | |
241 | + | let bG = parseIntValue(bE[u]) | |
242 | + | let bH = bv(bF, bG, by, bz) | |
243 | + | let bu = D(by, bF) | |
244 | + | let bt = D(bz, bG) | |
245 | + | let bI = D(bD, b) | |
246 | + | let bJ = bs(bu, bI) | |
247 | + | let bK = bs(bt, bI) | |
248 | + | [bH, bJ, bK] | |
260 | 249 | } | |
261 | 250 | ||
262 | 251 | ||
263 | - | func | |
264 | - | let | |
265 | - | [G( | |
252 | + | func bL (by,bz,bD) = { | |
253 | + | let bM = bC(by, bz, bD) | |
254 | + | [G(bM[0], b), G(bM[1], b), G(bM[2], b)] | |
266 | 255 | } | |
267 | 256 | ||
268 | 257 | ||
269 | - | func | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | let | |
277 | - | let | |
278 | - | if (( | |
258 | + | func bN (bO,bP,bQ,X) = { | |
259 | + | let bE = aH() | |
260 | + | let bR = bE[q] | |
261 | + | let bS = bE[r] | |
262 | + | let bT = bE[s] | |
263 | + | let bw = parseIntValue(bE[t]) | |
264 | + | let bx = parseIntValue(bE[u]) | |
265 | + | let bU = bE[p] | |
266 | + | let bV = valueOrErrorMessage(assetInfo(fromBase58String(bR)), (("Asset " + bR) + " doesn't exist")).quantity | |
267 | + | if ((bR != bP)) | |
279 | 268 | then throw("Invalid asset passed.") | |
280 | 269 | else { | |
281 | - | let | |
282 | - | let | |
283 | - | let | |
284 | - | let | |
285 | - | let | |
286 | - | let | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | let | |
270 | + | let bW = bq(bS) | |
271 | + | let bX = D(bW, bw) | |
272 | + | let bY = bq(bT) | |
273 | + | let bZ = D(bY, bx) | |
274 | + | let ca = bs(bZ, bX) | |
275 | + | let cb = G(ca, b) | |
276 | + | let cc = D(bQ, b) | |
277 | + | let cd = D(bV, b) | |
278 | + | let ce = fraction(bX, cc, cd) | |
279 | + | let cf = fraction(bZ, cc, cd) | |
280 | + | let cg = G(ce, bw) | |
281 | + | let ch = G(cf, bx) | |
282 | + | let ci = if ((bO == "")) | |
294 | 283 | then nil | |
295 | - | else [ScriptTransfer( | |
284 | + | else [ScriptTransfer(X, cg, if ((bS == "WAVES")) | |
296 | 285 | then unit | |
297 | - | else fromBase58String( | |
286 | + | else fromBase58String(bS)), ScriptTransfer(X, ch, if ((bT == "WAVES")) | |
298 | 287 | then unit | |
299 | - | else fromBase58String( | |
300 | - | $Tuple10( | |
288 | + | else fromBase58String(bT)), StringEntry(Z(toString(X), bO), bm(cg, ch, bQ, cb, height, lastBlock.timestamp)), IntegerEntry(S(), cb), IntegerEntry(T(height, lastBlock.timestamp), cb)] | |
289 | + | $Tuple10(cg, ch, bS, bT, bW, bY, bV, ca, bU, ci) | |
301 | 290 | } | |
302 | 291 | } | |
303 | 292 | ||
304 | 293 | ||
305 | - | func | |
306 | - | let | |
307 | - | let | |
308 | - | let | |
309 | - | let | |
310 | - | let | |
311 | - | let | |
312 | - | let | |
313 | - | let | |
314 | - | let | |
315 | - | let | |
316 | - | let | |
317 | - | let | |
318 | - | if (if (( | |
294 | + | func cj (bO,ck,cl,cm,cn,co,X,cp,cq) = { | |
295 | + | let bE = aH() | |
296 | + | let bR = fromBase58String(bE[q]) | |
297 | + | let cr = bE[r] | |
298 | + | let cs = bE[s] | |
299 | + | let ct = bE[v] | |
300 | + | let cu = bE[w] | |
301 | + | let bF = parseIntValue(bE[t]) | |
302 | + | let bG = parseIntValue(bE[u]) | |
303 | + | let bU = bE[p] | |
304 | + | let bV = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
305 | + | let cv = toBase58String(valueOrElse(cm, fromBase58String("WAVES"))) | |
306 | + | let cw = toBase58String(valueOrElse(co, fromBase58String("WAVES"))) | |
307 | + | if (if ((cr != cv)) | |
319 | 308 | then true | |
320 | - | else ( | |
309 | + | else (cs != cw)) | |
321 | 310 | then throw("Invalid amt or price asset passed.") | |
322 | 311 | else { | |
323 | - | let | |
324 | - | then | |
325 | - | else ( | |
326 | - | let | |
327 | - | then | |
328 | - | else ( | |
329 | - | let | |
330 | - | let | |
331 | - | let | |
332 | - | let | |
333 | - | let | |
334 | - | let | |
312 | + | let bW = if (cp) | |
313 | + | then bq(cr) | |
314 | + | else (bq(cr) - cl) | |
315 | + | let bY = if (cp) | |
316 | + | then bq(cs) | |
317 | + | else (bq(cs) - cn) | |
318 | + | let cx = D(cl, bF) | |
319 | + | let cy = D(cn, bG) | |
320 | + | let cz = bs(cy, cx) | |
321 | + | let bX = D(bW, bF) | |
322 | + | let bZ = D(bY, bG) | |
323 | + | let cA = if ((bV == 0)) | |
335 | 324 | then { | |
336 | - | let | |
337 | - | let | |
338 | - | let | |
339 | - | $Tuple5(G( | |
325 | + | let ca = e | |
326 | + | let cB = e | |
327 | + | let bI = pow((cx * cy), 0, toBigInt(5), 1, 0, DOWN) | |
328 | + | $Tuple5(G(bI, b), G(cx, bF), G(cy, bG), bs((bZ + cy), (bX + cx)), cB) | |
340 | 329 | } | |
341 | 330 | else { | |
342 | - | let | |
343 | - | let | |
344 | - | let | |
345 | - | if (if (( | |
346 | - | then ( | |
331 | + | let ca = bs(bZ, bX) | |
332 | + | let cB = fraction(O((ca - cz)), d, ca) | |
333 | + | let cC = D(ck, b) | |
334 | + | if (if ((ca != e)) | |
335 | + | then (cB > cC) | |
347 | 336 | else false) | |
348 | - | then throw(((("Price slippage " + toString( | |
337 | + | then throw(((("Price slippage " + toString(cB)) + " exceeded the passed limit of ") + toString(cC))) | |
349 | 338 | else { | |
350 | - | let | |
351 | - | let | |
352 | - | let | |
353 | - | let | |
354 | - | then $Tuple2( | |
355 | - | else $Tuple2( | |
356 | - | let | |
357 | - | let | |
358 | - | let | |
359 | - | $Tuple5( | |
339 | + | let cd = D(bV, b) | |
340 | + | let cD = fraction(cx, ca, d) | |
341 | + | let cE = fraction(cy, d, ca) | |
342 | + | let cF = if ((cD > cy)) | |
343 | + | then $Tuple2(cE, cy) | |
344 | + | else $Tuple2(cx, cD) | |
345 | + | let cG = cF._1 | |
346 | + | let cH = cF._2 | |
347 | + | let bI = fraction(cd, cH, bZ) | |
348 | + | $Tuple5(G(bI, b), G(cG, bF), G(cH, bG), ca, cB) | |
360 | 349 | } | |
361 | 350 | } | |
362 | - | let | |
363 | - | let | |
364 | - | let | |
365 | - | let | |
366 | - | let | |
367 | - | if ((0 >= | |
351 | + | let cI = cA._1 | |
352 | + | let cJ = cA._2 | |
353 | + | let cK = cA._3 | |
354 | + | let cb = G(cA._4, b) | |
355 | + | let cL = G(cA._5, b) | |
356 | + | if ((0 >= cI)) | |
368 | 357 | then throw("Invalid calculations. LP calculated is less than zero.") | |
369 | 358 | else { | |
370 | - | let | |
359 | + | let cM = if (!(cq)) | |
371 | 360 | then 0 | |
372 | - | else | |
373 | - | let | |
374 | - | let | |
375 | - | let | |
376 | - | $Tuple13( | |
361 | + | else cI | |
362 | + | let cN = (cl - cJ) | |
363 | + | let cO = (cn - cK) | |
364 | + | let cP = [IntegerEntry(S(), cb), IntegerEntry(T(height, lastBlock.timestamp), cb), StringEntry(W(X, bO), bb(cJ, cK, cM, cb, ck, cL, height, lastBlock.timestamp, cN, cO))] | |
365 | + | $Tuple13(cI, cM, cb, bW, bY, bV, bR, bU, cP, cN, cO, cm, co) | |
377 | 366 | } | |
378 | 367 | } | |
379 | 368 | } | |
380 | 369 | ||
381 | 370 | ||
382 | - | func cZ (da,db,ce) = { | |
383 | - | let dc = fraction(pow((da * db), 0, toBigInt(5), 1, 18, DOWN), g, ce) | |
384 | - | if ((ce == f)) | |
385 | - | then f | |
386 | - | else dc | |
371 | + | func cQ (cR) = { | |
372 | + | let bE = aH() | |
373 | + | let cS = bE[r] | |
374 | + | let cT = bE[s] | |
375 | + | let bU = parseIntValue(bE[p]) | |
376 | + | let bF = parseIntValue(bE[t]) | |
377 | + | let bG = parseIntValue(bE[u]) | |
378 | + | let cU = bq(cS) | |
379 | + | let cV = bq(cT) | |
380 | + | let ca = if ((cR.orderType == Buy)) | |
381 | + | then bv(bF, bG, (cU + cR.amount), cV) | |
382 | + | else bv(bF, bG, (cU - cR.amount), cV) | |
383 | + | let cb = G(ca, b) | |
384 | + | if (if (if (aF()) | |
385 | + | then true | |
386 | + | else (bU == m)) | |
387 | + | then true | |
388 | + | else (bU == n)) | |
389 | + | then throw("Exchange operations disabled") | |
390 | + | else { | |
391 | + | let cW = cR.assetPair.amountAsset | |
392 | + | let cX = if ((cW == unit)) | |
393 | + | then "WAVES" | |
394 | + | else toBase58String(value(cW)) | |
395 | + | let cY = cR.assetPair.priceAsset | |
396 | + | let cZ = if ((cY == unit)) | |
397 | + | then "WAVES" | |
398 | + | else toBase58String(value(cY)) | |
399 | + | if (if ((cX != cS)) | |
400 | + | then true | |
401 | + | else (cZ != cT)) | |
402 | + | then throw("Wrong order assets.") | |
403 | + | else { | |
404 | + | let da = cR.price | |
405 | + | let db = fraction(b, bG, bF) | |
406 | + | let dc = J(da, b, db) | |
407 | + | let dd = if ((cR.orderType == Buy)) | |
408 | + | then (cb >= dc) | |
409 | + | else (dc >= cb) | |
410 | + | true | |
411 | + | } | |
412 | + | } | |
387 | 413 | } | |
388 | 414 | ||
389 | 415 | ||
390 | - | func dd (de,df,dg) = { | |
391 | - | let dh = (toBigInt(by(aU(bc))) - de) | |
392 | - | let di = (toBigInt(by(aU(bd))) - df) | |
393 | - | let dj = (toBigInt(value(assetInfo(bb)).quantity) - dg) | |
394 | - | let dk = cZ(dh, di, dj) | |
395 | - | dk | |
396 | - | } | |
397 | - | ||
398 | - | ||
399 | - | func dl (dm,dn,dg) = { | |
400 | - | let dh = (by(aU(bc)) + dm) | |
401 | - | let di = (by(aU(bd)) + dn) | |
402 | - | let dj = (value(assetInfo(bb)).quantity + dg) | |
403 | - | let dc = cZ(toBigInt(dh), toBigInt(di), toBigInt(dj)) | |
404 | - | let do = [IntegerEntry(ai, height), StringEntry(ah, toString(dc))] | |
405 | - | $Tuple2(do, dc) | |
406 | - | } | |
407 | - | ||
408 | - | ||
409 | - | func dp (dq,dc) = if ((dc >= dq)) | |
410 | - | then true | |
411 | - | else aI(makeString(["updated KLp lower than current KLp", toString(dq), toString(dc)], " ")) | |
412 | - | ||
413 | - | ||
414 | - | func dr (ds) = { | |
415 | - | let dt = ds.amount | |
416 | - | let du = fraction(ds.amount, ds.price, b, FLOOR) | |
417 | - | let dv = if ((ds.orderType == Buy)) | |
418 | - | then $Tuple2(dt, -(du)) | |
419 | - | else $Tuple2(-(dt), du) | |
420 | - | let dm = dv._1 | |
421 | - | let dn = dv._2 | |
422 | - | if (if (if (aN()) | |
423 | - | then true | |
424 | - | else (ba == m)) | |
425 | - | then true | |
426 | - | else (ba == n)) | |
427 | - | then throw("Exchange operations disabled") | |
428 | - | else if (if ((ds.assetPair.amountAsset != bc)) | |
429 | - | then true | |
430 | - | else (ds.assetPair.priceAsset != bd)) | |
431 | - | then throw("Wrong order assets.") | |
432 | - | else { | |
433 | - | let dw = valueOrErrorMessage(parseBigInt(valueOrErrorMessage(getString(this, ah), aK("kLp is required"))), aK("invalid kLp")) | |
434 | - | let dx = dl(dm, dn, 0) | |
435 | - | let dy = dx._1 | |
436 | - | let dz = dx._2 | |
437 | - | let dA = (dz >= dw) | |
438 | - | dA | |
439 | - | } | |
440 | - | } | |
441 | - | ||
442 | - | ||
443 | - | func dB (dC) = if ((size(dC.payments) != 1)) | |
416 | + | func de (df) = if ((size(df.payments) != 1)) | |
444 | 417 | then throw("exactly 1 payment is expected") | |
445 | 418 | else { | |
446 | - | let | |
447 | - | let | |
448 | - | let | |
449 | - | let | |
450 | - | let | |
451 | - | let | |
452 | - | let | |
453 | - | let | |
454 | - | if (if ( | |
419 | + | let dg = value(df.payments[0]) | |
420 | + | let bP = value(dg.assetId) | |
421 | + | let dh = dg.amount | |
422 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(bP), dh, df.caller) | |
423 | + | let cg = cA._1 | |
424 | + | let ch = cA._2 | |
425 | + | let bU = parseIntValue(cA._9) | |
426 | + | let ci = cA._10 | |
427 | + | if (if (aF()) | |
455 | 428 | then true | |
456 | - | else ( | |
457 | - | then throw(("Get operation is blocked by admin. Status = " + toString( | |
458 | - | else $Tuple5( | |
429 | + | else (bU == n)) | |
430 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bU))) | |
431 | + | else $Tuple5(cg, ch, dh, bP, ci) | |
459 | 432 | } | |
460 | 433 | ||
461 | 434 | ||
462 | - | func | |
435 | + | func di (df,ck,cq) = if ((size(df.payments) != 2)) | |
463 | 436 | then throw("exactly 2 payments are expected") | |
464 | 437 | else { | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | if (if (if ( | |
438 | + | let dj = value(df.payments[0]) | |
439 | + | let dk = value(df.payments[1]) | |
440 | + | let dl = cj(toBase58String(df.transactionId), ck, dj.amount, dj.assetId, dk.amount, dk.assetId, toString(df.caller), false, cq) | |
441 | + | let bU = parseIntValue(dl._8) | |
442 | + | if (if (if (aF()) | |
470 | 443 | then true | |
471 | - | else ( | |
444 | + | else (bU == l)) | |
472 | 445 | then true | |
473 | - | else ( | |
474 | - | then throw(("Put operation is blocked by admin. Status = " + toString( | |
475 | - | else | |
446 | + | else (bU == n)) | |
447 | + | then throw(("Put operation is blocked by admin. Status = " + toString(bU))) | |
448 | + | else dl | |
476 | 449 | } | |
477 | 450 | ||
478 | 451 | ||
479 | - | func | |
480 | - | let | |
481 | - | if (( | |
452 | + | func dm (dn) = { | |
453 | + | let do = invoke(aA, "emit", [dn], nil) | |
454 | + | if ((do == do)) | |
482 | 455 | then { | |
483 | - | let | |
484 | - | let | |
485 | - | if ($isInstanceOf( | |
456 | + | let dp = { | |
457 | + | let dq = do | |
458 | + | if ($isInstanceOf(dq, "Address")) | |
486 | 459 | then { | |
487 | - | let | |
488 | - | invoke( | |
460 | + | let dr = dq | |
461 | + | invoke(dr, "emit", [dn], nil) | |
489 | 462 | } | |
490 | 463 | else unit | |
491 | 464 | } | |
492 | - | if (( | |
493 | - | then | |
465 | + | if ((dp == dp)) | |
466 | + | then dn | |
494 | 467 | else throw("Strict value is not equal to itself.") | |
495 | 468 | } | |
496 | 469 | else throw("Strict value is not equal to itself.") | |
497 | 470 | } | |
498 | 471 | ||
499 | 472 | ||
500 | - | func dP (dK) = { | |
501 | - | let dQ = fraction(dK, ag, b) | |
502 | - | $Tuple2((dK - dQ), dQ) | |
473 | + | func ds (dn,dt) = { | |
474 | + | let du = if ((dt == 0)) | |
475 | + | then 0 | |
476 | + | else fraction(dn, dt, b) | |
477 | + | $Tuple2((dn - du), du) | |
503 | 478 | } | |
504 | 479 | ||
505 | 480 | ||
506 | - | func | |
507 | - | let | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
481 | + | func dv (dw,dx,X,Y) = { | |
482 | + | let dy = (Y == unit) | |
483 | + | let dz = bq(aM(aU)) | |
484 | + | let dA = bq(aM(aV)) | |
485 | + | let dB = if ((dx == aU)) | |
511 | 486 | then true | |
512 | - | else if (( | |
487 | + | else if ((dx == aV)) | |
513 | 488 | then false | |
514 | - | else | |
515 | - | let | |
516 | - | then $Tuple2( | |
517 | - | else if ( | |
518 | - | then $Tuple2(( | |
519 | - | else $Tuple2( | |
520 | - | let | |
521 | - | let | |
522 | - | let | |
523 | - | then $Tuple2( | |
524 | - | else $Tuple2(0, | |
525 | - | let | |
526 | - | let | |
527 | - | let | |
528 | - | let | |
529 | - | let | |
530 | - | let | |
531 | - | let | |
532 | - | let | |
533 | - | let | |
534 | - | let | |
535 | - | let | |
536 | - | let | |
537 | - | then | |
538 | - | else | |
539 | - | let | |
540 | - | let | |
541 | - | let | |
489 | + | else ay("invalid asset") | |
490 | + | let dC = if (dy) | |
491 | + | then $Tuple2(dz, dA) | |
492 | + | else if (dB) | |
493 | + | then $Tuple2((dz - dw), dA) | |
494 | + | else $Tuple2(dz, (dA - dw)) | |
495 | + | let dD = dC._1 | |
496 | + | let dE = dC._2 | |
497 | + | let dF = if (dB) | |
498 | + | then $Tuple2(dw, 0) | |
499 | + | else $Tuple2(0, dw) | |
500 | + | let dG = dF._1 | |
501 | + | let dH = dF._2 | |
502 | + | let dI = ds(dG, aC)._1 | |
503 | + | let dJ = ds(dH, aC)._1 | |
504 | + | let dK = ds(dw, aC) | |
505 | + | let dL = dK._1 | |
506 | + | let du = dK._2 | |
507 | + | let dM = (dD + dI) | |
508 | + | let dN = (dE + dJ) | |
509 | + | let dO = bs(D(dN, aX), D(dM, aW)) | |
510 | + | let dP = G(dO, b) | |
511 | + | let dQ = if (dB) | |
512 | + | then dD | |
513 | + | else dE | |
514 | + | let dR = toBigInt(dQ) | |
515 | + | let dS = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
516 | + | let dT = if ((dS > f)) | |
542 | 517 | then true | |
543 | - | else | |
544 | - | if (( | |
518 | + | else ay("initial deposit requires all coins") | |
519 | + | if ((dT == dT)) | |
545 | 520 | then { | |
546 | - | let | |
547 | - | let | |
548 | - | let | |
521 | + | let dU = toBigInt(dL) | |
522 | + | let dV = max([0, toInt(((dS * (sqrtBigInt((d + ((dU * d) / dR)), 18, 18, DOWN) - d)) / d))]) | |
523 | + | let cP = if (dy) | |
549 | 524 | then nil | |
550 | - | else [IntegerEntry( | |
551 | - | let | |
552 | - | let | |
553 | - | let | |
554 | - | let | |
555 | - | then $Tuple2( | |
556 | - | else $Tuple2( | |
557 | - | let | |
558 | - | let | |
559 | - | let | |
560 | - | fraction(( | |
525 | + | else [IntegerEntry(S(), dP), IntegerEntry(T(height, lastBlock.timestamp), dP), StringEntry(W(toString(value(X)), toBase58String(value(Y))), bb(dG, dH, dV, dP, 0, 0, height, lastBlock.timestamp, 0, 0))] | |
526 | + | let dW = bs(D(dE, aX), D(dD, aW)) | |
527 | + | let dX = G(dW, b) | |
528 | + | let dY = { | |
529 | + | let dZ = if (dB) | |
530 | + | then $Tuple2(dG, dD) | |
531 | + | else $Tuple2(dH, dE) | |
532 | + | let dn = dZ._1 | |
533 | + | let ea = dZ._2 | |
534 | + | let eb = toInt(fraction(dS, toBigInt((dn / 2)), toBigInt(ea))) | |
535 | + | fraction((dV - eb), b, eb) | |
561 | 536 | } | |
562 | - | $ | |
537 | + | $Tuple4(dV, cP, du, dY) | |
563 | 538 | } | |
564 | 539 | else throw("Strict value is not equal to itself.") | |
565 | 540 | } | |
566 | 541 | ||
567 | 542 | ||
568 | - | func ew (ex,ef,dT,Z,aa) = { | |
569 | - | let dU = (aa == unit) | |
570 | - | let bN = aP() | |
571 | - | let bO = parseIntValue(bN[t]) | |
572 | - | let bP = parseIntValue(bN[u]) | |
573 | - | let ey = [if ((dT == bb)) | |
543 | + | func ec (ed,dL,dx,X,Y) = { | |
544 | + | let dy = (Y == unit) | |
545 | + | let ee = [if ((dx == aT)) | |
574 | 546 | then true | |
575 | - | else | |
576 | - | if (( | |
547 | + | else ay("invalid lp asset")] | |
548 | + | if ((ee == ee)) | |
577 | 549 | then { | |
578 | - | let | |
550 | + | let ef = if ((ed == aU)) | |
579 | 551 | then true | |
580 | - | else if (( | |
552 | + | else if ((ed == aV)) | |
581 | 553 | then false | |
582 | - | else aI("invalid asset") | |
583 | - | let eA = if (ez) | |
584 | - | then toBigInt(by(aU(bc))) | |
585 | - | else toBigInt(by(aU(bd))) | |
586 | - | let eB = if (ez) | |
587 | - | then bO | |
588 | - | else bP | |
589 | - | let eC = by(aU(bc)) | |
590 | - | let eD = by(aU(bd)) | |
591 | - | let eE = if (ez) | |
592 | - | then eC | |
593 | - | else eD | |
594 | - | let eF = toBigInt(eE) | |
595 | - | let em = toBigInt(valueOrErrorMessage(assetInfo(bb), (("asset " + toBase58String(bb)) + " doesn't exist")).quantity) | |
596 | - | let eG = toBigInt(ef) | |
597 | - | let eH = max([0, toInt(((eA * (d - pow((d - ((eG * d) / em)), 18, h, 0, 18, DOWN))) / d))]) | |
598 | - | let eI = dP(eH) | |
599 | - | let eJ = eI._1 | |
600 | - | let dQ = eI._2 | |
601 | - | let eK = if (ez) | |
602 | - | then $Tuple4(eJ, 0, (eC - eH), eD) | |
603 | - | else $Tuple4(0, eJ, eC, (eD - eH)) | |
604 | - | let eL = eK._1 | |
605 | - | let eM = eK._2 | |
606 | - | let eN = eK._3 | |
607 | - | let eO = eK._4 | |
608 | - | let ei = bA(D(eO, bf), D(eN, be)) | |
609 | - | let ej = G(ei, b) | |
610 | - | let cY = if (dU) | |
554 | + | else ay("invalid asset") | |
555 | + | let eg = if (ef) | |
556 | + | then toBigInt(bq(aM(aU))) | |
557 | + | else toBigInt(bq(aM(aV))) | |
558 | + | let eh = bq(aM(aU)) | |
559 | + | let ei = bq(aM(aV)) | |
560 | + | let ej = if (ef) | |
561 | + | then eh | |
562 | + | else ei | |
563 | + | let ek = toBigInt(ej) | |
564 | + | let dS = toBigInt(valueOrErrorMessage(assetInfo(aT), (("asset " + toBase58String(aT)) + " doesn't exist")).quantity) | |
565 | + | let el = toBigInt(dL) | |
566 | + | let em = max([0, toInt(((eg * (d - pow((d - ((el * d) / dS)), 18, h, 0, 18, DOWN))) / d))]) | |
567 | + | let en = ds(em, aE) | |
568 | + | let eo = en._1 | |
569 | + | let du = en._2 | |
570 | + | let ep = if (ef) | |
571 | + | then $Tuple4(eo, 0, (eh - em), ei) | |
572 | + | else $Tuple4(0, eo, eh, (ei - em)) | |
573 | + | let eq = ep._1 | |
574 | + | let er = ep._2 | |
575 | + | let es = ep._3 | |
576 | + | let et = ep._4 | |
577 | + | let dO = bs(D(et, aX), D(es, aW)) | |
578 | + | let dP = G(dO, b) | |
579 | + | let cP = if (dy) | |
611 | 580 | then nil | |
612 | - | else [StringEntry( | |
613 | - | let | |
614 | - | let | |
615 | - | let | |
616 | - | let | |
617 | - | fraction(( | |
581 | + | else [StringEntry(Z(toString(value(X)), toBase58String(value(Y))), bm(eq, er, dL, dP, height, lastBlock.timestamp)), IntegerEntry(S(), dP), IntegerEntry(T(height, lastBlock.timestamp), dP)] | |
582 | + | let dW = bs(D(ei, aX), D(eh, aW)) | |
583 | + | let dX = G(dW, b) | |
584 | + | let dY = { | |
585 | + | let eu = (toInt(fraction(eg, el, dS)) * 2) | |
586 | + | fraction((eo - eu), b, eu) | |
618 | 587 | } | |
619 | - | $ | |
588 | + | $Tuple4(eo, cP, du, dY) | |
620 | 589 | } | |
621 | 590 | else throw("Strict value is not equal to itself.") | |
622 | 591 | } | |
623 | 592 | ||
624 | 593 | ||
625 | - | func | |
626 | - | let | |
627 | - | if ($isInstanceOf( | |
594 | + | func ev () = { | |
595 | + | let dq = getString(Q()) | |
596 | + | if ($isInstanceOf(dq, "String")) | |
628 | 597 | then { | |
629 | - | let | |
630 | - | fromBase58String( | |
598 | + | let ew = dq | |
599 | + | fromBase58String(ew) | |
631 | 600 | } | |
632 | - | else if ($isInstanceOf( | |
601 | + | else if ($isInstanceOf(dq, "Unit")) | |
633 | 602 | then unit | |
634 | 603 | else throw("Match error") | |
635 | 604 | } | |
636 | 605 | ||
637 | 606 | ||
638 | - | func | |
639 | - | let | |
640 | - | if ($isInstanceOf( | |
607 | + | func ex () = { | |
608 | + | let dq = getString(R()) | |
609 | + | if ($isInstanceOf(dq, "String")) | |
641 | 610 | then { | |
642 | - | let | |
643 | - | fromBase58String( | |
611 | + | let ew = dq | |
612 | + | fromBase58String(ew) | |
644 | 613 | } | |
645 | - | else if ($isInstanceOf( | |
614 | + | else if ($isInstanceOf(dq, "Unit")) | |
646 | 615 | then unit | |
647 | 616 | else throw("Match error") | |
648 | 617 | } | |
649 | 618 | ||
650 | 619 | ||
651 | - | func | |
652 | - | let | |
653 | - | if ($isInstanceOf( | |
620 | + | func ey (df) = { | |
621 | + | let dq = ev() | |
622 | + | if ($isInstanceOf(dq, "ByteVector")) | |
654 | 623 | then { | |
655 | - | let | |
656 | - | ( | |
624 | + | let ez = dq | |
625 | + | (df.callerPublicKey == ez) | |
657 | 626 | } | |
658 | - | else if ($isInstanceOf( | |
659 | - | then ( | |
627 | + | else if ($isInstanceOf(dq, "Unit")) | |
628 | + | then (df.caller == this) | |
660 | 629 | else throw("Match error") | |
661 | 630 | } | |
662 | 631 | ||
663 | 632 | ||
664 | - | func | |
665 | - | let | |
666 | - | let | |
667 | - | if ($isInstanceOf( | |
633 | + | func eA (df) = { | |
634 | + | let eB = throw("Permission denied") | |
635 | + | let dq = ev() | |
636 | + | if ($isInstanceOf(dq, "ByteVector")) | |
668 | 637 | then { | |
669 | - | let | |
670 | - | if (( | |
638 | + | let ez = dq | |
639 | + | if ((df.callerPublicKey == ez)) | |
671 | 640 | then true | |
672 | - | else | |
641 | + | else eB | |
673 | 642 | } | |
674 | - | else if ($isInstanceOf( | |
675 | - | then if (( | |
643 | + | else if ($isInstanceOf(dq, "Unit")) | |
644 | + | then if ((df.caller == this)) | |
676 | 645 | then true | |
677 | - | else | |
646 | + | else eB | |
678 | 647 | else throw("Match error") | |
679 | 648 | } | |
680 | 649 | ||
681 | 650 | ||
682 | - | @Callable( | |
683 | - | func setManager ( | |
684 | - | let | |
685 | - | if (( | |
651 | + | @Callable(df) | |
652 | + | func setManager (eC) = { | |
653 | + | let eD = eA(df) | |
654 | + | if ((eD == eD)) | |
686 | 655 | then { | |
687 | - | let | |
688 | - | if (( | |
689 | - | then [StringEntry( | |
656 | + | let eE = fromBase58String(eC) | |
657 | + | if ((eE == eE)) | |
658 | + | then [StringEntry(R(), eC)] | |
690 | 659 | else throw("Strict value is not equal to itself.") | |
691 | 660 | } | |
692 | 661 | else throw("Strict value is not equal to itself.") | |
693 | 662 | } | |
694 | 663 | ||
695 | 664 | ||
696 | 665 | ||
697 | - | @Callable( | |
666 | + | @Callable(df) | |
698 | 667 | func confirmManager () = { | |
699 | - | let | |
700 | - | let | |
668 | + | let eF = ex() | |
669 | + | let eG = if (isDefined(eF)) | |
701 | 670 | then true | |
702 | 671 | else throw("No pending manager") | |
703 | - | if (( | |
672 | + | if ((eG == eG)) | |
704 | 673 | then { | |
705 | - | let | |
674 | + | let eH = if ((df.callerPublicKey == value(eF))) | |
706 | 675 | then true | |
707 | 676 | else throw("You are not pending manager") | |
708 | - | if (( | |
709 | - | then [StringEntry( | |
677 | + | if ((eH == eH)) | |
678 | + | then [StringEntry(Q(), toBase58String(value(eF))), DeleteEntry(R())] | |
710 | 679 | else throw("Strict value is not equal to itself.") | |
711 | 680 | } | |
712 | 681 | else throw("Strict value is not equal to itself.") | |
713 | 682 | } | |
714 | 683 | ||
715 | 684 | ||
716 | 685 | ||
717 | - | @Callable( | |
718 | - | func put ( | |
686 | + | @Callable(df) | |
687 | + | func put (ck,eI) = if ((0 > ck)) | |
719 | 688 | then throw("Invalid slippageTolerance passed") | |
720 | 689 | else { | |
721 | - | let dI = dF(dC, ct, true) | |
722 | - | let cV = dI._2 | |
723 | - | let ca = dI._7 | |
724 | - | let cr = dI._9 | |
725 | - | let cW = dI._10 | |
726 | - | let cX = dI._11 | |
727 | - | let fe = dI._12 | |
728 | - | let ff = dI._13 | |
729 | - | let dG = toBigInt(value(dC.payments[0]).amount) | |
730 | - | let dH = toBigInt(value(dC.payments[1]).amount) | |
731 | - | let dk = dd(dG, dH, toBigInt(0)) | |
732 | - | if ((dk == dk)) | |
690 | + | let dl = di(df, ck, true) | |
691 | + | let cM = dl._2 | |
692 | + | let bR = dl._7 | |
693 | + | let ci = dl._9 | |
694 | + | let cN = dl._10 | |
695 | + | let cO = dl._11 | |
696 | + | let eJ = dl._12 | |
697 | + | let eK = dl._13 | |
698 | + | let do = invoke(aA, "emit", [cM], nil) | |
699 | + | if ((do == do)) | |
733 | 700 | then { | |
734 | - | let dL = invoke(aL, "emit", [cV], nil) | |
735 | - | if ((dL == dL)) | |
701 | + | let dp = { | |
702 | + | let dq = do | |
703 | + | if ($isInstanceOf(dq, "Address")) | |
704 | + | then { | |
705 | + | let dr = dq | |
706 | + | invoke(dr, "emit", [cM], nil) | |
707 | + | } | |
708 | + | else unit | |
709 | + | } | |
710 | + | if ((dp == dp)) | |
736 | 711 | then { | |
737 | - | let dM = { | |
738 | - | let dN = dL | |
739 | - | if ($isInstanceOf(dN, "Address")) | |
740 | - | then { | |
741 | - | let dO = dN | |
742 | - | invoke(dO, "emit", [cV], nil) | |
743 | - | } | |
744 | - | else unit | |
745 | - | } | |
746 | - | if ((dM == dM)) | |
712 | + | let eL = if ((cN > 0)) | |
713 | + | then invoke(ba, "put", nil, [AttachedPayment(eJ, cN)]) | |
714 | + | else nil | |
715 | + | if ((eL == eL)) | |
747 | 716 | then { | |
748 | - | let | |
749 | - | then invoke( | |
717 | + | let eM = if ((cO > 0)) | |
718 | + | then invoke(ba, "put", nil, [AttachedPayment(eK, cO)]) | |
750 | 719 | else nil | |
751 | - | if (( | |
720 | + | if ((eM == eM)) | |
752 | 721 | then { | |
753 | - | let fh = if ((cX > 0)) | |
754 | - | then invoke(bi, "put", nil, [AttachedPayment(ff, cX)]) | |
755 | - | else nil | |
756 | - | if ((fh == fh)) | |
722 | + | let eN = if (eI) | |
757 | 723 | then { | |
758 | - | let fi = if (fd) | |
759 | - | then { | |
760 | - | let fj = invoke(bh, "stake", nil, [AttachedPayment(ca, cV)]) | |
761 | - | if ((fj == fj)) | |
762 | - | then nil | |
763 | - | else throw("Strict value is not equal to itself.") | |
764 | - | } | |
765 | - | else [ScriptTransfer(dC.caller, cV, ca)] | |
766 | - | let fk = dl(0, 0, 0) | |
767 | - | if ((fk == fk)) | |
768 | - | then { | |
769 | - | let dc = fk._2 | |
770 | - | let fl = fk._1 | |
771 | - | let fm = dp(dk, dc) | |
772 | - | if ((fm == fm)) | |
773 | - | then ((cr ++ fi) ++ fl) | |
774 | - | else throw("Strict value is not equal to itself.") | |
775 | - | } | |
724 | + | let eO = invoke(aZ, "stake", nil, [AttachedPayment(bR, cM)]) | |
725 | + | if ((eO == eO)) | |
726 | + | then nil | |
776 | 727 | else throw("Strict value is not equal to itself.") | |
777 | 728 | } | |
778 | - | else throw("Strict value is not equal to itself.") | |
729 | + | else [ScriptTransfer(df.caller, cM, bR)] | |
730 | + | (ci ++ eN) | |
779 | 731 | } | |
780 | 732 | else throw("Strict value is not equal to itself.") | |
781 | 733 | } | |
782 | 734 | else throw("Strict value is not equal to itself.") | |
783 | 735 | } | |
784 | 736 | else throw("Strict value is not equal to itself.") | |
785 | 737 | } | |
786 | 738 | else throw("Strict value is not equal to itself.") | |
787 | 739 | } | |
788 | 740 | ||
789 | 741 | ||
790 | 742 | ||
791 | - | @Callable( | |
792 | - | func putForFree ( | |
743 | + | @Callable(df) | |
744 | + | func putForFree (eP) = if ((0 > eP)) | |
793 | 745 | then throw("Invalid value passed") | |
794 | 746 | else { | |
795 | - | let dI = dF(dC, fn, false) | |
796 | - | let cr = dI._9 | |
797 | - | let dG = toBigInt(value(dC.payments[0]).amount) | |
798 | - | let dH = toBigInt(value(dC.payments[1]).amount) | |
799 | - | let dk = dd(dG, dH, toBigInt(0)) | |
800 | - | if ((dk == dk)) | |
801 | - | then { | |
802 | - | let fo = dl(0, 0, 0) | |
803 | - | let fl = fo._1 | |
804 | - | let dc = fo._2 | |
805 | - | let fm = dp(dk, dc) | |
806 | - | if ((fm == fm)) | |
807 | - | then (cr ++ fl) | |
808 | - | else throw("Strict value is not equal to itself.") | |
809 | - | } | |
810 | - | else throw("Strict value is not equal to itself.") | |
747 | + | let dl = di(df, eP, false) | |
748 | + | dl._9 | |
811 | 749 | } | |
812 | 750 | ||
813 | 751 | ||
814 | 752 | ||
815 | - | @Callable( | |
816 | - | func putOneTkn ( | |
817 | - | let | |
818 | - | let | |
819 | - | if ($isInstanceOf( | |
820 | - | then | |
821 | - | else throw(($getType( | |
753 | + | @Callable(df) | |
754 | + | func putOneTkn (eQ,eR) = { | |
755 | + | let eS = { | |
756 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
757 | + | if ($isInstanceOf(aD, "Boolean")) | |
758 | + | then aD | |
759 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
822 | 760 | } | |
823 | - | let | |
761 | + | let eT = if (if (if (aF()) | |
824 | 762 | then true | |
825 | - | else ( | |
763 | + | else (aS == l)) | |
826 | 764 | then true | |
827 | - | else ( | |
765 | + | else (aS == n)) | |
828 | 766 | then true | |
829 | - | else | |
830 | - | let | |
767 | + | else eS | |
768 | + | let ee = [if (if (!(eT)) | |
831 | 769 | then true | |
832 | - | else | |
770 | + | else ey(df)) | |
833 | 771 | then true | |
834 | - | else | |
772 | + | else ay("put operation is blocked by admin"), if ((size(df.payments) == 1)) | |
835 | 773 | then true | |
836 | - | else | |
837 | - | if (( | |
774 | + | else ay("exactly 1 payment are expected")] | |
775 | + | if ((ee == ee)) | |
838 | 776 | then { | |
839 | - | let fu = dC.payments[0] | |
840 | - | let dT = fu.assetId | |
841 | - | let dS = fu.amount | |
842 | - | let dk = if ((dT == bc)) | |
843 | - | then dd(toBigInt(dS), toBigInt(0), toBigInt(0)) | |
844 | - | else if ((dT == bd)) | |
845 | - | then dd(toBigInt(0), toBigInt(dS), toBigInt(0)) | |
846 | - | else aI("payment asset is not supported") | |
847 | - | if ((dk == dk)) | |
777 | + | let eU = df.payments[0] | |
778 | + | let dx = eU.assetId | |
779 | + | let dw = eU.amount | |
780 | + | let X = df.caller | |
781 | + | let Y = df.transactionId | |
782 | + | let eV = dv(dw, dx, X, Y) | |
783 | + | if ((eV == eV)) | |
848 | 784 | then { | |
849 | - | let Z = dC.caller | |
850 | - | let aa = dC.transactionId | |
851 | - | let fv = dR(dS, dT, Z, aa) | |
852 | - | if ((fv == fv)) | |
785 | + | let eW = eV._4 | |
786 | + | let du = eV._3 | |
787 | + | let cP = eV._2 | |
788 | + | let eX = eV._1 | |
789 | + | let eY = if (if ((eQ > 0)) | |
790 | + | then (eQ > eX) | |
791 | + | else false) | |
792 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
793 | + | else eX | |
794 | + | let do = dm(eY) | |
795 | + | if ((do == do)) | |
853 | 796 | then { | |
854 | - | let dX = fv._5 | |
855 | - | let fw = fv._4 | |
856 | - | let dQ = fv._3 | |
857 | - | let cY = fv._2 | |
858 | - | let fx = fv._1 | |
859 | - | let fy = if (if ((fp > 0)) | |
860 | - | then (fp > fx) | |
797 | + | let eN = if (eR) | |
798 | + | then { | |
799 | + | let eZ = invoke(aZ, "stake", nil, [AttachedPayment(aT, eY)]) | |
800 | + | if ((eZ == eZ)) | |
801 | + | then nil | |
802 | + | else throw("Strict value is not equal to itself.") | |
803 | + | } | |
804 | + | else [ScriptTransfer(df.caller, eY, aT)] | |
805 | + | let fa = if ((du > 0)) | |
806 | + | then [ScriptTransfer(aB, du, dx)] | |
807 | + | else nil | |
808 | + | $Tuple2(((cP ++ eN) ++ fa), eY) | |
809 | + | } | |
810 | + | else throw("Strict value is not equal to itself.") | |
811 | + | } | |
812 | + | else throw("Strict value is not equal to itself.") | |
813 | + | } | |
814 | + | else throw("Strict value is not equal to itself.") | |
815 | + | } | |
816 | + | ||
817 | + | ||
818 | + | ||
819 | + | @Callable(df) | |
820 | + | func putOneTknREADONLY (dx,dw) = { | |
821 | + | let fb = dv(dw, aK(dx), unit, unit) | |
822 | + | let eX = fb._1 | |
823 | + | let cP = fb._2 | |
824 | + | let du = fb._3 | |
825 | + | let eW = fb._4 | |
826 | + | $Tuple2(nil, $Tuple3(eX, du, eW)) | |
827 | + | } | |
828 | + | ||
829 | + | ||
830 | + | ||
831 | + | @Callable(df) | |
832 | + | func getOneTkn (fc,eQ) = { | |
833 | + | let eS = { | |
834 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
835 | + | if ($isInstanceOf(aD, "Boolean")) | |
836 | + | then aD | |
837 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
838 | + | } | |
839 | + | let fd = if (if (aF()) | |
840 | + | then true | |
841 | + | else (aS == n)) | |
842 | + | then true | |
843 | + | else eS | |
844 | + | let ee = [if (if (!(fd)) | |
845 | + | then true | |
846 | + | else ey(df)) | |
847 | + | then true | |
848 | + | else ay("get operation is blocked by admin"), if ((size(df.payments) == 1)) | |
849 | + | then true | |
850 | + | else ay("exactly 1 payment are expected")] | |
851 | + | if ((ee == ee)) | |
852 | + | then { | |
853 | + | let ed = aK(fc) | |
854 | + | let eU = df.payments[0] | |
855 | + | let dx = eU.assetId | |
856 | + | let dL = eU.amount | |
857 | + | let X = df.caller | |
858 | + | let Y = df.transactionId | |
859 | + | let fe = ec(ed, dL, dx, X, Y) | |
860 | + | if ((fe == fe)) | |
861 | + | then { | |
862 | + | let eW = fe._4 | |
863 | + | let du = fe._3 | |
864 | + | let cP = fe._2 | |
865 | + | let ff = fe._1 | |
866 | + | let dn = if (if ((eQ > 0)) | |
867 | + | then (eQ > ff) | |
868 | + | else false) | |
869 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
870 | + | else ff | |
871 | + | let fg = invoke(aA, "burn", [dL], [AttachedPayment(dx, dL)]) | |
872 | + | if ((fg == fg)) | |
873 | + | then { | |
874 | + | let fh = [ScriptTransfer(X, dn, ed)] | |
875 | + | let fa = if ((du > 0)) | |
876 | + | then [ScriptTransfer(aB, du, ed)] | |
877 | + | else nil | |
878 | + | $Tuple2(((cP ++ fh) ++ fa), dn) | |
879 | + | } | |
880 | + | else throw("Strict value is not equal to itself.") | |
881 | + | } | |
882 | + | else throw("Strict value is not equal to itself.") | |
883 | + | } | |
884 | + | else throw("Strict value is not equal to itself.") | |
885 | + | } | |
886 | + | ||
887 | + | ||
888 | + | ||
889 | + | @Callable(df) | |
890 | + | func getOneTknREADONLY (ed,dL) = { | |
891 | + | let fi = ec(aK(ed), dL, aT, unit, unit) | |
892 | + | let ff = fi._1 | |
893 | + | let cP = fi._2 | |
894 | + | let du = fi._3 | |
895 | + | let eW = fi._4 | |
896 | + | $Tuple2(nil, $Tuple3(ff, du, eW)) | |
897 | + | } | |
898 | + | ||
899 | + | ||
900 | + | ||
901 | + | @Callable(df) | |
902 | + | func unstakeAndGetOneTkn (fj,fc,eQ) = { | |
903 | + | let eS = { | |
904 | + | let aD = invoke(aA, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
905 | + | if ($isInstanceOf(aD, "Boolean")) | |
906 | + | then aD | |
907 | + | else throw(($getType(aD) + " couldn't be cast to Boolean")) | |
908 | + | } | |
909 | + | let fd = if (if (aF()) | |
910 | + | then true | |
911 | + | else (aS == n)) | |
912 | + | then true | |
913 | + | else eS | |
914 | + | let ee = [if (if (!(fd)) | |
915 | + | then true | |
916 | + | else ey(df)) | |
917 | + | then true | |
918 | + | else ay("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
919 | + | then true | |
920 | + | else ay("no payments are expected")] | |
921 | + | if ((ee == ee)) | |
922 | + | then { | |
923 | + | let ed = aK(fc) | |
924 | + | let X = df.caller | |
925 | + | let Y = df.transactionId | |
926 | + | let fk = invoke(aZ, "unstake", [toBase58String(aT), fj], nil) | |
927 | + | if ((fk == fk)) | |
928 | + | then { | |
929 | + | let fl = ec(ed, fj, aT, X, Y) | |
930 | + | if ((fl == fl)) | |
931 | + | then { | |
932 | + | let eW = fl._4 | |
933 | + | let du = fl._3 | |
934 | + | let cP = fl._2 | |
935 | + | let ff = fl._1 | |
936 | + | let dn = if (if ((eQ > 0)) | |
937 | + | then (eQ > ff) | |
861 | 938 | else false) | |
862 | - | then | |
863 | - | else | |
864 | - | let | |
865 | - | if (( | |
939 | + | then ay(makeString(["amount to receive is less than ", toString(eQ)], "")) | |
940 | + | else ff | |
941 | + | let fg = invoke(aA, "burn", [fj], [AttachedPayment(aT, fj)]) | |
942 | + | if ((fg == fg)) | |
866 | 943 | then { | |
867 | - | let fi = if (fq) | |
868 | - | then { | |
869 | - | let fz = invoke(bh, "stake", nil, [AttachedPayment(bb, fy)]) | |
870 | - | if ((fz == fz)) | |
871 | - | then nil | |
872 | - | else throw("Strict value is not equal to itself.") | |
873 | - | } | |
874 | - | else [ScriptTransfer(dC.caller, fy, bb)] | |
875 | - | let fA = if ((dQ > 0)) | |
876 | - | then [ScriptTransfer(aM, dQ, dT)] | |
944 | + | let fh = [ScriptTransfer(df.caller, dn, ed)] | |
945 | + | let fa = if ((du > 0)) | |
946 | + | then [ScriptTransfer(aB, du, ed)] | |
877 | 947 | else nil | |
878 | - | let fB = if ((this == aM)) | |
879 | - | then $Tuple2(0, 0) | |
880 | - | else if (dX) | |
881 | - | then $Tuple2(-(dQ), 0) | |
882 | - | else $Tuple2(0, -(dQ)) | |
883 | - | let dm = fB._1 | |
884 | - | let dn = fB._2 | |
885 | - | let fC = dl(dm, dn, 0) | |
886 | - | let fl = fC._1 | |
887 | - | let dc = fC._2 | |
888 | - | let dw = value(getString(ah)) | |
889 | - | let fm = dp(dk, dc) | |
890 | - | if ((fm == fm)) | |
891 | - | then $Tuple2((((cY ++ fi) ++ fA) ++ fl), fy) | |
892 | - | else throw("Strict value is not equal to itself.") | |
948 | + | $Tuple2(((cP ++ fh) ++ fa), dn) | |
893 | 949 | } | |
894 | 950 | else throw("Strict value is not equal to itself.") | |
895 | 951 | } | |
896 | 952 | else throw("Strict value is not equal to itself.") | |
897 | 953 | } | |
898 | 954 | else throw("Strict value is not equal to itself.") | |
899 | 955 | } | |
900 | 956 | else throw("Strict value is not equal to itself.") | |
901 | 957 | } | |
902 | 958 | ||
903 | 959 | ||
904 | 960 | ||
905 | - | @Callable(dC) | |
906 | - | func putOneTknREADONLY (dT,dS) = { | |
907 | - | let fD = dR(dS, aS(dT), unit, unit) | |
908 | - | let fx = fD._1 | |
909 | - | let cY = fD._2 | |
910 | - | let dQ = fD._3 | |
911 | - | let fw = fD._4 | |
912 | - | let dX = fD._5 | |
913 | - | $Tuple2(nil, $Tuple3(fx, dQ, fw)) | |
961 | + | @Callable(df) | |
962 | + | func get () = { | |
963 | + | let cA = de(df) | |
964 | + | let fm = cA._1 | |
965 | + | let ch = cA._2 | |
966 | + | let dh = cA._3 | |
967 | + | let bP = cA._4 | |
968 | + | let ci = cA._5 | |
969 | + | let fn = invoke(aA, "burn", [dh], [AttachedPayment(bP, dh)]) | |
970 | + | if ((fn == fn)) | |
971 | + | then ci | |
972 | + | else throw("Strict value is not equal to itself.") | |
914 | 973 | } | |
915 | 974 | ||
916 | 975 | ||
917 | 976 | ||
918 | - | @Callable(dC) | |
919 | - | func getOneTkn (fE,fp) = { | |
920 | - | let fr = { | |
921 | - | let fs = invoke(aL, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
922 | - | if ($isInstanceOf(fs, "Boolean")) | |
923 | - | then fs | |
924 | - | else throw(($getType(fs) + " couldn't be cast to Boolean")) | |
925 | - | } | |
926 | - | let fF = if (if (aN()) | |
927 | - | then true | |
928 | - | else (ba == n)) | |
929 | - | then true | |
930 | - | else fr | |
931 | - | let ey = [if (if (!(fF)) | |
932 | - | then true | |
933 | - | else eT(dC)) | |
934 | - | then true | |
935 | - | else aI("get operation is blocked by admin"), if ((size(dC.payments) == 1)) | |
936 | - | then true | |
937 | - | else aI("exactly 1 payment are expected")] | |
938 | - | if ((ey == ey)) | |
977 | + | @Callable(df) | |
978 | + | func getNoLess (fo,fp) = { | |
979 | + | let cA = de(df) | |
980 | + | let cg = cA._1 | |
981 | + | let ch = cA._2 | |
982 | + | let dh = cA._3 | |
983 | + | let bP = cA._4 | |
984 | + | let ci = cA._5 | |
985 | + | if ((fo > cg)) | |
986 | + | then throw(((("noLessThenAmtAsset failed: " + toString(cg)) + " < ") + toString(fo))) | |
987 | + | else if ((fp > ch)) | |
988 | + | then throw(((("noLessThenPriceAsset failed: " + toString(ch)) + " < ") + toString(fp))) | |
989 | + | else { | |
990 | + | let fn = invoke(aA, "burn", [dh], [AttachedPayment(bP, dh)]) | |
991 | + | if ((fn == fn)) | |
992 | + | then ci | |
993 | + | else throw("Strict value is not equal to itself.") | |
994 | + | } | |
995 | + | } | |
996 | + | ||
997 | + | ||
998 | + | ||
999 | + | @Callable(df) | |
1000 | + | func unstakeAndGet (dn) = { | |
1001 | + | let fq = if ((size(df.payments) != 0)) | |
1002 | + | then throw("No payments are expected") | |
1003 | + | else true | |
1004 | + | if ((fq == fq)) | |
939 | 1005 | then { | |
940 | - | let ex = aS(fE) | |
941 | - | let fu = dC.payments[0] | |
942 | - | let dT = fu.assetId | |
943 | - | let ef = fu.amount | |
944 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
945 | - | if ((dk == dk)) | |
1006 | + | let bE = aH() | |
1007 | + | let bR = fromBase58String(bE[q]) | |
1008 | + | let fk = invoke(aZ, "unstake", [toBase58String(bR), dn], nil) | |
1009 | + | if ((fk == fk)) | |
946 | 1010 | then { | |
947 | - | let Z = dC.caller | |
948 | - | let aa = dC.transactionId | |
949 | - | let fG = ew(ex, ef, dT, Z, aa) | |
950 | - | if ((fG == fG)) | |
1011 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(bR), dn, df.caller) | |
1012 | + | let bU = parseIntValue(cA._9) | |
1013 | + | let ci = cA._10 | |
1014 | + | let fr = if (if (aF()) | |
1015 | + | then true | |
1016 | + | else (bU == n)) | |
1017 | + | then throw(("Get operation is blocked by admin. Status = " + toString(bU))) | |
1018 | + | else true | |
1019 | + | if ((fr == fr)) | |
951 | 1020 | then { | |
952 | - | let ez = fG._5 | |
953 | - | let fw = fG._4 | |
954 | - | let dQ = fG._3 | |
955 | - | let cY = fG._2 | |
956 | - | let fH = fG._1 | |
957 | - | let dK = if (if ((fp > 0)) | |
958 | - | then (fp > fH) | |
959 | - | else false) | |
960 | - | then aI(makeString(["amount to receive is less than ", toString(fp)], "")) | |
961 | - | else fH | |
962 | - | let fI = invoke(aL, "burn", [ef], [AttachedPayment(dT, ef)]) | |
963 | - | if ((fI == fI)) | |
964 | - | then { | |
965 | - | let fJ = [ScriptTransfer(Z, dK, ex)] | |
966 | - | let fA = if ((dQ > 0)) | |
967 | - | then [ScriptTransfer(aM, dQ, ex)] | |
968 | - | else nil | |
969 | - | let fK = { | |
970 | - | let fL = if ((this == aM)) | |
971 | - | then 0 | |
972 | - | else dQ | |
973 | - | if (ez) | |
974 | - | then $Tuple2(-((dK + fL)), 0) | |
975 | - | else $Tuple2(0, -((dK + fL))) | |
976 | - | } | |
977 | - | let dm = fK._1 | |
978 | - | let dn = fK._2 | |
979 | - | let fM = dl(dm, dn, 0) | |
980 | - | let fl = fM._1 | |
981 | - | let dc = fM._2 | |
982 | - | let fm = dp(dk, dc) | |
983 | - | if ((fm == fm)) | |
984 | - | then $Tuple2((((cY ++ fJ) ++ fA) ++ fl), dK) | |
985 | - | else throw("Strict value is not equal to itself.") | |
986 | - | } | |
1021 | + | let fn = invoke(aA, "burn", [dn], [AttachedPayment(bR, dn)]) | |
1022 | + | if ((fn == fn)) | |
1023 | + | then ci | |
987 | 1024 | else throw("Strict value is not equal to itself.") | |
988 | 1025 | } | |
989 | 1026 | else throw("Strict value is not equal to itself.") | |
990 | 1027 | } | |
991 | 1028 | else throw("Strict value is not equal to itself.") | |
992 | 1029 | } | |
993 | 1030 | else throw("Strict value is not equal to itself.") | |
994 | 1031 | } | |
995 | 1032 | ||
996 | 1033 | ||
997 | 1034 | ||
998 | - | @Callable(dC) | |
999 | - | func getOneTknREADONLY (ex,ef) = { | |
1000 | - | let fN = ew(aS(ex), ef, bb, unit, unit) | |
1001 | - | let fH = fN._1 | |
1002 | - | let cY = fN._2 | |
1003 | - | let dQ = fN._3 | |
1004 | - | let fw = fN._4 | |
1005 | - | let ez = fN._5 | |
1006 | - | $Tuple2(nil, $Tuple3(fH, dQ, fw)) | |
1007 | - | } | |
1008 | - | ||
1009 | - | ||
1010 | - | ||
1011 | - | @Callable(dC) | |
1012 | - | func unstakeAndGetOneTkn (fO,fE,fp) = { | |
1013 | - | let fr = { | |
1014 | - | let fs = invoke(aL, "isPoolOneTokenOperationsDisabledREADONLY", [toString(this)], nil) | |
1015 | - | if ($isInstanceOf(fs, "Boolean")) | |
1016 | - | then fs | |
1017 | - | else throw(($getType(fs) + " couldn't be cast to Boolean")) | |
1018 | - | } | |
1019 | - | let fF = if (if (aN()) | |
1035 | + | @Callable(df) | |
1036 | + | func unstakeAndGetNoLess (fj,fs,fp) = { | |
1037 | + | let fd = if (aF()) | |
1020 | 1038 | then true | |
1021 | - | else (ba == n)) | |
1039 | + | else (aS == n) | |
1040 | + | let ee = [if (!(fd)) | |
1022 | 1041 | then true | |
1023 | - | else fr | |
1024 | - | let ey = [if (if (!(fF)) | |
1042 | + | else throw("get operation is blocked by admin"), if ((size(df.payments) == 0)) | |
1025 | 1043 | then true | |
1026 | - | else eT(dC)) | |
1027 | - | then true | |
1028 | - | else aI("get operation is blocked by admin"), if ((size(dC.payments) == 0)) | |
1029 | - | then true | |
1030 | - | else aI("no payments are expected")] | |
1031 | - | if ((ey == ey)) | |
1044 | + | else throw("no payments are expected")] | |
1045 | + | if ((ee == ee)) | |
1032 | 1046 | then { | |
1033 | - | let ex = aS(fE) | |
1034 | - | let Z = dC.caller | |
1035 | - | let aa = dC.transactionId | |
1036 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1037 | - | if ((dk == dk)) | |
1047 | + | let fk = invoke(aZ, "unstake", [toBase58String(aT), fj], nil) | |
1048 | + | if ((fk == fk)) | |
1038 | 1049 | then { | |
1039 | - | let fP = invoke(bh, "unstake", [toBase58String(bb), fO], nil) | |
1040 | - | if ((fP == fP)) | |
1050 | + | let cA = bN(toBase58String(df.transactionId), toBase58String(aT), fj, df.caller) | |
1051 | + | let cg = cA._1 | |
1052 | + | let ch = cA._2 | |
1053 | + | let ci = cA._10 | |
1054 | + | let ft = [if ((cg >= fs)) | |
1055 | + | then true | |
1056 | + | else throw(makeString(["amount asset amount to receive is less than ", toString(fs)], "")), if ((ch >= fp)) | |
1057 | + | then true | |
1058 | + | else throw(makeString(["price asset amount to receive is less than ", toString(fp)], ""))] | |
1059 | + | if ((ft == ft)) | |
1041 | 1060 | then { | |
1042 | - | let fQ = ew(ex, fO, bb, Z, aa) | |
1043 | - | if ((fQ == fQ)) | |
1044 | - | then { | |
1045 | - | let ez = fQ._5 | |
1046 | - | let fw = fQ._4 | |
1047 | - | let dQ = fQ._3 | |
1048 | - | let cY = fQ._2 | |
1049 | - | let fH = fQ._1 | |
1050 | - | let dK = if (if ((fp > 0)) | |
1051 | - | then (fp > fH) | |
1052 | - | else false) | |
1053 | - | then aI(makeString(["amount to receive is less than ", toString(fp)], "")) | |
1054 | - | else fH | |
1055 | - | let fI = invoke(aL, "burn", [fO], [AttachedPayment(bb, fO)]) | |
1056 | - | if ((fI == fI)) | |
1057 | - | then { | |
1058 | - | let fJ = [ScriptTransfer(dC.caller, dK, ex)] | |
1059 | - | let fA = if ((dQ > 0)) | |
1060 | - | then [ScriptTransfer(aM, dQ, ex)] | |
1061 | - | else nil | |
1062 | - | let fR = { | |
1063 | - | let fL = if ((this == aM)) | |
1064 | - | then 0 | |
1065 | - | else dQ | |
1066 | - | if (ez) | |
1067 | - | then $Tuple2(-((dK + fL)), 0) | |
1068 | - | else $Tuple2(0, -((dK + fL))) | |
1069 | - | } | |
1070 | - | let dm = fR._1 | |
1071 | - | let dn = fR._2 | |
1072 | - | let fS = dl(dm, dn, 0) | |
1073 | - | let fl = fS._1 | |
1074 | - | let dc = fS._2 | |
1075 | - | let fm = dp(dk, dc) | |
1076 | - | if ((fm == fm)) | |
1077 | - | then $Tuple2((((cY ++ fJ) ++ fA) ++ fl), dK) | |
1078 | - | else throw("Strict value is not equal to itself.") | |
1079 | - | } | |
1080 | - | else throw("Strict value is not equal to itself.") | |
1081 | - | } | |
1061 | + | let fn = invoke(aA, "burn", [fj], [AttachedPayment(aT, fj)]) | |
1062 | + | if ((fn == fn)) | |
1063 | + | then ci | |
1082 | 1064 | else throw("Strict value is not equal to itself.") | |
1083 | 1065 | } | |
1084 | 1066 | else throw("Strict value is not equal to itself.") | |
1085 | 1067 | } | |
1086 | 1068 | else throw("Strict value is not equal to itself.") | |
1087 | 1069 | } | |
1088 | 1070 | else throw("Strict value is not equal to itself.") | |
1089 | 1071 | } | |
1090 | 1072 | ||
1091 | 1073 | ||
1092 | 1074 | ||
1093 | - | @Callable(dC) | |
1094 | - | func get () = { | |
1095 | - | let cJ = dB(dC) | |
1096 | - | let fT = cJ._1 | |
1097 | - | let cq = cJ._2 | |
1098 | - | let dE = cJ._3 | |
1099 | - | let bY = cJ._4 | |
1100 | - | let cr = cJ._5 | |
1101 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1102 | - | if ((dk == dk)) | |
1103 | - | then { | |
1104 | - | let fU = invoke(aL, "burn", [dE], [AttachedPayment(bY, dE)]) | |
1105 | - | if ((fU == fU)) | |
1106 | - | then { | |
1107 | - | let fV = dl(-(fT), -(cq), 0) | |
1108 | - | let fl = fV._1 | |
1109 | - | let dc = fV._2 | |
1110 | - | let fm = dp(dk, dc) | |
1111 | - | if ((fm == fm)) | |
1112 | - | then (cr ++ fl) | |
1113 | - | else throw("Strict value is not equal to itself.") | |
1114 | - | } | |
1115 | - | else throw("Strict value is not equal to itself.") | |
1116 | - | } | |
1117 | - | else throw("Strict value is not equal to itself.") | |
1075 | + | @Callable(df) | |
1076 | + | func activate (fu,fv) = if ((toString(df.caller) != toString(aA))) | |
1077 | + | then throw("permissions denied") | |
1078 | + | else $Tuple2([StringEntry(aa(), fu), StringEntry(ab(), fv)], "success") | |
1079 | + | ||
1080 | + | ||
1081 | + | ||
1082 | + | @Callable(df) | |
1083 | + | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aH()) | |
1084 | + | ||
1085 | + | ||
1086 | + | ||
1087 | + | @Callable(df) | |
1088 | + | func getAccBalanceWrapperREADONLY (br) = $Tuple2(nil, bq(br)) | |
1089 | + | ||
1090 | + | ||
1091 | + | ||
1092 | + | @Callable(df) | |
1093 | + | func calcPricesWrapperREADONLY (by,bz,bD) = { | |
1094 | + | let bM = bC(by, bz, bD) | |
1095 | + | $Tuple2(nil, [toString(bM[0]), toString(bM[1]), toString(bM[2])]) | |
1118 | 1096 | } | |
1119 | 1097 | ||
1120 | 1098 | ||
1121 | 1099 | ||
1122 | - | @Callable(dC) | |
1123 | - | func getNoLess (fW,fX) = { | |
1124 | - | let cJ = dB(dC) | |
1125 | - | let cp = cJ._1 | |
1126 | - | let cq = cJ._2 | |
1127 | - | let dE = cJ._3 | |
1128 | - | let bY = cJ._4 | |
1129 | - | let cr = cJ._5 | |
1130 | - | if ((fW > cp)) | |
1131 | - | then throw(((("noLessThenAmtAsset failed: " + toString(cp)) + " < ") + toString(fW))) | |
1132 | - | else if ((fX > cq)) | |
1133 | - | then throw(((("noLessThenPriceAsset failed: " + toString(cq)) + " < ") + toString(fX))) | |
1134 | - | else { | |
1135 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1136 | - | if ((dk == dk)) | |
1137 | - | then { | |
1138 | - | let fU = invoke(aL, "burn", [dE], [AttachedPayment(bY, dE)]) | |
1139 | - | if ((fU == fU)) | |
1140 | - | then { | |
1141 | - | let fY = dl(-(cp), -(cq), 0) | |
1142 | - | let fl = fY._1 | |
1143 | - | let dc = fY._2 | |
1144 | - | let fm = dp(dk, dc) | |
1145 | - | if ((fm == fm)) | |
1146 | - | then (cr ++ fl) | |
1147 | - | else throw("Strict value is not equal to itself.") | |
1148 | - | } | |
1149 | - | else throw("Strict value is not equal to itself.") | |
1150 | - | } | |
1151 | - | else throw("Strict value is not equal to itself.") | |
1152 | - | } | |
1100 | + | @Callable(df) | |
1101 | + | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1102 | + | ||
1103 | + | ||
1104 | + | ||
1105 | + | @Callable(df) | |
1106 | + | func fromX18WrapperREADONLY (H,I) = $Tuple2(nil, G(parseBigIntValue(H), I)) | |
1107 | + | ||
1108 | + | ||
1109 | + | ||
1110 | + | @Callable(df) | |
1111 | + | func calcPriceBigIntWrapperREADONLY (bt,bu) = $Tuple2(nil, toString(bs(parseBigIntValue(bt), parseBigIntValue(bu)))) | |
1112 | + | ||
1113 | + | ||
1114 | + | ||
1115 | + | @Callable(df) | |
1116 | + | func estimatePutOperationWrapperREADONLY (bO,ck,cl,cm,cn,co,X,cp,cq) = $Tuple2(nil, cj(bO, ck, cl, cm, cn, co, X, cp, cq)) | |
1117 | + | ||
1118 | + | ||
1119 | + | ||
1120 | + | @Callable(df) | |
1121 | + | func estimateGetOperationWrapperREADONLY (bO,bP,bQ,X) = { | |
1122 | + | let cA = bN(bO, bP, bQ, addressFromStringValue(X)) | |
1123 | + | $Tuple2(nil, $Tuple10(cA._1, cA._2, cA._3, cA._4, cA._5, cA._6, cA._7, toString(cA._8), cA._9, cA._10)) | |
1153 | 1124 | } | |
1154 | 1125 | ||
1155 | 1126 | ||
1156 | 1127 | ||
1157 | - | @Callable(dC) | |
1158 | - | func unstakeAndGet (dK) = { | |
1159 | - | let fZ = if ((size(dC.payments) != 0)) | |
1160 | - | then throw("No payments are expected") | |
1161 | - | else true | |
1162 | - | if ((fZ == fZ)) | |
1163 | - | then { | |
1164 | - | let bN = aP() | |
1165 | - | let ca = fromBase58String(bN[q]) | |
1166 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1167 | - | if ((dk == dk)) | |
1168 | - | then { | |
1169 | - | let fP = invoke(bh, "unstake", [toBase58String(ca), dK], nil) | |
1170 | - | if ((fP == fP)) | |
1171 | - | then { | |
1172 | - | let cJ = bW(toBase58String(dC.transactionId), toBase58String(ca), dK, dC.caller) | |
1173 | - | let cp = cJ._1 | |
1174 | - | let cq = cJ._2 | |
1175 | - | let cd = parseIntValue(cJ._9) | |
1176 | - | let cr = cJ._10 | |
1177 | - | let ga = if (if (aN()) | |
1178 | - | then true | |
1179 | - | else (cd == n)) | |
1180 | - | then throw(("Get operation is blocked by admin. Status = " + toString(cd))) | |
1181 | - | else true | |
1182 | - | if ((ga == ga)) | |
1183 | - | then { | |
1184 | - | let fU = invoke(aL, "burn", [dK], [AttachedPayment(ca, dK)]) | |
1185 | - | if ((fU == fU)) | |
1186 | - | then { | |
1187 | - | let gb = dl(-(cp), -(cq), 0) | |
1188 | - | let fl = gb._1 | |
1189 | - | let dc = gb._2 | |
1190 | - | let fm = dp(dk, dc) | |
1191 | - | if ((fm == fm)) | |
1192 | - | then (cr ++ fl) | |
1193 | - | else throw("Strict value is not equal to itself.") | |
1194 | - | } | |
1195 | - | else throw("Strict value is not equal to itself.") | |
1196 | - | } | |
1197 | - | else throw("Strict value is not equal to itself.") | |
1198 | - | } | |
1199 | - | else throw("Strict value is not equal to itself.") | |
1200 | - | } | |
1201 | - | else throw("Strict value is not equal to itself.") | |
1202 | - | } | |
1203 | - | else throw("Strict value is not equal to itself.") | |
1128 | + | @Callable(df) | |
1129 | + | func statsREADONLY () = { | |
1130 | + | let bE = aH() | |
1131 | + | let bR = fromBase58String(bE[q]) | |
1132 | + | let cS = bE[r] | |
1133 | + | let cT = bE[s] | |
1134 | + | let ct = bE[v] | |
1135 | + | let cu = bE[w] | |
1136 | + | let bF = parseIntValue(bE[t]) | |
1137 | + | let bG = parseIntValue(bE[u]) | |
1138 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1139 | + | let cU = bq(cS) | |
1140 | + | let cV = bq(cT) | |
1141 | + | let fx = if ((fw == 0)) | |
1142 | + | then [e, e, e] | |
1143 | + | else bC(cU, cV, fw) | |
1144 | + | let cb = 0 | |
1145 | + | let fy = G(fx[1], b) | |
1146 | + | let fz = G(fx[2], b) | |
1147 | + | let fA = value(getInteger(aA, am(toString(this)))) | |
1148 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cU), toString(cV), toString(fw), toString(cb), toString(fy), toString(fz), toString(fA)], j)) | |
1204 | 1149 | } | |
1205 | 1150 | ||
1206 | 1151 | ||
1207 | 1152 | ||
1208 | - | @Callable(dC) | |
1209 | - | func unstakeAndGetNoLess (fO,gc,fX) = { | |
1210 | - | let fF = if (aN()) | |
1211 | - | then true | |
1212 | - | else (ba == n) | |
1213 | - | let ey = [if (!(fF)) | |
1214 | - | then true | |
1215 | - | else throw("get operation is blocked by admin"), if ((size(dC.payments) == 0)) | |
1216 | - | then true | |
1217 | - | else throw("no payments are expected")] | |
1218 | - | if ((ey == ey)) | |
1219 | - | then { | |
1220 | - | let dk = dd(toBigInt(0), toBigInt(0), toBigInt(0)) | |
1221 | - | if ((dk == dk)) | |
1222 | - | then { | |
1223 | - | let fP = invoke(bh, "unstake", [toBase58String(bb), fO], nil) | |
1224 | - | if ((fP == fP)) | |
1225 | - | then { | |
1226 | - | let cJ = bW(toBase58String(dC.transactionId), toBase58String(bb), fO, dC.caller) | |
1227 | - | let cp = cJ._1 | |
1228 | - | let cq = cJ._2 | |
1229 | - | let cr = cJ._10 | |
1230 | - | let gd = [if ((cp >= gc)) | |
1231 | - | then true | |
1232 | - | else throw(makeString(["amount asset amount to receive is less than ", toString(gc)], "")), if ((cq >= fX)) | |
1233 | - | then true | |
1234 | - | else throw(makeString(["price asset amount to receive is less than ", toString(fX)], ""))] | |
1235 | - | if ((gd == gd)) | |
1236 | - | then { | |
1237 | - | let fU = invoke(aL, "burn", [fO], [AttachedPayment(bb, fO)]) | |
1238 | - | if ((fU == fU)) | |
1239 | - | then { | |
1240 | - | let ge = dl(-(cp), -(cq), 0) | |
1241 | - | let fl = ge._1 | |
1242 | - | let dc = ge._2 | |
1243 | - | let fm = dp(dk, dc) | |
1244 | - | if ((fm == fm)) | |
1245 | - | then (cr ++ fl) | |
1246 | - | else throw("Strict value is not equal to itself.") | |
1247 | - | } | |
1248 | - | else throw("Strict value is not equal to itself.") | |
1249 | - | } | |
1250 | - | else throw("Strict value is not equal to itself.") | |
1251 | - | } | |
1252 | - | else throw("Strict value is not equal to itself.") | |
1253 | - | } | |
1254 | - | else throw("Strict value is not equal to itself.") | |
1255 | - | } | |
1256 | - | else throw("Strict value is not equal to itself.") | |
1153 | + | @Callable(df) | |
1154 | + | func evaluatePutByAmountAssetREADONLY (cl) = { | |
1155 | + | let bE = aH() | |
1156 | + | let bR = fromBase58String(bE[q]) | |
1157 | + | let cr = bE[r] | |
1158 | + | let bS = fromBase58String(cr) | |
1159 | + | let cs = bE[s] | |
1160 | + | let bT = fromBase58String(cs) | |
1161 | + | let bF = parseIntValue(bE[t]) | |
1162 | + | let bG = parseIntValue(bE[u]) | |
1163 | + | let bU = bE[p] | |
1164 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1165 | + | let cU = bq(cr) | |
1166 | + | let cV = bq(cs) | |
1167 | + | let bA = D(cU, bF) | |
1168 | + | let bB = D(cV, bG) | |
1169 | + | let ca = if ((fw == 0)) | |
1170 | + | then e | |
1171 | + | else bs(bB, bA) | |
1172 | + | let cx = D(cl, bF) | |
1173 | + | let cy = fraction(cx, ca, d) | |
1174 | + | let cn = G(cy, bG) | |
1175 | + | let dl = cj("", 500000, cl, bS, cn, bT, "", true, false) | |
1176 | + | let cI = dl._1 | |
1177 | + | let fB = dl._3 | |
1178 | + | let bW = dl._4 | |
1179 | + | let bY = dl._5 | |
1180 | + | let bV = dl._6 | |
1181 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cI), toString(G(ca, b)), toString(bW), toString(bY), toString(bV), bU, toString(cl), toString(cn)], j)) | |
1257 | 1182 | } | |
1258 | 1183 | ||
1259 | 1184 | ||
1260 | 1185 | ||
1261 | - | @Callable(dC) | |
1262 | - | func activate (gf,gg) = if ((toString(dC.caller) != toString(aL))) | |
1263 | - | then throw("permissions denied") | |
1264 | - | else $Tuple2([StringEntry(ac(), gf), StringEntry(ad(), gg)], "success") | |
1265 | - | ||
1266 | - | ||
1267 | - | ||
1268 | - | @Callable(dC) | |
1269 | - | func refreshKLp () = { | |
1270 | - | let gh = valueOrElse(getInteger(ai), 0) | |
1271 | - | let gi = if (((height - gh) >= al)) | |
1272 | - | then unit | |
1273 | - | else aI(makeString([toString(al), " blocks have not passed since the previous call"], "")) | |
1274 | - | if ((gi == gi)) | |
1275 | - | then { | |
1276 | - | let dw = valueOrErrorMessage(parseBigInt(valueOrElse(getString(this, ah), "0")), aK("invalid kLp")) | |
1277 | - | let gj = dl(0, 0, 0) | |
1278 | - | let gk = gj._1 | |
1279 | - | let dc = gj._2 | |
1280 | - | let do = if ((dw != dc)) | |
1281 | - | then gk | |
1282 | - | else aI("nothing to refresh") | |
1283 | - | $Tuple2(do, toString(dc)) | |
1284 | - | } | |
1285 | - | else throw("Strict value is not equal to itself.") | |
1186 | + | @Callable(df) | |
1187 | + | func evaluatePutByPriceAssetREADONLY (cn) = { | |
1188 | + | let bE = aH() | |
1189 | + | let bR = fromBase58String(bE[q]) | |
1190 | + | let cr = bE[r] | |
1191 | + | let bS = fromBase58String(cr) | |
1192 | + | let cs = bE[s] | |
1193 | + | let bT = fromBase58String(cs) | |
1194 | + | let bF = parseIntValue(bE[t]) | |
1195 | + | let bG = parseIntValue(bE[u]) | |
1196 | + | let bU = bE[p] | |
1197 | + | let fw = valueOrErrorMessage(assetInfo(bR), (("Asset " + toBase58String(bR)) + " doesn't exist")).quantity | |
1198 | + | let fC = bq(cr) | |
1199 | + | let fD = bq(cs) | |
1200 | + | let fE = D(fC, bF) | |
1201 | + | let fF = D(fD, bG) | |
1202 | + | let ca = if ((fw == 0)) | |
1203 | + | then e | |
1204 | + | else bs(fF, fE) | |
1205 | + | let cy = D(cn, bG) | |
1206 | + | let cx = fraction(cy, d, ca) | |
1207 | + | let cl = G(cx, bF) | |
1208 | + | let dl = cj("", 500000, cl, bS, cn, bT, "", true, false) | |
1209 | + | let cI = dl._1 | |
1210 | + | let fB = dl._3 | |
1211 | + | let bW = dl._4 | |
1212 | + | let bY = dl._5 | |
1213 | + | let bV = dl._6 | |
1214 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cI), toString(G(ca, b)), toString(bW), toString(bY), toString(bV), bU, toString(cl), toString(cn)], j)) | |
1286 | 1215 | } | |
1287 | 1216 | ||
1288 | 1217 | ||
1289 | 1218 | ||
1290 | - | @Callable(dC) | |
1291 | - | func getPoolConfigWrapperREADONLY () = $Tuple2(nil, aP()) | |
1292 | - | ||
1293 | - | ||
1294 | - | ||
1295 | - | @Callable(dC) | |
1296 | - | func getAccBalanceWrapperREADONLY (bz) = $Tuple2(nil, by(bz)) | |
1297 | - | ||
1298 | - | ||
1299 | - | ||
1300 | - | @Callable(dC) | |
1301 | - | func calcPricesWrapperREADONLY (bH,bI,bM) = { | |
1302 | - | let bV = bL(bH, bI, bM) | |
1303 | - | $Tuple2(nil, [toString(bV[0]), toString(bV[1]), toString(bV[2])]) | |
1219 | + | @Callable(df) | |
1220 | + | func evaluateGetREADONLY (fG,fH) = { | |
1221 | + | let cA = bN("", fG, fH, this) | |
1222 | + | let cg = cA._1 | |
1223 | + | let ch = cA._2 | |
1224 | + | let bW = cA._5 | |
1225 | + | let bY = cA._6 | |
1226 | + | let bV = cA._7 | |
1227 | + | let cb = cA._8 | |
1228 | + | let bU = parseIntValue(cA._9) | |
1229 | + | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cg), toString(ch), toString(bW), toString(bY), toString(bV), toString(cb), toString(bU)], j)) | |
1304 | 1230 | } | |
1305 | 1231 | ||
1306 | 1232 | ||
1307 | - | ||
1308 | - | @Callable(dC) | |
1309 | - | func toX18WrapperREADONLY (E,F) = $Tuple2(nil, toString(D(E, F))) | |
1310 | - | ||
1311 | - | ||
1312 | - | ||
1313 | - | @Callable(dC) | |
1314 | - | func fromX18WrapperREADONLY (H,I) = $Tuple2(nil, G(parseBigIntValue(H), I)) | |
1315 | - | ||
1316 | - | ||
1317 | - | ||
1318 | - | @Callable(dC) | |
1319 | - | func calcPriceBigIntWrapperREADONLY (bB,bC) = $Tuple2(nil, toString(bA(parseBigIntValue(bB), parseBigIntValue(bC)))) | |
1320 | - | ||
1321 | - | ||
1322 | - | ||
1323 | - | @Callable(dC) | |
1324 | - | func estimatePutOperationWrapperREADONLY (bX,ct,cu,cv,cw,cx,Z,cy,cz) = $Tuple2(nil, cs(bX, ct, cu, cv, cw, cx, Z, cy, cz)) | |
1325 | - | ||
1326 | - | ||
1327 | - | ||
1328 | - | @Callable(dC) | |
1329 | - | func estimateGetOperationWrapperREADONLY (bX,bY,bZ,Z) = { | |
1330 | - | let cJ = bW(bX, bY, bZ, addressFromStringValue(Z)) | |
1331 | - | $Tuple2(nil, $Tuple10(cJ._1, cJ._2, cJ._3, cJ._4, cJ._5, cJ._6, cJ._7, toString(cJ._8), cJ._9, cJ._10)) | |
1332 | - | } | |
1333 | - | ||
1334 | - | ||
1335 | - | ||
1336 | - | @Callable(dC) | |
1337 | - | func statsREADONLY () = { | |
1338 | - | let bN = aP() | |
1339 | - | let ca = fromBase58String(bN[q]) | |
1340 | - | let gl = bN[r] | |
1341 | - | let gm = bN[s] | |
1342 | - | let cC = bN[v] | |
1343 | - | let cD = bN[w] | |
1344 | - | let bO = parseIntValue(bN[t]) | |
1345 | - | let bP = parseIntValue(bN[u]) | |
1346 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1347 | - | let go = by(gl) | |
1348 | - | let gp = by(gm) | |
1349 | - | let gq = if ((gn == 0)) | |
1350 | - | then [e, e, e] | |
1351 | - | else bL(go, gp, gn) | |
1352 | - | let ck = 0 | |
1353 | - | let gr = G(gq[1], b) | |
1354 | - | let gs = G(gq[2], b) | |
1355 | - | let gt = value(getInteger(aL, aw(toString(this)))) | |
1356 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(go), toString(gp), toString(gn), toString(ck), toString(gr), toString(gs), toString(gt)], j)) | |
1357 | - | } | |
1358 | - | ||
1359 | - | ||
1360 | - | ||
1361 | - | @Callable(dC) | |
1362 | - | func evaluatePutByAmountAssetREADONLY (cu) = { | |
1363 | - | let bN = aP() | |
1364 | - | let ca = fromBase58String(bN[q]) | |
1365 | - | let cA = bN[r] | |
1366 | - | let cb = fromBase58String(cA) | |
1367 | - | let cB = bN[s] | |
1368 | - | let cc = fromBase58String(cB) | |
1369 | - | let bO = parseIntValue(bN[t]) | |
1370 | - | let bP = parseIntValue(bN[u]) | |
1371 | - | let cd = bN[p] | |
1372 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1373 | - | let go = by(cA) | |
1374 | - | let gp = by(cB) | |
1375 | - | let bJ = D(go, bO) | |
1376 | - | let bK = D(gp, bP) | |
1377 | - | let cj = if ((gn == 0)) | |
1378 | - | then e | |
1379 | - | else bA(bK, bJ) | |
1380 | - | let cG = D(cu, bO) | |
1381 | - | let cH = fraction(cG, cj, d) | |
1382 | - | let cw = G(cH, bP) | |
1383 | - | let dI = cs("", 500000, cu, cb, cw, cc, "", true, false) | |
1384 | - | let cR = dI._1 | |
1385 | - | let gu = dI._3 | |
1386 | - | let cf = dI._4 | |
1387 | - | let ch = dI._5 | |
1388 | - | let ce = dI._6 | |
1389 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cR), toString(G(cj, b)), toString(cf), toString(ch), toString(ce), cd, toString(cu), toString(cw)], j)) | |
1390 | - | } | |
1391 | - | ||
1392 | - | ||
1393 | - | ||
1394 | - | @Callable(dC) | |
1395 | - | func evaluatePutByPriceAssetREADONLY (cw) = { | |
1396 | - | let bN = aP() | |
1397 | - | let ca = fromBase58String(bN[q]) | |
1398 | - | let cA = bN[r] | |
1399 | - | let cb = fromBase58String(cA) | |
1400 | - | let cB = bN[s] | |
1401 | - | let cc = fromBase58String(cB) | |
1402 | - | let bO = parseIntValue(bN[t]) | |
1403 | - | let bP = parseIntValue(bN[u]) | |
1404 | - | let cd = bN[p] | |
1405 | - | let gn = valueOrErrorMessage(assetInfo(ca), (("Asset " + toBase58String(ca)) + " doesn't exist")).quantity | |
1406 | - | let gv = by(cA) | |
1407 | - | let gw = by(cB) | |
1408 | - | let gx = D(gv, bO) | |
1409 | - | let gy = D(gw, bP) | |
1410 | - | let cj = if ((gn == 0)) | |
1411 | - | then e | |
1412 | - | else bA(gy, gx) | |
1413 | - | let cH = D(cw, bP) | |
1414 | - | let cG = fraction(cH, d, cj) | |
1415 | - | let cu = G(cG, bO) | |
1416 | - | let dI = cs("", 500000, cu, cb, cw, cc, "", true, false) | |
1417 | - | let cR = dI._1 | |
1418 | - | let gu = dI._3 | |
1419 | - | let cf = dI._4 | |
1420 | - | let ch = dI._5 | |
1421 | - | let ce = dI._6 | |
1422 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d%d", toString(cR), toString(G(cj, b)), toString(cf), toString(ch), toString(ce), cd, toString(cu), toString(cw)], j)) | |
1423 | - | } | |
1424 | - | ||
1425 | - | ||
1426 | - | ||
1427 | - | @Callable(dC) | |
1428 | - | func evaluateGetREADONLY (gz,gA) = { | |
1429 | - | let cJ = bW("", gz, gA, this) | |
1430 | - | let cp = cJ._1 | |
1431 | - | let cq = cJ._2 | |
1432 | - | let cf = cJ._5 | |
1433 | - | let ch = cJ._6 | |
1434 | - | let ce = cJ._7 | |
1435 | - | let ck = cJ._8 | |
1436 | - | let cd = parseIntValue(cJ._9) | |
1437 | - | $Tuple2(nil, makeString(["%d%d%d%d%d%d%d", toString(cp), toString(cq), toString(cf), toString(ch), toString(ce), toString(ck), toString(cd)], j)) | |
1438 | - | } | |
1439 | - | ||
1440 | - | ||
1441 | - | @Verifier(gB) | |
1442 | - | func gC () = { | |
1443 | - | let gD = { | |
1444 | - | let dN = eQ() | |
1445 | - | if ($isInstanceOf(dN, "ByteVector")) | |
1233 | + | @Verifier(fI) | |
1234 | + | func fJ () = { | |
1235 | + | let fK = { | |
1236 | + | let dq = ev() | |
1237 | + | if ($isInstanceOf(dq, "ByteVector")) | |
1446 | 1238 | then { | |
1447 | - | let | |
1448 | - | | |
1239 | + | let ez = dq | |
1240 | + | ez | |
1449 | 1241 | } | |
1450 | - | else if ($isInstanceOf( | |
1451 | - | then | |
1242 | + | else if ($isInstanceOf(dq, "Unit")) | |
1243 | + | then fI.senderPublicKey | |
1452 | 1244 | else throw("Match error") | |
1453 | 1245 | } | |
1454 | - | let | |
1455 | - | if ($isInstanceOf( | |
1246 | + | let dq = fI | |
1247 | + | if ($isInstanceOf(dq, "Order")) | |
1456 | 1248 | then { | |
1457 | - | let | |
1458 | - | let | |
1459 | - | let | |
1460 | - | let | |
1461 | - | let | |
1462 | - | if (if (if ( | |
1463 | - | then | |
1249 | + | let cR = dq | |
1250 | + | let fL = aG() | |
1251 | + | let ar = cQ(cR) | |
1252 | + | let as = sigVerify(cR.bodyBytes, cR.proofs[0], cR.senderPublicKey) | |
1253 | + | let at = sigVerify(cR.bodyBytes, cR.proofs[1], fL) | |
1254 | + | if (if (if (ar) | |
1255 | + | then as | |
1464 | 1256 | else false) | |
1465 | - | then | |
1257 | + | then at | |
1466 | 1258 | else false) | |
1467 | 1259 | then true | |
1468 | - | else | |
1260 | + | else aq(ar, as, at) | |
1469 | 1261 | } | |
1470 | - | else if ($isInstanceOf( | |
1262 | + | else if ($isInstanceOf(dq, "SetScriptTransaction")) | |
1471 | 1263 | then { | |
1472 | - | let | |
1473 | - | let | |
1474 | - | let | |
1475 | - | let | |
1476 | - | if (if (( | |
1477 | - | then ( | |
1264 | + | let ew = dq | |
1265 | + | let fM = blake2b256(value(ew.script)) | |
1266 | + | let fN = fromBase64String(value(getString(aA, ao()))) | |
1267 | + | let fO = scriptHash(this) | |
1268 | + | if (if ((fN == fM)) | |
1269 | + | then (fO != fM) | |
1478 | 1270 | else false) | |
1479 | 1271 | then true | |
1480 | - | else sigVerify( | |
1272 | + | else sigVerify(fI.bodyBytes, fI.proofs[0], fK) | |
1481 | 1273 | } | |
1482 | - | else sigVerify( | |
1274 | + | else sigVerify(fI.bodyBytes, fI.proofs[0], fK) | |
1483 | 1275 | } | |
1484 | 1276 |
github/deemru/w8io/169f3d6 306.94 ms ◑