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