tx · 2HtNT7NzH7PBjaehQpsE9WpEwnwjpsiMwrwtiRtJQFUs

3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d:  -0.01000000 Waves

2023.03.21 13:44 [2499676] smart account 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d > SELF 0.00000000 Waves

{ "type": 13, "id": "2HtNT7NzH7PBjaehQpsE9WpEwnwjpsiMwrwtiRtJQFUs", "fee": 1000000, "feeAssetId": null, "timestamp": 1679395547244, "version": 2, "chainId": 84, "sender": "3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d", "senderPublicKey": "AZLzseQJi9XUNNp7cN6jwqDdSmQvDPNNqu7aQ6ujbsnJ", "proofs": [ "5yTpJwb6wy785YRAceMRvXRU1V3jM36BpDoNjoVkyeBzkyYLQiVFVszXvbrdMboBfH5ezMMzP76gtzcJPrjiUa3i" ], "script": "base64:BgIICAISBAoCAQEMAAZzY2FsZTgAgMLXLwAMc2NhbGU4QmlnSW50CQC2AgEAgMLXLwAHc2NhbGUxOAkAtgIBAICAkLu61q3wDQAKemVyb0JpZ0ludAkAtgIBAAAABGJpZzAJALYCAQAAAARiaWcxCQC2AgEAAQAEYmlnMgkAtgIBAAIABGJpZzMJALYCAQADAARiaWc0CQC2AgEABAAFQW11bHQCAzEwMAABQQIEMTAwMAEEZ2V0RAECeHAEA3hwMAkAkQMCBQJ4cAAABAN4cDEJAJEDAgUCeHAAAQQBcwkAtwICBQN4cDAFA3hwMQMJAAACBQFzBQRiaWcwBQRiaWcwBAFhCQENcGFyc2VJbnRWYWx1ZQEFAUEEA2FubgkAaAIFAWEAAgQBcAkAvAIDBQN4cDAFA3hwMQUEYmlnMQQLeHAwX3hwMV9uX24JALwCAwUBcAUEYmlnNAUEYmlnMQQFYW5uX3MJALwCAwkAtgIBBQNhbm4FAXMFBGJpZzEEBWFubl8xCQC2AgEJAGUCBQNhbm4AAQoBCWNhbGNETmV4dAEBZAQCZGQJALwCAwUBZAUBZAUEYmln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jBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIEAWQIBQskdDAxNDgwMTUyOAJfMQQFZm91bmQIBQskdDAxNDgwMTUyOAJfMgMFBWZvdW5kBQFkCQACAQkArAICAhlEIGNhbGN1bGF0aW9uIGVycm9yLCBEID0gCQCmAwEFAWQBAWkBBGNhbGMCA3hwMAN4cDEEAUQJAQRnZXREAQkAzAgCCQC2AgEFA3hwMAkAzAgCCQC2AgEFA3hwMQUDbmlsBAZTY2FsZTgAgMLXLwQHcG93QmFzZQCPTgQLcG93RXhwb25lbnQA3VYEA3JlcwDXCAkAzAgCCQEMSW50ZWdlckVudHJ5AgIBRAkAoAMBBQFECQDMCAIJAQtEZWxldGVFbnRyeQECB3Bvd0Jhc2UJAMwIAgkBC0RlbGV0ZUVudHJ5AQILcG93RXhwb25lbnQFA25pbAECdHgBBnZlcmlmeQAGH71aUA==", "height": 2499676, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D7bWjqH8EGt26eErdGwWdXnoZoLuHvvGF2rMVzTTFHMB Next: C29V6eCgwHJBMZtJSyXLqQeCiqQ8LyqsjRRVvWYARQWE Diff:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let asd = 999
4+let scale8 = 100000000
5+
6+let scale8BigInt = toBigInt(100000000)
7+
8+let scale18 = toBigInt(1000000000000000000)
9+
10+let zeroBigInt = toBigInt(0)
11+
12+let big0 = toBigInt(0)
13+
14+let big1 = toBigInt(1)
15+
16+let big2 = toBigInt(2)
17+
18+let big3 = toBigInt(3)
19+
20+let big4 = toBigInt(4)
21+
22+let Amult = "100"
23+
24+let A = "1000"
25+
26+func getD (xp) = {
27+ let xp0 = xp[0]
28+ let xp1 = xp[1]
29+ let s = (xp0 + xp1)
30+ if ((s == big0))
31+ then big0
32+ else {
33+ let a = parseIntValue(A)
34+ let ann = (a * 2)
35+ let p = fraction(xp0, xp1, big1)
36+ let xp0_xp1_n_n = fraction(p, big4, big1)
37+ let ann_s = fraction(toBigInt(ann), s, big1)
38+ let ann_1 = toBigInt((ann - 1))
39+ func calcDNext (d) = {
40+ let dd = fraction(d, d, big1)
41+ let ddd = fraction(dd, d, big1)
42+ let dp = fraction(ddd, big1, xp0_xp1_n_n)
43+ fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
44+ }
45+
46+ func calc (acc,i) = if (acc._2)
47+ then acc
48+ else {
49+ let d = acc._1
50+ let dNext = calcDNext(d)
51+ let dDiffRaw = (dNext - value(d))
52+ let dDiff = if ((big0 > dDiffRaw))
53+ then -(dDiffRaw)
54+ else dDiffRaw
55+ if ((big1 >= dDiff))
56+ then $Tuple2(dNext, true)
57+ else $Tuple2(dNext, false)
58+ }
59+
60+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
61+ let $t014801528 = {
62+ let $l = arr
63+ let $s = size($l)
64+ let $acc0 = $Tuple2(s, false)
65+ func $f0_1 ($a,$i) = if (($i >= $s))
66+ then $a
67+ else calc($a, $l[$i])
68+
69+ func $f0_2 ($a,$i) = if (($i >= $s))
70+ then $a
71+ else throw("List size exceeds 18")
72+
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+ }
75+ let d = $t014801528._1
76+ let found = $t014801528._2
77+ if (found)
78+ then d
79+ else throw(("D calculation error, D = " + toString(d)))
80+ }
81+ }
82+
583
684 @Callable(i)
7-func calc (asd) = {
85+func calc (xp0,xp1) = {
86+ let D = getD([toBigInt(xp0), toBigInt(xp1)])
887 let Scale8 = 100000000
988 let powBase = 9999
1089 let powExponent = 11101
1190 let res = 1111
12-[IntegerEntry("powExponent", powExponent), IntegerEntry("powBase", powBase), IntegerEntry("powExponent", powExponent)]
91+[IntegerEntry("D", toInt(D)), DeleteEntry("powBase"), DeleteEntry("powExponent")]
1392 }
1493
1594
Full:
OldNewDifferences
1-{-# STDLIB_VERSION 5 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let asd = 999
4+let scale8 = 100000000
5+
6+let scale8BigInt = toBigInt(100000000)
7+
8+let scale18 = toBigInt(1000000000000000000)
9+
10+let zeroBigInt = toBigInt(0)
11+
12+let big0 = toBigInt(0)
13+
14+let big1 = toBigInt(1)
15+
16+let big2 = toBigInt(2)
17+
18+let big3 = toBigInt(3)
19+
20+let big4 = toBigInt(4)
21+
22+let Amult = "100"
23+
24+let A = "1000"
25+
26+func getD (xp) = {
27+ let xp0 = xp[0]
28+ let xp1 = xp[1]
29+ let s = (xp0 + xp1)
30+ if ((s == big0))
31+ then big0
32+ else {
33+ let a = parseIntValue(A)
34+ let ann = (a * 2)
35+ let p = fraction(xp0, xp1, big1)
36+ let xp0_xp1_n_n = fraction(p, big4, big1)
37+ let ann_s = fraction(toBigInt(ann), s, big1)
38+ let ann_1 = toBigInt((ann - 1))
39+ func calcDNext (d) = {
40+ let dd = fraction(d, d, big1)
41+ let ddd = fraction(dd, d, big1)
42+ let dp = fraction(ddd, big1, xp0_xp1_n_n)
43+ fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
44+ }
45+
46+ func calc (acc,i) = if (acc._2)
47+ then acc
48+ else {
49+ let d = acc._1
50+ let dNext = calcDNext(d)
51+ let dDiffRaw = (dNext - value(d))
52+ let dDiff = if ((big0 > dDiffRaw))
53+ then -(dDiffRaw)
54+ else dDiffRaw
55+ if ((big1 >= dDiff))
56+ then $Tuple2(dNext, true)
57+ else $Tuple2(dNext, false)
58+ }
59+
60+ let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
61+ let $t014801528 = {
62+ let $l = arr
63+ let $s = size($l)
64+ let $acc0 = $Tuple2(s, false)
65+ func $f0_1 ($a,$i) = if (($i >= $s))
66+ then $a
67+ else calc($a, $l[$i])
68+
69+ func $f0_2 ($a,$i) = if (($i >= $s))
70+ then $a
71+ else throw("List size exceeds 18")
72+
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+ }
75+ let d = $t014801528._1
76+ let found = $t014801528._2
77+ if (found)
78+ then d
79+ else throw(("D calculation error, D = " + toString(d)))
80+ }
81+ }
82+
583
684 @Callable(i)
7-func calc (asd) = {
85+func calc (xp0,xp1) = {
86+ let D = getD([toBigInt(xp0), toBigInt(xp1)])
887 let Scale8 = 100000000
988 let powBase = 9999
1089 let powExponent = 11101
1190 let res = 1111
12-[IntegerEntry("powExponent", powExponent), IntegerEntry("powBase", powBase), IntegerEntry("powExponent", powExponent)]
91+[IntegerEntry("D", toInt(D)), DeleteEntry("powBase"), DeleteEntry("powExponent")]
1392 }
1493
1594
1695 @Verifier(tx)
1796 func verify () = true
1897

github/deemru/w8io/169f3d6 
28.63 ms