tx · 5XpXqnX7REsK9MvPyxmz7vPFZPJy9yfjuo9teboMyY3R 3Muh4FMqQEciR4eM8aRSHaeSsezQpwgsewY: -0.01000000 Waves 2023.01.10 12:51 [2398688] smart account 3Muh4FMqQEciR4eM8aRSHaeSsezQpwgsewY > SELF 0.00000000 Waves
{ "type": 13, "id": "5XpXqnX7REsK9MvPyxmz7vPFZPJy9yfjuo9teboMyY3R", "fee": 1000000, "feeAssetId": null, "timestamp": 1673344368408, "version": 2, "chainId": 84, "sender": "3Muh4FMqQEciR4eM8aRSHaeSsezQpwgsewY", "senderPublicKey": "AbKSXC77cdmH8X3UJXcPzxsXqAX2mr2mkYZRjfRBQ7te", "proofs": [ "3dHwUMddM2e93izux2syLBJnjPk8RvhrMhptef24hHa1FfE8rHniQGP1HPqHetDwE9az4ZDvdyovgLVe8tS595zh" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABAAAAAAOc3RhcnRFbWlzc2lvbkgAAAAAAAAckecAAAAAEHN3b3BZZWFyRW1pc3Npb24AAABa8xB6QAAAAAAADWJsb2Nrc1BlclllYXIAAAAAAAAIB/oBAAAAEmdldFJld2FyZHNQZXJCbG9jawAAAAAEAAAAD2VtaXNzaW9uUGVyaW9kcwkAAGkAAAACCQAAZQAAAAIFAAAABmhlaWdodAUAAAAOc3RhcnRFbWlzc2lvbkgFAAAADWJsb2Nrc1BlclllYXIKAQAAAAxjYWxjRW1pc3Npb24AAAACAAAAA2FjYwAAAAFpBAAAAAkkdDA0MDQ0NDEFAAAAA2FjYwQAAAALY3VyRW1pc3Npb24IBQAAAAkkdDA0MDQ0NDEAAAACXzEEAAAADHByZXZFbWlzc2lvbggFAAAACSR0MDQwNDQ0MQAAAAJfMgMJAABmAAAAAgUAAAABaQUAAAAPZW1pc3Npb25QZXJpb2RzCQAFFAAAAAIJAABrAAAAAwUAAAALY3VyRW1pc3Npb24AAAAAAAAAAEsAAAAAAAAAAGQFAAAAC2N1ckVtaXNzaW9uCQAFFAAAAAIFA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kBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVeXU3Q=", "height": 2398688, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 48aSt5oow8Mhe99tnm4mKv85VBRZq3etH4tmQcFumLf7 Next: B6wC7JkSMgVMpGyaJEVpjSDZUvjA6atgfQxy41Ap8gS5 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let startEmissionH = 1872359 | |
5 | 5 | ||
6 | - | let | |
6 | + | let swopYearEmission = 100000000000000 | |
7 | 7 | ||
8 | - | let | |
8 | + | let blocksPerYear = 526330 | |
9 | 9 | ||
10 | - | let exchangeRatioLimitMin = 90000000 | |
10 | + | func getRewardsPerBlock () = { | |
11 | + | let emissionPeriods = ((height - startEmissionH) / blocksPerYear) | |
12 | + | func calcEmission (acc,i) = { | |
13 | + | let $t0404441 = acc | |
14 | + | let curEmission = $t0404441._1 | |
15 | + | let prevEmission = $t0404441._2 | |
16 | + | if ((i > emissionPeriods)) | |
17 | + | then $Tuple2(fraction(curEmission, 75, 100), curEmission) | |
18 | + | else $Tuple2(curEmission, prevEmission) | |
19 | + | } | |
11 | 20 | ||
12 | - | let exchangeRatioLimitMax = 110000000 | |
21 | + | let $l = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
22 | + | let $s = size($l) | |
23 | + | let $acc0 = $Tuple2(swopYearEmission, swopYearEmission) | |
24 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
25 | + | then $a | |
26 | + | else calcEmission($a, $l[$i]) | |
13 | 27 | ||
14 | - | let alpha = 50 | |
28 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
29 | + | then $a | |
30 | + | else throw("List size exceeds 20") | |
15 | 31 | ||
16 | - | let alphaDigits = 2 | |
17 | - | ||
18 | - | let beta = 4600000000000000 | |
19 | - | ||
20 | - | func skewness (x,y) = ((fraction(scale16, x, y) + fraction(scale16, y, x)) / 2) | |
21 | - | ||
22 | - | ||
23 | - | func invariantCalc (x,y) = { | |
24 | - | let sk = skewness(x, y) | |
25 | - | (fraction((x + y), scale16, pow(sk, digits8, alpha, alphaDigits, digits8, CEILING)) + (2 * fraction(toInt(pow(fraction(toBigInt(x), toBigInt(y), toBigInt(scale8)), 0, toBigInt(5), 1, (digits8 / 2), DOWN)), pow((sk - beta), digits8, alpha, alphaDigits, digits8, DOWN), scale8))) | |
26 | - | } | |
27 | - | ||
28 | - | ||
29 | - | func d (A,B,invariant,amount) = { | |
30 | - | let Dmin = (B - fraction(amount, exchangeRatioLimitMax, scale8)) | |
31 | - | let Dmax = (B - fraction(amount, exchangeRatioLimitMin, scale8)) | |
32 | - | let A_new = (A + amount) | |
33 | - | let Fmin = (invariantCalc(A_new, Dmin) - invariant) | |
34 | - | func DF (a,u) = if ((a._1 == 0)) | |
35 | - | then a | |
36 | - | else { | |
37 | - | let D = a._2 | |
38 | - | let Flastvalid = a._3 | |
39 | - | let Dlastvalid = a._4 | |
40 | - | let Fprev = a._5 | |
41 | - | let Dprev = a._6 | |
42 | - | let F = (invariantCalc(A_new, D) - invariant) | |
43 | - | if ((F == 0)) | |
44 | - | then $Tuple6(0, D, 0, 0, 0, 0) | |
45 | - | else { | |
46 | - | let $t021762304 = if (if ((F > 0)) | |
47 | - | then (Flastvalid > F) | |
48 | - | else false) | |
49 | - | then $Tuple2(F, D) | |
50 | - | else $Tuple2(Flastvalid, Dlastvalid) | |
51 | - | let Fvalid = $t021762304._1 | |
52 | - | let Dvalid = $t021762304._2 | |
53 | - | if (((F - Fprev) == 0)) | |
54 | - | then $Tuple6(1, (D + 1), Fvalid, Dvalid, F, D) | |
55 | - | else { | |
56 | - | let Dnext = (D - fraction(F, (D - Dprev), (F - Fprev))) | |
57 | - | if (((D - Dnext) != 0)) | |
58 | - | then $Tuple6(1, Dnext, Fvalid, Dvalid, F, D) | |
59 | - | else if ((0 > F)) | |
60 | - | then $Tuple6(1, (D + 1), Fvalid, Dvalid, F, D) | |
61 | - | else $Tuple6(0, D, 0, 0, 0, 0) | |
62 | - | } | |
63 | - | } | |
64 | - | } | |
65 | - | ||
66 | - | let a = { | |
67 | - | let $l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] | |
68 | - | let $s = size($l) | |
69 | - | let $acc0 = $Tuple6(1, Dmax, 9223372036854775807, B, Fmin, Dmin) | |
70 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
71 | - | then $a | |
72 | - | else DF($a, $l[$i]) | |
73 | - | ||
74 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
75 | - | then $a | |
76 | - | else throw("List size exceeds 12") | |
77 | - | ||
78 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12) | |
79 | - | } | |
80 | - | if ((a._1 == 0)) | |
81 | - | then (B - a._2) | |
82 | - | else (B - a._4) | |
32 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
83 | 33 | } | |
84 | 34 | ||
85 | 35 | ||
86 | 36 | @Callable(i) | |
87 | - | func D (A,B,invariant,amount) = { | |
88 | - | let est = d(A, B, invariant, amount) | |
89 | - | $Tuple2([IntegerEntry("est", est)], est) | |
37 | + | func call () = { | |
38 | + | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
39 | + | let assetId = calculateAssetId(asset) | |
40 | + | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)] | |
90 | 41 | } | |
91 | 42 | ||
43 | + | ||
44 | + | @Verifier(tx) | |
45 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
92 | 46 |
github/deemru/w8io/169f3d6 27.93 ms ◑