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