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