tx · 3nBXWPNz6QUHWjdV1hXaiGmvAL1XhiWZf519u5YLSr7C 3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N: -0.01500000 Waves 2024.02.05 13:10 [2962833] smart account 3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N > SELF 0.00000000 Waves
{ "type": 13, "id": "3nBXWPNz6QUHWjdV1hXaiGmvAL1XhiWZf519u5YLSr7C", "fee": 1500000, "feeAssetId": null, "timestamp": 1707127934912, "version": 2, "chainId": 84, "sender": "3Mzep1R5kHeC1ecKFkWjuhU3Gw4LAdCib9N", "senderPublicKey": "41THq9VrFxHEvVGJyz2oMpJQErnSkkqJXpBypSDxa5Mv", "proofs": [ "5K5jHMXZaTVEPcFeSsSR6uC5W6mNVzYk3KS9yWZFWtgDzdktGZ2GHaDXPFNSdWe6Db6v1duMhhsMdNynDzdAdLsU" ], "script": "base64:BwIkCAISAwoBGBIDCgEYEgQKAgIYEgQKAgIYEgQKAgIYEgQKAgIYJwAHY2hhaW5JZAkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQAIY2hhaW5JZFQBAVQACGNoYWluSWRXAQFXAANTRVACAl9fAAVXQVZFUwIFV0FWRVMAEGNvbnRyYWN0RmlsZW5hbWUCFXd4ZGFvX2NhbGN1bGF0b3IucmlkZQAFbXVsdDgAgMLXLwAGbXVsdDE4CQC2AgEAgICQu7rWrfANAA13YXZlc0RlY2ltYWxzAAgADHVzZHREZWNpbWFscwAGAQV0b1gxOAIHb3JpZ1ZhbA1vcmlnU2NhbGVNdWx0CQC8AgMJALYCAQUHb3JpZ1ZhbAUGbXVsdDE4CQC2AgEFDW9yaWdTY2FsZU11bHQBB2Zyb21YMTgCA3ZhbA9yZXN1bHRTY2FsZU11bHQJAKADAQkAvAIDBQN2YWwJALYCAQUPcmVzdWx0U2NhbGVNdWx0BQZtdWx0MTgBB3dyYXBFcnIBAXMJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBc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pbAUOZmFjdG9yeUFjdGlvbnMJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEFcHJpY2UCD2NhbGxlclB1YmxpY0tleQRhcmdzBA5mYWN0b3J5QWRkcmVzcwgFAWkGY2FsbGVyCQCUCgIFA25pbAgJAQljYWxjUHJpY2UBBQ5mYWN0b3J5QWRkcmVzcwJfMQFpAQpwcmljZURlYnVnAg9jYWxsZXJQdWJsaWNLZXkEYXJncwQOZmFjdG9yeUFkZHJlc3MIBQFpBmNhbGxlcgkAlAoCBQNuaWwICQEJY2FsY1ByaWNlAQUOZmFjdG9yeUFkZHJlc3MCXzIBaQEQZ2V0VHJlYXN1cnlWYWx1ZQIPY2FsbGVyUHVibGljS2V5BGFyZ3MEDmZhY3RvcnlBZGRyZXNzCAUBaQZjYWxsZXIEDXRyZWFzdXJ5VmFsdWUJAQdmcm9tWDE4AgkBEWNhbGNUcmVhc3VyeVZhbHVlAQUOZmFjdG9yeUFkZHJlc3MJAGwGAAoAAAUMdXNkdERlY2ltYWxzAAAAAAUERE9XTgkAlAoCBQNuaWwFDXRyZWFzdXJ5VmFsdWUBAnR4AQZ2ZXJpZnkACQAAAgUHY2hhaW5JZAUIY2hhaW5JZFR17Llk", "height": 2962833, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3iP4L2rBh2y71LUyNFvSW5QSsy2rqEaX6Z7MhRfWvkYS Next: 7bAZBfr61Lvz5pZo9cfvLwWrS6gT64p15xWg9STLpxtE Diff:
Old | New | Differences | |
---|---|---|---|
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | - | @Callable(aS) | |
371 | - | func withdraw (aT) = { | |
372 | - | let aU = addressFromStringValue(aT[0]) | |
373 | - | let aV = parseIntValue(aT[1]) | |
374 | - | let aW = invoke(aS.caller, "transferWaves", [aU.bytes, aV], nil) | |
375 | - | $Tuple2(nil, aW) | |
370 | + | func aS (D) = { | |
371 | + | let aj = K(D) | |
372 | + | let aT = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
373 | + | let aU = valueOrErrorMessage(getInteger(D, y(aT)), q(("invalid treasury value for period " + toString(aT)))) | |
374 | + | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
375 | + | let aV = (aR - aU) | |
376 | + | let aW = G(D) | |
377 | + | let aX = ai(aj, [toBase58String(aW)])[0] | |
378 | + | let aY = if ((aX > toBigInt(0))) | |
379 | + | then n(aX, pow(10, 0, j, 0, 0, DOWN)) | |
380 | + | else s("invalid PWR price") | |
381 | + | let A = M(D) | |
382 | + | let aZ = valueOrElse(getInteger(I(D), z(A)), 0) | |
383 | + | let ba = (R(Q(D)).quantity / 100) | |
384 | + | let bb = (aZ + ba) | |
385 | + | let bc = T(D, [toBase58String(t)])[0] | |
386 | + | let bd = if ((bc > toBigInt(0))) | |
387 | + | then n(bc, pow(10, 0, j, 0, 0, DOWN)) | |
388 | + | else s("invalid factory wx balance") | |
389 | + | let be = ai(aj, [toBase58String(t)])[0] | |
390 | + | let bf = if ((be > toBigInt(0))) | |
391 | + | then n(be, pow(10, 0, j, 0, 0, DOWN)) | |
392 | + | else s("invalid wx price") | |
393 | + | let bg = R(Q(D)).quantity | |
394 | + | let bh = (((aY + fraction((bd * 100), bf, bg)) + fraction(max([aV, 0]), 2, (10 * bb))) / 100) | |
395 | + | $Tuple2(bh, [["wxDaoPrice", bh], ["pwrPrice", aY], ["factoryAddressWxBalance", bd], ["wxPrice", bf], ["wxdaoQuantity", bg], ["treasuryValueDiff", aV], ["pwrAmount", bb]]) | |
396 | + | } | |
397 | + | ||
398 | + | ||
399 | + | @Callable(bi) | |
400 | + | func withdraw (bj) = { | |
401 | + | let bk = addressFromStringValue(bj[0]) | |
402 | + | let bl = parseIntValue(bj[1]) | |
403 | + | let bm = invoke(bi.caller, "transferWaves", [bk.bytes, bl], nil) | |
404 | + | $Tuple2(nil, bm) | |
376 | 405 | } | |
377 | 406 | ||
378 | 407 | ||
379 | 408 | ||
380 | - | @Callable( | |
381 | - | func setIntParam ( | |
382 | - | let | |
383 | - | let o = parseIntValue( | |
384 | - | let | |
385 | - | $Tuple2(nil, | |
409 | + | @Callable(bi) | |
410 | + | func setIntParam (bj) = { | |
411 | + | let bn = bj[0] | |
412 | + | let o = parseIntValue(bj[1]) | |
413 | + | let bm = invoke(bi.caller, "integerEntry", [bn, o], nil) | |
414 | + | $Tuple2(nil, bm) | |
386 | 415 | } | |
387 | 416 | ||
388 | 417 | ||
389 | 418 | ||
390 | - | @Callable( | |
391 | - | func swap ( | |
392 | - | let D = | |
393 | - | let | |
394 | - | let | |
395 | - | then | |
419 | + | @Callable(bi) | |
420 | + | func swap (bo,bj) = { | |
421 | + | let D = bi.caller | |
422 | + | let bp = addressFromPublicKey(bo) | |
423 | + | let bq = if ((size(bi.payments) == 1)) | |
424 | + | then bi.payments[0] | |
396 | 425 | else s("1 payment is required") | |
397 | - | let | |
398 | - | let | |
399 | - | then value( | |
400 | - | else s( | |
401 | - | let | |
402 | - | let | |
426 | + | let br = q("invalid payment asset id") | |
427 | + | let bs = if ((valueOrErrorMessage(bq.assetId, br) == Q(D))) | |
428 | + | then value(bq.assetId) | |
429 | + | else s(br) | |
430 | + | let aY = 100 | |
431 | + | let bb = (bq.amount / aY) | |
403 | 432 | let aL = split(O(D), d) | |
404 | - | let | |
405 | - | if (( | |
433 | + | let bt = assetBalance(D, G(D)) | |
434 | + | if ((bt == bt)) | |
406 | 435 | then { | |
407 | 436 | let bg = R(Q(D)).quantity | |
408 | 437 | if ((bg == bg)) | |
413 | 442 | let aP = valueOrErrorMessage(indexOf(aL, Y), q("invalid asset balance")) | |
414 | 443 | let aa = R(S).decimals | |
415 | 444 | let Z = n(aM[aP], pow(10, 0, aa, 0, 0, DOWN)) | |
416 | - | let | |
417 | - | if (( | |
418 | - | then $Tuple2((X._1 :+ S), (X._2 :+ | |
445 | + | let bl = fraction(Z, bq.amount, bg) | |
446 | + | if ((bl > 0)) | |
447 | + | then $Tuple2((X._1 :+ S), (X._2 :+ bl)) | |
419 | 448 | else X | |
420 | 449 | } | |
421 | 450 | ||
422 | - | let | |
451 | + | let bu = { | |
423 | 452 | let ab = aL | |
424 | 453 | let ac = size(ab) | |
425 | 454 | let ad = $Tuple2(nil, nil) | |
433 | 462 | ||
434 | 463 | ah(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6) | |
435 | 464 | } | |
436 | - | if (( | |
465 | + | if ((bu == bu)) | |
437 | 466 | then { | |
438 | - | let | |
439 | - | let | |
467 | + | let bv = 0 | |
468 | + | let bw = ([invoke(D, "commitAfterStartWithLockRoundFor", [toString(I(D)), toString(D), toString(bp), bv, G(D), bb], nil)] ++ (if ((size(bu._1) == 0)) | |
440 | 469 | then nil | |
441 | - | else [invoke(D, "transferAssets", [ | |
442 | - | $Tuple2([Burn( | |
470 | + | else [invoke(D, "transferAssets", [bp.bytes, bu._1, bu._2], nil)])) | |
471 | + | $Tuple2([Burn(bs, bq.amount)], bw) | |
443 | 472 | } | |
444 | 473 | else throw("Strict value is not equal to itself.") | |
445 | 474 | } | |
450 | 479 | ||
451 | 480 | ||
452 | 481 | ||
453 | - | @Callable(aS) | |
454 | - | func price (aY,aT) = { | |
455 | - | let D = aS.caller | |
456 | - | let aj = K(D) | |
457 | - | let bk = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
458 | - | let bl = valueOrErrorMessage(getInteger(D, y(bk)), q(("invalid treasury value for period " + toString(bk)))) | |
459 | - | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
460 | - | let bm = (aR - bl) | |
461 | - | let bn = G(D) | |
462 | - | let bo = ai(aj, [toBase58String(bn)])[0] | |
463 | - | let bd = if ((bo > toBigInt(0))) | |
464 | - | then n(bo, pow(10, 0, j, 0, 0, DOWN)) | |
465 | - | else s("invalid PWR price") | |
466 | - | let A = M(D) | |
467 | - | let bp = valueOrElse(getInteger(I(D), z(A)), 0) | |
468 | - | let bq = (R(Q(D)).quantity / 100) | |
469 | - | let be = (bp + bq) | |
470 | - | let br = T(D, [toBase58String(t)])[0] | |
471 | - | let bs = if ((br > toBigInt(0))) | |
472 | - | then n(br, pow(10, 0, j, 0, 0, DOWN)) | |
473 | - | else s("invalid factory wx balance") | |
474 | - | let bt = ai(aj, [toBase58String(t)])[0] | |
475 | - | let bu = if ((bt > toBigInt(0))) | |
476 | - | then n(bt, pow(10, 0, j, 0, 0, DOWN)) | |
477 | - | else s("invalid wx price") | |
478 | - | let bg = R(Q(D)).quantity | |
479 | - | let ar = (((bd / 100) + fraction(bs, bu, bg)) + fraction(max([bm, 0]), 2, (1000 * be))) | |
480 | - | $Tuple2(nil, ar) | |
482 | + | @Callable(bi) | |
483 | + | func price (bo,bj) = { | |
484 | + | let D = bi.caller | |
485 | + | $Tuple2(nil, aS(D)._1) | |
481 | 486 | } | |
482 | 487 | ||
483 | 488 | ||
484 | 489 | ||
485 | - | @Callable(aS) | |
486 | - | func priceDebug (aY,aT) = { | |
487 | - | let D = aS.caller | |
488 | - | let aj = K(D) | |
489 | - | let bk = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
490 | - | let bl = valueOrErrorMessage(getInteger(D, y(bk)), q(("invalid treasury value for period " + toString(bk)))) | |
491 | - | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
492 | - | let bm = (aR - bl) | |
493 | - | let bn = G(D) | |
494 | - | let bo = ai(aj, [toBase58String(bn)])[0] | |
495 | - | let bd = if ((bo > toBigInt(0))) | |
496 | - | then n(bo, pow(10, 0, j, 0, 0, DOWN)) | |
497 | - | else s("invalid PWR price") | |
498 | - | let A = M(D) | |
499 | - | let bp = valueOrElse(getInteger(I(D), z(A)), 0) | |
500 | - | let bq = (R(Q(D)).quantity / 100) | |
501 | - | let be = (bp + bq) | |
502 | - | let br = T(D, [toBase58String(t)])[0] | |
503 | - | let bs = if ((br > toBigInt(0))) | |
504 | - | then n(br, pow(10, 0, j, 0, 0, DOWN)) | |
505 | - | else s("invalid factory wx balance") | |
506 | - | let bt = ai(aj, [toBase58String(t)])[0] | |
507 | - | let bu = if ((bt > toBigInt(0))) | |
508 | - | then n(bt, pow(10, 0, j, 0, 0, DOWN)) | |
509 | - | else s("invalid wx price") | |
510 | - | let bg = R(Q(D)).quantity | |
511 | - | let bv = (((bd / 100) + fraction(bs, bu, bg)) + fraction(max([bm, 0]), 2, (1000 * be))) | |
512 | - | $Tuple2(nil, [["wxDaoPrice", bv], ["pwrPrice", bd], ["factoryAddressWxBalance", bs], ["wxPrice", bu], ["wxdaoQuantity", bg], ["treasuryValueDiff", bm], ["pwrAmount", be]]) | |
490 | + | @Callable(bi) | |
491 | + | func priceDebug (bo,bj) = { | |
492 | + | let D = bi.caller | |
493 | + | $Tuple2(nil, aS(D)._2) | |
513 | 494 | } | |
514 | 495 | ||
515 | 496 | ||
516 | 497 | ||
517 | - | @Callable( | |
518 | - | func getTreasuryValue ( | |
519 | - | let D = | |
498 | + | @Callable(bi) | |
499 | + | func getTreasuryValue (bo,bj) = { | |
500 | + | let D = bi.caller | |
520 | 501 | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
521 | 502 | $Tuple2(nil, aR) | |
522 | 503 | } | |
523 | 504 | ||
524 | 505 | ||
525 | - | @Verifier( | |
526 | - | func | |
506 | + | @Verifier(bx) | |
507 | + | func by () = (a == b) | |
527 | 508 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 7 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = take(drop(this.bytes, 1), 1) | |
5 | 5 | ||
6 | 6 | let b = base58'2T' | |
7 | 7 | ||
8 | 8 | let c = base58'2W' | |
9 | 9 | ||
10 | 10 | let d = "__" | |
11 | 11 | ||
12 | 12 | let e = "WAVES" | |
13 | 13 | ||
14 | 14 | let f = "wxdao_calculator.ride" | |
15 | 15 | ||
16 | 16 | let g = 100000000 | |
17 | 17 | ||
18 | 18 | let h = toBigInt(1000000000000000000) | |
19 | 19 | ||
20 | 20 | let i = 8 | |
21 | 21 | ||
22 | 22 | let j = 6 | |
23 | 23 | ||
24 | 24 | func k (l,m) = fraction(toBigInt(l), h, toBigInt(m)) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func n (o,p) = toInt(fraction(o, toBigInt(p), h)) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func q (r) = ((f + ": ") + r) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func s (r) = throw(q(r)) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | let t = if ((a == c)) | |
37 | 37 | then base58'Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on' | |
38 | 38 | else if ((a == b)) | |
39 | 39 | then base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
40 | 40 | else s("invalid chain id") | |
41 | 41 | ||
42 | 42 | func u () = makeString(["%s", "currentPeriod"], d) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func v (w) = makeString(["%s%d", "startHeight", toString(w)], d) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func x () = makeString(["%s", "periodLength"], d) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func y (w) = makeString(["%s%d", "treasuryValue", toString(w)], d) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func z (A) = ("skin_total_" + toString(A)) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func B () = "%s__powerConfigAddress" | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func C (D) = valueOrErrorMessage({ | |
61 | 61 | let E = getString(D, B()) | |
62 | 62 | if ($isInstanceOf(E, "String")) | |
63 | 63 | then { | |
64 | 64 | let r = E | |
65 | 65 | addressFromString(r) | |
66 | 66 | } | |
67 | 67 | else if ($isInstanceOf(E, "Unit")) | |
68 | 68 | then unit | |
69 | 69 | else throw("Match error") | |
70 | 70 | }, q("invalid power config address")) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func F () = "powerAssetId" | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func G (D) = fromBase58String(valueOrErrorMessage(getString(C(D), F()), q("invalid power asset id"))) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func H () = "%s__powerContractAddress" | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func I (D) = valueOrErrorMessage({ | |
83 | 83 | let E = getString(D, H()) | |
84 | 84 | if ($isInstanceOf(E, "String")) | |
85 | 85 | then { | |
86 | 86 | let r = E | |
87 | 87 | addressFromString(r) | |
88 | 88 | } | |
89 | 89 | else if ($isInstanceOf(E, "Unit")) | |
90 | 90 | then unit | |
91 | 91 | else throw("Match error") | |
92 | 92 | }, q("invalid power contract address")) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func J () = "%s__poolsFactoryAddress" | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func K (D) = valueOrErrorMessage({ | |
99 | 99 | let E = getString(D, J()) | |
100 | 100 | if ($isInstanceOf(E, "String")) | |
101 | 101 | then { | |
102 | 102 | let r = E | |
103 | 103 | addressFromString(r) | |
104 | 104 | } | |
105 | 105 | else if ($isInstanceOf(E, "Unit")) | |
106 | 106 | then unit | |
107 | 107 | else throw("Match error") | |
108 | 108 | }, q("invalid pools factory address")) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func L () = "%s__treasuryAddress" | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func M (D) = valueOrErrorMessage({ | |
115 | 115 | let E = getString(D, L()) | |
116 | 116 | if ($isInstanceOf(E, "String")) | |
117 | 117 | then { | |
118 | 118 | let r = E | |
119 | 119 | addressFromString(r) | |
120 | 120 | } | |
121 | 121 | else if ($isInstanceOf(E, "Unit")) | |
122 | 122 | then unit | |
123 | 123 | else throw("Match error") | |
124 | 124 | }, q("invalid treasury address")) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func N () = "%s__assets" | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func O (D) = valueOrErrorMessage(getString(D, N()), q("invalid assets")) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func P () = "%s__lpAssetId" | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func Q (D) = fromBase58String(valueOrErrorMessage(getString(D, P()), q("invalid lp asset id"))) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func R (S) = valueOrErrorMessage(assetInfo(S), q("invalid asset info")) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func T (U,V) = { | |
143 | 143 | func W (X,Y) = { | |
144 | 144 | let Z = if ((Y == e)) | |
145 | 145 | then k(wavesBalance(U).available, pow(10, 0, i, 0, 0, DOWN)) | |
146 | 146 | else { | |
147 | 147 | let S = fromBase58String(Y) | |
148 | 148 | let aa = R(S).decimals | |
149 | 149 | k(assetBalance(U, S), pow(10, 0, aa, 0, 0, DOWN)) | |
150 | 150 | } | |
151 | 151 | (X :+ Z) | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | let ab = V | |
155 | 155 | let ac = size(ab) | |
156 | 156 | let ad = nil | |
157 | 157 | func ae (af,ag) = if ((ag >= ac)) | |
158 | 158 | then af | |
159 | 159 | else W(af, ab[ag]) | |
160 | 160 | ||
161 | 161 | func ah (af,ag) = if ((ag >= ac)) | |
162 | 162 | then af | |
163 | 163 | else throw("List size exceeds 10") | |
164 | 164 | ||
165 | 165 | ah(ae(ae(ae(ae(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
166 | 166 | } | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func ai (aj,V) = if ((a == c)) | |
170 | 170 | then { | |
171 | 171 | let ak = "3PKfrupEydU2nZAghVjZAfvCwMBkzuR1F52" | |
172 | 172 | let al = parseBigIntValue({ | |
173 | 173 | let am = invoke(aj, "getPrice", [ak], nil) | |
174 | 174 | if ($isInstanceOf(am, "String")) | |
175 | 175 | then am | |
176 | 176 | else throw(($getType(am) + " couldn't be cast to String")) | |
177 | 177 | }) | |
178 | 178 | let an = "3PPZWgFNRKHLvM51pwS934C8VZ7d2F4Z58g" | |
179 | 179 | let ao = parseBigIntValue({ | |
180 | 180 | let am = invoke(aj, "getPrice", [an], nil) | |
181 | 181 | if ($isInstanceOf(am, "String")) | |
182 | 182 | then am | |
183 | 183 | else throw(($getType(am) + " couldn't be cast to String")) | |
184 | 184 | }) | |
185 | 185 | let ap = fraction(al, h, ao) | |
186 | 186 | func W (X,aq) = { | |
187 | 187 | let ar = { | |
188 | 188 | let E = aq | |
189 | 189 | if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == E)) | |
190 | 190 | then { | |
191 | 191 | let as = "3PDi7Qq8pLQYvtKyTfQuqqPUWyhoYbU957t" | |
192 | 192 | let at = parseBigIntValue({ | |
193 | 193 | let am = invoke(aj, "getPrice", [as], nil) | |
194 | 194 | if ($isInstanceOf(am, "String")) | |
195 | 195 | then am | |
196 | 196 | else throw(($getType(am) + " couldn't be cast to String")) | |
197 | 197 | }) | |
198 | 198 | fraction(at, al, h) | |
199 | 199 | } | |
200 | 200 | else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == E)) | |
201 | 201 | then { | |
202 | 202 | let au = "3PFzaH2ghpwANHFgjeva83N1yxzErELx2eh" | |
203 | 203 | let av = parseBigIntValue({ | |
204 | 204 | let am = invoke(aj, "getPrice", [au], nil) | |
205 | 205 | if ($isInstanceOf(am, "String")) | |
206 | 206 | then am | |
207 | 207 | else throw(($getType(am) + " couldn't be cast to String")) | |
208 | 208 | }) | |
209 | 209 | fraction(av, al, h) | |
210 | 210 | } | |
211 | 211 | else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == E)) | |
212 | 212 | then { | |
213 | 213 | let aw = "3PKMVZ7kQeaREajYi8Yc25Ro6mcNw5D6QSa" | |
214 | 214 | let ax = parseBigIntValue({ | |
215 | 215 | let am = invoke(aj, "getPrice", [aw], nil) | |
216 | 216 | if ($isInstanceOf(am, "String")) | |
217 | 217 | then am | |
218 | 218 | else throw(($getType(am) + " couldn't be cast to String")) | |
219 | 219 | }) | |
220 | 220 | fraction(al, h, ax) | |
221 | 221 | } | |
222 | 222 | else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == E)) | |
223 | 223 | then { | |
224 | 224 | let ay = "3P3g3eipfG2NZKKQE8DZXt2E9tRJqii9jcX" | |
225 | 225 | let az = parseBigIntValue({ | |
226 | 226 | let am = invoke(aj, "getPrice", [ay], nil) | |
227 | 227 | if ($isInstanceOf(am, "String")) | |
228 | 228 | then am | |
229 | 229 | else throw(($getType(am) + " couldn't be cast to String")) | |
230 | 230 | }) | |
231 | 231 | fraction(al, h, az) | |
232 | 232 | } | |
233 | 233 | else if (("HZk1mbfuJpmxU1Fs4AX5MWLVYtctsNcg6e2C6VKqK8zk" == E)) | |
234 | 234 | then { | |
235 | 235 | let aA = "3P94wvu5gA7VhjPgAB3twaeqdwHCwNK2vsn" | |
236 | 236 | let aB = parseBigIntValue({ | |
237 | 237 | let am = invoke(aj, "getPrice", [aA], nil) | |
238 | 238 | if ($isInstanceOf(am, "String")) | |
239 | 239 | then am | |
240 | 240 | else throw(($getType(am) + " couldn't be cast to String")) | |
241 | 241 | }) | |
242 | 242 | fraction(aB, ap, h) | |
243 | 243 | } | |
244 | 244 | else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == E)) | |
245 | 245 | then { | |
246 | 246 | let aC = "3P3XGTN6s292g9iwYhs3TEqJqHiffQYojuE" | |
247 | 247 | let aD = parseBigIntValue({ | |
248 | 248 | let am = invoke(aj, "getPrice", [aC], nil) | |
249 | 249 | if ($isInstanceOf(am, "String")) | |
250 | 250 | then am | |
251 | 251 | else throw(($getType(am) + " couldn't be cast to String")) | |
252 | 252 | }) | |
253 | 253 | fraction(aD, al, h) | |
254 | 254 | } | |
255 | 255 | else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == E)) | |
256 | 256 | then { | |
257 | 257 | let aE = "3PCBWDTA6jrFswd7gQgaE3Xk7gLM5RKofvp" | |
258 | 258 | let aF = parseBigIntValue({ | |
259 | 259 | let am = invoke(aj, "getPrice", [aE], nil) | |
260 | 260 | if ($isInstanceOf(am, "String")) | |
261 | 261 | then am | |
262 | 262 | else throw(($getType(am) + " couldn't be cast to String")) | |
263 | 263 | }) | |
264 | 264 | fraction(aF, ap, h) | |
265 | 265 | } | |
266 | 266 | else s("invalid asset id") | |
267 | 267 | } | |
268 | 268 | (X :+ ar) | |
269 | 269 | } | |
270 | 270 | ||
271 | 271 | let ab = V | |
272 | 272 | let ac = size(ab) | |
273 | 273 | let ad = nil | |
274 | 274 | func ae (af,ag) = if ((ag >= ac)) | |
275 | 275 | then af | |
276 | 276 | else W(af, ab[ag]) | |
277 | 277 | ||
278 | 278 | func ah (af,ag) = if ((ag >= ac)) | |
279 | 279 | then af | |
280 | 280 | else throw("List size exceeds 10") | |
281 | 281 | ||
282 | 282 | ah(ae(ae(ae(ae(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
283 | 283 | } | |
284 | 284 | else if ((a == b)) | |
285 | 285 | then { | |
286 | 286 | func W (X,aq) = { | |
287 | 287 | let ar = { | |
288 | 288 | let E = aq | |
289 | 289 | if (("EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc" == E)) | |
290 | 290 | then { | |
291 | 291 | let aG = "3MrULQRLc52GWrJF1tMcAm4M78fPe57o9Kt" | |
292 | 292 | let aH = parseBigIntValue({ | |
293 | 293 | let am = invoke(aj, "getPrice", [aG], nil) | |
294 | 294 | if ($isInstanceOf(am, "String")) | |
295 | 295 | then am | |
296 | 296 | else throw(($getType(am) + " couldn't be cast to String")) | |
297 | 297 | }) | |
298 | 298 | aH | |
299 | 299 | } | |
300 | 300 | else if (("A7Ksh7fXyqm1KhKAiK3bAB2aiPSitQQF6v1pyu9SS3FR" == E)) | |
301 | 301 | then { | |
302 | 302 | let aI = "3MzKSdTH2jFbypLsoNfrH7QgkzSbx3EYwCA" | |
303 | 303 | let aJ = parseBigIntValue({ | |
304 | 304 | let am = invoke(aj, "getPrice", [aI], nil) | |
305 | 305 | if ($isInstanceOf(am, "String")) | |
306 | 306 | then am | |
307 | 307 | else throw(($getType(am) + " couldn't be cast to String")) | |
308 | 308 | }) | |
309 | 309 | aJ | |
310 | 310 | } | |
311 | 311 | else if (("8Q6SE2ANebufw8JuPjJVRjZD6drD8ihjNjM8xaGUSfdR" == E)) | |
312 | 312 | then { | |
313 | 313 | let ar = toBigInt(100000000) | |
314 | 314 | ar | |
315 | 315 | } | |
316 | 316 | else s("invalid asset id") | |
317 | 317 | } | |
318 | 318 | (X :+ ar) | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | let ab = V | |
322 | 322 | let ac = size(ab) | |
323 | 323 | let ad = nil | |
324 | 324 | func ae (af,ag) = if ((ag >= ac)) | |
325 | 325 | then af | |
326 | 326 | else W(af, ab[ag]) | |
327 | 327 | ||
328 | 328 | func ah (af,ag) = if ((ag >= ac)) | |
329 | 329 | then af | |
330 | 330 | else throw("List size exceeds 10") | |
331 | 331 | ||
332 | 332 | ah(ae(ae(ae(ae(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
333 | 333 | } | |
334 | 334 | else s("invalid chain id") | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | func aK (D) = { | |
338 | 338 | let A = M(D) | |
339 | 339 | let aj = K(D) | |
340 | 340 | let aL = split(O(D), d) | |
341 | 341 | let aM = T(A, aL) | |
342 | 342 | let aN = ai(aj, aL) | |
343 | 343 | func aO (X,Y) = { | |
344 | 344 | let S = fromBase58String(Y) | |
345 | 345 | let aP = valueOrErrorMessage(indexOf(aL, Y), q("invalid asset id")) | |
346 | 346 | let Z = aM[aP] | |
347 | 347 | let ar = aN[aP] | |
348 | 348 | let aQ = fraction(Z, ar, h) | |
349 | 349 | (X + aQ) | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | let aR = { | |
353 | 353 | let ab = aL | |
354 | 354 | let ac = size(ab) | |
355 | 355 | let ad = toBigInt(0) | |
356 | 356 | func ae (af,ag) = if ((ag >= ac)) | |
357 | 357 | then af | |
358 | 358 | else aO(af, ab[ag]) | |
359 | 359 | ||
360 | 360 | func ah (af,ag) = if ((ag >= ac)) | |
361 | 361 | then af | |
362 | 362 | else throw("List size exceeds 10") | |
363 | 363 | ||
364 | 364 | ah(ae(ae(ae(ae(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
365 | 365 | } | |
366 | 366 | aR | |
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | - | @Callable(aS) | |
371 | - | func withdraw (aT) = { | |
372 | - | let aU = addressFromStringValue(aT[0]) | |
373 | - | let aV = parseIntValue(aT[1]) | |
374 | - | let aW = invoke(aS.caller, "transferWaves", [aU.bytes, aV], nil) | |
375 | - | $Tuple2(nil, aW) | |
370 | + | func aS (D) = { | |
371 | + | let aj = K(D) | |
372 | + | let aT = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
373 | + | let aU = valueOrErrorMessage(getInteger(D, y(aT)), q(("invalid treasury value for period " + toString(aT)))) | |
374 | + | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
375 | + | let aV = (aR - aU) | |
376 | + | let aW = G(D) | |
377 | + | let aX = ai(aj, [toBase58String(aW)])[0] | |
378 | + | let aY = if ((aX > toBigInt(0))) | |
379 | + | then n(aX, pow(10, 0, j, 0, 0, DOWN)) | |
380 | + | else s("invalid PWR price") | |
381 | + | let A = M(D) | |
382 | + | let aZ = valueOrElse(getInteger(I(D), z(A)), 0) | |
383 | + | let ba = (R(Q(D)).quantity / 100) | |
384 | + | let bb = (aZ + ba) | |
385 | + | let bc = T(D, [toBase58String(t)])[0] | |
386 | + | let bd = if ((bc > toBigInt(0))) | |
387 | + | then n(bc, pow(10, 0, j, 0, 0, DOWN)) | |
388 | + | else s("invalid factory wx balance") | |
389 | + | let be = ai(aj, [toBase58String(t)])[0] | |
390 | + | let bf = if ((be > toBigInt(0))) | |
391 | + | then n(be, pow(10, 0, j, 0, 0, DOWN)) | |
392 | + | else s("invalid wx price") | |
393 | + | let bg = R(Q(D)).quantity | |
394 | + | let bh = (((aY + fraction((bd * 100), bf, bg)) + fraction(max([aV, 0]), 2, (10 * bb))) / 100) | |
395 | + | $Tuple2(bh, [["wxDaoPrice", bh], ["pwrPrice", aY], ["factoryAddressWxBalance", bd], ["wxPrice", bf], ["wxdaoQuantity", bg], ["treasuryValueDiff", aV], ["pwrAmount", bb]]) | |
396 | + | } | |
397 | + | ||
398 | + | ||
399 | + | @Callable(bi) | |
400 | + | func withdraw (bj) = { | |
401 | + | let bk = addressFromStringValue(bj[0]) | |
402 | + | let bl = parseIntValue(bj[1]) | |
403 | + | let bm = invoke(bi.caller, "transferWaves", [bk.bytes, bl], nil) | |
404 | + | $Tuple2(nil, bm) | |
376 | 405 | } | |
377 | 406 | ||
378 | 407 | ||
379 | 408 | ||
380 | - | @Callable( | |
381 | - | func setIntParam ( | |
382 | - | let | |
383 | - | let o = parseIntValue( | |
384 | - | let | |
385 | - | $Tuple2(nil, | |
409 | + | @Callable(bi) | |
410 | + | func setIntParam (bj) = { | |
411 | + | let bn = bj[0] | |
412 | + | let o = parseIntValue(bj[1]) | |
413 | + | let bm = invoke(bi.caller, "integerEntry", [bn, o], nil) | |
414 | + | $Tuple2(nil, bm) | |
386 | 415 | } | |
387 | 416 | ||
388 | 417 | ||
389 | 418 | ||
390 | - | @Callable( | |
391 | - | func swap ( | |
392 | - | let D = | |
393 | - | let | |
394 | - | let | |
395 | - | then | |
419 | + | @Callable(bi) | |
420 | + | func swap (bo,bj) = { | |
421 | + | let D = bi.caller | |
422 | + | let bp = addressFromPublicKey(bo) | |
423 | + | let bq = if ((size(bi.payments) == 1)) | |
424 | + | then bi.payments[0] | |
396 | 425 | else s("1 payment is required") | |
397 | - | let | |
398 | - | let | |
399 | - | then value( | |
400 | - | else s( | |
401 | - | let | |
402 | - | let | |
426 | + | let br = q("invalid payment asset id") | |
427 | + | let bs = if ((valueOrErrorMessage(bq.assetId, br) == Q(D))) | |
428 | + | then value(bq.assetId) | |
429 | + | else s(br) | |
430 | + | let aY = 100 | |
431 | + | let bb = (bq.amount / aY) | |
403 | 432 | let aL = split(O(D), d) | |
404 | - | let | |
405 | - | if (( | |
433 | + | let bt = assetBalance(D, G(D)) | |
434 | + | if ((bt == bt)) | |
406 | 435 | then { | |
407 | 436 | let bg = R(Q(D)).quantity | |
408 | 437 | if ((bg == bg)) | |
409 | 438 | then { | |
410 | 439 | let aM = T(D, aL) | |
411 | 440 | func W (X,Y) = { | |
412 | 441 | let S = fromBase58String(Y) | |
413 | 442 | let aP = valueOrErrorMessage(indexOf(aL, Y), q("invalid asset balance")) | |
414 | 443 | let aa = R(S).decimals | |
415 | 444 | let Z = n(aM[aP], pow(10, 0, aa, 0, 0, DOWN)) | |
416 | - | let | |
417 | - | if (( | |
418 | - | then $Tuple2((X._1 :+ S), (X._2 :+ | |
445 | + | let bl = fraction(Z, bq.amount, bg) | |
446 | + | if ((bl > 0)) | |
447 | + | then $Tuple2((X._1 :+ S), (X._2 :+ bl)) | |
419 | 448 | else X | |
420 | 449 | } | |
421 | 450 | ||
422 | - | let | |
451 | + | let bu = { | |
423 | 452 | let ab = aL | |
424 | 453 | let ac = size(ab) | |
425 | 454 | let ad = $Tuple2(nil, nil) | |
426 | 455 | func ae (af,ag) = if ((ag >= ac)) | |
427 | 456 | then af | |
428 | 457 | else W(af, ab[ag]) | |
429 | 458 | ||
430 | 459 | func ah (af,ag) = if ((ag >= ac)) | |
431 | 460 | then af | |
432 | 461 | else throw("List size exceeds 6") | |
433 | 462 | ||
434 | 463 | ah(ae(ae(ae(ae(ae(ae(ad, 0), 1), 2), 3), 4), 5), 6) | |
435 | 464 | } | |
436 | - | if (( | |
465 | + | if ((bu == bu)) | |
437 | 466 | then { | |
438 | - | let | |
439 | - | let | |
467 | + | let bv = 0 | |
468 | + | let bw = ([invoke(D, "commitAfterStartWithLockRoundFor", [toString(I(D)), toString(D), toString(bp), bv, G(D), bb], nil)] ++ (if ((size(bu._1) == 0)) | |
440 | 469 | then nil | |
441 | - | else [invoke(D, "transferAssets", [ | |
442 | - | $Tuple2([Burn( | |
470 | + | else [invoke(D, "transferAssets", [bp.bytes, bu._1, bu._2], nil)])) | |
471 | + | $Tuple2([Burn(bs, bq.amount)], bw) | |
443 | 472 | } | |
444 | 473 | else throw("Strict value is not equal to itself.") | |
445 | 474 | } | |
446 | 475 | else throw("Strict value is not equal to itself.") | |
447 | 476 | } | |
448 | 477 | else throw("Strict value is not equal to itself.") | |
449 | 478 | } | |
450 | 479 | ||
451 | 480 | ||
452 | 481 | ||
453 | - | @Callable(aS) | |
454 | - | func price (aY,aT) = { | |
455 | - | let D = aS.caller | |
456 | - | let aj = K(D) | |
457 | - | let bk = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
458 | - | let bl = valueOrErrorMessage(getInteger(D, y(bk)), q(("invalid treasury value for period " + toString(bk)))) | |
459 | - | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
460 | - | let bm = (aR - bl) | |
461 | - | let bn = G(D) | |
462 | - | let bo = ai(aj, [toBase58String(bn)])[0] | |
463 | - | let bd = if ((bo > toBigInt(0))) | |
464 | - | then n(bo, pow(10, 0, j, 0, 0, DOWN)) | |
465 | - | else s("invalid PWR price") | |
466 | - | let A = M(D) | |
467 | - | let bp = valueOrElse(getInteger(I(D), z(A)), 0) | |
468 | - | let bq = (R(Q(D)).quantity / 100) | |
469 | - | let be = (bp + bq) | |
470 | - | let br = T(D, [toBase58String(t)])[0] | |
471 | - | let bs = if ((br > toBigInt(0))) | |
472 | - | then n(br, pow(10, 0, j, 0, 0, DOWN)) | |
473 | - | else s("invalid factory wx balance") | |
474 | - | let bt = ai(aj, [toBase58String(t)])[0] | |
475 | - | let bu = if ((bt > toBigInt(0))) | |
476 | - | then n(bt, pow(10, 0, j, 0, 0, DOWN)) | |
477 | - | else s("invalid wx price") | |
478 | - | let bg = R(Q(D)).quantity | |
479 | - | let ar = (((bd / 100) + fraction(bs, bu, bg)) + fraction(max([bm, 0]), 2, (1000 * be))) | |
480 | - | $Tuple2(nil, ar) | |
482 | + | @Callable(bi) | |
483 | + | func price (bo,bj) = { | |
484 | + | let D = bi.caller | |
485 | + | $Tuple2(nil, aS(D)._1) | |
481 | 486 | } | |
482 | 487 | ||
483 | 488 | ||
484 | 489 | ||
485 | - | @Callable(aS) | |
486 | - | func priceDebug (aY,aT) = { | |
487 | - | let D = aS.caller | |
488 | - | let aj = K(D) | |
489 | - | let bk = valueOrErrorMessage(getInteger(D, u()), q("invalid current period")) | |
490 | - | let bl = valueOrErrorMessage(getInteger(D, y(bk)), q(("invalid treasury value for period " + toString(bk)))) | |
491 | - | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
492 | - | let bm = (aR - bl) | |
493 | - | let bn = G(D) | |
494 | - | let bo = ai(aj, [toBase58String(bn)])[0] | |
495 | - | let bd = if ((bo > toBigInt(0))) | |
496 | - | then n(bo, pow(10, 0, j, 0, 0, DOWN)) | |
497 | - | else s("invalid PWR price") | |
498 | - | let A = M(D) | |
499 | - | let bp = valueOrElse(getInteger(I(D), z(A)), 0) | |
500 | - | let bq = (R(Q(D)).quantity / 100) | |
501 | - | let be = (bp + bq) | |
502 | - | let br = T(D, [toBase58String(t)])[0] | |
503 | - | let bs = if ((br > toBigInt(0))) | |
504 | - | then n(br, pow(10, 0, j, 0, 0, DOWN)) | |
505 | - | else s("invalid factory wx balance") | |
506 | - | let bt = ai(aj, [toBase58String(t)])[0] | |
507 | - | let bu = if ((bt > toBigInt(0))) | |
508 | - | then n(bt, pow(10, 0, j, 0, 0, DOWN)) | |
509 | - | else s("invalid wx price") | |
510 | - | let bg = R(Q(D)).quantity | |
511 | - | let bv = (((bd / 100) + fraction(bs, bu, bg)) + fraction(max([bm, 0]), 2, (1000 * be))) | |
512 | - | $Tuple2(nil, [["wxDaoPrice", bv], ["pwrPrice", bd], ["factoryAddressWxBalance", bs], ["wxPrice", bu], ["wxdaoQuantity", bg], ["treasuryValueDiff", bm], ["pwrAmount", be]]) | |
490 | + | @Callable(bi) | |
491 | + | func priceDebug (bo,bj) = { | |
492 | + | let D = bi.caller | |
493 | + | $Tuple2(nil, aS(D)._2) | |
513 | 494 | } | |
514 | 495 | ||
515 | 496 | ||
516 | 497 | ||
517 | - | @Callable( | |
518 | - | func getTreasuryValue ( | |
519 | - | let D = | |
498 | + | @Callable(bi) | |
499 | + | func getTreasuryValue (bo,bj) = { | |
500 | + | let D = bi.caller | |
520 | 501 | let aR = n(aK(D), pow(10, 0, j, 0, 0, DOWN)) | |
521 | 502 | $Tuple2(nil, aR) | |
522 | 503 | } | |
523 | 504 | ||
524 | 505 | ||
525 | - | @Verifier( | |
526 | - | func | |
506 | + | @Verifier(bx) | |
507 | + | func by () = (a == b) | |
527 | 508 |
github/deemru/w8io/026f985 105.34 ms ◑