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