tx · AxwQP8ehEs91CYS9sQMh8GFS3y5i9J7VBM2cQ2MgZh3J 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d: -0.01000000 Waves 2023.03.21 17:41 [2499907] smart account 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d > SELF 0.00000000 Waves
{ "type": 13, "id": "AxwQP8ehEs91CYS9sQMh8GFS3y5i9J7VBM2cQ2MgZh3J", "fee": 1000000, "feeAssetId": null, "timestamp": 1679409720720, "version": 2, "chainId": 84, "sender": "3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d", "senderPublicKey": "AZLzseQJi9XUNNp7cN6jwqDdSmQvDPNNqu7aQ6ujbsnJ", "proofs": [ "3C3t3HUxybWgQmW1oHpzNUYQthrNVPSHpEhCkJo3PMbcAQ58GH3CK324pA3E2gxQqzByBfyxJGG66WNghCoZxZgM" ], "script": "base64:BgIICAISBAoCAQEMAAZzY2FsZTgAgMLXLwAMc2NhbGU4QmlnSW50CQC2AgEAgMLXLwAHc2NhbGUxOAkAtgIBAICAkLu61q3wDQAKemVyb0JpZ0ludAkAtgIBAAAABGJpZzAJALYCAQAAAARiaWcxCQC2AgEAAQAEYmlnMgkAtgIBAAIABGJpZzMJALYCAQADAARiaWc0CQC2AgEABAAFQW11bHQCAzEwMAABQQIEMTAwMAEEZ2V0RAECeHAEA3hwMAkAkQMCBQJ4cAAABAN4cDEJAJEDAgUCeHAAAQQBcwkAtwICBQN4cDAFA3hwMQMJAAACBQFzBQRiaWcwBQRiaWcwBAFhCQENcGFyc2VJbnRWYWx1ZQEFAUEEA2FubgkAaAIFAWEAAgQBcAkAvAIDBQN4cDAFA3hwMQUEYmlnMQQLeHAwX3hwMV9uX24JALwCAwUBcAUEYmlnNAUEYmlnMQQFYW5uX3MJALwCAwkAtgIBBQNhbm4FAXMFBGJpZzEEBWFubl8xCQC2AgEJAGUCBQNhbm4AAQoBCWNhbGNETmV4dAEBZAQCZGQJALwCAwUBZAUBZAUEYmln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jBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIEAWQIBQskdDAxNDgwMTUyOAJfMQQFZm91bmQIBQskdDAxNDgwMTUyOAJfMgMFBWZvdW5kBQFkCQACAQkArAICAhlEIGNhbGN1bGF0aW9uIGVycm9yLCBEID0gCQCmAwEFAWQBAWkBBGNhbGMCA3hwMAN4cDEEAUQJAQRnZXREAQkAzAgCCQC2AgEFA3hwMAkAzAgCCQC2AgEFA3hwMQUDbmlsBAZTY2FsZTgAgMLXLwQDcmVzANcICQDMCAIJAQxJbnRlZ2VyRW50cnkCAgFECQCgAwEFAUQJAMwIAgkBC0RlbGV0ZUVudHJ5AQIFYW5uXzEJAMwIAgkBC0RlbGV0ZUVudHJ5AQIFYW5uX3MFA25pbAECdHgBBnZlcmlmeQAGDOkHew==", "height": 2499907, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G9q3kNbDJhi46ThmyMyEAyGEX1kgJWsuH3zUbb46efDH Next: 6eTduhG46VF9pJaCvc9n1VDpDMpSJej9Wa31NWxFJHXp Diff:
Old | New | Differences | |
---|---|---|---|
86 | 86 | let D = getD([toBigInt(xp0), toBigInt(xp1)]) | |
87 | 87 | let Scale8 = 100000000 | |
88 | 88 | let res = 1111 | |
89 | - | [IntegerEntry("D", toInt(D))] | |
89 | + | [IntegerEntry("D", toInt(D)), DeleteEntry("ann_1"), DeleteEntry("ann_s")] | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let scale8 = 100000000 | |
5 | 5 | ||
6 | 6 | let scale8BigInt = toBigInt(100000000) | |
7 | 7 | ||
8 | 8 | let scale18 = toBigInt(1000000000000000000) | |
9 | 9 | ||
10 | 10 | let zeroBigInt = toBigInt(0) | |
11 | 11 | ||
12 | 12 | let big0 = toBigInt(0) | |
13 | 13 | ||
14 | 14 | let big1 = toBigInt(1) | |
15 | 15 | ||
16 | 16 | let big2 = toBigInt(2) | |
17 | 17 | ||
18 | 18 | let big3 = toBigInt(3) | |
19 | 19 | ||
20 | 20 | let big4 = toBigInt(4) | |
21 | 21 | ||
22 | 22 | let Amult = "100" | |
23 | 23 | ||
24 | 24 | let A = "1000" | |
25 | 25 | ||
26 | 26 | func getD (xp) = { | |
27 | 27 | let xp0 = xp[0] | |
28 | 28 | let xp1 = xp[1] | |
29 | 29 | let s = (xp0 + xp1) | |
30 | 30 | if ((s == big0)) | |
31 | 31 | then big0 | |
32 | 32 | else { | |
33 | 33 | let a = parseIntValue(A) | |
34 | 34 | let ann = (a * 2) | |
35 | 35 | let p = fraction(xp0, xp1, big1) | |
36 | 36 | let xp0_xp1_n_n = fraction(p, big4, big1) | |
37 | 37 | let ann_s = fraction(toBigInt(ann), s, big1) | |
38 | 38 | let ann_1 = toBigInt((ann - 1)) | |
39 | 39 | func calcDNext (d) = { | |
40 | 40 | let dd = fraction(d, d, big1) | |
41 | 41 | let ddd = fraction(dd, d, big1) | |
42 | 42 | let dp = fraction(ddd, big1, xp0_xp1_n_n) | |
43 | 43 | fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1))) | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | func calc (acc,i) = if (acc._2) | |
47 | 47 | then acc | |
48 | 48 | else { | |
49 | 49 | let d = acc._1 | |
50 | 50 | let dNext = calcDNext(d) | |
51 | 51 | let dDiffRaw = (dNext - value(d)) | |
52 | 52 | let dDiff = if ((big0 > dDiffRaw)) | |
53 | 53 | then -(dDiffRaw) | |
54 | 54 | else dDiffRaw | |
55 | 55 | if ((big1 >= dDiff)) | |
56 | 56 | then $Tuple2(dNext, true) | |
57 | 57 | else $Tuple2(dNext, false) | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] | |
61 | 61 | let $t014801528 = { | |
62 | 62 | let $l = arr | |
63 | 63 | let $s = size($l) | |
64 | 64 | let $acc0 = $Tuple2(s, false) | |
65 | 65 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
66 | 66 | then $a | |
67 | 67 | else calc($a, $l[$i]) | |
68 | 68 | ||
69 | 69 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
70 | 70 | then $a | |
71 | 71 | else throw("List size exceeds 18") | |
72 | 72 | ||
73 | 73 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18) | |
74 | 74 | } | |
75 | 75 | let d = $t014801528._1 | |
76 | 76 | let found = $t014801528._2 | |
77 | 77 | if (found) | |
78 | 78 | then d | |
79 | 79 | else throw(("D calculation error, D = " + toString(d))) | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Callable(i) | |
85 | 85 | func calc (xp0,xp1) = { | |
86 | 86 | let D = getD([toBigInt(xp0), toBigInt(xp1)]) | |
87 | 87 | let Scale8 = 100000000 | |
88 | 88 | let res = 1111 | |
89 | - | [IntegerEntry("D", toInt(D))] | |
89 | + | [IntegerEntry("D", toInt(D)), DeleteEntry("ann_1"), DeleteEntry("ann_s")] | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Verifier(tx) | |
94 | 94 | func verify () = true | |
95 | 95 |
github/deemru/w8io/169f3d6 43.05 ms ◑